:root {
    --navy: #14233c;
    --navy-2: #203452;
    --blue: #2f80ed;
    --sky: #eaf4ff;
    --line: #d9e4f2;
    --soft: #f5f8fc;
    --text: #172033;
    --muted: #66758a;
    --green: #1f9d7a;
    --amber: #c47c14;
    --danger: #d04444;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--soft);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }

button,
input,
select,
textarea {
    font: inherit;
}

button {
    appearance: none;
}

.app-shell { min-height: 100vh; display: flex; }

.sidebar {
    width: 280px;
    min-height: 100vh;
    background: var(--navy);
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    padding: 20px 14px;
    z-index: 20;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 10px 22px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--navy);
    font-weight: 800;
}

.brand small { display: block; color: #b8c6d9; font-size: 12px; margin-top: 2px; }

.role-panel {
    margin: 0 6px 16px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    background: rgba(255,255,255,.07);
}

.role-panel span,
.role-panel small {
    display: block;
    color: #b8c6d9;
    font-size: 12px;
}

.role-panel strong {
    display: block;
    margin: 3px 0;
    color: #fff;
}

.nav-menu { gap: 4px; }

.nav-menu .nav-link {
    color: #d7e2ef;
    border-radius: 8px;
    padding: 11px 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    font-weight: 600;
    min-height: 42px;
}

.nav-menu .nav-link:hover,
.nav-menu .nav-link.active {
    background: #fff;
    color: var(--navy);
}

.main {
    flex: 1;
    margin-left: 280px;
    min-width: 0;
}

.topbar {
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar h1 {
    margin: 0;
    font-size: 23px;
    font-weight: 800;
}

.topbar p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    display: inline-grid;
    place-items: center;
    color: var(--navy);
}

.icon-btn:hover { background: var(--sky); }

.user-chip {
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-weight: 700;
}

.content { padding: 26px 28px 48px; }

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 18px;
}

.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-title h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
}

.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; font-size: 28px; margin-top: 8px; color: var(--navy); }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.table {
    --bs-table-color: var(--text);
    font-size: 14px;
}

.table thead th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    border-bottom-color: var(--line);
}

.badge-status {
    border-radius: 6px;
    padding: 6px 8px;
    font-weight: 700;
    font-size: 12px;
}

