/* Precompiled production stylesheet for the Tailwind + Poppins interface. */
:root {
    --brand-950: #042f2e;
    --brand-900: #134e4a;
    --brand-800: #115e59;
    --brand-700: #0f766e;
    --brand-600: #0d9488;
    --brand-500: #14b8a6;
    --brand-100: #ccfbf1;
    --brand-50: #f0fdfa;
    --navy-950: #0b172a;
    --navy-800: #1e293b;
    --navy-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    --white: #ffffff;
    --danger-700: #b91c1c;
    --danger-100: #fee2e2;
    --danger-50: #fef2f2;
    --warning-700: #b45309;
    --warning-100: #fef3c7;
    --warning-50: #fffbeb;
    --success-700: #15803d;
    --success-100: #dcfce7;
    --success-50: #f0fdf4;
    --blue-700: #1d4ed8;
    --blue-100: #dbeafe;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-md: 0 10px 28px rgba(15, 23, 42, .08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, .16);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Poppins, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--navy-800); background: #f4f7fb; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .62; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.eyebrow { margin: 0 0 6px; color: var(--brand-700); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.btn { min-height: 42px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; font-size: .84rem; font-weight: 700; line-height: 1; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:focus-visible, .icon-button:focus-visible, .nav-button:focus-visible, .page-button:focus-visible { outline: 3px solid rgba(20, 184, 166, .24); outline-offset: 2px; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { color: var(--white); background: linear-gradient(135deg, var(--brand-700), var(--brand-600)); box-shadow: 0 8px 20px rgba(13, 148, 136, .2); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 12px 26px rgba(13, 148, 136, .28); }
.btn-secondary { color: var(--navy-700); background: var(--white); border-color: var(--slate-200); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { border-color: var(--slate-300); background: var(--slate-50); }
.btn-ghost { color: var(--slate-600); background: transparent; border-color: var(--slate-200); }
.btn-ghost:hover:not(:disabled) { color: var(--brand-700); border-color: #99f6e4; background: var(--brand-50); }
.btn-small { min-height: 36px; padding: 8px 12px; font-size: .75rem; }
.btn-block { width: 100%; }

.icon-button { width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--slate-500); background: var(--white); border: 1px solid var(--slate-200); border-radius: 12px; transition: color .18s ease, background .18s ease, transform .18s ease; }
.icon-button:hover { color: var(--brand-700); background: var(--brand-50); transform: translateY(-1px); }
.icon-button svg { width: 19px; height: 19px; }

.input, .select, .search-field { border: 1px solid var(--slate-200); border-radius: 12px; background: var(--white); box-shadow: var(--shadow-sm); transition: border-color .18s ease, box-shadow .18s ease; }
.input, .select { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--navy-800); font-size: .84rem; outline: none; }
.input::placeholder, .search-field input::placeholder { color: var(--slate-400); }
.input:focus, .select:focus, .search-field:focus-within { border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(20, 184, 166, .12); }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label { color: var(--navy-700); font-size: .78rem; font-weight: 700; }
.form-row { display: grid; gap: 16px; margin-bottom: 16px; }
.form-row.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.three-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 10px; }