.badge-status.active,
.badge-status.paid,
.badge-status.arrived,
.badge-status.attended,
.badge-status.ready { background: #e7f7f1; color: var(--green); }
.badge-status.pending,
.badge-status.requested,
.badge-status.planned,
.badge-status.partial { background: #fff5df; color: var(--amber); }
.badge-status.cancelled,
.badge-status.failed,
.badge-status.passive,
.badge-status.overdue { background: #ffe8e8; color: var(--danger); }

.form-label { font-weight: 700; color: var(--navy); }
.form-control, .form-select { border-color: var(--line); border-radius: 8px; min-height: 42px; }
.btn { border-radius: 8px; font-weight: 700; }
.btn-primary { background: var(--blue); border-color: var(--blue); }
.btn-outline-primary { color: var(--blue); border-color: var(--blue); }

.detail-grid {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 18px;
}

.tabs-line {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px;
}

.tabs-line .nav-link {
    border: 0;
    color: var(--muted);
    font-weight: 700;
    padding: 10px 12px;
}

.tabs-line .nav-link.active {
    color: var(--blue);
    border-bottom: 3px solid var(--blue);
}

.guest-body {
    min-height: 100vh;
    background: var(--navy);
}

.guest-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card,
.public-card {
    width: min(100%, 460px);
    background: #fff;
    border-radius: 8px;
    padding: 28px;
    border: 1px solid var(--line);
}

.public-list {
    width: min(100%, 900px);
}

.chat-layout {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 18px;
}

.chat-messages {
    min-height: 420px;
    max-height: 58vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fbfdff;
}

.chat-bubble {
    max-width: 75%;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid var(--line);
}

.chat-bubble.mine {
    margin-left: auto;
    background: var(--sky);
}

.hero-ops {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 24px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(120deg, #2854f2 0%, #4332c9 58%, #7b1fd1 100%);
    box-shadow: 0 14px 34px rgba(22, 37, 64, .18);
    margin-bottom: 18px;
}

.hero-ops h2 {
    margin: 4px 0 6px;
    font-size: 30px;
    font-weight: 850;
}

.hero-ops p,
.eyebrow {
    margin: 0;
    color: rgba(255,255,255,.82);
}

.eyebrow {
    display: inline-block;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.critical-strip,
.cockpit-card {
    margin-bottom: 18px;
}

.critical-title {
    display: flex;
    gap: 8px;
    align-items: center;
    font-weight: 850;
    margin-bottom: 10px;
}

.critical-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.critical-card {
    min-height: 92px;
    display: grid;
    grid-template-columns: 28px 1fr;
    grid-template-rows: auto auto;
    gap: 2px 10px;
    align-items: center;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
}

.critical-card i {
    grid-row: span 2;
    font-size: 22px;
}

.critical-card strong {
    font-size: 15px;
}

.critical-card span {
    color: var(--muted);
    font-size: 13px;
}

.critical-card.danger { border-color: #f7b3b3; background: #fff3f3; color: #a92727; }
.critical-card.warning { border-color: #f8d582; background: #fff9e8; color: #915b00; }
.critical-card.info { border-color: #b9d5ff; background: #eef6ff; color: #2357b5; }
.critical-card.success { border-color: #b8ead6; background: #effaf6; color: #116b50; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.kpi-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    min-height: 118px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(22, 37, 64, .06);
}

.kpi-card span,
.kpi-card small {
    display: block;
    color: var(--muted);
}

.kpi-card strong {
    display: block;
    margin: 7px 0;
    font-size: 30px;
    color: var(--navy);
}

.kpi-card i {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--sky);
    color: var(--blue);
    font-size: 24px;
}

.kpi-card.primary i {
    background: #e9f8f3;
    color: var(--green);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .55fr);
    gap: 18px;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.calendar-live {
    margin-left: auto;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    font-size: 13px;
    color: var(--green);
    font-weight: 800;
}

.mini-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.mini-calendar-head {
    padding: 10px;
    background: #f0f5fb;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-align: center;
    border-right: 1px solid var(--line);
}

.mini-calendar-day {
    min-height: 112px;
    padding: 10px;
    border-top: 1px solid var(--line);
    border-right: 1px solid var(--line);
    background: #fff;
}

.mini-calendar-day:hover { background: #fbfdff; }
.mini-calendar-day.muted { background: #f8fafc; color: #a0acba; }
.mini-calendar-day.today { box-shadow: inset 0 0 0 2px var(--blue); }

.mini-calendar-day span {
    display: block;
    font-weight: 850;
    margin-bottom: 6px;
}

.mini-calendar-day small,
.mini-calendar-day em {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    padding: 3px 6px;
    border-radius: 6px;
    background: #eaf4ff;
    color: #2854a8;
    font-size: 12px;
    font-style: normal;
}

.mini-calendar-day em {
    background: #f3efff;
    color: #673ab7;
}

.ai-badge {
    padding: 6px 8px;
    border-radius: 6px;
    background: #f3efff;
    color: #673ab7;
    font-weight: 850;
    font-size: 12px;
}

.ai-summary {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 8px;
    background: #f8f5ff;
    border: 1px solid #dfd0ff;
    margin-bottom: 12px;
}

.ai-summary i {
    color: #673ab7;
    font-size: 24px;
}

.ai-summary p {
    margin: 3px 0 0;
    color: var(--muted);
}

.insight-card,
.finance-alert {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.insight-card strong,
.insight-card span,
.finance-alert strong,
.finance-alert span {
    display: block;
}

.insight-card span,
.finance-alert span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.insight-card.danger { border-color: #f7b3b3; background: #fff3f3; }
.insight-card.warning { border-color: #f8d582; background: #fff9e8; }
.insight-card.info { border-color: #b9d5ff; background: #eef6ff; }
.insight-card.success { border-color: #b8ead6; background: #effaf6; }

.chart-wrap {
    min-height: 300px;
}

.pipeline-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pipeline-grid div {
    min-height: 112px;
    display: grid;
    place-items: center;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.pipeline-grid strong {
    font-size: 34px;
    color: var(--navy);
}

.pipeline-grid span {
    color: var(--muted);
    font-weight: 700;
}

.appointment-timeline {
    display: grid;
    gap: 10px;
}

.timeline-row {
    display: grid;
    grid-template-columns: 84px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.timeline-row time {
    font-weight: 850;
    color: var(--blue);
}

.timeline-row span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.finance-alert {
    display: flex;
    gap: 10px;
    align-items: start;
    background: #fff9e8;
    border-color: #f8d582;
}

.finance-alert i {
    color: #915b00;
}

.floating-ai-button {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 50;
    height: 56px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: #14233c;
    color: #fff;
    font-weight: 850;
    box-shadow: 0 16px 36px rgba(20, 35, 60, .28);
}

.floating-ai-button i {
    font-size: 22px;
    color: #8ee6c7;
}

.ai-drawer {
    position: fixed;
    right: 22px;
    bottom: 90px;
    width: min(380px, calc(100vw - 32px));
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 22px 54px rgba(20, 35, 60, .24);
    z-index: 49;
    transform: translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: .18s ease;
}

.ai-drawer.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.ai-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid var(--line);
}

.ai-drawer-head span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.ai-drawer-body {
    padding: 14px;
}

.ai-message {
    padding: 12px;
    border-radius: 8px;
    background: #f5f8fc;
    margin-bottom: 12px;
}

.ai-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ai-quick-grid a {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 800;
    color: var(--navy);
}

.ai-command-ribbon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    margin-bottom: 18px;
    border: 1px solid #cfe1ff;
    border-radius: 8px;
    background: linear-gradient(90deg, #f7fbff, #f7f3ff);
}

.ai-command-main {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ai-command-main p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.ai-pulse {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #1f9d7a;
    box-shadow: 0 0 0 6px rgba(31,157,122,.13);
}

.ai-command-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.branch-board-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.branch-board-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(22, 37, 64, .07);
}

.branch-board-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    color: #fff;
    background: linear-gradient(120deg, #203452, #2854f2);
}

.branch-board-head span {
    color: rgba(255,255,255,.72);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.branch-board-head h3 {
    margin: 2px 0 0;
    font-size: 22px;
    font-weight: 850;
}

.branch-board-head i {
    font-size: 28px;
    color: rgba(255,255,255,.84);
}

.branch-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.branch-metric-grid a {
    min-height: 94px;
    padding: 12px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.branch-metric-grid a:hover {
    background: #f7fbff;
}

.branch-metric-grid strong,
.branch-metric-grid span {
    display: block;
}

.branch-metric-grid strong {
    font-size: 22px;
    color: var(--navy);
}

.branch-metric-grid span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.branch-ai-note {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    background: #fbfdff;
    color: var(--navy);
}

.branch-ai-note i {
    color: #673ab7;
}

.login-card-wide {
    width: min(100%, 1180px);
}

.enterprise-login {
    display: grid;
    grid-template-columns: .95fr 1.05fr;
    padding: 0;
    overflow: hidden;
}

.login-brand-panel {
    padding: 34px;
    color: #fff;
    background:
        linear-gradient(140deg, rgba(20,35,60,.92), rgba(40,84,242,.78)),
        radial-gradient(circle at 20% 20%, rgba(142,230,199,.35), transparent 34%);
}

.login-brand-panel .brand-mark {
    background: #fff;
}

.login-brand-panel .brand small {
    color: rgba(255,255,255,.72);
}

.login-brand-panel h1 {
    margin: 36px 0 12px;
    font-size: 42px;
    line-height: 1.05;
    font-weight: 900;
}

.login-brand-panel p {
    color: rgba(255,255,255,.78);
    font-size: 17px;
}

.login-feature-list {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.login-feature-list span {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 8px;
    background: rgba(255,255,255,.08);
}

.login-form-panel {
    padding: 34px;
}

.login-intro h2 {
    margin: 6px 0 4px;
    font-size: 30px;
    font-weight: 850;
}

.login-intro p {
    color: var(--muted);
}

.role-login-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.role-login-card {
    text-align: left;
    min-height: 126px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    box-shadow: none;
}

.role-login-card.active,
.role-login-card:hover {
    border-color: var(--blue);
    background: var(--sky);
}

.role-login-card i {
    display: block;
    color: var(--blue);
    font-size: 24px;
    margin-bottom: 8px;
}

.role-login-card strong,
.role-login-card span {
    display: block;
}

.role-login-card span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.payment-choice-grid {
    display: grid;
    gap: 12px;
}

.payment-choice-card {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 4px 12px;
    text-align: left;
    width: 100%;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.payment-choice-card:hover {
    border-color: var(--blue);
    background: var(--sky);
}

.payment-choice-card i {
    grid-row: span 2;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #eef6ff;
    color: var(--blue);
    font-size: 22px;
}

.payment-choice-card span {
    color: var(--muted);
    font-size: 13px;
}

.ai-studio-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 22px;
    margin-bottom: 18px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(120deg, #203452 0%, #2854f2 52%, #7b1fd1 100%);
}

.ai-studio-hero h2 {
    margin: 5px 0 6px;
    font-size: 26px;
    font-weight: 900;
}

.ai-studio-hero p {
    margin: 0;
    color: rgba(255,255,255,.78);
}

.ai-studio-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ai-inline-hint {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    margin-top: 6px;
    padding: 4px 7px;
    border-radius: 6px;
    background: #f3efff;
    color: #673ab7;
    font-size: 12px;
    font-weight: 750;
}

.public-ai-note {
    display: flex;
    gap: 12px;
    padding: 14px;
    margin-bottom: 18px;
    border: 1px solid #dfd0ff;
    border-radius: 8px;
    background: #f8f5ff;
}

.public-ai-note i {
    color: #673ab7;
    font-size: 24px;
}

.public-ai-note strong,
.public-ai-note span {
    display: block;
}

.public-ai-note span {
    color: var(--muted);
    margin-top: 3px;
}

.calendar-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
}

.calendar-header-pro {
    display: grid;
    grid-template-columns: auto minmax(260px, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin: -18px -18px 16px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(120deg, #2854f2, #7b1fd1);
    color: #fff;
}

.calendar-search {
    position: relative;
}

.calendar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    z-index: 1;
}

.calendar-search .form-select {
    padding-left: 38px;
}

.calendar-large .mini-calendar-day {
    min-height: 132px;
}

.calendar-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.calendar-stat-grid div {
    min-height: 96px;
    display: grid;
    place-items: center;
    text-align: center;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #f7fbff;
}

.calendar-stat-grid strong {
    display: block;
    font-size: 32px;
    color: var(--blue);
}

.calendar-stat-grid span {
    display: block;
    color: var(--muted);
    font-weight: 700;
}

@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi-grid, .critical-grid, .role-login-grid, .branch-board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-grid, .chat-layout, .dashboard-grid, .calendar-page-grid { grid-template-columns: 1fr; }
    .enterprise-login { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .topbar { padding: 0 16px; }
    .content { padding: 18px 16px 36px; }
}

@media (max-width: 640px) {
    .stat-grid { grid-template-columns: 1fr; }
    .kpi-grid, .critical-grid, .role-login-grid, .pipeline-grid, .branch-board-grid, .branch-metric-grid { grid-template-columns: 1fr; }
    .ai-command-ribbon { align-items: stretch; flex-direction: column; }
    .hero-ops { align-items: stretch; flex-direction: column; padding: 18px; }
    .ai-studio-hero { align-items: stretch; flex-direction: column; padding: 18px; }
    .hero-ops h2 { font-size: 24px; }
    .login-brand-panel, .login-form-panel { padding: 22px; }
    .login-brand-panel h1 { font-size: 30px; }
    .topbar h1 { font-size: 18px; }
    .topbar p, .user-chip { display: none; }
    .panel { padding: 14px; }
    .toolbar > * { width: 100%; }
    .table-responsive { border: 1px solid var(--line); border-radius: 8px; }
    .mini-calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mini-calendar-head { display: none; }
    .timeline-row { grid-template-columns: 1fr; }
    .floating-ai-button span { display: none; }
}

/* Aidoc-inspired compact SaaS shell */
:root {
    --navy: #0f172a;
    --navy-2: #1e293b;
    --blue: #2563eb;
    --blue-soft: #dbeafe;
    --sky: #eff6ff;
    --line: #e2e8f0;
    --soft: #f8fafc;
    --text: #111827;
    --muted: #64748b;
    --green: #16a34a;
    --emerald: #10b981;
    --amber: #d97706;
    --danger: #dc2626;
    --violet: #7c3aed;
    --cyan: #0891b2;
    --rose: #e11d48;
    --radius: 8px;
}

body {
    background:
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    color: var(--text);
    min-height: 100vh;
}

.app-shell {
    min-height: 100vh;
    background: transparent;
}

.sidebar {
    width: 264px;
    background: rgba(255,255,255,.96);
    color: var(--text);
    border-right: 1px solid var(--line);
    box-shadow: 14px 0 34px rgba(15, 23, 42, .04);
    padding: 14px 12px;
    overflow-y: auto;
}

.brand {
    min-height: 62px;
    padding: 10px 10px 14px;
    border-bottom: 1px solid var(--line);
}

.brand-mark {
    width: 38px;
    height: 38px;
    background: var(--blue);
    color: #fff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, .22);
}

.brand strong {
    display: block;
    color: var(--text);
    font-size: 17px;
    line-height: 1.1;
}

.brand small {
    color: var(--muted);
}

.role-panel {
    margin: 14px 4px;
    border-color: var(--line);
    background: linear-gradient(180deg, #fff, #f8fbff);
    color: var(--text);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

.role-panel span,
.role-panel small {
    color: var(--muted);
}

.role-panel strong {
    color: var(--text);
}

.role-panel-meter {
    height: 5px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 8px;
    background: #e5edf7;
}

.role-panel-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--emerald));
}

.nav-menu {
    gap: 2px;
    padding-bottom: 12px;
}

.nav-section-label {
    display: block;
    margin: 14px 10px 6px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0;
}

.nav-menu .nav-link {
    min-height: 38px;
    padding: 9px 10px;
    color: #475569;
    border-radius: 8px;
    font-size: 14px;
    gap: 10px;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.nav-menu .nav-link i {
    width: 20px;
    color: #64748b;
    font-size: 17px;
    text-align: center;
}

.nav-menu .nav-link:hover {
    background: #f1f5f9;
    color: var(--text);
    transform: translateX(2px);
}

.nav-menu .nav-link.active {
    background: var(--blue-soft);
    color: #1d4ed8;
}

.nav-menu .nav-link.active i {
    color: #2563eb;
}

.sidebar-quick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 4px 8px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.sidebar-quick > span {
    grid-column: 1 / -1;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.sidebar-quick a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    transition: .16s ease;
}

.sidebar-quick a:hover {
    border-color: #bfdbfe;
    background: var(--sky);
    color: #1d4ed8;
}

.main {
    margin-left: 264px;
}

.topbar {
    height: 68px;
    padding: 0 22px;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}

.topbar-title h1 {
    font-size: 21px;
    color: var(--text);
}

.topbar-title p {
    color: var(--muted);
}

.topbar-actions {
    position: relative;
    gap: 8px;
}

.topbar-search {
    width: min(30vw, 340px);
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
}

.topbar-search:hover {
    border-color: #bfdbfe;
    background: #fff;
    color: #2563eb;
}

.icon-btn {
    border-color: var(--line);
    color: #334155;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.icon-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.has-dot {
    position: relative;
}

.has-dot::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--rose);
}

.ai-top-trigger {
    color: #6d28d9;
    background: #faf5ff;
}

.topbar-action-wrap {
    position: relative;
}

.user-chip {
    gap: 8px;
    border-color: var(--line);
    color: #334155;
    background: #fff;
}

.avatar {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}

.avatar.lg {
    width: 42px;
    height: 42px;
    font-size: 18px;
}

.topbar-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(360px, calc(100vw - 28px));
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 22px 50px rgba(15, 23, 42, .18);
    z-index: 100;
    opacity: 0;
    transform: translateY(-4px) scale(.98);
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease;
}

.topbar-popover.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 6px 10px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 6px;
}

.popover-head strong {
    font-size: 14px;
}

.popover-head a {
    color: var(--blue);
    font-size: 12px;
    font-weight: 850;
}

.popover-row {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 10px;
    align-items: center;
    padding: 9px 8px;
    border-radius: 8px;
    color: #334155;
}

.popover-row:hover {
    background: #f8fafc;
}

.popover-row i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #dbeafe;
    color: #2563eb;
}

.popover-row.urgent i {
    background: #fee2e2;
    color: #dc2626;
}

.popover-row.success i {
    background: #dcfce7;
    color: #16a34a;
}

.popover-row strong,
.popover-row small {
    display: block;
}

.popover-row small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.profile-card {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 6px;
}

.profile-card small {
    display: block;
    color: var(--muted);
}

.popover-menu-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 9px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    font-weight: 750;
    text-align: left;
}

.popover-menu-link:hover {
    background: #f8fafc;
}

.popover-menu-link.danger {
    color: #dc2626;
}

.content {
    padding: 22px 22px 48px;
}

.ai-command-ribbon {
    border-color: #dbeafe;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}

.ai-pulse {
    animation: pulseRing 1.8s ease-out infinite;
}

.panel,
.cockpit-card,
.branch-board-card,
.critical-card,
.kpi-card,
.ops-module-card {
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}

.panel,
.cockpit-card {
    border-color: var(--line);
}

.panel-title {
    margin-bottom: 12px;
}

.panel-title h2 {
    font-size: 16px;
    color: var(--text);
}

.panel-kicker,
.section-heading span {
    display: block;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.eyebrow.dark {
    color: #2563eb;
}

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 122px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,246,255,.96)),
        linear-gradient(90deg, #2563eb, #10b981);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .07);
}

.dashboard-hero h2 {
    margin: 5px 0;
    color: var(--text);
    font-size: 25px;
    font-weight: 900;
}

.dashboard-hero p {
    margin: 0;
    color: var(--muted);
}

.hero-command-stack {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.hero-command-stack .btn-light {
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.hero-command-stack .btn-outline-light {
    color: #334155;
    border-color: #cbd5e1;
    background: #fff;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.section-heading h2 {
    margin: 2px 0 0;
    font-size: 16px;
    font-weight: 900;
}

.compact-alerts {
    margin-bottom: 16px;
}

.critical-grid {
    gap: 10px;
}

.critical-card {
    min-height: 84px;
    padding: 12px;
    border-color: var(--line);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.critical-card:hover,
.kpi-card:hover,
.ops-module-card:hover,
.activity-row:hover,
.timeline-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, .1);
}

.critical-card i {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    font-size: 18px;
}

.critical-card.danger { background: #fff7f7; border-color: #fecaca; color: #991b1b; }
.critical-card.warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.critical-card.info { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.critical-card.success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }

.kpi-grid {
    gap: 12px;
    margin-bottom: 16px;
}

.kpi-card {
    min-height: 112px;
    color: inherit;
    transition: transform .16s ease, box-shadow .16s ease;
}

.kpi-card strong {
    font-size: 27px;
}

.kpi-card i {
    flex: 0 0 auto;
}

.kpi-card.blue i { background: #dbeafe; color: #2563eb; }
.kpi-card.green i { background: #dcfce7; color: #16a34a; }
.kpi-card.emerald i { background: #d1fae5; color: #059669; }
.kpi-card.violet i { background: #ede9fe; color: #7c3aed; }

.ops-module-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.ops-module-card {
    min-height: 142px;
    display: block;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    transition: transform .16s ease, box-shadow .16s ease;
}

.ops-module-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-size: 14px;
}

.ops-module-head span {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #f1f5f9;
}

.ops-module-value {
    margin-top: 14px;
    color: var(--text);
    font-size: 28px;
    font-weight: 900;
}

.ops-module-card p {
    margin: 2px 0 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.ops-progress {
    height: 7px;
    overflow: hidden;
    border-radius: 8px;
    background: #e2e8f0;
}

.ops-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--blue);
    animation: progressFlow 1.2s ease both;
}

.ops-module-card.blue .ops-module-head span,
.ops-module-card.blue .ops-progress span { background: #2563eb; color: #fff; }
.ops-module-card.rose .ops-module-head span,
.ops-module-card.rose .ops-progress span { background: #e11d48; color: #fff; }
.ops-module-card.cyan .ops-module-head span,
.ops-module-card.cyan .ops-progress span { background: #0891b2; color: #fff; }
.ops-module-card.amber .ops-module-head span,
.ops-module-card.amber .ops-progress span { background: #d97706; color: #fff; }

.branch-board-grid {
    gap: 12px;
    margin-bottom: 16px;
}

.branch-board-head {
    background: linear-gradient(135deg, #0f172a, #2563eb);
}

.branch-metric-grid a {
    min-height: 78px;
}

.dashboard-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .55fr);
    gap: 16px;
    align-items: start;
}

.dashboard-side-stack {
    display: grid;
    gap: 16px;
}

.calendar-toolbar {
    gap: 8px;
}

.calendar-live {
    margin-left: 0;
    margin-right: auto;
    padding: 7px 9px;
    border-radius: 8px;
    background: #ecfdf5;
}

.mini-calendar-day {
    min-height: 94px;
    transition: background .16s ease, box-shadow .16s ease;
}

.mini-calendar-day:hover {
    background: #eff6ff;
}

.mini-calendar-day.today {
    box-shadow: inset 0 0 0 2px #2563eb;
}

.mini-calendar-day small,
.mini-calendar-day em {
    background: #dbeafe;
    color: #1d4ed8;
}

.ai-summary {
    background: #f8f5ff;
    border-color: #ddd6fe;
}

.ai-summary i {
    color: #7c3aed;
}

.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.quick-action-grid a {
    min-height: 76px;
    display: grid;
    place-items: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-weight: 800;
    transition: .16s ease;
}

.quick-action-grid a:hover {
    border-color: #bfdbfe;
    background: var(--sky);
    color: #1d4ed8;
}

.quick-action-grid i {
    font-size: 22px;
}

.pipeline-grid {
    gap: 10px;
}

.pipeline-grid div {
    min-height: 96px;
    background: #f8fafc;
}

.pipeline-grid strong {
    font-size: 30px;
}

.activity-feed,
.notice-stack {
    display: grid;
    gap: 8px;
}

.activity-row {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    transition: .16s ease;
}

.activity-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 8px;
}

.activity-icon.blue {
    background: #dbeafe;
    color: #2563eb;
}

.activity-icon.rose {
    background: #ffe4e6;
    color: #e11d48;
}

.activity-row strong,
.activity-row small {
    display: block;
}

.activity-row small {
    margin-top: 2px;
    color: var(--muted);
}

.queue-pill,
.ai-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 8px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 850;
}

.appointment-timeline.compact {
    gap: 8px;
}

.timeline-row {
    background: #fff;
    transition: .16s ease;
}

.timeline-row time {
    color: #2563eb;
}

.empty-state {
    min-height: 92px;
    display: grid;
    place-items: center;
    gap: 6px;
    color: var(--muted);
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    text-align: center;
}

.empty-state i {
    font-size: 24px;
    color: #94a3b8;
}

.dashboard-chat-notice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-chat-card {
    margin-bottom: 0;
}

.notice-stack a {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 8px;
    align-items: center;
    min-height: 42px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #334155;
}

.notice-stack a:hover {
    background: #f8fafc;
}

.mini-chat-line {
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    margin-bottom: 8px;
}

.mini-chat-line strong {
    font-size: 12px;
    color: #475569;
}

.mini-chat-line span {
    color: #334155;
    font-size: 13px;
}

.mini-chat-line.outgoing {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.mini-chat-line.just-sent {
    animation: uiRise .22s ease both;
}

.mini-chat-form {
    display: grid;
    grid-template-columns: 1fr 38px;
    gap: 8px;
}

.mini-chat-form input {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 10px;
    outline: 0;
}

.mini-chat-form input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.mini-chat-form button {
    border: 0;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
}

.floating-ai-button {
    background: var(--navy);
    border-radius: 8px;
}

.ai-drawer {
    border-radius: 8px;
}

.ai-drawer.open {
    animation: drawerIn .18s ease both;
}

.ai-message.bot {
    background: #f8fafc;
}

.ai-message.user {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.ai-quick-grid a {
    display: inline-flex;
    gap: 7px;
    align-items: center;
}

.ops-modal {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 30px 70px rgba(15, 23, 42, .28);
}

.ops-brief-list {
    display: grid;
    gap: 10px;
}

.ops-brief-list div {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.ops-brief-list i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #f8fafc;
}

.chart-wrap {
    min-height: 280px;
}

.guest-body {
    background:
        linear-gradient(135deg, #0f172a 0%, #172554 48%, #065f46 100%);
}

.guest-shell {
    padding: 28px;
}

.aidoc-login {
    border: 1px solid rgba(255,255,255,.22);
    box-shadow: 0 30px 80px rgba(2, 6, 23, .32);
}

.guest-body:has(.aidoc-login) {
    min-height: 100svh !important;
    background:
        radial-gradient(circle at 10% 12%, rgba(14,165,233,.22), transparent 34%),
        radial-gradient(circle at 88% 18%, rgba(59,130,246,.18), transparent 34%),
        linear-gradient(135deg, #f8fbff 0%, #eef7ff 48%, #f7fbff 100%) !important;
}

.guest-shell:has(.aidoc-login) {
    width: 100% !important;
    min-height: 100svh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 18px !important;
    background: transparent !important;
}

.login-brand-panel {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(15,23,42,.96), rgba(37,99,235,.82) 58%, rgba(5,150,105,.86));
}

.login-brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .16;
    background-image:
        linear-gradient(rgba(255,255,255,.24) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.24) 1px, transparent 1px);
    background-size: 38px 38px;
    pointer-events: none;
}

.login-brand-panel > * {
    position: relative;
}

.login-hero-copy h1 {
    margin: 28px 0 12px;
    font-size: 42px;
    line-height: 1.05;
    font-weight: 900;
}

.login-hero-copy p {
    max-width: 520px;
}

.login-preview-card {
    margin-top: 28px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    background: rgba(255,255,255,.1);
    backdrop-filter: blur(12px);
}

.preview-head,
.preview-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.preview-head span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255,255,255,.82);
    font-weight: 850;
}

.preview-head strong {
    color: #fff;
    font-size: 28px;
}

.preview-bars {
    display: grid;
    gap: 8px;
    margin: 16px 0;
}

.preview-bars span {
    height: 8px;
    border-radius: 8px;
    background: linear-gradient(90deg, #93c5fd, #34d399);
    animation: progressFlow 1.2s ease both;
}

.preview-grid div {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255,255,255,.12);
}

.preview-grid strong,
.preview-grid span {
    display: block;
}

.preview-grid strong {
    color: #fff;
    font-size: 20px;
}

.preview-grid span {
    color: rgba(255,255,255,.72);
    font-size: 12px;
}

.login-form-panel {
    background: #fff;
}

.login-intro h2 {
    color: var(--text);
}

.role-login-card {
    transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.role-login-card:hover,
.role-login-card.active {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(37, 99, 235, .12);
}

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.input-icon-wrap .form-control {
    padding-left: 40px;
}

.login-submit {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-security-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.login-security-strip span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 9px;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

@keyframes uiRise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 2026-05 premium workflow refinements */
.profile-avatar,
.avatar,
.avatar-chip,
.profile-photo-preview {
    background-size: cover !important;
    background-position: center !important;
    color: transparent !important;
    text-indent: -999px;
    overflow: hidden;
}

.avatar-chip:has(i) {
    background-image: none !important;
    color: inherit !important;
    text-indent: 0;
}

.avatar-chip:has(i) i {
    color: inherit !important;
    font-size: 18px;
}

.profile-avatar:not([style]),
.avatar:not([style]),
.avatar-chip:not([style]) {
    background-image: url("https://cdn-icons-png.flaticon.com/512/3177/3177440.png") !important;
}

.system-notification-toast {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 2200;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    width: min(520px, calc(100vw - 28px));
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 22px;
    background: rgba(15, 23, 42, .88);
    color: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .32);
    backdrop-filter: blur(18px);
    transform: translate(-50%, -130%);
    opacity: 0;
    transition: transform .42s cubic-bezier(.2, .8, .2, 1), opacity .24s ease;
}

.system-notification-toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

.system-notification-toast > span {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #22c55e, #2563eb);
}

.system-notification-toast strong,
.system-notification-toast small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.parent-process-panel {
    margin-bottom: 16px;
}

.process-action-row,
.process-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.process-step-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.process-step-card {
    position: relative;
    min-height: 180px;
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 22px;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .07);
    overflow: hidden;
}

.process-step-card::after {
    content: "";
    position: absolute;
    inset: auto -44px -54px auto;
    width: 150px;
    height: 150px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .08);
}

.process-step-card > span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #e0e7ff;
    color: #1d4ed8;
    font-weight: 950;
}

.process-step-card strong {
    display: block;
    color: #0f172a;
    font-size: 17px;
}

.process-step-card p,
.process-step-card small {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

.process-step-card.active {
    border-color: rgba(37, 99, 235, .28);
    background: linear-gradient(135deg, #eff6ff, #fff);
}

.process-step-card.done {
    border-color: rgba(16, 185, 129, .28);
    background: linear-gradient(135deg, #ecfdf5, #fff);
}

.process-test-strip,
.template-card-grid,
.package-card-grid,
.attendance-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.process-test-strip a,
.template-card,
.package-modern-card,
.attendance-day-card {
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 20px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .07);
}

.process-test-strip a {
    display: flex;
    gap: 12px;
    align-items: center;
}

.process-test-strip i {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #eff6ff;
    color: #2563eb;
}

.process-test-picker {
    display: grid;
    gap: 10px;
}

.process-test-picker label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 16px;
    background: #f8fafc;
}

.process-closed-note,
.auto-child-preview,
.paytr-preview-box {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8fafc;
    color: #475569;
    font-weight: 800;
}

.auto-child-preview.is-danger {
    background: #fef2f2;
    color: #b91c1c;
}

.package-modern-card {
    position: relative;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease;
}

.package-modern-card:hover,
.payment-track-card:hover,
.smart-test-card:hover,
.chat-person-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .12);
}

.package-modern-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.package-modern-head > span {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #dbeafe, #ccfbf1);
    color: #1d4ed8;
}

.package-modern-card h3,
.template-card h3 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 18px;
}

.package-modern-card p,
.template-card p {
    color: #64748b;
    min-height: 44px;
}

.package-modern-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0;
}

.package-modern-meta div {
    padding: 10px;
    border-radius: 14px;
    background: #f8fafc;
}

.package-modern-meta small,
.package-modern-meta strong {
    display: block;
}

.payment-track-card.overdue {
    border-color: rgba(239, 68, 68, .32);
    background: linear-gradient(135deg, #fff, #fef2f2);
}

.test-admin-card {
    position: relative;
    min-height: 300px;
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,250,252,.96)),
        radial-gradient(circle at 0 0, rgba(37, 99, 235, .18), transparent 34%);
    border: 1px solid rgba(37, 99, 235, .14);
}

.test-admin-card .test-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    color: #fff;
    box-shadow: 0 18px 32px rgba(37, 99, 235, .22);
}

.test-admin-card h3 {
    font-size: 18px;
    line-height: 1.25;
}

.test-admin-card .card-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.payment-track-card.overdue .payment-amount-row div:nth-child(2) {
    color: #b91c1c;
}

.card-action-row .btn,
.appointment-action-grid .btn {
    min-height: 34px;
    border-radius: 999px;
    font-weight: 900;
    transition: transform .16s ease, box-shadow .16s ease;
}

.card-action-row .btn:hover,
.appointment-action-grid .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, .12);
}

.appointment-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(98px, 1fr));
}

.appointment-action-grid form,
.card-action-row form {
    margin: 0;
}

.ai-panel .insight-card,
.ai-summary {
    min-width: 0;
}

.ai-panel .insight-card strong,
.ai-panel .insight-card span,
.ai-summary strong,
.ai-summary p {
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.ai-panel .insight-card strong {
    font-size: 14px;
}

.ai-panel .insight-card span,
.ai-summary p {
    font-size: 12px;
}

.critical-card {
    min-width: 0;
}

.critical-card strong {
    font-size: 15px !important;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.critical-card span {
    font-size: 12px !important;
    line-height: 1.35;
}

.ai-drawer {
    background: #0f172a;
    color: #e5f2ff;
}

.ai-drawer .ai-drawer-head,
.ai-drawer .ai-message,
.ai-drawer .ai-quick-grid a,
.ai-drawer .ai-quick-grid button {
    background: rgba(255,255,255,.08);
    color: #f8fafc;
    border-color: rgba(255,255,255,.12);
}

.floating-ai-button {
    background: linear-gradient(135deg, #111827, #2563eb, #14b8a6);
    box-shadow: 0 24px 60px rgba(37, 99, 235, .28);
}

.chat-person-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.chat-pro-layout {
    align-items: stretch;
}

.chat-contact-panel {
    max-height: 720px;
    overflow: hidden;
}

.chat-thread-list {
    max-height: 620px;
    overflow: auto;
    padding-right: 4px;
}

.chat-message-panel {
    min-height: 620px;
    display: flex;
    flex-direction: column;
}

.chat-messages.pro {
    flex: 1;
    min-height: 460px;
}

.attendance-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.attendance-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
    background: #f8fafc;
}

.attendance-day-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-settings-grid {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 16px;
}

.profile-photo-panel {
    display: flex;
    gap: 18px;
    align-items: center;
}

.profile-photo-preview {
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
    border-radius: 30px;
    border: 1px solid rgba(148, 163, 184, .2);
    background-image: url("https://cdn-icons-png.flaticon.com/512/3177/3177440.png");
    box-shadow: 0 18px 42px rgba(15, 23, 42, .12);
}

.premium-upload {
    min-height: 180px;
    border-radius: 24px;
}

.guest-premium {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(360px, .7fr);
    gap: 34px;
    align-items: center;
    padding: clamp(22px, 5vw, 64px);
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .92), rgba(37, 99, 235, .78)),
        radial-gradient(circle at 20% 20%, rgba(20, 184, 166, .3), transparent 34%);
}

.guest-story {
    color: #fff;
}

.guest-story h1 {
    max-width: 720px;
    margin: 16px 0;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1;
}

.guest-story p {
    max-width: 580px;
    color: rgba(255,255,255,.78);
    font-size: 16px;
}

.brand-pill,
.guest-signal-list span {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-weight: 900;
}

.guest-signal-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.public-appointment-card {
    max-width: 620px;
}

.paytr-sheet {
    position: fixed;
    inset: 0;
    z-index: 2300;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .58);
    opacity: 0;
    transition: opacity .2s ease;
}

.paytr-sheet.show {
    opacity: 1;
}

.paytr-sheet-card {
    position: relative;
    width: min(420px, 100%);
    padding: 28px;
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 34px 90px rgba(15, 23, 42, .28);
    text-align: center;
}

.paytr-sheet-card .icon-btn {
    position: absolute;
    top: 12px;
    right: 12px;
}

.paytr-lock {
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 22px;
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    color: #fff;
    font-size: 24px;
}

.aidoc-login {
    width: min(1060px, calc(100vw - 36px));
    min-height: 640px;
    border-radius: 30px;
    overflow: hidden;
    background: rgba(255,255,255,.94);
    box-shadow: 0 34px 90px rgba(15, 23, 42, .22);
}

.aidoc-login .login-brand-panel {
    background:
        linear-gradient(145deg, rgba(15, 23, 42, .94), rgba(37, 99, 235, .76)),
        radial-gradient(circle at 20% 20%, rgba(20,184,166,.34), transparent 38%);
}

.aidoc-login .login-form-panel {
    padding: clamp(26px, 4vw, 44px);
}

.aidoc-login .login-hero-copy h1 {
    font-size: clamp(34px, 4.8vw, 58px);
    letter-spacing: 0;
}

.aidoc-login .role-login-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.aidoc-login .role-login-card {
    min-height: 92px;
    border-radius: 18px;
}

.aidoc-login .login-security-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 1100px) {
    .process-step-grid,
    .process-test-strip,
    .template-card-grid,
    .package-card-grid,
    .attendance-grid,
    .chat-person-grid,
    .profile-settings-grid,
    .guest-premium {
        grid-template-columns: 1fr;
    }

    .appointment-action-grid {
        grid-template-columns: 1fr;
    }

    .attendance-row {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .attendance-row em {
        grid-column: 2;
        justify-self: start;
    }
}

.ai-summary {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
}

.ai-summary > div,
.ai-summary p,
.insight-card span,
.ops-brief-list span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.test-submission-hero h2 {
    font-size: clamp(34px, 4.2vw, 62px);
    line-height: 1.04;
}

.test-submission-hero .profile-actions {
    flex-wrap: wrap;
}

.branch-board-card {
    position: relative;
    overflow: hidden;
}

.branch-board-card::after {
    content: "";
    position: absolute;
    inset: auto -40px -60px auto;
    width: 160px;
    height: 160px;
    border-radius: 999px;
    background: rgba(20, 184, 166, .12);
    pointer-events: none;
}

@keyframes pulseRing {
    0% {
        box-shadow: 0 0 0 0 rgba(16,185,129,.28);
    }
    70% {
        box-shadow: 0 0 0 9px rgba(16,185,129,0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16,185,129,0);
    }
}

@keyframes progressFlow {
    from {
        transform: scaleX(.42);
        transform-origin: left;
    }
    to {
        transform: scaleX(1);
        transform-origin: left;
    }
}

@keyframes drawerIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-hero,
.critical-strip,
.kpi-card,
.ops-module-card,
.branch-board-card,
.cockpit-card,
.dashboard-chat-notice-grid > * {
    animation: uiRise .34s ease both;
}

.kpi-card:nth-child(2),
.ops-module-card:nth-child(2) { animation-delay: .04s; }
.kpi-card:nth-child(3),
.ops-module-card:nth-child(3) { animation-delay: .08s; }
.kpi-card:nth-child(4),
.ops-module-card:nth-child(4) { animation-delay: .12s; }

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 1200px) {
    .ops-module-grid,
    .critical-grid,
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .dashboard-chat-notice-grid {
        grid-template-columns: 1fr;
    }

    .topbar-search {
        display: none;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
    }

    .topbar {
        padding: 0 14px;
    }

    .content {
        padding: 16px 14px 38px;
    }

    .dashboard-hero,
    .ai-command-ribbon {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-command-stack {
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    .topbar-title p,
    .user-chip > span:not(.avatar),
    .user-chip > i {
        display: none;
    }

    .topbar-actions {
        gap: 6px;
    }

    .icon-btn {
        width: 38px;
        height: 38px;
    }

    .dashboard-hero h2,
    .login-hero-copy h1 {
        font-size: 28px;
    }

    .ops-module-grid,
    .critical-grid,
    .kpi-grid,
    .branch-board-grid,
    .pipeline-grid,
    .role-login-grid,
    .branch-metric-grid {
        grid-template-columns: 1fr;
    }

    .activity-row,
    .timeline-row {
        grid-template-columns: 1fr;
    }

    .enterprise-login {
        grid-template-columns: 1fr;
    }

    .login-brand-panel,
    .login-form-panel {
        padding: 22px;
    }

    .preview-grid {
        flex-direction: column;
        align-items: stretch;
    }

    .mini-calendar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mini-calendar-head {
        display: none;
    }

    .floating-ai-button {
        right: 14px;
        bottom: 14px;
        width: 50px;
        height: 50px;
        justify-content: center;
        padding: 0;
    }
}

/* Advanced operational surfaces */
.studio-shell,
.profile-hero {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    min-height: 168px;
    padding: 24px;
    margin-bottom: 18px;
    border-radius: 12px;
    color: #fff;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .96), rgba(30, 64, 175, .86) 46%, rgba(20, 184, 166, .76)),
        #0f172a;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .16);
    animation: uiRise .36s ease both;
}

.studio-shell.compact,
.profile-hero {
    min-height: 132px;
}

.studio-shell::after,
.profile-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 4px;
    background: linear-gradient(90deg, #22c55e, #38bdf8, #f59e0b, #f43f5e);
    animation: shimmerLine 5s linear infinite;
}

.studio-copy,
.profile-hero > div {
    position: relative;
    z-index: 1;
}

.studio-copy h2,
.profile-hero h2 {
    margin: 6px 0;
    max-width: 760px;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 900;
    letter-spacing: 0;
}

.studio-copy p,
.profile-hero p {
    max-width: 720px;
    margin: 0;
    color: rgba(255,255,255,.78);
    font-size: 14px;
}

.studio-actions,
.profile-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.studio-actions .form-select {
    width: 220px;
    border-color: rgba(255,255,255,.45);
    background-color: rgba(255,255,255,.95);
}

.insight-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.insight-card {
    position: relative;
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 4px 12px;
    align-items: center;
    min-height: 92px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .06);
    overflow: hidden;
    animation: uiRise .32s ease both;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.insight-card:hover,
.smart-test-card:hover,
.child-profile-card:hover,
.task-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 50px rgba(15, 23, 42, .12);
}

.insight-card i {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    color: #fff;
    font-size: 18px;
}

.insight-card span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.insight-card strong {
    color: #0f172a;
    font-size: 22px;
    line-height: 1;
}

.insight-card.teal i { background: linear-gradient(135deg, #0f766e, #2dd4bf); }
.insight-card.violet i { background: linear-gradient(135deg, #4f46e5, #8b5cf6); }
.insight-card.amber i { background: linear-gradient(135deg, #d97706, #fbbf24); }
.insight-card.rose i { background: linear-gradient(135deg, #be123c, #fb7185); }

.test-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.test-card-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.smart-test-card,
.task-card {
    position: relative;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(248, 250, 252, .82), #fff 40%),
        #fff;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.smart-test-card::before,
.task-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #0ea5e9, #22c55e, #f59e0b);
}

.smart-test-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.test-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    color: #0369a1;
    background: #e0f2fe;
}

.smart-test-card h3,
.task-card h3 {
    margin: 14px 0 7px;
    color: #0f172a;
    font-size: 16px;
    font-weight: 900;
}

.smart-test-card p,
.task-card p {
    min-height: 40px;
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.test-meta-row,
.test-card-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.test-card-actions a,
.mini-link {
    color: #2563eb;
    font-weight: 900;
    text-decoration: none;
}

.test-progress {
    height: 6px;
    margin-top: 14px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.test-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #14b8a6);
    animation: progressFlow .7s ease both;
}

.builder-toolbar,
.question-block-head,
.submission-head,
.submission-meta,
.finance-mini-grid,
.calendar-header-pro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.question-builder {
    display: grid;
    gap: 12px;
}

.question-block {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(37, 99, 235, .16);
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fbff, #fff);
}

.option-list {
    display: grid;
    gap: 8px;
}

.icon-btn.small {
    width: 30px;
    height: 30px;
}

.form-hint {
    margin-top: 5px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    font-weight: 900;
}

.submission-timeline,
.rich-timeline,
.session-feed {
    display: grid;
    gap: 12px;
}

.submission-item,
.rich-timeline-item,
.session-feed-item {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 12px;
    background: #fff;
}

.submission-mark,
.session-feed-item > i {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    color: #92400e;
    background: #fef3c7;
}

.submission-mark.ready,
.session-feed-item:nth-child(2n) > i {
    color: #047857;
    background: #d1fae5;
}

.submission-head strong,
.session-feed-item strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
}

.submission-head span,
.submission-meta,
.session-feed-item span,
.session-feed-item p {
    color: #64748b;
    font-size: 12px;
}

.submission-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin: 8px 0;
    font-weight: 800;
}

.upload-dropzone {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 154px;
    padding: 18px;
    border: 1px dashed rgba(37, 99, 235, .42);
    border-radius: 12px;
    background: #f8fbff;
    color: #334155;
    text-align: center;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
}

.upload-dropzone:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.upload-dropzone i {
    color: #dc2626;
    font-size: 30px;
}

.upload-dropzone input {
    display: none;
}

.profile-hero.child {
    background:
        linear-gradient(135deg, rgba(5, 46, 22, .94), rgba(13, 148, 136, .84) 48%, rgba(37, 99, 235, .74)),
        #052e16;
}

.child-profile-card,
.compact-row {
    display: grid;
    grid-template-columns: 40px 1fr 20px;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 12px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease;
}

.compact-row {
    grid-template-columns: 1fr auto;
    margin-bottom: 8px;
}

.avatar-chip {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #0f766e);
    font-weight: 900;
}

.child-profile-card small,
.compact-row span,
.task-card small {
    display: block;
    color: #64748b;
    font-size: 12px;
}

/* 2026-05-17 closure pass: readability, action states and responsive polish */
:root {
    --font-modern: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Arial, sans-serif;
}

html,
body,
button,
input,
select,
textarea {
    font-family: var(--font-modern);
    letter-spacing: 0;
}

body {
    font-size: 14px;
}

.btn,
.icon-btn,
button[type="submit"],
button[type="button"] {
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
}

.btn {
    border-radius: 12px;
    font-weight: 850;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
}

.btn:hover,
.icon-btn:hover,
.quick-action-grid a:hover,
.quick-action-grid button:hover,
.card-action-row .btn:hover,
.table-action-row .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, .1);
}

.btn:active,
.icon-btn:active {
    transform: translateY(0) scale(.99);
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-light {
    background: rgba(255, 255, 255, .86);
}

.btn-outline-danger {
    color: #be123c;
    border-color: rgba(225, 29, 72, .35);
}

.btn-outline-success {
    color: #047857;
    border-color: rgba(16, 185, 129, .38);
}

.profile-avatar,
.profile-avatar.small,
.profile-avatar.lg,
.avatar,
.avatar.lg,
.avatar-chip[style],
.user-chip .avatar,
.profile-photo-preview,
.child-avatar {
    border-radius: 50% !important;
    overflow: hidden;
    background-color: #fff;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    border: 2px solid rgba(255, 255, 255, .95);
    color: transparent !important;
    font-size: 0 !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}

.profile-avatar:not([style]),
.avatar:not([style]),
.avatar-chip:not(:has(i)):not([style]),
.child-avatar:not([style]) {
    background-image: url("https://cdn-icons-png.flaticon.com/512/3177/3177440.png");
}

.avatar-chip:has(i) {
    border-radius: 14px !important;
    background-image: none !important;
    color: #2563eb !important;
    font-size: 16px !important;
    text-indent: 0 !important;
}

.avatar-chip:has(i) i {
    color: inherit !important;
}

.profile-avatar.small {
    width: 34px;
    height: 34px;
}

.profile-avatar.lg,
.profile-photo-preview {
    width: 72px;
    height: 72px;
}

.system-notification-toast {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    left: 50%;
    right: auto;
    z-index: 2200;
    width: min(520px, calc(100vw - 24px));
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 18px;
    background: rgba(15, 23, 42, .76);
    color: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
    backdrop-filter: blur(18px);
    transform: translate(-50%, -140%);
}

.system-notification-toast.show {
    transform: translate(-50%, 0);
}

.system-notification-toast > span {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #0f172a;
    background: linear-gradient(135deg, #ccfbf1, #dbeafe);
}

.system-notification-toast strong,
.system-notification-toast small {
    color: #fff;
}

.system-notification-toast small {
    color: rgba(255,255,255,.78);
    overflow-wrap: anywhere;
}

.ai-orb-button.floating-ai-button {
    min-width: 218px;
    min-height: 66px;
    padding: 10px 14px;
    gap: 12px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 20px;
    color: #fff;
    background: linear-gradient(135deg, #111827 0%, #1d4ed8 56%, #0f766e 100%);
    box-shadow: 0 20px 48px rgba(29, 78, 216, .28);
}

.ai-orb-button:hover {
    color: #fff;
    background: linear-gradient(135deg, #0f172a 0%, #2563eb 50%, #0d9488 100%);
}

.ai-orb-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255,255,255,.16);
    color: #fff;
}

.ai-orb-copy {
    display: grid;
    text-align: left;
    line-height: 1.1;
}

.ai-orb-copy strong,
.ai-orb-copy small {
    color: #fff;
}

.ai-orb-copy small {
    opacity: .72;
    font-size: 11px;
}

.ai-drawer {
    background: #0f172a;
    color: #fff;
}

.ai-drawer .ai-message,
.ai-drawer .ai-message.bot,
.ai-drawer .ai-message.user {
    color: #e5eefb;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.08);
}

.ai-drawer .ai-message.user {
    background: rgba(37, 99, 235, .22);
}

.ai-drawer .ai-quick-grid {
    gap: 10px;
}

.ai-drawer .ai-quick-grid a,
.ai-drawer .ai-quick-grid button {
    min-height: 46px;
    color: #e5eefb;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
}

.ai-drawer .ai-quick-grid a:hover,
.ai-drawer .ai-quick-grid button:hover {
    color: #0f172a;
    background: #fff;
}

.ai-panel .panel-title h2 {
    font-size: 18px;
}

.ai-panel .ai-summary {
    align-items: center;
    padding: 12px;
    border-radius: 16px;
}

.ai-panel .ai-summary strong {
    font-size: 14px;
    line-height: 1.25;
}

.ai-panel .ai-summary p {
    margin: 3px 0 0;
    font-size: 12px;
    line-height: 1.35;
}

.ai-panel .insight-card {
    min-height: auto;
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 14px;
}

.ai-panel .insight-card strong {
    font-size: 13px;
    line-height: 1.25;
}

.ai-panel .insight-card span {
    font-size: 12px;
    line-height: 1.35;
}

.test-admin-card {
    min-height: 292px;
    display: grid;
    grid-template-rows: auto auto minmax(42px, auto) auto auto 1fr;
    gap: 10px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, .2);
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.test-admin-card h3 {
    font-size: 17px;
    line-height: 1.28;
}

.test-admin-card p {
    font-size: 12px;
    line-height: 1.45;
}

.test-admin-actions {
    align-self: end;
    display: grid;
    gap: 8px;
}

.test-primary-actions,
.test-secondary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.test-primary-actions form,
.test-secondary-actions form,
.test-primary-actions .btn,
.test-secondary-actions .btn {
    width: 100%;
}

.test-primary-actions .btn,
.test-secondary-actions .btn {
    min-width: 0;
    white-space: nowrap;
}

.integration-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.integration-status-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 18px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .07);
}

.integration-status-card > span {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: #eff6ff;
    color: #2563eb;
}

.integration-status-card strong,
.integration-status-card small {
    display: block;
}

.integration-status-card small {
    color: #64748b;
    font-weight: 700;
}

.integration-status-card em {
    padding: 6px 9px;
    border-radius: 999px;
    font-style: normal;
    font-size: 11px;
    font-weight: 950;
    color: #92400e;
    background: #fef3c7;
}

.integration-status-card.ready em {
    color: #047857;
    background: #d1fae5;
}

.integration-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.integration-service-card {
    min-height: 100%;
}

.web-appointment-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
    gap: 18px;
    align-items: start;
}

.web-appointment-content p {
    max-width: 720px;
    color: #64748b;
}

.guest-body {
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
    background: linear-gradient(135deg, #eefcf8 0%, #f8fafc 48%, #eff6ff 100%);
}

.guest-shell {
    height: 100%;
    min-height: 0;
    padding: clamp(10px, 2vw, 22px);
    overflow: hidden;
}

.aidoc-login {
    width: min(1040px, 100%);
    height: min(720px, calc(100svh - 28px));
    min-height: 0;
    max-height: calc(100svh - 28px);
    overflow: hidden;
    border-radius: 24px;
}

.aidoc-login .login-brand-panel,
.aidoc-login .login-form-panel {
    min-height: 0;
}

.aidoc-login .login-form-panel {
    overflow: auto;
    padding: clamp(20px, 3vw, 34px);
}

.aidoc-login .login-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    background: linear-gradient(145deg, #0f766e 0%, #155e75 48%, #1d4ed8 100%);
}

.aidoc-login .login-brand-panel h1,
.aidoc-login .login-brand-panel .brand strong {
    color: #fff;
}

.aidoc-login .login-brand-panel .brand small,
.aidoc-login .login-hero-copy p,
.aidoc-login .login-slogan-copy {
    color: rgba(255,255,255,.82);
}

.login-slogan-copy {
    display: grid;
    gap: 8px;
    max-width: 460px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.22);
}

.login-slogan-copy strong {
    color: #fff;
    font-size: 16px;
    line-height: 1.35;
}

.login-slogan-copy span {
    line-height: 1.45;
}

.login-slogan-stack {
    display: none !important;
}

.role-login-grid {
    gap: 10px;
}

.role-login-card {
    min-height: 88px;
    color: #0f172a;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, .24);
}

.role-login-card:hover,
.role-login-card.active {
    color: #fff;
    background: linear-gradient(135deg, #0f172a, #2563eb);
    border-color: transparent;
}

.role-login-card:hover strong,
.role-login-card:hover span,
.role-login-card.active strong,
.role-login-card.active span,
.role-login-card:hover i,
.role-login-card.active i {
    color: #fff;
}

.login-security-strip span {
    color: #334155;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, .2);
}

@media (max-width: 1100px) {
    .integration-status-grid,
    .integration-grid.three,
    .web-appointment-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .aidoc-login {
        height: calc(100svh - 20px);
        max-height: calc(100svh - 20px);
        grid-template-columns: 1fr;
    }

    .aidoc-login .login-brand-panel {
        padding: 18px;
        justify-content: start;
    }

    .aidoc-login .login-brand-panel h1 {
        font-size: 24px;
    }

    .login-slogan-copy {
        display: none;
    }

    .role-login-grid {
        grid-template-columns: 1fr;
    }

    .system-notification-toast {
        top: max(10px, env(safe-area-inset-top));
        width: calc(100vw - 18px);
        grid-template-columns: 38px minmax(0, 1fr);
        border-radius: 16px;
    }

    .ai-orb-button.floating-ai-button {
        min-width: 62px;
        min-height: 62px;
        padding: 10px;
        border-radius: 20px;
    }

    .ai-orb-copy {
        display: none;
    }

    .test-primary-actions,
    .test-secondary-actions {
        grid-template-columns: 1fr;
    }
}

/* PDF contract template fill */
.pdf-contract-template {
    position: relative;
    width: min(100%, 900px);
    margin: 0 auto;
    aspect-ratio: 1240 / 1754;
    background: #fff;
    overflow: hidden;
}

.pdf-contract-template img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.pdf-contract-field {
    position: absolute;
    z-index: 2;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    min-height: 16px;
    max-width: 30%;
    word-break: break-word;
}

.pdf-contract-field.check {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 950;
}

.pdf-contract-field.child-tc { left: 16.5%; top: 14.2%; }
.pdf-contract-field.child-name { left: 16.5%; top: 17.1%; }
.pdf-contract-field.child-father { left: 16.5%; top: 20.1%; }
.pdf-contract-field.child-mother { left: 16.5%; top: 23.1%; }
.pdf-contract-field.child-birth-place { left: 16.5%; top: 26.1%; }
.pdf-contract-field.child-birth-date { left: 16.5%; top: 29.1%; }
.pdf-contract-field.parent-tc { left: 61%; top: 14.2%; }
.pdf-contract-field.parent-name { left: 61%; top: 17.1%; }
.pdf-contract-field.parent-phone-one { left: 61%; top: 20.1%; }
.pdf-contract-field.parent-phone-two { left: 61%; top: 23.1%; }
.pdf-contract-field.parent-address { left: 61%; top: 26%; width: 29%; max-width: 29%; font-size: 11px; line-height: 1.2; }
.pdf-contract-field.contract-amount { left: 16%; top: 36.7%; font-size: 15px; }
.pdf-contract-field.pay-cash { left: 52.7%; top: 38.8%; }
.pdf-contract-field.pay-installment { left: 63.8%; top: 38.8%; }
.pdf-contract-field.pay-card { left: 76.8%; top: 38.8%; }
.pdf-contract-field.pay-row-0-no { left: 17.4%; top: 45.6%; }
.pdf-contract-field.pay-row-0-date { left: 33.8%; top: 45.6%; }
.pdf-contract-field.pay-row-0-amount { left: 50.2%; top: 45.6%; }
.pdf-contract-field.pay-row-1-no { left: 17.4%; top: 48.7%; }
.pdf-contract-field.pay-row-1-date { left: 33.8%; top: 48.7%; }
.pdf-contract-field.pay-row-1-amount { left: 50.2%; top: 48.7%; }
.pdf-contract-field.pay-row-2-no { left: 17.4%; top: 51.8%; }
.pdf-contract-field.pay-row-2-date { left: 33.8%; top: 51.8%; }
.pdf-contract-field.pay-row-2-amount { left: 50.2%; top: 51.8%; }
.pdf-contract-field.pay-row-3-no { left: 17.4%; top: 54.9%; }
.pdf-contract-field.pay-row-3-date { left: 33.8%; top: 54.9%; }
.pdf-contract-field.pay-row-3-amount { left: 50.2%; top: 54.9%; }
.pdf-contract-field.contract-no { right: 8%; top: 6.1%; font-size: 10px; color: #475569; }
.pdf-contract-field.contract-package { left: 8%; top: 33.6%; max-width: 46%; font-size: 11px; color: #475569; }
.pdf-contract-field.contract-date { right: 10%; top: 57.8%; font-size: 11px; }

.contract-print-note {
    margin: 12px auto 0;
    width: min(100%, 900px);
    padding: 12px 14px;
    border-radius: 18px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 800;
}

.signed-file-card,
.signed-upload-form,
.legacy-flow-card,
.installment-modern-card,
.payment-line-card,
.parent-payment-panel,
.contract-mini-card {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.signed-file-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 18px;
    color: #0f172a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    text-decoration: none;
}

.signed-file-card:hover,
.legacy-flow-card:hover,
.installment-modern-card:hover,
.payment-line-card:hover,
.parent-payment-panel:hover,
.contract-mini-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, .10);
}

.signed-file-card i,
.legacy-flow-card i,
.contract-mini-card i {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #2563eb;
    background: #eff6ff;
}

.signed-file-card strong,
.signed-file-card small,
.contract-mini-card strong,
.contract-mini-card small {
    display: block;
}

.signed-file-card small,
.contract-mini-card small {
    color: #64748b;
    font-size: 12px;
}

.signed-upload-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.legacy-flow-panel {
    margin-bottom: 16px;
}

.legacy-flow-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.legacy-flow-card {
    border: 1px solid #dbeafe;
    border-radius: 22px;
    padding: 16px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    text-align: left;
    color: #0f172a;
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,246,255,.86));
}

.legacy-flow-card strong,
.legacy-flow-card small {
    display: block;
}

.legacy-flow-card small {
    color: #64748b;
    font-size: 12px;
    margin-top: 2px;
}

.finance-modern-panel {
    overflow: hidden;
}

.finance-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.finance-summary-grid article {
    padding: 16px;
    border-radius: 22px;
    background: linear-gradient(135deg, #fff, #f8fafc);
    border: 1px solid #e2e8f0;
}

.finance-summary-grid i {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #2563eb;
    background: #eff6ff;
    margin-bottom: 10px;
}

.finance-summary-grid span,
.finance-summary-grid strong {
    display: block;
}

.finance-summary-grid span {
    color: #64748b;
    font-size: 12px;
    font-weight: 850;
}

.finance-summary-grid strong {
    color: #0f172a;
    font-size: 22px;
}

.finance-summary-grid article.warning {
    border-color: #fecdd3;
    background: linear-gradient(135deg, #fff, #fff1f2);
}

.finance-summary-grid article.ready {
    border-color: #bbf7d0;
    background: linear-gradient(135deg, #fff, #f0fdf4);
}

.finance-workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    gap: 16px;
}

.installment-card-list,
.payment-timeline-list,
.contract-mini-grid,
.payment-installment-stack,
.payment-history-mini,
.parent-payment-groups {
    display: grid;
    gap: 10px;
}

.installment-modern-card,
.payment-line-card {
    padding: 14px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.installment-modern-card {
    display: grid;
    gap: 10px;
}

.installment-modern-card h3,
.payment-line-card strong {
    margin: 6px 0 2px;
    color: #0f172a;
    font-size: 15px;
}

.installment-modern-card small,
.payment-line-card small {
    color: #64748b;
    font-weight: 750;
}

.installment-modern-card.overdue,
.payment-line-card.overdue {
    border-color: #fecdd3;
    background: #fff7f8;
}

.installment-progress {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
}

.installment-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #2563eb);
}

.payment-timeline-list article,
.payment-history-mini > div {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.payment-timeline-list i,
.payment-history-mini i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #2563eb;
    background: #eff6ff;
}

.payment-timeline-list strong,
.payment-timeline-list small,
.payment-history-mini strong,
.payment-history-mini small {
    display: block;
}

.payment-timeline-list small,
.payment-history-mini small {
    color: #64748b;
    font-size: 12px;
}

.finance-contract-strip {
    margin-top: 16px;
}

.contract-mini-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.contract-mini-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    color: #0f172a;
    text-decoration: none;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
}

.contract-mini-card em {
    font-style: normal;
    color: #2563eb;
    font-size: 12px;
    font-weight: 900;
}

.parent-payment-panel {
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(248,250,252,.92));
    padding: 16px;
}

.parent-payment-panel > header,
.payment-parent-title,
.payment-parent-totals,
.payment-line-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.parent-payment-panel > header {
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 14px;
}

.payment-parent-title strong,
.payment-parent-title small,
.payment-parent-totals small,
.payment-parent-totals strong {
    display: block;
}

.payment-parent-title small,
.payment-parent-totals small {
    color: #64748b;
    font-size: 12px;
    font-weight: 850;
}

.payment-parent-totals span {
    min-width: 110px;
    padding: 10px 12px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.parent-payment-body {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
    gap: 16px;
}

.payment-line-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.payment-line-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.integration-status-grid,
.integration-grid.three,
.integration-test-grid {
    align-items: stretch;
}

.integration-service-card,
.integration-test-grid .panel,
.web-appointment-card,
.template-card,
.integration-status-card {
    border-radius: 24px;
}

.integration-service-card .form-control,
.integration-service-card .form-select,
.integration-test-grid .form-control,
.integration-test-grid .form-select {
    border-radius: 16px;
}

.integration-status-card {
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,246,255,.72));
}

.integration-status-card.ready {
    border-color: #bbf7d0;
}

.integration-status-card.waiting {
    border-color: #fde68a;
}

.integration-status-grid {
    margin-bottom: 14px;
}

.integration-service-card .panel-title,
.integration-test-grid .panel-title {
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.integration-service-card form,
.integration-test-grid form {
    align-content: start;
}

.integration-test-grid {
    margin-top: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.template-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.template-card {
    display: grid;
    gap: 10px;
    align-content: start;
    background: linear-gradient(135deg, #fff, #f8fafc);
    border-color: #e2e8f0;
}

.web-appointment-content {
    align-items: start;
}

.appointment-preview-shell {
    border-radius: 20px;
    overflow: hidden;
}

@media (max-width: 992px) {
    .legacy-flow-grid,
    .finance-summary-grid,
    .finance-workspace-grid,
    .parent-payment-body {
        grid-template-columns: 1fr;
    }

    .parent-payment-panel > header,
    .payment-line-card {
        grid-template-columns: 1fr;
        display: grid;
    }

    .payment-parent-totals,
    .payment-line-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media print {
    .pdf-contract-template {
        width: 100%;
        max-width: none;
    }

    .contract-print-note {
        display: none;
    }

    .pdf-contract-field {
        font-size: 11px;
    }
}

/* 2026-05-18 login16 and button rebuild pass. */
.guest-body:has(.login16-shell) {
    min-height: 100svh !important;
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 16%, rgba(56,189,248,.26), transparent 34%),
        radial-gradient(circle at 90% 12%, rgba(79,70,229,.18), transparent 34%),
        linear-gradient(135deg, #f8fbff 0%, #eaf6ff 50%, #f5f9ff 100%) !important;
}

.guest-shell:has(.login16-shell) {
    width: 100% !important;
    min-height: 100svh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: clamp(16px, 3vw, 34px) !important;
    background: transparent !important;
}

.login16-shell {
    width: min(1040px, 100%);
    height: min(650px, calc(100svh - 44px));
    display: grid;
    grid-template-columns: 1.04fr .96fr;
    overflow: hidden;
    border-radius: 32px;
    background: #fff;
    box-shadow: 0 36px 100px rgba(15,23,42,.18);
}

.login16-visual {
    position: relative;
    display: grid;
    align-content: space-between;
    min-height: 100%;
    padding: clamp(30px, 4vw, 56px);
    color: #fff;
    background:
        radial-gradient(circle at 18% 18%, rgba(125,211,252,.38), transparent 32%),
        linear-gradient(135deg, #111827, #1735ff 56%, #06b6d4);
}

.login16-visual::after {
    content: "";
    position: absolute;
    inset: auto -80px -110px auto;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,.13);
}

.login16-brand,
.login16-copy,
.login16-social {
    position: relative;
    z-index: 1;
}

.login16-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 950;
}

.login16-brand span {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #0891b2;
    background: #fff;
}

.login16-copy h1 {
    max-width: 520px;
    margin: 0 0 16px;
    color: #fff;
    font-size: clamp(38px, 4.6vw, 64px);
    line-height: .98;
}

.login16-copy p {
    max-width: 430px;
    margin: 0;
    color: rgba(255,255,255,.8);
    font-size: 16px;
}

.login16-social span {
    display: block;
    margin-bottom: 12px;
    color: rgba(255,255,255,.82);
    font-weight: 850;
}

.login16-social div {
    display: flex;
    gap: 10px;
}

.login16-social a {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,.12);
    text-decoration: none;
    transition: transform .18s ease, background .18s ease;
}

.login16-social a:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,.22);
}

.login16-form-panel {
    display: grid;
    align-content: center;
    gap: 22px;
    padding: clamp(28px, 4vw, 56px);
    background: #fff;
}

.login16-form-head h2 {
    margin: 8px 0;
    color: #0f172a;
    font-size: clamp(28px, 3vw, 42px);
}

.login16-form-head p {
    margin: 0;
    color: #64748b;
}

.login16-form {
    display: grid;
    gap: 16px;
}

.login16-form label > span {
    display: block;
    margin-bottom: 7px;
    color: #0f172a;
    font-weight: 900;
}

.login16-form .form-control {
    min-height: 50px;
    border-radius: 999px !important;
    background: #f8fafc;
}

.login16-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 4px;
}

.login16-forgot {
    justify-self: start;
    border: 0;
    padding: 0;
    color: #2563eb;
    background: transparent;
    font-weight: 900;
}

.login16-forgot:hover {
    color: #0f172a;
}

.btn,
button.btn,
a.btn {
    min-height: 40px !important;
    padding: 9px 16px !important;
    border-radius: 999px !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
}

.btn-xs {
    min-height: 32px !important;
    padding: 6px 11px !important;
    font-size: 12px !important;
}

.btn-sm {
    min-height: 35px !important;
    padding: 7px 13px !important;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-light {
    background: rgba(255,255,255,.84) !important;
    backdrop-filter: blur(10px);
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-success:hover,
.btn-outline-danger:hover,
.btn-outline-warning:hover,
.btn-outline-light:hover {
    color: #fff !important;
    background: linear-gradient(135deg, #1735ff, #0875ff) !important;
    border-color: rgba(23,53,255,.48) !important;
    box-shadow: 0 14px 34px rgba(37,99,235,.22) !important;
}

.online-tests-landing {
    margin-left: auto !important;
    margin-right: auto !important;
}

.online-tests-grid {
    justify-items: stretch;
}

.online-test-card {
    min-height: 250px;
}

.staff-attendance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 16px;
}

.staff-attendance-card {
    display: grid;
    gap: 14px;
}

.staff-attendance-head {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.staff-attendance-head strong,
.staff-attendance-head small {
    display: block;
}

.staff-attendance-head small {
    color: #64748b;
}

.attendance-count-pill {
    padding: 8px 12px;
    border-radius: 999px;
    color: #1d4ed8;
    background: #eff6ff;
    font-weight: 950;
}

.staff-attendance-timeline {
    display: grid;
    gap: 8px;
}

.staff-attendance-event {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(148,163,184,.16);
    border-radius: 16px;
    background: #fff;
}

.staff-attendance-event i {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #2563eb;
    background: #eff6ff;
}

.staff-attendance-event.logout i {
    color: #f59e0b;
    background: #fffbeb;
}

.staff-attendance-event strong,
.staff-attendance-event span {
    display: block;
}

.staff-attendance-event span {
    color: #64748b;
    font-size: 12px;
}

@media (max-width: 900px) {
    .login16-shell {
        height: auto;
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .login16-visual {
        min-height: 320px;
    }
}

@media (max-width: 560px) {
    .login16-shell {
        border-radius: 24px;
    }

    .login16-visual,
    .login16-form-panel {
        padding: 24px;
    }
}

.detail-tabs {
    margin-bottom: 12px;
}

.dossier-grid,
.finance-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dossier-grid > div,
.finance-mini-grid > div {
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
}

.dossier-grid span,
.finance-mini-grid span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

.dossier-grid strong,
.finance-mini-grid strong {
    color: #0f172a;
    overflow-wrap: anywhere;
}

.diagnosis-card,
.public-ai-note,
.soft-checklist {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
}

.soft-checklist {
    grid-template-columns: 1fr;
}

.soft-checklist span {
    display: flex;
    gap: 8px;
    align-items: center;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.diagnosis-card i,
.public-ai-note i {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: #0f766e;
    background: #ccfbf1;
}

.task-grid,
.integration-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.integration-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, .6fr);
}

.template-editor {
    display: grid;
    gap: 6px;
    color: #334155;
    font-weight: 900;
}

.public-test-shell {
    max-width: 980px;
}

.public-question-card {
    position: relative;
    padding: 16px 16px 16px 58px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 12px;
    background: #fff;
}

.question-count {
    position: absolute;
    left: 16px;
    top: 16px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    color: #fff;
    background: #2563eb;
    font-weight: 900;
}

.public-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.public-option {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 42px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 132px;
    padding: 18px;
    border: 1px dashed rgba(148, 163, 184, .32);
    border-radius: 12px;
    color: #64748b;
    text-align: center;
}

.empty-state.wide {
    grid-column: 1 / -1;
}

.empty-state i {
    color: #2563eb;
    font-size: 26px;
}

.is-muted {
    opacity: .55;
}

.pop-in {
    animation: uiRise .22s ease both;
}

@keyframes shimmerLine {
    from { background-position: 0 0; }
    to { background-position: 520px 0; }
}

@media (max-width: 1200px) {
    .insight-strip,
    .test-card-grid,
    .test-card-grid.compact,
    .integration-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .studio-shell,
    .profile-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .studio-actions,
    .profile-actions {
        justify-content: flex-start;
    }

    .insight-strip,
    .test-card-grid,
    .test-card-grid.compact,
    .task-grid,
    .integration-grid,
    .public-option-grid {
        grid-template-columns: 1fr;
    }
}

/* 2026-05-17 modern UI pass */
.profile-avatar,
.profile-avatar.small,
.profile-avatar.lg,
.avatar,
.avatar.lg,
.avatar-chip,
.user-chip .avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    background: #eef6ff url("https://cdn-icons-png.flaticon.com/512/3177/3177440.png") center / 78% no-repeat;
    color: transparent;
    font-size: 0;
    box-shadow: 0 12px 26px rgba(37, 99, 235, .15);
    border: 1px solid rgba(37, 99, 235, .14);
}

.user-chip {
    min-height: 46px;
    padding: 6px 10px 6px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(148, 163, 184, .24);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
}

.user-chip > span:not(.avatar) {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.sidebar-quick-action,
.ai-quick-grid button,
.quick-action-grid button {
    border: 0;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.74);
    color: #0f172a;
    font-weight: 800;
    text-align: left;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.sidebar-quick-action:hover,
.ai-quick-grid button:hover,
.quick-action-grid button:hover {
    transform: translateY(-2px);
    background: #fff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .1);
}

.aidoc-login {
    max-width: 1040px;
    min-height: 620px;
}

.aidoc-login .login-brand-panel {
    background:
        radial-gradient(circle at 10% 16%, rgba(20, 184, 166, .22), transparent 30%),
        linear-gradient(145deg, #0f766e 0%, #155e75 48%, #1d4ed8 100%);
    color: #fff;
}

.aidoc-login .brand-mark {
    background: rgba(255,255,255,.96);
    color: #0f766e;
}

.aidoc-login .brand small,
.aidoc-login .login-hero-copy p,
.aidoc-login .login-slogan-stack span {
    color: rgba(255,255,255,.82);
}

.aidoc-login .login-brand-panel h1 {
    color: #fff;
    font-size: 34px;
    line-height: 1.08;
    max-width: 480px;
}

.login-slogan-stack {
    margin: 22px 0 0;
}

.login-slogan-stack div {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.16);
    color: #fff;
    backdrop-filter: blur(14px);
}

.login-slogan-stack i {
    background: rgba(255,255,255,.18);
    color: #fff;
}

.login-form-panel {
    padding: 34px;
}

.role-login-card {
    min-height: 104px;
}

.appointments-calendar-stack {
    grid-template-columns: 1fr;
}

.appointments-calendar-stack aside {
    width: 100%;
}

.appointments-calendar-stack .calendar-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.appointments-calendar-stack .calendar-large {
    min-height: 620px;
}

.appointment-action-grid,
.table-action-row,
.card-action-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.appointment-action-grid .btn,
.appointment-more-actions .btn,
.table-action-row .btn,
.card-action-row .btn {
    min-width: 104px;
    border-radius: 12px;
    font-weight: 800;
}

.payment-card-grid,
.test-card-grid-modern,
.public-test-grid,
.chat-person-grid,
.branch-finance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.payment-track-card,
.test-admin-card,
.public-test-card-modern,
.contract-row-card,
.chat-person-card,
.branch-finance-card {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.payment-track-card:hover,
.test-admin-card:hover,
.public-test-card-modern:hover,
.contract-row-card:hover,
.chat-person-card:hover,
.branch-finance-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 46px rgba(15, 23, 42, .12);
}

.payment-check {
    display: none;
}

.payment-history-list.wide {
    display: grid;
    gap: 10px;
}

.payment-history-card {
    justify-content: space-between;
}

.branch-finance-card,
.chat-person-card {
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 18px;
    background: #fff;
    padding: 16px;
    text-align: left;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.branch-finance-card span,
.chat-person-card small {
    display: block;
    color: #64748b;
    font-weight: 700;
}

.branch-finance-card strong {
    display: block;
    margin-top: 6px;
    color: #0f172a;
    font-size: 21px;
}

.branch-finance-card.income { border-left: 5px solid #10b981; }
.branch-finance-card.expense { border-left: 5px solid #f59e0b; }
.branch-finance-card.salary { border-left: 5px solid #ef4444; }

.chat-person-card {
    border: 0;
    display: grid;
    gap: 8px;
}

.chat-person-card strong {
    color: #0f172a;
}

.public-test-hero {
    padding: 28px;
    min-height: auto;
}

.public-test-hero h1 {
    font-size: clamp(24px, 3vw, 38px);
    max-width: 820px;
}

.public-test-card-modern {
    min-height: 220px;
    border-radius: 18px;
}

.contract-editor-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    color: #64748b;
    font-weight: 800;
}

.branch-board-grid {
    align-items: stretch;
}

.branch-board-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background:
        linear-gradient(145deg, rgba(255,255,255,.96), rgba(248,250,252,.9)),
        radial-gradient(circle at 82% 8%, rgba(37, 99, 235, .16), transparent 34%);
    border: 1px solid rgba(148, 163, 184, .2);
}

.branch-board-card::before {
    content: "";
    position: absolute;
    inset: auto 18px 18px auto;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: conic-gradient(from 120deg, rgba(20,184,166,.18), rgba(37,99,235,.22), rgba(245,158,11,.16), rgba(20,184,166,.18));
    filter: blur(.2px);
    animation: logoBreath 4s ease-in-out infinite;
}

.branch-metric-grid a {
    min-height: 84px;
    border-radius: 16px;
}

.ai-summary {
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: start;
}

.ai-summary p,
.ai-summary strong,
.insight-card span {
    overflow-wrap: anywhere;
}

.floating-ai-button {
    border-radius: 18px;
    background: linear-gradient(135deg, #0f172a, #2563eb);
    box-shadow: 0 18px 45px rgba(37, 99, 235, .28);
    animation: aiFloat 3.4s ease-in-out infinite;
}

.ai-drawer {
    border-radius: 24px 0 0 24px;
    background:
        radial-gradient(circle at top left, rgba(45,212,191,.16), transparent 34%),
        #0f172a;
    color: #fff;
}

.ai-drawer .ai-message.bot,
.ai-drawer .ai-message.user {
    border-radius: 16px;
}

@keyframes aiFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@media (max-width: 900px) {
    .appointments-calendar-stack .calendar-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .appointments-calendar-stack .calendar-large {
        min-height: 520px;
    }

    .contract-editor-toolbar,
    .appointment-action-grid,
    .table-action-row,
    .card-action-row {
        align-items: stretch;
        justify-content: stretch;
    }

    .appointment-action-grid .btn,
    .appointment-more-actions .btn,
    .table-action-row .btn,
    .card-action-row .btn {
        width: 100%;
    }
}

@media (max-width: 680px) {
    .aidoc-login {
        min-height: auto;
    }

    .login-form-panel,
    .aidoc-login .login-brand-panel {
        padding: 22px;
    }

    .aidoc-login .login-brand-panel h1 {
        font-size: 28px;
    }

    .login-slogan-stack div {
        grid-template-columns: 36px 1fr;
        padding: 12px;
    }

    .mini-calendar.calendar-large {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mini-calendar-head {
        display: none;
    }
}

.calendar-signal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}

.calendar-signal-grid > div {
    position: relative;
    overflow: hidden;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.92), rgba(240,253,250,.9)),
        #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.calendar-signal-grid > div::after {
    content: "";
    position: absolute;
    inset: auto 10px 8px 10px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #14b8a6, #f59e0b);
    animation: shimmerLine 2.8s linear infinite;
}

.calendar-signal-grid span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
}

.calendar-signal-grid strong {
    color: #0f172a;
    font-size: 24px;
    line-height: 1.1;
}

.mini-calendar-day {
    position: relative;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.mini-calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .08);
    z-index: 2;
}

.mini-calendar-day.today::after {
    content: "";
    position: absolute;
    top: 9px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #10b981;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, .14);
    animation: softPulse 1.8s ease-in-out infinite;
}

.answer-review-list {
    display: grid;
    gap: 14px;
}

.answer-review-card {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.98), rgba(248,250,252,.92)),
        #fff;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .07);
    animation: uiRise .28s ease both;
}

.answer-review-card h3 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.35;
}

.answer-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.answer-option {
    display: flex;
    gap: 9px;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 11px;
    background: #f8fafc;
    color: #475569;
    font-weight: 800;
}

.answer-option i {
    color: #94a3b8;
}

.answer-option.selected {
    border-color: rgba(16, 185, 129, .46);
    background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
    color: #065f46;
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .2);
}

.answer-option.selected i {
    color: #10b981;
}

.staff-orbit,
.panel:has(#staff-create),
#staff-create {
    animation: uiRise .28s ease both;
}

.aidoc-login .login-brand-panel {
    color: #0f172a;
    background:
        radial-gradient(circle at 12% 10%, rgba(20, 184, 166, .16), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #eefcf8 100%);
    border-right: 1px solid rgba(148, 163, 184, .2);
}

.aidoc-login .login-brand-panel::before {
    opacity: .08;
    background-image:
        linear-gradient(rgba(15,23,42,.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,23,42,.14) 1px, transparent 1px);
}

.aidoc-login .login-brand-panel .brand small,
.aidoc-login .login-hero-copy p {
    color: #475569;
}

.aidoc-login .login-brand-panel h1 {
    color: #0f172a;
}

.aidoc-login .login-feature-list span {
    border-color: rgba(15, 23, 42, .08);
    background: rgba(255,255,255,.72);
    color: #334155;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.aidoc-login .login-preview-card {
    border: 1px solid rgba(148, 163, 184, .2);
    background: rgba(255,255,255,.86);
    color: #0f172a;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .12);
}

.aidoc-login .preview-grid div {
    background: #f8fafc;
}

@keyframes softPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(.72); opacity: .72; }
}

@media (max-width: 760px) {
    .calendar-signal-grid,
    .answer-option-grid {
        grid-template-columns: 1fr;
    }
}

.brand-mark {
    animation: logoBreath 3.6s ease-in-out infinite;
}

.login-slogan-stack {
    display: grid;
    gap: 12px;
    margin: 28px 0;
}

.login-slogan-stack div {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(20, 184, 166, .18);
    border-radius: 16px;
    background: rgba(255,255,255,.78);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
    color: #0f172a;
}

.login-slogan-stack i {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    color: #0f766e;
    background: #ccfbf1;
}

.answer-review-card .question-count {
    position: static;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 18px;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .22);
}

.answer-review-card {
    align-items: start;
}

.answer-review-card h3 {
    max-width: 980px;
    word-break: normal;
    overflow-wrap: anywhere;
}

.answer-option-grid {
    align-items: stretch;
}

.answer-option {
    min-width: 0;
    overflow-wrap: anywhere;
}

.profile-avatar {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    font-weight: 950;
    box-shadow: 0 12px 26px rgba(37, 99, 235, .2);
}

.profile-avatar.small {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 13px;
}

.profile-avatar.lg {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    font-size: 24px;
}

.child-avatar {
    background: linear-gradient(135deg, #0f766e, #f59e0b);
}

.list-profile-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}

.list-profile-cell.compact {
    min-width: 180px;
}

.list-profile-cell small,
.staff-row-main small,
.staff-row-main span,
.staff-row-meta small,
.payment-history-card small,
.chat-thread-card small,
.chat-user-option small,
.contract-row-card span {
    display: block;
    color: #64748b;
    font-size: 12px;
}

.staff-card-list,
.payment-card-grid,
.contract-list,
.chat-thread-list,
.payment-history-list {
    display: grid;
    gap: 12px;
}

.staff-row-card,
.contract-row-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) minmax(180px, auto) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 16px;
    background: linear-gradient(135deg, #fff, #f8fafc);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
    animation: uiRise .28s ease both;
}

.staff-row-main strong,
.contract-row-card strong {
    color: #0f172a;
}

.staff-row-meta {
    display: grid;
    gap: 4px;
    justify-items: end;
}

.staff-row-meta strong {
    color: #0f766e;
    font-size: 12px;
}

.payment-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.payment-track-card {
    position: relative;
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
    overflow: hidden;
}

.payment-track-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, #f59e0b, #ef4444);
}

.payment-track-card.paid::before {
    background: linear-gradient(180deg, #10b981, #14b8a6);
}

.payment-check {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.payment-card-head,
.payment-history-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 62px;
}

.payment-amount-row,
.contract-price-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.contract-price-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payment-amount-row div,
.contract-price-card {
    padding: 12px;
    border-radius: 14px;
    background: #f8fafc;
}

.payment-amount-row span,
.contract-price-card span,
.visual-graph-card span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
}

.payment-amount-row strong,
.contract-price-card strong {
    color: #0f172a;
}

.contract-price-card {
    display: grid;
    gap: 8px;
    border: 1px solid rgba(148, 163, 184, .18);
    background: linear-gradient(135deg, #fff, #f0fdfa);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
}

.contract-price-card i {
    color: #0f766e;
    font-size: 24px;
}

.contract-row-card {
    grid-template-columns: 48px minmax(0, 1fr) minmax(142px, auto) auto;
}

.contract-row-card p {
    margin: 6px 0 0;
    color: #475569;
    font-size: 13px;
}

.contract-row-meta {
    display: grid;
    gap: 5px;
    justify-items: end;
}

.contract-row-meta small {
    color: #64748b;
    font-weight: 800;
}

.installment-planner,
.contract-auto-preview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(37, 99, 235, .16);
    border-radius: 18px;
    background:
        radial-gradient(circle at 92% 10%, rgba(20, 184, 166, .16), transparent 34%),
        linear-gradient(135deg, #eff6ff, #ffffff);
    box-shadow: 0 16px 38px rgba(37, 99, 235, .08);
}

.installment-planner span,
.contract-summary-mini span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.installment-planner strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    font-size: 18px;
}