.auth-page { min-height: 100vh; background: radial-gradient(circle at top left, rgba(20, 184, 166, .18), transparent 38%), linear-gradient(145deg, #eefaf8 0%, #f5f7fb 50%, #e8eef8 100%); }
.auth-shell { min-height: 100vh; padding: 32px 18px; display: grid; place-items: center; }
.auth-card { width: min(460px, 100%); padding: 38px; background: rgba(255, 255, 255, .96); border: 1px solid rgba(255, 255, 255, .8); border-radius: 26px; box-shadow: 0 30px 80px rgba(15, 23, 42, .14); }
.auth-card.install-card { width: min(720px, 100%); }
.auth-card h1 { margin: 0; color: var(--navy-950); font-size: clamp(1.7rem, 4vw, 2.15rem); letter-spacing: -.04em; }
.auth-subtitle { margin: 8px 0 24px; color: var(--slate-500); font-size: .86rem; line-height: 1.7; }
.brand-mark { width: 56px; height: 56px; margin-bottom: 24px; display: grid; place-items: center; color: var(--white); background: linear-gradient(135deg, var(--brand-800), var(--brand-500)); border-radius: 17px; box-shadow: 0 12px 28px rgba(13, 148, 136, .28); }
.brand-mark svg { width: 25px; height: 25px; stroke-width: 2.4; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .form-row { margin: 0; }
.privacy-note { margin: 22px 0 0; color: var(--slate-400); font-size: .7rem; line-height: 1.6; text-align: center; }
.alert { margin: 18px 0; padding: 13px 15px; border: 1px solid transparent; border-radius: 12px; font-size: .78rem; line-height: 1.65; }
.alert-error { color: var(--danger-700); background: var(--danger-50); border-color: var(--danger-100); }
.alert-success { color: var(--success-700); background: var(--success-50); border-color: var(--success-100); }
.alert-warning { color: var(--warning-700); background: var(--warning-50); border-color: var(--warning-100); }
.alert code { padding: 2px 5px; color: inherit; background: rgba(255, 255, 255, .6); border-radius: 5px; }
.checkbox-row { margin: 4px 0; padding: 14px; display: flex; align-items: flex-start; gap: 11px; border: 1px solid var(--slate-200); border-radius: 12px; cursor: pointer; }
.checkbox-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand-700); }
.checkbox-row span { display: flex; flex-direction: column; gap: 3px; font-size: .8rem; }
.checkbox-row small { color: var(--slate-500); line-height: 1.5; }
.setup-summary { margin: 22px 0; padding: 16px; display: flex; align-items: center; gap: 13px; color: var(--success-700); background: var(--success-50); border: 1px solid var(--success-100); border-radius: 14px; }
.setup-summary p { margin: 3px 0 0; color: var(--slate-500); font-size: .78rem; }
.summary-check { width: 36px; height: 36px; display: grid; place-items: center; color: var(--white); background: #22c55e; border-radius: 50%; font-weight: 800; }

.app-shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 40; min-height: 76px; padding: 12px clamp(18px, 3vw, 42px); display: grid; grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr); align-items: center; gap: 22px; background: rgba(255, 255, 255, .94); border-bottom: 1px solid rgba(226, 232, 240, .9); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 11px; width: fit-content; }
.brand-mark-small { width: 42px; height: 42px; margin: 0; border-radius: 13px; box-shadow: 0 8px 20px rgba(13, 148, 136, .22); }
.brand-mark-small svg { width: 20px; height: 20px; }
.brand > span:last-child { display: flex; flex-direction: column; }
.brand strong { color: var(--navy-950); font-size: .97rem; letter-spacing: -.02em; }
.brand small { color: var(--slate-500); font-size: .62rem; }
.main-nav { padding: 5px; display: flex; gap: 4px; background: var(--slate-100); border-radius: 14px; }
.nav-button { min-height: 42px; padding: 9px 13px; display: inline-flex; align-items: center; gap: 7px; color: var(--slate-500); background: transparent; border: 0; border-radius: 10px; font-size: .75rem; font-weight: 700; white-space: nowrap; transition: color .18s ease, background .18s ease, box-shadow .18s ease; }
.nav-button svg { width: 17px; height: 17px; }
.nav-button:hover { color: var(--brand-700); }
.nav-button.is-active { color: var(--brand-800); background: var(--white); box-shadow: var(--shadow-sm); }
.user-area { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.public-access-badge { min-height: 38px; padding: 8px 12px; display: inline-flex; align-items: center; gap: 7px; color: var(--brand-800); background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.public-access-badge svg { width: 16px; height: 16px; }
.user-copy { display: flex; flex-direction: column; text-align: right; }
.user-copy strong { max-width: 190px; overflow: hidden; color: var(--navy-800); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { color: var(--slate-400); font-size: .64rem; }

.main-content { width: min(1500px, calc(100% - 36px)); margin: 0 auto; padding: 34px 0 64px; }
.app-view { display: none; }
.app-view.is-active { display: block; animation: view-in .24s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { margin-bottom: 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; }
.page-heading h1 { margin: 0; color: var(--navy-950); font-size: clamp(1.65rem, 3vw, 2.4rem); letter-spacing: -.045em; line-height: 1.18; }
.page-heading p:last-child { margin: 8px 0 0; color: var(--slate-500); font-size: .82rem; }
.heading-actions { display: flex; gap: 10px; }

.stats-grid { margin-bottom: 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.stat-card { min-height: 136px; padding: 20px; display: flex; align-items: center; gap: 15px; background: var(--white); border: 1px solid #e7edf4; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; position: relative; }
.stat-card::after { content: ""; position: absolute; right: -20px; bottom: -28px; width: 92px; height: 92px; border-radius: 50%; background: currentColor; opacity: .035; }
.stat-icon { flex: 0 0 auto; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; }
.stat-icon svg { width: 22px; height: 22px; }
.stat-card small { display: block; color: var(--slate-500); font-size: .7rem; font-weight: 600; }
.stat-card strong { display: block; margin-top: 3px; color: var(--navy-950); font-size: 1.72rem; line-height: 1.1; letter-spacing: -.04em; }
.stat-card p { margin: 5px 0 0; color: var(--slate-400); font-size: .64rem; }
.stat-total { color: var(--blue-700); }.stat-total .stat-icon { background: #eff6ff; }
.stat-pending { color: var(--warning-700); }.stat-pending .stat-icon { background: var(--warning-50); }
.stat-upcoming { color: var(--brand-700); }.stat-upcoming .stat-icon { background: var(--brand-50); }
.stat-complete { color: var(--success-700); }.stat-complete .stat-icon { background: var(--success-50); }

.panel { background: var(--white); border: 1px solid #e7edf4; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.filter-bar { padding: 18px; display: grid; grid-template-columns: minmax(260px, 1fr) 150px 155px 165px auto; gap: 10px; border-bottom: 1px solid var(--slate-100); }
.filter-bar.compact { padding: 0 0 16px; grid-template-columns: minmax(180px, 1fr) 170px; border-bottom: 0; }
.search-field { min-height: 44px; padding: 0 12px; display: flex; align-items: center; gap: 9px; }
.search-field svg { flex: 0 0 auto; width: 17px; height: 17px; color: var(--slate-400); }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--navy-800); background: transparent; font-size: .82rem; }
.panel-meta { min-height: 46px; padding: 11px 18px; display: flex; align-items: center; justify-content: space-between; color: var(--slate-400); border-bottom: 1px solid var(--slate-100); font-size: .68rem; }
.panel-meta strong { color: var(--slate-600); font-size: .72rem; }

.desktop-table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .75rem; }
.data-table th { padding: 13px 16px; color: var(--slate-500); background: var(--slate-50); border-bottom: 1px solid var(--slate-200); font-size: .65rem; font-weight: 800; letter-spacing: .04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 15px 16px; color: var(--slate-600); border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: #fbfefd; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.align-right { text-align: right !important; }
.date-cell { min-width: 145px; }
.date-cell strong, .patient-cell strong, .procedure-cell strong { display: block; color: var(--navy-800); font-size: .76rem; font-weight: 700; }
.date-cell small, .patient-cell small, .procedure-cell small { display: block; margin-top: 3px; color: var(--slate-400); font-size: .65rem; }
.patient-cell { min-width: 210px; max-width: 290px; }
.procedure-cell { min-width: 190px; max-width: 310px; }
.cell-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-badge { padding: 6px 10px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-size: .64rem; font-weight: 800; white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending { color: var(--warning-700); background: var(--warning-100); }
.status-complete { color: var(--success-700); background: var(--success-100); }
.table-action { min-height: 34px; padding: 7px 10px; color: var(--brand-700); background: var(--brand-50); border: 1px solid #ccfbf1; border-radius: 9px; font-size: .68rem; font-weight: 800; }
.table-action:hover { color: var(--brand-900); background: var(--brand-100); }
.link-cluster { margin-top: 5px; display: flex; gap: 7px; }
.mini-link { color: var(--brand-700); font-size: .61rem; font-weight: 700; }
.mini-link:hover { text-decoration: underline; }

/* Premium ledger: satu pasien tetap satu baris horizontal seperti spreadsheet. */
.operation-ledger {
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    border-color: rgba(203, 213, 225, .72);
    box-shadow: 0 22px 55px rgba(15, 23, 42, .09);
}
.operation-ledger .filter-bar {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .035);
}
.operation-ledger .panel-meta {
    min-height: 52px;
    padding-inline: 22px;
    background: linear-gradient(90deg, rgba(240, 253, 250, .72), rgba(248, 250, 252, .65));
    border-bottom: 0;
}
.operation-ledger .panel-meta strong {
    color: var(--navy-800);
    font-size: .75rem;
}
.operation-table-wrap {
    padding: 0 14px 12px;
    background: linear-gradient(180deg, #f4f8fb 0%, #f8fafc 100%);
    scrollbar-color: var(--slate-300) transparent;
    scrollbar-width: thin;
}
.operation-table-wrap::-webkit-scrollbar { height: 9px; }
.operation-table-wrap::-webkit-scrollbar-track { background: transparent; }
.operation-table-wrap::-webkit-scrollbar-thumb { background: var(--slate-300); border: 3px solid #f8fafc; border-radius: 999px; }
.operation-table {
    min-width: 1160px;
    border-collapse: separate;
    border-spacing: 0 10px;
    table-layout: fixed;
}
.operation-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 14px 16px 9px;
    color: #718096;
    background: rgba(244, 248, 251, .96);
    border: 0;
    letter-spacing: .075em;
    backdrop-filter: blur(10px);
}
.operation-table th:nth-child(1), .operation-table td:nth-child(1) { width: 205px; }
.operation-table th:nth-child(2), .operation-table td:nth-child(2) { width: 280px; }
.operation-table th:nth-child(3), .operation-table td:nth-child(3) { width: 250px; }
.operation-table th:nth-child(4), .operation-table td:nth-child(4) { width: 145px; }
.operation-table th:nth-child(5), .operation-table td:nth-child(5) { width: 150px; }
.operation-table th:nth-child(6), .operation-table td:nth-child(6) { width: 115px; }
.operation-table th:nth-child(7), .operation-table td:nth-child(7) { width: 76px; }
.operation-table tbody tr {
    filter: drop-shadow(0 5px 10px rgba(15, 23, 42, .045));
    transition: filter .2s ease, transform .2s ease;
}
.operation-table tbody tr:hover {
    background: transparent;
    filter: drop-shadow(0 12px 18px rgba(15, 23, 42, .095));
    transform: translateY(-2px);
}
.operation-table tbody td {
    padding: 17px 16px;
    color: var(--slate-600);
    background: rgba(255, 255, 255, .98);
    border-top: 1px solid #e6edf3;
    border-bottom: 1px solid #e6edf3;
    transition: background .2s ease, border-color .2s ease;
}
.operation-table tbody tr:hover td {
    background: #ffffff;
    border-color: #dbe7ea;
}
.operation-table tbody td:first-child {
    padding-left: 21px;
    border-left: 1px solid #e6edf3;
    border-radius: 14px 0 0 14px;
}
.operation-table tbody td:last-child {
    border-right: 1px solid #e6edf3;
    border-radius: 0 14px 14px 0;
}
.operation-table tbody tr:last-child td { border-bottom: 1px solid #e6edf3; }
.operation-row.is-pending td:first-child { box-shadow: inset 4px 0 0 #f59e0b; }
.operation-row.is-complete td:first-child { box-shadow: inset 4px 0 0 #10b981; }
.operation-table .date-cell strong,
.operation-table .patient-cell strong,
.operation-table .procedure-cell strong {
    color: #172033;
    font-size: .77rem;
    line-height: 1.45;
}
.operation-table .date-cell small,
.operation-table .patient-cell small,
.operation-table .procedure-cell small {
    margin-top: 4px;
    color: #8ca0bb;
    line-height: 1.5;
}
.operation-table .status-badge {
    padding: 7px 11px;
    border: 1px solid transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .62);
}
.operation-table .status-pending {
    color: #b45309;
    background: linear-gradient(135deg, #fff7d6, #fef3c7);
    border-color: #fde7a5;
}
.operation-table .status-complete {
    color: #047857;
    background: linear-gradient(135deg, #dcfce7, #d1fae5);
    border-color: #bbf7d0;
}
.operation-table .table-action {
    min-width: 50px;
    min-height: 36px;
    padding: 8px 11px;
    color: var(--brand-800);
    background: linear-gradient(135deg, #f0fdfa, #ecfeff);
    border-color: #b8eee7;
    border-radius: 11px;
    box-shadow: 0 4px 10px rgba(13, 148, 136, .08);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.operation-table .table-action:hover {
    color: var(--white);
    background: linear-gradient(135deg, var(--brand-700), var(--brand-600));
    border-color: var(--brand-600);
    box-shadow: 0 8px 18px rgba(13, 148, 136, .22);
    transform: translateY(-1px);
}

.loading-state, .empty-state { min-height: 260px; padding: 38px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--slate-400); text-align: center; }
.loading-state p, .empty-state p { margin: 9px 0 0; font-size: .75rem; }
.empty-state span { width: 54px; height: 54px; display: grid; place-items: center; color: var(--slate-400); background: var(--slate-100); border-radius: 16px; }
.empty-state span svg { width: 24px; height: 24px; }
.empty-state h3 { margin: 14px 0 0; color: var(--slate-600); font-size: .95rem; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--brand-100); border-top-color: var(--brand-700); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.compact-loading { min-height: 130px; }
.pagination { min-height: 62px; padding: 12px 18px; display: flex; align-items: center; justify-content: center; gap: 6px; border-top: 1px solid var(--slate-100); }
.page-button { min-width: 36px; height: 36px; padding: 0 9px; display: inline-grid; place-items: center; color: var(--slate-500); background: var(--white); border: 1px solid var(--slate-200); border-radius: 10px; font-size: .7rem; font-weight: 700; }
.page-button:hover:not(:disabled), .page-button.is-active { color: var(--white); background: var(--brand-700); border-color: var(--brand-700); }
.pagination-label { padding: 0 8px; color: var(--slate-400); font-size: .68rem; }
.mobile-card-list { display: none; }

.legend-row { margin: -10px 0 18px; display: flex; flex-wrap: wrap; gap: 15px; color: var(--slate-500); font-size: .7rem; }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; }
.shift-p { color: var(--blue-700); background: var(--blue-100); }
.shift-s { color: #7e22ce; background: #f3e8ff; }

.assistant-calendar-panel { overflow: hidden; background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%); }
.assistant-calendar-toolbar { min-height: 82px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: linear-gradient(120deg, #f0fdfa 0%, #f6fbff 52%, #faf5ff 100%); border-bottom: 1px solid #e3edf2; }
.assistant-calendar-title { display: flex; align-items: center; gap: 13px; }
.assistant-calendar-icon { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; color: var(--white); background: linear-gradient(135deg, var(--brand-700), var(--brand-500)); border-radius: 14px; box-shadow: 0 9px 20px rgba(13, 148, 136, .2); }
.assistant-calendar-icon svg { width: 21px; height: 21px; }
.assistant-calendar-title p { margin: 0 0 2px; color: var(--slate-500); font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.assistant-calendar-title h2 { margin: 0; color: var(--navy-950); font-size: 1.05rem; letter-spacing: -.025em; text-transform: capitalize; }
.assistant-calendar-range { padding: 8px 12px; color: var(--brand-800); background: rgba(255, 255, 255, .78); border: 1px solid var(--brand-100); border-radius: 999px; font-size: .67rem; font-weight: 700; white-space: nowrap; }
.assistant-agenda { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.assistant-agenda-day { min-width: 0; padding: 13px; display: grid; grid-template-columns: 145px minmax(0, 1fr); align-items: stretch; gap: 13px; background: var(--white); border: 1px solid #e2eaf1; border-radius: 16px; box-shadow: 0 5px 16px rgba(15, 23, 42, .045); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.assistant-agenda-day:hover { border-color: #cbdde3; box-shadow: 0 10px 24px rgba(15, 23, 42, .075); transform: translateY(-1px); }
.assistant-agenda-day.is-today { border-color: #86dfd4; box-shadow: 0 10px 26px rgba(13, 148, 136, .11); }
.assistant-agenda-day.is-empty { background: rgba(255, 255, 255, .72); }
.assistant-agenda-date { min-width: 0; padding: 13px 15px; display: flex; flex-direction: column; justify-content: center; background: var(--slate-50); border: 1px solid #e7edf3; border-radius: 13px; }
.assistant-agenda-day.is-today .assistant-agenda-date { color: var(--white); background: linear-gradient(145deg, var(--brand-800), var(--brand-600)); border-color: transparent; box-shadow: 0 8px 18px rgba(13, 148, 136, .2); }
.assistant-agenda-weekday { color: var(--slate-500); font-size: .64rem; font-weight: 800; text-transform: capitalize; }
.assistant-agenda-day.is-today .assistant-agenda-weekday { color: rgba(255, 255, 255, .76); }
.assistant-agenda-date-line { margin-top: 3px; display: flex; align-items: baseline; gap: 7px; }
.assistant-agenda-date-line strong { color: var(--navy-950); font-size: 1.75rem; line-height: 1; letter-spacing: -.06em; }
.assistant-agenda-date-line span { color: var(--slate-500); font-size: .72rem; font-weight: 700; text-transform: capitalize; }
.assistant-agenda-day.is-today .assistant-agenda-date-line strong, .assistant-agenda-day.is-today .assistant-agenda-date-line span { color: var(--white); }
.today-badge { width: fit-content; margin-top: 9px; padding: 4px 8px; color: var(--brand-900); background: rgba(255, 255, 255, .9); border-radius: 999px; font-size: .56rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.assistant-shift-lanes { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.assistant-shift-lane { min-width: 0; padding: 12px; border: 1px solid; border-radius: 13px; }
.shift-lane-p { background: #f5f9ff; border-color: #dbeafe; }
.shift-lane-s { background: #fdf8ff; border-color: #f3e8ff; }
.assistant-shift-heading { display: flex; align-items: center; gap: 8px; }
.assistant-shift-heading strong { color: var(--navy-700); font-size: .7rem; }
.assistant-shift-code { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; font-size: .65rem; font-weight: 900; }
.shift-lane-p .assistant-shift-code { color: var(--blue-700); background: var(--blue-100); }
.shift-lane-s .assistant-shift-code { color: #7e22ce; background: #f3e8ff; }
.assistant-shift-people { min-height: 38px; margin-top: 9px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.assistant-person { min-width: 112px; padding: 8px 10px; display: flex; flex-direction: column; align-items: flex-start; color: var(--navy-800); background: var(--white); border: 1px solid rgba(203, 213, 225, .8); border-radius: 10px; box-shadow: var(--shadow-sm); text-align: left; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.assistant-person:hover { border-color: #5eead4; box-shadow: 0 6px 14px rgba(13, 148, 136, .1); transform: translateY(-1px); }
.assistant-person strong { max-width: 100%; overflow: hidden; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.assistant-person small { margin-top: 2px; color: var(--slate-400); font-size: .56rem; }
.assistant-shift-empty { color: var(--slate-400); font-size: .65rem; font-style: italic; }
.assistant-summary-drawer { margin: 0 16px 16px; border: 1px solid #e2eaf1; border-radius: 14px; background: rgba(255, 255, 255, .82); }
.assistant-summary-drawer summary { padding: 13px 15px; color: var(--slate-600); font-size: .7rem; font-weight: 800; cursor: pointer; }
.assistant-summary-grid { padding: 0 13px 13px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.assistant-summary-card { min-width: 0; padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; background: var(--slate-50); border: 1px solid #e6edf3; border-radius: 12px; }
.assistant-summary-card > div:first-child { min-width: 0; display: flex; flex-direction: column; }
.assistant-summary-card > div:first-child strong { overflow: hidden; color: var(--navy-800); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.assistant-summary-card small { margin-top: 2px; color: var(--slate-400); font-size: .58rem; }
.assistant-summary-totals { display: flex; flex-direction: column; align-items: flex-end; color: var(--slate-500); font-size: .62rem; }
.assistant-summary-totals strong { margin-top: 2px; color: var(--brand-800); font-size: .68rem; }

.schedule-table-wrap { max-height: calc(100vh - 250px); min-height: 300px; }
.schedule-table { width: max-content; min-width: 100%; }
.schedule-table th, .schedule-table td { min-width: 44px; padding: 11px 9px; text-align: center; }
.schedule-table th:first-child, .schedule-table td:first-child { position: sticky; left: 0; z-index: 3; min-width: 205px; text-align: left; background: var(--white); box-shadow: 8px 0 16px rgba(15, 23, 42, .04); }
.schedule-table thead th:first-child { z-index: 4; background: var(--slate-50); }
.schedule-table th:last-child, .schedule-table td:last-child { min-width: 120px; }
.schedule-name strong { display: block; color: var(--navy-800); font-size: .75rem; }
.schedule-name small { display: block; margin-top: 2px; color: var(--slate-400); font-size: .62rem; }
.shift-chip { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 8px; font-size: .66rem; font-weight: 800; }
.shift-chip.shift-empty { color: var(--slate-300); background: var(--slate-50); }

.monthly-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(340px, .7fr); gap: 20px; align-items: start; }
.monthly-editor, .monthly-list-panel { padding: 22px; }
.monthly-list-panel { position: sticky; top: 98px; }
.panel-title { margin-bottom: 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.panel-title h2 { margin: 0; color: var(--navy-950); font-size: 1.05rem; letter-spacing: -.025em; }
.panel-title p { margin: 5px 0 0; color: var(--slate-400); font-size: .68rem; }
.monthly-live-summary, .schedule-live-summary { margin: 18px 0; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: linear-gradient(135deg, var(--brand-50), #ecfeff); border: 1px solid var(--brand-100); border-radius: 14px; }
.monthly-live-summary > div { display: flex; flex-direction: column; }
.monthly-live-summary small { color: var(--slate-500); font-size: .65rem; }
.monthly-live-summary strong, .schedule-live-summary strong { color: var(--brand-800); font-size: 1.02rem; }
.schedule-live-summary span { color: var(--slate-600); font-size: .75rem; font-weight: 700; }
.day-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; }
.day-field { min-width: 0; padding: 9px; display: flex; flex-direction: column; gap: 6px; background: var(--slate-50); border: 1px solid var(--slate-200); border-radius: 11px; }
.day-field label { display: flex; align-items: center; justify-content: space-between; color: var(--slate-500); font-size: .6rem; font-weight: 700; }
.day-field label strong { color: var(--navy-800); font-size: .72rem; }
.day-field select { width: 100%; height: 34px; padding: 4px; color: var(--navy-700); background: var(--white); border: 1px solid var(--slate-200); border-radius: 8px; outline: none; font-size: .66rem; font-weight: 800; text-align: center; }
.day-field.has-shift-p { background: #eff6ff; border-color: #bfdbfe; }
.day-field.has-shift-s { background: #faf5ff; border-color: #e9d5ff; }
.monthly-record-list { display: flex; flex-direction: column; gap: 10px; }
.monthly-record { padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--slate-200); border-radius: 13px; transition: border-color .18s ease, transform .18s ease; }
.monthly-record:hover { border-color: #99f6e4; transform: translateY(-1px); }
.monthly-record h3 { margin: 0; color: var(--navy-800); font-size: .78rem; }
.monthly-record p { margin: 4px 0 0; color: var(--slate-400); font-size: .65rem; }
.monthly-record-stats { margin-top: 8px; display: flex; gap: 10px; color: var(--slate-500); font-size: .65rem; }
.monthly-record-stats strong { color: var(--brand-800); }
.month-filter { max-width: 170px; }

.optional-fields { margin-top: 4px; padding: 12px 14px; background: var(--slate-50); border: 1px solid var(--slate-200); border-radius: 12px; }
.optional-fields summary { color: var(--slate-600); font-size: .75rem; font-weight: 700; cursor: pointer; }
.optional-fields .form-row { margin: 14px 0 0; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 21, 36, .62); backdrop-filter: blur(7px); }
.modal-panel { position: relative; z-index: 1; width: min(650px, 100%); max-height: calc(100vh - 44px); padding: 24px; overflow-y: auto; background: var(--white); border-radius: 22px; box-shadow: var(--shadow-lg); animation: modal-in .2s ease both; }
.modal-large { width: min(920px, 100%); }
.modal-small { width: min(480px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { margin-bottom: 22px; padding-bottom: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--slate-100); }
.modal-header h2 { margin: 0; color: var(--navy-950); font-size: 1.22rem; letter-spacing: -.03em; }
.modal-actions { padding-top: 16px; border-top: 1px solid var(--slate-100); }
body.modal-open { overflow: hidden; }

.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 150; width: min(390px, calc(100% - 44px)); display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast { padding: 13px 15px; display: flex; align-items: flex-start; gap: 10px; color: var(--navy-800); background: var(--white); border: 1px solid var(--slate-200); border-left: 4px solid var(--brand-600); border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .75rem; line-height: 1.55; animation: toast-in .22s ease both; pointer-events: auto; }
.toast.toast-error { border-left-color: #ef4444; }
.toast.toast-success { border-left-color: #22c55e; }
.toast strong { display: block; margin-bottom: 2px; }
.toast p { margin: 0; color: var(--slate-500); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1180px) {
    .topbar { grid-template-columns: auto 1fr auto; }
    .main-nav { justify-self: center; }
    .nav-button span { display: none; }
    .nav-button { padding: 10px 12px; }
    .filter-bar { grid-template-columns: minmax(240px, 1fr) repeat(3, 140px); }
    .filter-bar > .btn { grid-column: -2 / -1; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .monthly-layout { grid-template-columns: 1fr; }
    .monthly-list-panel { position: static; }
}

@media (max-width: 780px) {
    body { overflow-x: hidden; }
    .topbar { position: static; padding: 12px 16px; grid-template-columns: 1fr auto; gap: 10px; }
    .main-nav { grid-column: 1 / -1; grid-row: 2; width: 100%; overflow-x: auto; justify-content: stretch; }
    .nav-button { flex: 1; justify-content: center; padding: 9px; }
    .nav-button span { display: inline; }
    .user-copy { display: none; }
    .main-content { width: min(100% - 24px, 1500px); padding-top: 24px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .heading-actions { width: 100%; }
    .heading-actions .btn { flex: 1; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { min-height: 118px; padding: 15px; gap: 10px; }
    .stat-icon { width: 39px; height: 39px; border-radius: 12px; }
    .stat-card strong { font-size: 1.4rem; }
    .filter-bar { grid-template-columns: 1fr 1fr; padding: 14px; }
    .filter-bar .search-field { grid-column: 1 / -1; }
    .filter-bar > .btn { grid-column: auto; }
    #operationTableWrap { display: none !important; }
    #operationCardList:not([hidden]) { display: flex !important; flex-direction: column; gap: 12px; padding: 12px; }
    .assistant-cards { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 12px; }
    .operation-ledger { border-radius: 18px; }
    .operation-ledger .panel-meta { padding-inline: 15px; }
    .operation-card {
        position: relative;
        width: 100%;
        min-width: 0;
        padding: 18px;
        overflow: hidden;
        background: linear-gradient(150deg, #ffffff 0%, #fbfdff 100%);
        border: 1px solid #e2eaf1;
        border-radius: 17px;
        box-shadow: 0 9px 24px rgba(15, 23, 42, .075);
    }
    .operation-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #f59e0b; }
    .operation-card.is-complete::before { background: #10b981; }
    .operation-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
    .operation-card-date-copy { min-width: 0; }
    .operation-card-label { display: block; margin-bottom: 4px; color: #8ca0bb; font-size: .59rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
    .operation-card .operation-date { display: block; margin: 0; padding: 0; color: #172033; background: transparent; font-size: .78rem; font-weight: 800; line-height: 1.5; }
    .operation-card .operation-code { display: block; margin: 3px 0 0; color: var(--slate-400); font-size: .62rem; }
    .operation-card .status-badge { flex: 0 0 auto; padding: 6px 9px; font-size: .59rem; }
    .operation-card-patient { margin-top: 14px; padding: 13px 14px; background: linear-gradient(135deg, var(--brand-50), #f2fbff); border: 1px solid #d8f3ef; border-radius: 13px; }
    .operation-card h3 { margin: 0; color: var(--navy-950); font-size: .88rem; line-height: 1.45; overflow-wrap: anywhere; }
    .operation-card-patient p { margin: 4px 0 0; color: #7890ad; font-size: .66rem; line-height: 1.5; overflow-wrap: anywhere; }
    .operation-card-grid { margin: 13px 0 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px; }
    .operation-card-grid > div { min-width: 0; padding: 10px 11px; background: var(--slate-50); border: 1px solid #e8eef4; border-radius: 11px; }
    .operation-card-grid > .is-wide { grid-column: 1 / -1; }
    .operation-card dt { color: #8ca0bb; font-size: .57rem; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
    .operation-card dd { margin: 4px 0 0; color: var(--navy-700); font-size: .69rem; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
    .operation-card-foot { margin-top: 14px; padding-top: 13px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--slate-100); }
    .operation-card-links { min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
    .operation-card .table-action { margin-left: auto; min-height: 38px; padding-inline: 13px; }
    .assistant-calendar-toolbar { padding: 15px; align-items: flex-start; flex-direction: column; gap: 11px; }
    .assistant-calendar-range { white-space: normal; }
    .assistant-agenda { padding: 12px; gap: 11px; }
    .assistant-agenda-day { padding: 13px; grid-template-columns: 1fr; gap: 11px; border-radius: 15px; }
    .assistant-agenda-date { padding: 11px 13px; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px 12px; }
    .assistant-agenda-weekday { min-width: 68px; }
    .assistant-agenda-date-line { margin: 0; }
    .assistant-agenda-date-line strong { font-size: 1.45rem; }
    .today-badge { margin: 0 0 0 auto; }
    .assistant-shift-lanes { grid-template-columns: 1fr; }
    .assistant-person { flex: 1 1 120px; }
    .assistant-summary-drawer { margin: 0 12px 12px; }
    .assistant-summary-grid { grid-template-columns: 1fr; }
    .assistant-cards { display: grid; }
    .assistant-card { padding: 15px; border: 1px solid var(--slate-200); border-radius: 14px; }
    .assistant-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
    .assistant-card h3 { margin: 0; font-size: .82rem; }
    .assistant-card p { margin: 3px 0 0; color: var(--slate-400); font-size: .65rem; }
    .assistant-shift-list { margin: 12px 0; display: flex; flex-wrap: wrap; gap: 6px; }
    .assistant-shift-list span { padding: 5px 7px; color: #7e22ce; background: #faf5ff; border-radius: 8px; font-size: .63rem; font-weight: 700; }
    .assistant-card-foot { display: flex; align-items: center; justify-content: space-between; color: var(--slate-500); font-size: .66rem; }
    .schedule-table-wrap { display: none; }
    .form-row.two-cols, .form-row.three-cols { grid-template-columns: 1fr; }
    .day-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .modal { padding: 10px; }
    .modal-panel { max-height: calc(100vh - 20px); padding: 18px; border-radius: 18px; }
}

@media (max-width: 480px) {
    .brand small { display: none; }
    .nav-button { font-size: .64rem; gap: 5px; }
    .nav-button svg { width: 15px; height: 15px; }
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { min-height: 100px; }
    .filter-bar { grid-template-columns: 1fr; }
    .filter-bar .search-field { grid-column: auto; }
    .heading-actions { flex-direction: column-reverse; }
    .operation-card-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .day-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .monthly-editor, .monthly-list-panel { padding: 16px; }
    .auth-card { padding: 28px 22px; }
}

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