.installment-planner small,
.contract-auto-preview span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-weight: 700;
}

.installment-planner label {
    display: grid;
    gap: 6px;
    margin: 0;
}

.contract-auto-preview {
    grid-template-columns: 42px minmax(0, 1fr);
    border-color: rgba(16, 185, 129, .2);
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
}

.contract-auto-preview i {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #047857;
    background: #d1fae5;
}

.contract-preview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 18px;
    align-items: start;
}

.contract-paper {
    background: #f8fafc;
}

.contract-paper-status {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.contract-paper-status small {
    color: #64748b;
    font-weight: 800;
}

.contract-paper-body {
    padding: clamp(18px, 3vw, 34px);
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 20px;
    background: #fff;
    color: #0f172a;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .06);
}

.contract-paper-body.compact {
    max-height: 62vh;
    overflow: auto;
}

.contract-document {
    display: grid;
    gap: 22px;
}

.contract-document-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
    padding-bottom: 18px;
    border-bottom: 2px solid #e2e8f0;
}

.contract-document-header span,
.contract-document-header p {
    color: #64748b;
    font-weight: 800;
}

.contract-document-header h1 {
    margin: 6px 0;
    color: #0f172a;
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.1;
}

.contract-document-header > strong {
    padding: 10px 14px;
    border-radius: 999px;
    color: #1d4ed8;
    background: #eff6ff;
    white-space: nowrap;
}

.contract-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.contract-info-grid div,
.contract-summary-mini div {
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 14px;
    background: #f8fafc;
}

.contract-info-grid span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 950;
}

.contract-info-grid strong,
.contract-summary-mini strong {
    display: block;
    margin-top: 5px;
    color: #0f172a;
}

.contract-payment-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 16px;
}

.contract-payment-table th,
.contract-payment-table td {
    padding: 12px;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.contract-payment-table th {
    color: #1d4ed8;
    background: #eff6ff;
}

.contract-body-copy {
    display: grid;
    gap: 10px;
}

.contract-body-copy h2 {
    margin: 10px 0 0;
    color: #0f172a;
    font-size: 18px;
}

.contract-body-copy p {
    margin: 0;
    color: #334155;
    line-height: 1.65;
}

.contract-approval-panel {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 14px;
}

.contract-approved-box,
.contract-consent-check,
.contract-notice-button {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 18px;
    background: #f8fafc;
}

.contract-approved-box {
    align-items: flex-start;
    flex-direction: column;
}

.contract-approved-box i {
    color: #10b981;
    font-size: 28px;
}

.contract-approved-box span,
.contract-consent-check span,
.contract-notice-button small {
    color: #64748b;
    font-weight: 800;
}

.contract-approved-box.muted i {
    color: #2563eb;
}

.contract-approval-form,
.contract-summary-mini {
    display: grid;
    gap: 10px;
}

.contract-consent-check {
    cursor: pointer;
}

.contract-consent-check input {
    width: 20px;
    height: 20px;
    accent-color: #2563eb;
}

.contract-notice-button {
    width: 100%;
    text-align: left;
    color: inherit;
    background: linear-gradient(135deg, #fff, #f8fafc);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.contract-notice-button:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, .24);
    box-shadow: 0 16px 34px rgba(15, 23, 42, .08);
}

.contract-notice-button i {
    font-size: 22px;
}

.contract-notice-button span {
    display: grid;
    gap: 2px;
}

.contract-modal-footer,
.contract-inline-approve {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.chat-pro-layout {
    display: grid;
    grid-template-columns: minmax(320px, .35fr) minmax(0, .65fr);
    gap: 16px;
    align-items: start;
}

.chat-thread-card,
.chat-user-option {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 14px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease;
}

.chat-thread-card:hover,
.chat-user-option:hover,
.public-test-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, .08);
}

.chat-thread-card.active {
    border-color: rgba(37, 99, 235, .38);
    background: #eff6ff;
}

.chat-create-box {
    margin-top: 16px;
}

.chat-user-picker {
    display: grid;
    gap: 8px;
    max-height: 300px;
    overflow: auto;
}

.chat-picker-heading {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 7px 8px;
    border-radius: 10px;
    background: #eef2ff;
    color: #334155;
    font-size: 11px;
    font-weight: 950;
}

.chat-user-option {
    grid-template-columns: 18px 32px 1fr;
    cursor: pointer;
}

.chat-messages.pro {
    min-height: 440px;
    padding: 14px;
    border-radius: 18px;
    background:
        linear-gradient(rgba(255,255,255,.78), rgba(255,255,255,.78)),
        radial-gradient(circle at 12% 10%, rgba(20, 184, 166, .18), transparent 34%),
        #f8fafc;
}

.chat-messages.pro .chat-bubble {
    display: flex;
    gap: 10px;
    max-width: 74%;
    padding: 12px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.chat-messages.pro .chat-bubble.mine {
    margin-left: auto;
    background: #eff6ff;
}

.chat-bubble p {
    margin: 4px 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.settings-save-button {
    position: sticky;
    bottom: 18px;
    margin-top: 16px;
    box-shadow: 0 20px 40px rgba(37, 99, 235, .22);
}

.dashboard-visual-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.visual-graph-card {
    position: relative;
    overflow: hidden;
    min-height: 150px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 20px;
    background: linear-gradient(135deg, #fff, #eff6ff);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
}

.visual-graph-card::after {
    content: "";
    position: absolute;
    inset: auto -30px -48px auto;
    width: 150px;
    height: 150px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .12);
}

.visual-graph-card.success {
    background: linear-gradient(135deg, #fff, #ecfdf5);
}

.visual-graph-card.warning {
    background: linear-gradient(135deg, #fff, #fffbeb);
}

.visual-graph-card strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    font-size: 24px;
}

.spark-bars {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    display: flex;
    gap: 7px;
    align-items: end;
    height: 54px;
}

.spark-bars i {
    flex: 1;
    border-radius: 999px 999px 4px 4px;
    background: linear-gradient(180deg, #2563eb, #14b8a6);
    animation: barFloat 2.8s ease-in-out infinite;
}

.orbit-meter {
    position: absolute;
    right: 24px;
    bottom: 20px;
    width: 76px;
    height: 76px;
    border-radius: 999px;
    background: conic-gradient(#10b981 calc(var(--meter) * 1%), #dbeafe 0);
    display: grid;
    place-items: center;
}

.orbit-meter b {
    width: 50px;
    height: 50px;
    border-radius: 999px;
    background: #fff;
}

.wave-line {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 26px;
    display: flex;
    gap: 8px;
}

.wave-line i {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    animation: shimmerLine 2s linear infinite;
}

.branch-board-card,
.kpi-card,
.ops-module-card,
.critical-card {
    animation: uiRise .32s ease both;
}

.appointment-action-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.appointment-more-actions {
    margin-top: 6px;
}

.appointment-more-actions summary {
    cursor: pointer;
    color: #2563eb;
    font-weight: 900;
    font-size: 12px;
}

.mini-action-form {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    gap: 6px;
    margin-top: 6px;
}

.public-test-hero {
    min-height: 260px;
    display: flex;
    align-items: end;
    padding: 34px;
    border-radius: 24px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .92), rgba(37, 99, 235, .72)),
        radial-gradient(circle at 20% 20%, rgba(20, 184, 166, .4), transparent 36%);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .2);
}

.public-test-hero h1 {
    max-width: 860px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.03;
    margin: 8px 0 10px;
}

.public-test-hero p {
    max-width: 680px;
    color: rgba(255,255,255,.78);
}

.public-test-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.public-test-card-modern {
    display: grid;
    gap: 14px;
    min-height: 240px;
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 20px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
    transition: transform .18s ease, box-shadow .18s ease;
}

.public-test-card-modern strong {
    color: #0f172a;
    font-size: 20px;
}

.public-test-card-modern p,
.public-test-card-modern small {
    color: #64748b;
}

.public-test-card-modern em {
    align-self: end;
    color: #2563eb;
    font-style: normal;
    font-weight: 950;
}

@keyframes logoBreath {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(20, 184, 166, 0); }
    50% { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(20, 184, 166, .12); }
}

@keyframes barFloat {
    0%, 100% { transform: scaleY(.82); }
    50% { transform: scaleY(1); }
}

@media (max-width: 1100px) {
    .chat-pro-layout,
    .settings-grid,
    .dashboard-visual-grid,
    .public-test-grid,
    .payment-card-grid,
    .contract-price-grid {
        grid-template-columns: 1fr;
    }

    .staff-row-card,
    .contract-row-card {
        grid-template-columns: 48px 1fr;
    }

    .staff-row-meta,
    .staff-row-card .btn {
        justify-self: start;
        grid-column: 2;
    }

    .contract-preview-layout,
    .contract-info-grid,
    .installment-planner {
        grid-template-columns: 1fr;
    }

    .contract-approval-panel {
        position: static;
    }
}

@media (max-width: 680px) {
    .contract-document-header,
    .contract-paper-status,
    .contract-modal-footer,
    .contract-inline-approve {
        align-items: stretch;
        flex-direction: column;
    }

    .contract-row-card {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .contract-row-meta,
    .contract-row-card .card-action-row {
        justify-items: start;
        grid-column: 2;
    }
}

@media print {
    .contract-print-hidden,
    .sidebar,
    .topbar,
    .floating-ai-button,
    .ai-drawer {
        display: none !important;
    }

    body,
    .app-main {
        background: #fff !important;
    }

    .app-main {
        margin: 0 !important;
        padding: 0 !important;
    }

    .contract-preview-layout {
        display: block;
    }

    .contract-paper,
    .contract-paper-body {
        border: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
    }
}

/* Final override: keeps the latest UX fixes above older duplicated blocks. */
html,
body,
button,
input,
select,
textarea {
    font-family: var(--font-modern, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Arial, sans-serif) !important;
    letter-spacing: 0 !important;
}

.guest-body {
    height: 100svh !important;
    min-height: 100svh !important;
    overflow: hidden !important;
    background: linear-gradient(135deg, #eefcf8 0%, #f8fafc 48%, #eff6ff 100%) !important;
}

.guest-shell {
    height: 100% !important;
    min-height: 0 !important;
    padding: clamp(10px, 2vw, 22px) !important;
    overflow: hidden !important;
}

.aidoc-login {
    width: min(1040px, 100%) !important;
    height: min(720px, calc(100svh - 28px)) !important;
    min-height: 0 !important;
    max-height: calc(100svh - 28px) !important;
    overflow: hidden !important;
    border-radius: 24px !important;
}

.aidoc-login .login-brand-panel {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    color: #fff !important;
    background: linear-gradient(145deg, #0f766e 0%, #155e75 48%, #1d4ed8 100%) !important;
}

.aidoc-login .login-brand-panel h1,
.aidoc-login .login-brand-panel .brand strong,
.login-slogan-copy strong {
    color: #fff !important;
}

.aidoc-login .login-brand-panel .brand small,
.aidoc-login .login-hero-copy p,
.aidoc-login .login-slogan-copy,
.login-slogan-copy span {
    color: rgba(255,255,255,.82) !important;
}

.aidoc-login .login-form-panel {
    min-height: 0 !important;
    overflow: auto !important;
    padding: clamp(20px, 3vw, 34px) !important;
}

.login-slogan-stack {
    display: none !important;
}

.role-login-card {
    min-height: 88px !important;
    color: #0f172a !important;
    background: #fff !important;
}

.role-login-card:hover,
.role-login-card.active {
    color: #fff !important;
    background: linear-gradient(135deg, #0f172a, #2563eb) !important;
}

.role-login-card:hover strong,
.role-login-card:hover span,
.role-login-card.active strong,
.role-login-card.active span,
.role-login-card:hover i,
.role-login-card.active i {
    color: #fff !important;
}

.profile-avatar,
.profile-avatar.small,
.profile-avatar.lg,
.avatar,
.avatar.lg,
.user-chip .avatar,
.profile-photo-preview,
.child-avatar {
    border-radius: 50% !important;
    overflow: hidden !important;
    background-color: #fff !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    border: 2px solid rgba(255,255,255,.95) !important;
    color: transparent !important;
    font-size: 0 !important;
    text-indent: -999px !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12) !important;
}

.profile-avatar:not([style]),
.avatar:not([style]),
.child-avatar:not([style]) {
    background-image: url("https://cdn-icons-png.flaticon.com/512/3177/3177440.png") !important;
}

.avatar-chip:has(i) {
    border-radius: 14px !important;
    background-image: none !important;
    color: #2563eb !important;
    font-size: 16px !important;
    text-indent: 0 !important;
}

.system-notification-toast {
    top: max(14px, env(safe-area-inset-top)) !important;
    left: 50% !important;
    right: auto !important;
    width: min(520px, calc(100vw - 24px)) !important;
    border-radius: 18px !important;
    background: rgba(15, 23, 42, .76) !important;
    color: #fff !important;
    backdrop-filter: blur(18px) !important;
    transform: translate(-50%, -140%) !important;
}

.system-notification-toast.show {
    transform: translate(-50%, 0) !important;
}

.system-notification-toast strong,
.system-notification-toast small {
    color: #fff !important;
}

.ai-orb-button.floating-ai-button {
    min-width: 218px !important;
    min-height: 66px !important;
    padding: 10px 14px !important;
    gap: 12px !important;
    border-radius: 20px !important;
    color: #fff !important;
    background: linear-gradient(135deg, #111827 0%, #1d4ed8 56%, #0f766e 100%) !important;
}

.ai-orb-button:hover,
.ai-orb-copy strong,
.ai-orb-copy small {
    color: #fff !important;
}

.ai-drawer .ai-message,
.ai-drawer .ai-message.bot,
.ai-drawer .ai-message.user {
    color: #e5eefb !important;
    background: rgba(255,255,255,.08) !important;
}

.ai-drawer .ai-quick-grid a:hover,
.ai-drawer .ai-quick-grid button:hover {
    color: #0f172a !important;
    background: #fff !important;
}

.test-admin-card {
    min-height: 292px !important;
    display: grid !important;
    gap: 10px !important;
    padding: 18px !important;
    border-radius: 18px !important;
}

.test-primary-actions,
.test-secondary-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
}

.integration-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

@media (max-width: 1100px) {
    .integration-grid.three,
    .integration-status-grid,
    .web-appointment-content {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 760px) {
    .aidoc-login {
        height: calc(100svh - 20px) !important;
        max-height: calc(100svh - 20px) !important;
        grid-template-columns: 1fr !important;
    }

    .login-slogan-copy {
        display: none !important;
    }

    .ai-orb-button.floating-ai-button {
        min-width: 62px !important;
        min-height: 62px !important;
        padding: 10px !important;
    }

    .ai-orb-copy {
        display: none !important;
    }

    .test-primary-actions,
    .test-secondary-actions {
        grid-template-columns: 1fr !important;
    }
}

/* Final polish pass: modern buttons, fixed avatars, clean test/integration layouts. */
.btn,
button.btn,
a.btn {
    min-height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    padding: 7px 12px !important;
    border-radius: 11px !important;
    border-width: 1px !important;
    font-size: 13px !important;
    font-weight: 850 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06) !important;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease, color .16s ease !important;
}

.btn:hover,
button.btn:hover,
a.btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .1) !important;
}

.btn-sm {
    min-height: 30px !important;
    padding: 5px 9px !important;
    border-radius: 10px !important;
    font-size: 12px !important;
}

.btn-xs {
    min-height: 28px !important;
    padding: 4px 8px !important;
    border-radius: 9px !important;
    font-size: 11px !important;
    letter-spacing: 0 !important;
}

.btn-light,
.icon-btn.light {
    color: #0f172a !important;
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(241,245,249,.94)) !important;
    border-color: rgba(148, 163, 184, .28) !important;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #0f766e) !important;
    border-color: rgba(37, 99, 235, .4) !important;
}

.btn-success {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    border-color: rgba(16, 185, 129, .42) !important;
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #f43f5e) !important;
    border-color: rgba(244, 63, 94, .42) !important;
}

.icon-btn,
.sidebar-quick-action,
.quick-action-grid a,
.quick-action-grid button,
.chat-person-card,
.role-login-card {
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, color .16s ease !important;
}

.icon-btn:hover,
.sidebar-quick-action:hover,
.quick-action-grid a:hover,
.quick-action-grid button:hover,
.chat-person-card:hover,
.role-login-card:hover {
    transform: translateY(-1px) !important;
}

.icon-btn {
    border-radius: 12px !important;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning {
    background: rgba(255,255,255,.72) !important;
    backdrop-filter: blur(10px) !important;
}

.profile-avatar,
.avatar,
.child-avatar,
.profile-photo-preview {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    flex: 0 0 44px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #fff !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    object-fit: cover !important;
    overflow: hidden !important;
    isolation: isolate !important;
}

.profile-avatar.small,
.avatar.small {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    flex-basis: 32px !important;
}

.profile-avatar.lg,
.avatar.lg,
.profile-photo-preview {
    width: 74px !important;
    height: 74px !important;
    min-width: 74px !important;
    flex-basis: 74px !important;
}

.profile-avatar:not([style]),
.avatar:not([style]),
.child-avatar:not([style]) {
    background-image: url("https://cdn-icons-png.flaticon.com/512/3177/3177440.png") !important;
    background-size: 72% !important;
}

.guest-body {
    background:
        radial-gradient(circle at 18% 18%, rgba(20, 184, 166, .16), transparent 30%),
        radial-gradient(circle at 82% 12%, rgba(37, 99, 235, .12), transparent 32%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 48%, #edf7f4 100%) !important;
}

.aidoc-login {
    width: min(980px, calc(100vw - 24px)) !important;
    height: min(660px, calc(100svh - 26px)) !important;
    border: 1px solid rgba(148, 163, 184, .18) !important;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .13) !important;
}

.aidoc-login .login-brand-panel {
    color: #0f172a !important;
    background:
        linear-gradient(145deg, rgba(255,255,255,.94), rgba(236,253,245,.88) 48%, rgba(239,246,255,.92)),
        radial-gradient(circle at 18% 20%, rgba(20,184,166,.22), transparent 34%) !important;
}

.aidoc-login .login-brand-panel h1,
.aidoc-login .login-brand-panel .brand strong,
.login-slogan-copy strong,
.aidoc-login .login-brand-panel .brand small,
.aidoc-login .login-hero-copy p,
.aidoc-login .login-slogan-copy,
.login-slogan-copy span {
    color: #0f172a !important;
}

.role-login-card,
.login-form-card,
.aidoc-login .login-form-panel {
    background: rgba(255,255,255,.86) !important;
    color: #0f172a !important;
}

.ai-orb-button.floating-ai-button {
    min-width: 154px !important;
    min-height: 50px !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    border-radius: 16px !important;
}

.ai-orb-button .ai-orb-icon,
.ai-orb-icon {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
}

.ai-orb-copy strong {
    font-size: 13px !important;
}

.ai-orb-copy small {
    font-size: 10px !important;
}

.ai-drawer .ai-message,
.ai-drawer .ai-message.bot,
.ai-drawer .ai-message.user,
.ai-drawer .ai-insight-card,
.ai-drawer .ai-quick-grid a,
.ai-drawer .ai-quick-grid button {
    color: #e5eefb !important;
    background: rgba(255,255,255,.1) !important;
    border-color: rgba(255,255,255,.14) !important;
}

.ai-drawer .ai-message:hover,
.ai-drawer .ai-insight-card:hover,
.ai-drawer .ai-quick-grid a:hover,
.ai-drawer .ai-quick-grid button:hover {
    color: #fff !important;
    background: rgba(255,255,255,.18) !important;
}

.ai-insight-stack {
    display: grid;
    gap: 8px;
    margin: 10px 0;
}

.ai-insight-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    text-decoration: none;
    font-size: 12px;
}

.ai-insight-card.danger {
    border-color: rgba(248, 113, 113, .26) !important;
}

.ai-panel .ai-summary,
.ai-panel .insight-card {
    min-height: 0 !important;
    padding: 11px !important;
    border-radius: 14px !important;
}

.ai-panel .ai-summary {
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: start !important;
}

.ai-panel .ai-summary i {
    width: 34px !important;
    height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
}

.ai-panel .ai-summary strong,
.ai-panel .insight-card strong {
    font-size: 13px !important;
    line-height: 1.25 !important;
}

.ai-panel .ai-summary p,
.ai-panel .insight-card span {
    margin-top: 3px !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere !important;
}

.test-list-modern {
    display: grid;
    gap: 10px;
}

.test-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(190px, .5fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(248,250,252,.92));
    box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.test-list-row:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, .22);
    box-shadow: 0 20px 46px rgba(15, 23, 42, .1);
}

.test-list-main,
.test-list-title,
.test-list-meta,
.test-list-actions,
.compact-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.test-list-main {
    min-width: 0;
    gap: 12px;
}

.test-list-main p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

.test-list-title {
    flex-wrap: wrap;
}

.test-list-title strong {
    color: #0f172a;
    font-size: 15px;
}

.test-list-meta {
    flex-wrap: wrap;
    color: #64748b;
    font-size: 12px;
}

.test-list-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.test-list-actions,
.compact-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.compact-actions form {
    display: inline-flex;
    margin: 0;
}

.table-action-row.compact-actions .btn {
    min-width: auto !important;
}

.finance-section-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: #0f172a;
}

.finance-section-head small {
    color: #64748b;
}

.finance-quick-row {
    align-items: center;
    gap: 10px;
}

.finance-quick-row > div {
    min-width: 0;
}

.finance-quick-row form {
    margin: 0;
}

.integration-grid.three {
    align-items: stretch !important;
}

.integration-service-card {
    min-height: 100% !important;
}

.integration-test-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.web-appointment-content {
    display: grid !important;
    grid-template-columns: minmax(240px, .8fr) minmax(240px, .7fr) minmax(280px, 1fr) !important;
    gap: 16px !important;
    align-items: stretch !important;
}

.web-appointment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.appointment-preview-shell {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 16px;
    background: rgba(248,250,252,.88);
}

.appointment-preview-shell strong,
.appointment-preview-shell small {
    display: block;
}

.appointment-preview-shell small {
    color: #64748b;
}

.appointment-preview-frame {
    width: 100%;
    min-height: 280px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 14px;
    background: #fff;
}

.chat-thread-card-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.chat-thread-card-wrap form,
.chat-admin-delete {
    margin: 0;
}

.chat-bubble {
    position: relative;
}

.chat-admin-delete {
    align-self: start;
    margin-left: auto;
}

.attendance-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.attendance-summary-grid article {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, .16);
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
}

.attendance-summary-grid span,
.attendance-summary-grid strong {
    display: block;
}

.attendance-summary-grid span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.attendance-summary-grid strong {
    color: #0f172a;
    font-size: 22px;
}

.attendance-clean-list {
    display: grid;
    gap: 12px;
}

.attendance-day-card.clean {
    padding: 16px !important;
}

.attendance-day-card.clean .attendance-list {
    display: grid;
    gap: 8px;
}

.published-tests-hero {
    min-height: 220px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: end !important;
    gap: 20px !important;
    border-radius: 22px !important;
    color: #0f172a !important;
    background:
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(236,253,245,.9) 45%, rgba(239,246,255,.92)),
        radial-gradient(circle at 20% 18%, rgba(20,184,166,.24), transparent 32%) !important;
}

.published-tests-hero h1 {
    max-width: 780px !important;
    font-size: clamp(28px, 4vw, 46px) !important;
    color: #0f172a !important;
}

.published-tests-hero p {
    color: #475569 !important;
}

.published-test-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(90px, 1fr));
    gap: 10px;
}

.published-test-stats span {
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.8);
    border: 1px solid rgba(148, 163, 184, .18);
}

.published-test-stats strong,
.published-test-stats small {
    display: block;
}

.published-test-stats small {
    color: #64748b;
}

.public-test-list-modern {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.published-test-card {
    min-height: auto !important;
    grid-template-columns: 50px minmax(0, 1fr) auto !important;
    align-items: center !important;
    padding: 16px !important;
    border-radius: 18px !important;
}

@media (max-width: 1100px) {
    .test-list-row,
    .web-appointment-content,
    .integration-test-grid,
    .published-tests-hero,
    .attendance-summary-grid {
        grid-template-columns: 1fr !important;
    }

    .test-list-actions,
    .compact-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .btn,
    button.btn,
    a.btn {
        min-height: 32px !important;
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    .aidoc-login {
        height: calc(100svh - 16px) !important;
        max-height: calc(100svh - 16px) !important;
        border-radius: 18px !important;
    }

    .aidoc-login .login-brand-panel {
        min-height: 170px !important;
        padding: 18px !important;
    }

    .published-test-card {
        grid-template-columns: 44px minmax(0, 1fr) !important;
    }

    .published-test-card em {
        grid-column: 2;
        justify-self: start;
    }
}

/* 2026-05-18 revision: readable hover states, dynamic island, public forms. */
.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-success:hover,
.btn-outline-danger:hover,
.btn-outline-warning:hover,
.btn-outline-light:hover,
.table-action-row .btn:hover,
.card-action-row .btn:hover,
.appointment-action-grid .btn:hover,
.test-list-actions .btn:hover,
.compact-actions .btn:hover {
    color: #fff !important;
    background: linear-gradient(135deg, #0f172a, #2563eb) !important;
    border-color: rgba(37, 99, 235, .55) !important;
}

.btn-light:hover,
.profile-hero .btn-light:hover,
.profile-hero .btn-outline-light:hover,
.studio-actions .btn-light:hover {
    color: #0f172a !important;
    background: linear-gradient(135deg, #fff, #eef6ff) !important;
    border-color: rgba(37, 99, 235, .18) !important;
}

.profile-hero .btn-outline-light,
.profile-actions .btn-outline-light {
    color: #0f172a !important;
    background: rgba(255,255,255,.9) !important;
    border-color: rgba(255,255,255,.72) !important;
}

.btn i,
.icon-btn i,
.consent-open-button i {
    transition: transform .16s ease;
}

.btn:hover i,
.icon-btn:hover i,
.consent-open-button:hover i {
    transform: translateY(-1px) scale(1.04);
}

.system-notification-toast {
    position: fixed !important;
    z-index: 99999 !important;
    top: max(12px, env(safe-area-inset-top)) !important;
    left: 50% !important;
    right: auto !important;
    width: min(560px, calc(100vw - 24px)) !important;
    min-height: 58px !important;
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 14px !important;
    border: 1px solid rgba(255,255,255,.28) !important;
    border-radius: 999px !important;
    color: #fff !important;
    background: linear-gradient(135deg, rgba(15, 23, 42, .78), rgba(30, 64, 175, .58)) !important;
    box-shadow: 0 22px 70px rgba(15, 23, 42, .28) !important;
    backdrop-filter: blur(22px) saturate(150%) !important;
    transform: translate(-50%, -140%) scale(.98) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.system-notification-toast.show {
    transform: translate(-50%, 0) scale(1) !important;
    opacity: 1 !important;
}

.system-notification-toast > span {
    width: 42px !important;
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.16) !important;
}

.system-notification-toast strong,
.system-notification-toast small {
    display: block !important;
    color: #fff !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.system-notification-toast small {
    opacity: .82 !important;
    white-space: nowrap !important;
}

.guest-shell:has(.public-appointment-page),
.guest-shell:has(.public-test-hero),
.guest-shell:has(.public-test-shell) {
    min-height: 100svh !important;
    align-items: stretch !important;
    background:
        radial-gradient(circle at 14% 12%, rgba(20,184,166,.14), transparent 34%),
        radial-gradient(circle at 86% 14%, rgba(37,99,235,.12), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 50%, #eef8f4 100%) !important;
}

.guest-body:has(.public-appointment-page),
.guest-body:has(.public-test-hero),
.guest-body:has(.public-test-shell) {
    height: auto !important;
    min-height: 100svh !important;
    overflow: auto !important;
}

.public-appointment-page,
.guest-premium.public-appointment-page {
    width: min(1120px, 100%) !important;
    min-height: calc(100svh - 44px) !important;
    margin: auto !important;
    align-items: center !important;
}

.public-appointment-card {
    max-height: none !important;
    overflow: visible !important;
}

.consent-hidden-check {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.consent-open-button {
    width: 100%;
    min-height: 62px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 16px;
    color: #0f172a;
    background: rgba(255,255,255,.82);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
    text-align: left;
}

.consent-open-button i {
    grid-row: span 2;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #2563eb;
    background: #eff6ff;
}

.consent-open-button span,
.consent-open-button em {
    display: block;
}

.consent-open-button span {
    font-weight: 900;
}

.consent-open-button em {
    color: #64748b;
    font-size: 12px;
    font-style: normal;
}

.consent-open-button.accepted {
    border-color: rgba(16,185,129,.32);
    background: linear-gradient(135deg, #fff, #ecfdf5);
}

.consent-open-button.accepted i {
    color: #059669;
    background: #d1fae5;
}

.consent-rich-text {
    max-height: min(58vh, 520px);
    overflow: auto;
    color: #0f172a;
}

.consent-rich-text table,
.info-preview-box table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.consent-rich-text th,
.consent-rich-text td,
.info-preview-box th,
.info-preview-box td {
    border: 1px solid rgba(148,163,184,.28);
    padding: 8px;
}

.info-form-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.info-preview-card {
    grid-column: 1 / -1;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.editor-toolbar button {
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid rgba(37,99,235,.18);
    border-radius: 10px;
    color: #1d4ed8;
    background: rgba(239,246,255,.86);
    font-weight: 850;
}

.html-editor-area {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
    line-height: 1.5;
}

.info-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.info-preview-box {
    padding: 14px;
    border: 1px solid rgba(148,163,184,.18);
    border-radius: 16px;
    background: rgba(248,250,252,.88);
}

.notification-list-pro {
    display: grid;
    gap: 10px;
}

.notification-row-pro {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(148,163,184,.16);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15,23,42,.05);
}

.notification-row-pro.unread {
    border-color: rgba(37,99,235,.24);
    background: linear-gradient(135deg, #fff, #eff6ff);
}

.notification-row-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: #2563eb;
    background: #eff6ff;
}

.notification-row-pro p {
    margin: 3px 0;
    color: #475569;
}

.notification-row-pro small {
    color: #64748b;
}

.notification-row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.notification-row-actions form {
    margin: 0;
}

.pagination-soft {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.published-tests-hero,
.public-test-hero {
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    min-height: 190px !important;
}

.public-test-list-modern {
    margin-top: 10px !important;
}

.published-test-card,
.public-test-card-modern {
    background: rgba(255,255,255,.86) !important;
    border-color: rgba(148, 163, 184, .18) !important;
    backdrop-filter: blur(12px) !important;
}

.public-test-shell {
    width: min(1120px, 100%) !important;
    margin: auto !important;
    border-radius: 22px !important;
    background: rgba(255,255,255,.9) !important;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .1) !important;
}

@media (max-width: 960px) {
    .info-form-editor-grid,
    .info-preview-grid,
    .notification-row-pro {
        grid-template-columns: 1fr !important;
    }

    .notification-row-actions {
        justify-content: flex-start;
    }

    .public-appointment-page,
    .guest-premium.public-appointment-page {
        min-height: auto !important;
    }
}

/* Public appointment/test final fit and blue gradient pass. */
.guest-shell:has(.public-appointment-page),
.guest-shell:has(.published-tests-minimal-hero),
.guest-shell:has(.public-test-shell) {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: center !important;
    background:
        radial-gradient(circle at 12% 14%, rgba(56, 189, 248, .26), transparent 34%),
        radial-gradient(circle at 88% 18%, rgba(99, 102, 241, .24), transparent 32%),
        linear-gradient(135deg, #eff8ff 0%, #dbeafe 42%, #eef2ff 72%, #f8fbff 100%) !important;
}

.guest-body:has(.public-appointment-page),
.guest-body:has(.published-tests-minimal-hero),
.guest-body:has(.public-test-shell) {
    height: auto !important;
    min-height: 100svh !important;
    overflow-x: hidden !important;
    background:
        radial-gradient(circle at 12% 14%, rgba(56, 189, 248, .26), transparent 34%),
        radial-gradient(circle at 88% 18%, rgba(99, 102, 241, .24), transparent 32%),
        linear-gradient(135deg, #eff8ff 0%, #dbeafe 42%, #eef2ff 72%, #f8fbff 100%) !important;
}

.guest-premium.public-appointment-page {
    width: 100% !important;
    max-width: none !important;
    min-height: 100svh !important;
    display: grid !important;
    grid-template-columns: minmax(360px, .9fr) minmax(470px, .72fr) !important;
    gap: clamp(18px, 3vw, 42px) !important;
    padding: clamp(18px, 3vw, 42px) !important;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .9), rgba(37, 99, 235, .72) 58%, rgba(14, 165, 233, .58)),
        radial-gradient(circle at 18% 20%, rgba(125, 211, 252, .3), transparent 32%) !important;
}

.public-appointment-page .guest-story h1 {
    max-width: 620px !important;
    font-size: clamp(42px, 5.2vw, 76px) !important;
    line-height: .98 !important;
    margin: 14px 0 12px !important;
}

.public-appointment-page .guest-story p {
    font-size: 15px !important;
    line-height: 1.45 !important;
}

.public-appointment-page .guest-signal-list {
    margin-top: 18px !important;
}

.public-appointment-card {
    width: 100% !important;
    max-width: 560px !important;
    align-self: center !important;
    padding: clamp(22px, 2.4vw, 34px) !important;
    border-radius: 20px !important;
}

.public-appointment-card h2 {
    font-size: clamp(28px, 3vw, 42px) !important;
    line-height: 1.05 !important;
    margin-bottom: 14px !important;
}

.public-appointment-card form {
    row-gap: 12px !important;
}

.public-appointment-card .form-label {
    margin-bottom: 5px !important;
    font-size: 13px !important;
}

.public-appointment-card .form-control,
.public-appointment-card .form-select {
    min-height: 42px !important;
    border-radius: 12px !important;
}

.public-appointment-card textarea.form-control {
    min-height: 82px !important;
}

.public-appointment-card .col-md-6:has(.consent-open-button),
.public-appointment-card .consent-col {
    display: flex !important;
}

.public-appointment-card .consent-open-button {
    min-height: 78px !important;
    height: 100% !important;
    grid-template-columns: 36px minmax(0, 1fr) !important;
    align-content: center !important;
}

.public-appointment-card .consent-open-button i {
    width: 36px !important;
    height: 36px !important;
}

.published-tests-minimal-hero {
    width: min(1080px, calc(100% - 36px));
    margin: 34px auto 18px;
    padding: 22px 24px;
    text-align: center;
    border: 1px solid rgba(255,255,255,.58);
    border-radius: 24px;
    background: rgba(255,255,255,.55);
    box-shadow: 0 22px 70px rgba(30, 64, 175, .14);
    backdrop-filter: blur(18px) saturate(140%);
}

.published-tests-minimal-hero h1 {
    margin: 6px auto 6px;
    max-width: 680px;
    color: #0f172a;
    font-size: clamp(26px, 3vw, 40px);
    line-height: 1.08;
}

.published-tests-minimal-hero p {
    max-width: 620px;
    margin: 0 auto;
    color: #475569;
}

.published-test-card-grid {
    width: min(1120px, calc(100% - 36px));
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 360px));
    justify-content: center;
    gap: 16px;
    margin: 0 auto 36px;
}

.published-test-tile {
    min-height: 260px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.62);
    border-radius: 22px;
    color: #0f172a;
    text-decoration: none;
    background: rgba(255,255,255,.78);
    box-shadow: 0 20px 56px rgba(30, 64, 175, .12);
    backdrop-filter: blur(16px) saturate(140%);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.published-test-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(37, 99, 235, .28);
    box-shadow: 0 28px 70px rgba(30, 64, 175, .18);
}

.published-test-tile .test-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
}

.published-test-tile strong {
    display: block;
    margin-bottom: 6px;
    font-size: 18px;
    line-height: 1.2;
}

.published-test-tile p {
    color: #64748b;
    font-size: 13px;
}

.published-test-tile small {
    color: #64748b;
}

.published-test-tile em {
    justify-self: end;
    color: #2563eb;
    font-style: normal;
    font-weight: 950;
}

.info-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.info-form-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 42px rgba(15, 23, 42, .07);
}

.info-form-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: #2563eb;
    background: #eff6ff;
}

.info-form-card small {
    color: #64748b;
    font-weight: 850;
}

.info-form-card h3 {
    margin: 2px 0 8px;
    color: #0f172a;
    font-size: 17px;
}

.info-form-preview {
    max-height: 126px;
    overflow: hidden;
    color: #475569;
    font-size: 13px;
}

.info-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.info-form-actions form {
    margin: 0;
}

@media (max-height: 820px) and (min-width: 1000px) {
    .guest-premium.public-appointment-page {
        padding: 18px 34px !important;
    }

    .public-appointment-page .guest-story h1 {
        font-size: clamp(38px, 4.4vw, 64px) !important;
    }

    .public-appointment-card {
        padding: 22px !important;
    }

    .public-appointment-card h2 {
        font-size: 32px !important;
    }

    .public-appointment-card form {
        row-gap: 9px !important;
    }

    .public-appointment-card .form-control,
    .public-appointment-card .form-select {
        min-height: 38px !important;
    }

    .public-appointment-card textarea.form-control {
        min-height: 66px !important;
    }

    .public-appointment-card .consent-open-button {
        min-height: 68px !important;
    }
}

@media (max-width: 1080px) {
    .guest-premium.public-appointment-page,
    .published-test-card-grid,
    .info-card-grid {
        grid-template-columns: 1fr !important;
    }

    .public-appointment-page .guest-story {
        text-align: center;
    }

    .public-appointment-page .guest-story h1,
    .public-appointment-page .guest-story p {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .public-appointment-page .guest-signal-list {
        justify-content: center;
    }

    .public-appointment-card {
        justify-self: center;
    }
}

/* 2026-05-18 final interaction polish: pill buttons, live calendar, public pages. */
.btn,
button.btn,
a.btn,
.icon-btn,
.sidebar-quick-action,
.ai-quick-grid button,
.ai-quick-grid a,
.editor-toolbar button {
    border-radius: 999px !important;
}

.btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-width: 1px;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #1735ff, #0875ff) !important;
    border-color: rgba(23, 53, 255, .58) !important;
    box-shadow: 0 14px 30px rgba(23, 53, 255, .22) !important;
}

.btn-primary:hover {
    color: #fff !important;
    transform: translateY(-2px);
    background: linear-gradient(135deg, #061bd9, #075ee8) !important;
    box-shadow: 0 20px 42px rgba(23, 53, 255, .3) !important;
}

.btn-primary i {
    width: 25px;
    height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.58);
    border-radius: 50%;
}

.btn-xs.btn-primary i,
.btn-sm.btn-primary i {
    width: 20px;
    height: 20px;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning {
    background: rgba(255,255,255,.9) !important;
    box-shadow: 0 8px 22px rgba(15,23,42,.05);
}

.appointment-page-surface {
    margin: -18px;
    padding: clamp(18px, 2.4vw, 30px);
    min-height: calc(100svh - 42px);
    background:
        radial-gradient(circle at 8% 12%, rgba(56, 189, 248, .28), transparent 34%),
        radial-gradient(circle at 86% 8%, rgba(79, 70, 229, .2), transparent 30%),
        linear-gradient(135deg, #eff8ff 0%, #dbeafe 48%, #eef2ff 100%);
}

.appointment-page-surface .panel,
.appointment-page-surface .cockpit-card {
    background: rgba(255,255,255,.78) !important;
    border-color: rgba(255,255,255,.66) !important;
    backdrop-filter: blur(18px) saturate(145%);
}

.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    color: #475569;
    background: #f1f5f9;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.source-badge.website {
    color: #1d4ed8;
    background: linear-gradient(135deg, #dbeafe, #eef2ff);
}

.smart-appointment-picker {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(148,163,184,.2);
    border-radius: 22px;
    background: rgba(248,250,252,.86);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.smart-appointment-picker.needs-selection {
    border-color: rgba(239,68,68,.34);
    box-shadow: 0 0 0 4px rgba(239,68,68,.08);
}

.smart-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.smart-picker-head strong {
    color: #0f172a;
    font-size: 14px;
    text-transform: capitalize;
}

.smart-picker-weekdays,
.smart-picker-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.smart-picker-weekdays span {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-align: center;
}

.smart-day,
.smart-time {
    min-height: 34px;
    border: 1px solid rgba(148,163,184,.18);
    border-radius: 999px;
    color: #0f172a;
    background: rgba(255,255,255,.92);
    font-weight: 900;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
}

.smart-day:hover:not(:disabled),
.smart-time:hover:not(:disabled),
.smart-day.selected,
.smart-time.selected {
    color: #fff;
    background: linear-gradient(135deg, #1735ff, #0875ff);
    box-shadow: 0 12px 28px rgba(37,99,235,.25);
    transform: translateY(-1px);
}

.smart-day.muted {
    opacity: .45;
}

.smart-day.today {
    border-color: rgba(37,99,235,.45);
}

.smart-day.disabled,
.smart-time.disabled,
.smart-day:disabled,
.smart-time:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    background: rgba(226,232,240,.58);
    box-shadow: none;
}

.smart-picker-times {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.smart-picker-times > span {
    grid-column: 1 / -1;
    padding: 10px;
    border-radius: 16px;
    color: #64748b;
    background: rgba(255,255,255,.72);
    text-align: center;
    font-weight: 850;
}

.guest-shell:has(.online-tests-landing),
.guest-shell:has(.public-test-shell),
.guest-shell:has(.public-appointment-page) {
    min-height: 100svh !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    background:
        radial-gradient(circle at 12% 12%, rgba(14, 165, 233, .34), transparent 34%),
        radial-gradient(circle at 88% 10%, rgba(79, 70, 229, .26), transparent 32%),
        linear-gradient(135deg, #e0f2fe 0%, #dbeafe 44%, #eef2ff 100%) !important;
}

.guest-body:has(.online-tests-landing),
.guest-body:has(.public-test-shell),
.guest-body:has(.public-appointment-page) {
    min-height: 100svh !important;
    background:
        radial-gradient(circle at 12% 12%, rgba(14, 165, 233, .34), transparent 34%),
        radial-gradient(circle at 88% 10%, rgba(79, 70, 229, .26), transparent 32%),
        linear-gradient(135deg, #e0f2fe 0%, #dbeafe 44%, #eef2ff 100%) !important;
}

.online-tests-landing {
    width: min(1180px, calc(100% - 32px));
    display: grid;
    gap: 18px;
    padding: clamp(18px, 4vw, 42px) 0;
}

.online-tests-hero {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: clamp(28px, 5vw, 58px);
    text-align: center;
    border: 1px solid rgba(255,255,255,.66);
    border-radius: 30px;
    background: rgba(255,255,255,.58);
    box-shadow: 0 28px 80px rgba(30,64,175,.14);
    backdrop-filter: blur(20px) saturate(150%);
}

.online-tests-hero h1 {
    max-width: 720px;
    margin: 0;
    color: #0f172a;
    font-size: clamp(32px, 5vw, 62px);
    line-height: 1.02;
}

.online-tests-hero p {
    max-width: 640px;
    margin: 0;
    color: #475569;
}

.online-tests-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.online-tests-stats span {
    min-width: 128px;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 999px;
    background: rgba(255,255,255,.72);
}

.online-tests-stats strong,
.online-tests-stats small {
    display: block;
}

.online-tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
    gap: 16px;
}

.online-test-card {
    min-height: 280px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 16px;
    padding: 22px;
    border: 1px solid rgba(255,255,255,.68);
    border-radius: 28px;
    color: #0f172a;
    text-decoration: none;
    background: rgba(255,255,255,.78);
    box-shadow: 0 24px 64px rgba(30,64,175,.13);
    backdrop-filter: blur(18px) saturate(145%);
    transition: transform .18s ease, box-shadow .18s ease;
}

.online-test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 32px 84px rgba(30,64,175,.2);
}

.online-test-icon {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: #1d4ed8;
    background: linear-gradient(135deg, #dbeafe, #eef2ff);
}

.online-test-card small {
    color: #64748b;
    font-weight: 900;
}

.online-test-card h2 {
    margin: 8px 0;
    font-size: 22px;
    line-height: 1.15;
}

.online-test-card p {
    margin: 0;
    color: #64748b;
}

.online-test-card em {
    justify-self: end;
    color: #1735ff;
    font-style: normal;
    font-weight: 950;
}

.online-test-empty {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 34px;
    border-radius: 28px;
    background: rgba(255,255,255,.78);
}

.public-test-shell {
    width: min(1080px, calc(100% - 32px)) !important;
    margin: clamp(18px, 4vw, 42px) auto !important;
    padding: clamp(18px, 3vw, 34px) !important;
    border: 1px solid rgba(255,255,255,.66) !important;
    background: rgba(255,255,255,.82) !important;
}

.public-question-card {
    border-radius: 22px !important;
    background: linear-gradient(135deg, #fff, #f8fbff) !important;
}

.paytr-preview-amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 14px 0;
    padding: 12px 14px;
    border-radius: 18px;
    background: #eff6ff;
}

.paytr-preview-amount span {
    color: #64748b;
    font-weight: 850;
}

.paytr-preview-amount strong {
    color: #0f172a;
    font-size: 18px;
}

.success-orb {
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #10b981, #2563eb);
    box-shadow: 0 22px 48px rgba(16,185,129,.22);
    font-size: 34px;
}

/* Final hardening pass for the latest UI review. */
.btn,
button.btn,
a.btn,
.icon-btn,
.consent-open-button,
.editor-toolbar button {
    border-radius: 999px !important;
}

.btn,
button.btn,
a.btn {
    min-height: 38px !important;
    padding: 8px 15px !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .07) !important;
}

.btn:hover,
button.btn:hover,
a.btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 18px 38px rgba(15, 23, 42, .12) !important;
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-success:hover,
.btn-outline-danger:hover,
.btn-outline-warning:hover,
.btn-outline-light:hover {
    color: #fff !important;
    background: linear-gradient(135deg, #1735ff, #0875ff) !important;
    border-color: rgba(37,99,235,.44) !important;
}

.profile-avatar,
.avatar,
.avatar-chip:not(:has(i)),
.child-avatar,
.profile-photo-preview {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    overflow: hidden !important;
    background-color: #f8fbff !important;
    background-image: url("https://cdn-icons-png.flaticon.com/512/3177/3177440.png") !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: 72% !important;
    box-shadow: inset 0 0 0 1px rgba(148,163,184,.14), 0 10px 24px rgba(15,23,42,.08) !important;
}

.profile-avatar[style],
.avatar[style],
.child-avatar[style],
.profile-photo-preview[style] {
    background-size: cover !important;
}

.profile-avatar.small,
.avatar.small {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
}

.profile-avatar.lg,
.avatar.lg,
.profile-photo-preview {
    width: 74px !important;
    height: 74px !important;
    min-width: 74px !important;
}

.guest-body:has(.login16-shell),
.guest-shell:has(.login16-shell) {
    overflow: hidden !important;
}

.login16-shell {
    height: min(640px, calc(100svh - 32px)) !important;
    max-height: calc(100svh - 32px) !important;
}

.login16-form-panel {
    min-height: 0 !important;
}

.login16-copy h1 {
    font-size: clamp(34px, 4.2vw, 58px) !important;
}

.guest-shell:has(.online-tests-landing) {
    width: 100% !important;
    max-width: none !important;
    padding: clamp(18px, 3vw, 42px) !important;
    align-items: center !important;
}

.online-tests-landing {
    width: min(1120px, 100%) !important;
    margin-inline: auto !important;
}

.online-tests-hero {
    min-height: auto !important;
    padding: clamp(26px, 4vw, 46px) !important;
}

.online-tests-hero h1 {
    font-size: clamp(30px, 4vw, 52px) !important;
}

.online-test-card {
    min-height: 230px !important;
}

.smart-time {
    min-height: 48px !important;
    display: grid !important;
    place-items: center !important;
    gap: 2px !important;
    padding: 7px 8px !important;
}

.smart-time strong,
.smart-time small {
    display: block !important;
    line-height: 1.05 !important;
}

.smart-time strong {
    font-size: 13px !important;
}

.smart-time small {
    color: inherit !important;
    opacity: .72 !important;
    font-size: 10px !important;
    font-weight: 850 !important;
}

@media (max-width: 900px) {
    .login16-shell {
        height: auto !important;
        max-height: calc(100svh - 24px) !important;
        overflow: auto !important;
    }
}

.aidoc-login {
    width: min(980px, calc(100vw - 28px)) !important;
    min-height: auto !important;
    border-radius: 34px !important;
    background: rgba(255,255,255,.82) !important;
    box-shadow: 0 32px 90px rgba(15,23,42,.18) !important;
    backdrop-filter: blur(22px) saturate(150%);
}

.aidoc-login .login-brand-panel {
    border-radius: 28px !important;
    background:
        radial-gradient(circle at 24% 18%, rgba(125,211,252,.34), transparent 30%),
        linear-gradient(135deg, #0f172a, #1d4ed8 62%, #0891b2) !important;
}

.aidoc-login .login-form-panel {
    padding: clamp(22px, 3vw, 38px) !important;
}

.aidoc-login .role-login-card {
    border-radius: 24px !important;
}

@media (max-width: 760px) {
    .appointment-page-surface {
        margin: -12px;
        padding: 14px;
    }

    .smart-picker-times {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .online-tests-hero {
        padding: 24px 18px;
    }
}

/* 2026-05-18 full button, login motion, online tests and parent profile rebuild. */
button,
.btn,
.icon-btn,
.sidebar-quick-action,
.consent-open-button {
    -webkit-tap-highlight-color: transparent;
}

.btn,
button.btn,
a.btn {
    position: relative !important;
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 9px 16px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(37,99,235,.16) !important;
    color: #0f172a !important;
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,246,255,.9)) !important;
    box-shadow: 0 12px 28px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.82) !important;
    overflow: hidden !important;
    isolation: isolate !important;
    transition: transform .18s ease, box-shadow .18s ease, color .18s ease, border-color .18s ease, background .18s ease !important;
}

.btn::before,
button.btn::before,
a.btn::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.58) 42%, transparent 72%);
    transform: translateX(-110%);
    transition: transform .42s ease, opacity .2s ease;
}

.btn:hover,
button.btn:hover,
a.btn:hover {
    color: #fff !important;
    border-color: rgba(37,99,235,.46) !important;
    background: linear-gradient(135deg, #1735ff, #0875ff 62%, #0ea5e9) !important;
    box-shadow: 0 18px 44px rgba(37,99,235,.24) !important;
    transform: translateY(-2px) !important;
}

.btn:hover::before,
button.btn:hover::before,
a.btn:hover::before {
    opacity: 1;
    transform: translateX(110%);
}

.btn:active,
button.btn:active,
a.btn:active {
    transform: translateY(0) scale(.98) !important;
}

.btn-primary,
button.btn-primary,
a.btn-primary {
    color: #fff !important;
    border-color: rgba(23,53,255,.44) !important;
    background: linear-gradient(135deg, #1d4ed8, #1735ff 56%, #06b6d4) !important;
}

.btn-success,
button.btn-success,
a.btn-success {
    color: #fff !important;
    border-color: rgba(16,185,129,.4) !important;
    background: linear-gradient(135deg, #059669, #10b981) !important;
}

.btn-danger,
button.btn-danger,
a.btn-danger {
    color: #fff !important;
    border-color: rgba(244,63,94,.4) !important;
    background: linear-gradient(135deg, #dc2626, #f43f5e) !important;
}

.btn-warning,
button.btn-warning,
a.btn-warning {
    color: #111827 !important;
    border-color: rgba(245,158,11,.38) !important;
    background: linear-gradient(135deg, #facc15, #f59e0b) !important;
}

.btn-sm {
    min-height: 34px !important;
    padding: 7px 12px !important;
    font-size: 12px !important;
}

.btn-xs {
    min-height: 30px !important;
    padding: 5px 10px !important;
    font-size: 11px !important;
}

.btn i {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(37,99,235,.1);
    color: inherit;
}

.btn-primary i,
.btn-success i,
.btn-danger i,
.btn:hover i {
    background: rgba(255,255,255,.18);
}

.icon-btn {
    border-radius: 50% !important;
    box-shadow: 0 12px 26px rgba(15,23,42,.08) !important;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease !important;
}

.icon-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 18px 38px rgba(37,99,235,.2) !important;
}

.guest-body:has(.login16-shell) {
    background:
        radial-gradient(circle at 12% 16%, rgba(14,165,233,.26), transparent 30%),
        radial-gradient(circle at 86% 12%, rgba(79,70,229,.2), transparent 32%),
        linear-gradient(135deg, #f8fbff 0%, #edf7ff 48%, #f5f8ff 100%) !important;
}

.login16-shell {
    animation: loginEnter .72s cubic-bezier(.2,.8,.2,1) both;
}

.login16-visual {
    overflow: hidden;
}

.login16-visual::before {
    content: "";
    position: absolute;
    inset: -40% auto auto -20%;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    animation: loginFloat 8s ease-in-out infinite;
}

.login16-brand,
.login16-copy,
.login16-social {
    animation: loginContentRise .68s cubic-bezier(.2,.8,.2,1) both;
}

.login16-copy {
    animation-delay: .08s;
}

.login16-social {
    animation-delay: .16s;
}

.login16-form-panel {
    animation: loginFormSlide .68s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes loginEnter {
    from { opacity: 0; transform: translateY(18px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes loginContentRise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes loginFormSlide {
    from { opacity: 0; transform: translateX(22px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes loginFloat {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(32px, 26px, 0) scale(1.08); }
}

.guest-shell:has(.online-tests-landing) {
    width: 100% !important;
    max-width: none !important;
    min-height: 100svh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: clamp(18px, 4vw, 46px) !important;
}

.online-tests-landing {
    width: min(1140px, 100%) !important;
    margin: 0 auto !important;
    place-self: center !important;
}

.online-tests-hero {
    position: relative;
    overflow: hidden;
    border-radius: 34px !important;
    background:
        linear-gradient(135deg, rgba(255,255,255,.78), rgba(239,246,255,.58)),
        radial-gradient(circle at 18% 14%, rgba(14,165,233,.18), transparent 32%) !important;
}

.online-tests-hero::after {
    content: "";
    position: absolute;
    inset: auto -80px -120px auto;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(37,99,235,.1);
}

.online-tests-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)) !important;
    align-items: stretch;
}

.online-test-card {
    position: relative;
    min-height: 260px !important;
    padding: 24px !important;
    border-radius: 30px !important;
    background:
        linear-gradient(145deg, rgba(255,255,255,.92), rgba(248,251,255,.72)),
        radial-gradient(circle at 96% 0%, rgba(14,165,233,.16), transparent 34%) !important;
    box-shadow: 0 26px 74px rgba(30,64,175,.16) !important;
}

.online-test-card:hover {
    transform: translateY(-7px) !important;
    box-shadow: 0 34px 94px rgba(30,64,175,.22) !important;
}

.online-test-card h2 {
    font-size: 21px !important;
}

.online-test-cta {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #1735ff, #0875ff);
    box-shadow: 0 16px 34px rgba(37,99,235,.24);
    font-weight: 950;
}

.parent-profile-hub {
    background:
        radial-gradient(circle at 12% 0%, rgba(14,165,233,.08), transparent 30%),
        #fff;
}

.parent-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
    gap: 16px;
}

.parent-profile-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(148,163,184,.16);
    border-radius: 24px;
    background: linear-gradient(145deg, #fff, #f8fbff);
    box-shadow: 0 18px 52px rgba(15,23,42,.08);
    transition: transform .18s ease, box-shadow .18s ease;
}

.parent-profile-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 70px rgba(15,23,42,.13);
}

.parent-profile-top {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.parent-profile-top strong,
.parent-profile-top small {
    display: block;
}

.parent-profile-top small,
.parent-profile-meta span,
.parent-profile-children span,
.parent-profile-balance span {
    color: #64748b;
    font-size: 12px;
    font-weight: 850;
}

.parent-profile-meta {
    display: grid;
    gap: 8px;
}

.parent-profile-meta span {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.parent-profile-meta i {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #2563eb;
    background: #eff6ff;
}

.parent-profile-children,
.parent-profile-balance {
    padding: 12px;
    border-radius: 18px;
    background: rgba(239,246,255,.7);
}

.parent-profile-children strong,
.parent-profile-balance strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
}

.parent-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 760px) {
    .online-tests-landing {
        width: 100% !important;
    }

    .online-tests-hero h1 {
        font-size: 30px !important;
    }

    .parent-profile-top {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .parent-profile-top .badge-status {
        justify-self: start;
        grid-column: 2;
    }
}
