:root{
    --zen-primary:#20b7a6;
    --zen-primary-dark:#139484;
    --zen-soft:#eefbf9;
    --zen-dark:#1f2937;
    --zen-muted:#6b7280;
    --zen-border:#e5e7eb;
}
*{box-sizing:border-box}
body{background:#f5f7fb;color:#1f2937;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
a{text-decoration:none}
.app-shell{display:flex;min-height:100vh}
.sidebar{width:278px;background:linear-gradient(180deg,#139484,#20b7a6);color:#fff;position:fixed;top:0;bottom:0;left:0;padding:22px;display:flex;flex-direction:column;z-index:10}
.brand-box{display:flex;gap:12px;align-items:center;margin-bottom:26px}
.brand-logo{width:46px;height:46px;border-radius:16px;background:#fff;color:var(--zen-primary);display:grid;place-items:center;font-weight:800;font-size:24px;box-shadow:0 12px 24px rgba(0,0,0,.12)}
.brand-title{font-weight:800;font-size:20px;line-height:1}.brand-box small{opacity:.9}
.sidebar-menu{gap:6px;overflow-y:auto;padding-right:4px}
.sidebar .nav-link{color:rgba(255,255,255,.86);border-radius:14px;padding:12px 14px;display:flex;align-items:center;gap:11px;font-weight:600}
.sidebar .nav-link:hover,.sidebar .nav-link.active{background:rgba(255,255,255,.18);color:#fff}
.sidebar-footer{margin-top:auto;background:rgba(255,255,255,.12);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:2px}
.main-content{margin-left:278px;width:calc(100% - 278px);padding:28px}
.topbar{background:#fff;border:1px solid var(--zen-border);border-radius:22px;padding:22px 24px;margin-bottom:20px;box-shadow:0 8px 26px rgba(31,41,55,.05)}
.page-heading{font-size:26px;margin:0;font-weight:800;color:#111827}.card{border:1px solid var(--zen-border);border-radius:20px;box-shadow:0 8px 26px rgba(31,41,55,.05)}
.card-header{background:#fff;border-bottom:1px solid var(--zen-border);border-radius:20px 20px 0 0!important;font-weight:800}
.stat-card{padding:22px;border-radius:20px;background:#fff;border:1px solid var(--zen-border);height:100%}.stat-card .icon{width:46px;height:46px;border-radius:15px;background:var(--zen-soft);display:grid;place-items:center;color:var(--zen-primary);font-size:22px;margin-bottom:14px}.stat-card .value{font-size:28px;font-weight:900}.stat-card .label{color:var(--zen-muted);font-weight:600}
.btn-zen{background:var(--zen-primary);border-color:var(--zen-primary);color:#fff}.btn-zen:hover{background:var(--zen-primary-dark);border-color:var(--zen-primary-dark);color:#fff}
.table{vertical-align:middle}.table thead th{font-size:13px;text-transform:uppercase;color:#6b7280;background:#f9fafb}.action-buttons{display:flex;gap:6px;flex-wrap:wrap}.form-label{font-weight:700}.required:after{content:' *';color:#dc3545}
.login-page{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#e8fffb,#f7fbff)}.login-card{max-width:420px;width:100%;border-radius:28px;background:#fff;padding:34px;box-shadow:0 22px 60px rgba(31,41,55,.12);border:1px solid var(--zen-border)}
.invoice-box{background:#fff;border:1px solid var(--zen-border);border-radius:20px;padding:26px}.print-only{display:none}
@media(max-width: 992px){.sidebar{position:relative;width:100%;height:auto}.app-shell{display:block}.main-content{margin-left:0;width:100%;padding:16px}.sidebar-footer{display:none}}
@media print{.sidebar,.topbar,.no-print,.btn,.alert{display:none!important}.main-content{margin:0;width:100%;padding:0}.invoice-box{border:0}.print-only{display:block}}

.select2-container--bootstrap-5 .select2-selection{border-radius:.375rem;min-height:38px;border-color:#dee2e6}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered{padding-top:2px}
.select2-container--bootstrap-5 .select2-dropdown{border-color:#dee2e6;box-shadow:0 12px 34px rgba(31,41,55,.14)}
.select2-container--bootstrap-5 .select2-search__field{border-radius:10px}
.select2-results__option{font-size:14px}


/* =========================================================
   Sidebar refinement: vertical scroll only, no horizontal drag
   ========================================================= */
.sidebar{height:100vh;overflow:hidden}
.brand-box{flex-shrink:0;min-width:0}
.brand-text{min-width:0;overflow:hidden}
.brand-title,.brand-box small{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.brand-logo{flex:0 0 46px;overflow:hidden}
.brand-logo-img{width:100%;height:100%;display:block;object-fit:contain;border-radius:inherit}
.brand-logo-text{line-height:1}
.sidebar-menu{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding-right:6px;margin-right:-6px}
.sidebar-menu::-webkit-scrollbar{width:6px}
.sidebar-menu::-webkit-scrollbar-track{background:rgba(255,255,255,.08);border-radius:999px}
.sidebar-menu::-webkit-scrollbar-thumb{background:rgba(255,255,255,.42);border-radius:999px}
.sidebar .nav-link{width:100%;min-width:0}
.sidebar .nav-link i{flex:0 0 auto}
.sidebar .nav-link span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:normal;line-height:1.22}
.sidebar-footer{flex-shrink:0;overflow:hidden}
.sidebar-footer strong{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width: 992px){.sidebar{height:auto;max-height:none;overflow:visible}.sidebar-menu{max-height:none;overflow:visible;margin-right:0;padding-right:0}}

/* =========================================================
   FIX SIDEBAR: all menus restored, vertical scroll only
   ========================================================= */
html,body{overflow-x:hidden}
.app-shell{min-width:0;overflow-x:hidden}
.sidebar{
    width:278px;
    height:100vh;
    overflow:hidden!important;
    padding:18px 16px;
}
.brand-box{
    flex:0 0 auto;
    min-width:0;
    margin-bottom:16px;
}
.sidebar-menu{
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    padding-right:6px;
    margin-right:-6px;
    display:flex;
    flex-direction:column;
    gap:14px;
}
.sidebar-menu::-webkit-scrollbar{width:7px;height:0}
.sidebar-menu::-webkit-scrollbar-track{background:rgba(255,255,255,.08);border-radius:999px}
.sidebar-menu::-webkit-scrollbar-thumb{background:rgba(255,255,255,.45);border-radius:999px}
.sidebar-menu::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.65)}
.sidebar-section{min-width:0;display:flex;flex-direction:column;gap:5px}
.sidebar-section-title{
    padding:2px 12px 4px;
    font-size:10px;
    letter-spacing:.08em;
    text-transform:uppercase;
    font-weight:800;
    color:rgba(255,255,255,.62);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.sidebar-link{
    width:100%;
    min-width:0;
    color:rgba(255,255,255,.9);
    border-radius:13px;
    padding:10px 12px;
    display:flex;
    align-items:center;
    gap:10px;
    font-weight:650;
    line-height:1.18;
    overflow:hidden;
}
.sidebar-link:hover,.sidebar-link.active{background:rgba(255,255,255,.18);color:#fff}
.sidebar-link i{flex:0 0 20px;text-align:center;font-size:16px}
.sidebar-link span{
    flex:1 1 auto;
    min-width:0;
    white-space:normal;
    overflow-wrap:anywhere;
    word-break:normal;
}
.sidebar .nav-link{display:none!important}
.sidebar-footer{flex:0 0 auto;margin-top:14px;min-width:0}
@media(max-width: 992px){
    .sidebar{width:100%;height:auto;max-height:none;overflow:visible!important;padding:16px}
    .sidebar-menu{overflow:visible!important;margin-right:0;padding-right:0;gap:12px}
    .sidebar-footer{display:flex}
}

/* =========================================================
   Therapist Mobile Video App
========================================================= */
.therapist-page{
    min-height:100vh;
    background:linear-gradient(180deg,#e9faf8 0%,#f8fbff 50%,#ffffff 100%);
    color:#25313b;
}
.therapist-login-wrap{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:22px;
}
.therapist-card{
    background:#fff;
    border:1px solid rgba(15,90,91,.08);
    border-radius:24px;
    box-shadow:0 18px 50px rgba(33,96,102,.10);
    padding:18px;
}
.login-card-mobile{
    width:100%;
    max-width:430px;
}
.therapist-topbar{
    position:sticky;
    top:0;
    z-index:20;
    min-height:70px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:12px 16px;
    background:linear-gradient(135deg,#50b8b4,#78d1a7);
    color:#fff;
    box-shadow:0 10px 30px rgba(38,128,122,.25);
}
.therapist-topbar .brand-logo{
    width:44px;
    height:44px;
    min-width:44px;
    background:#fff;
    border-radius:14px;
    padding:6px;
}
.therapist-topbar .brand-logo-img{
    max-width:100%;
    max-height:100%;
    object-fit:contain;
}
.therapist-container{
    width:100%;
    max-width:760px;
    margin:0 auto;
    padding:16px;
}
.patient-session-card{
    border-left:6px solid #50b8b4;
}
.session-time{
    display:inline-flex;
    align-items:center;
    padding:4px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
    background:#e8f7f6;
    color:#257b79;
    margin-bottom:8px;
}
.record-preview-wrap{
    position:relative;
    width:100%;
    aspect-ratio:9/16;
    background:#102326;
    border-radius:24px;
    overflow:hidden;
    max-height:70vh;
}
.record-preview{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
    background:#102326;
}
.record-timer{
    position:absolute;
    top:14px;
    right:14px;
    background:rgba(0,0,0,.62);
    color:#fff;
    border-radius:999px;
    padding:7px 12px;
    font-weight:800;
    letter-spacing:.04em;
}
.recorder-card .btn-lg{
    border-radius:16px;
    font-weight:800;
}
@media (min-width:768px){
    .record-preview-wrap{
        max-width:430px;
        margin:0 auto;
    }
}

/* =========================================================
   Weekly therapy schedule table, Excel-like view
========================================================= */
.weekly-toolbar .form-label{font-size:13px;margin-bottom:4px}
.weekly-board{
    display:flex;
    flex-direction:column;
    min-height:calc(100vh - 190px);
}
.weekly-board .card-header{
    flex:0 0 auto;
}
.weekly-board .card-body{
    flex:1 1 auto;
    min-height:0;
}
.weekly-board:fullscreen{
    width:100vw;
    height:100vh;
    max-width:none;
    max-height:none;
    border-radius:0;
    background:#f5f7fb;
    padding:14px;
    overflow:hidden;
}
.weekly-board:fullscreen .card-header{
    border-radius:14px 14px 0 0;
}
.weekly-board:fullscreen .card-body{
    height:auto;
    flex:1 1 auto;
    min-height:0;
}
.weekly-board:fullscreen .weekly-calendar-scroll{
    height:100%;
    min-height:0;
    max-height:none;
    border-radius:0 0 14px 14px;
}
.weekly-calendar-scroll{
    width:100%;
    overflow:auto;
    height:calc(100vh - 245px);
    min-height:620px;
    max-height:none;
    background:#fff;
    border-radius:0 0 20px 20px;
}
.weekly-calendar-table{
    --weekly-zoom:1;
    width:100%;
    min-width:1380px;
    border-collapse:separate;
    border-spacing:0;
    font-size:calc(12.5px * var(--weekly-zoom));
}
.weekly-calendar-table th,
.weekly-calendar-table td{
    border-right:1px solid #dbe4ee;
    border-bottom:1px solid #dbe4ee;
    vertical-align:top;
}
.weekly-calendar-table thead th{
    position:sticky;
    top:0;
    z-index:4;
    background:#0f766e;
    color:#fff;
    text-align:center;
    font-weight:800;
    padding:calc(10px * var(--weekly-zoom));
    white-space:nowrap;
}
.weekly-calendar-table .weekly-title-row th{
    top:0;
    background:#0b5f59;
    font-size:calc(18px * var(--weekly-zoom));
    letter-spacing:.08em;
    padding:calc(13px * var(--weekly-zoom));
}
.weekly-calendar-table thead tr:nth-child(2) th{top:calc(52px * var(--weekly-zoom))}
.weekly-calendar-table .day-col{width:110px;min-width:110px}
.weekly-calendar-table .time-col{width:82px;min-width:82px}
.weekly-calendar-table .room-col{min-width:142px}
.weekly-calendar-table .day-cell{
    position:sticky;
    left:0;
    z-index:3;
    background:#e8fbf8;
    color:#064e48;
    text-align:center;
    font-weight:800;
    padding:calc(12px * var(--weekly-zoom));
    border-left:1px solid #dbe4ee;
}
.weekly-calendar-table .day-cell span{display:block;font-size:.86em;color:#46615d;margin-top:4px}
.weekly-calendar-table .time-cell{
    position:sticky;
    left:110px;
    z-index:2;
    background:#f8fafc;
    color:#475569;
    text-align:center;
    font-weight:800;
    padding:calc(12px * var(--weekly-zoom)) calc(8px * var(--weekly-zoom));
}
.weekly-calendar-table thead .sticky-col{z-index:5}
.weekly-calendar-table .schedule-cell{
    height:calc(92px * var(--weekly-zoom));
    padding:calc(6px * var(--weekly-zoom));
    background:#fff;
}
.weekly-calendar-table .today-row .schedule-cell{background:#fffdf5}
.weekly-calendar-table .today-row .time-cell{background:#fff7db}
.weekly-calendar-table .empty-slot{
    display:flex;
    min-height:calc(70px * var(--weekly-zoom));
    align-items:center;
    justify-content:center;
    color:#cbd5e1;
    font-weight:700;
}
.weekly-schedule-card{
    display:block;
    padding:calc(7px * var(--weekly-zoom)) calc(8px * var(--weekly-zoom));
    margin-bottom:calc(6px * var(--weekly-zoom));
    border-radius:calc(11px * var(--weekly-zoom));
    border:1px solid #ccefe9;
    background:#effdf9;
    color:#14332f;
    box-shadow:0 3px 8px rgba(15,118,110,.08);
}
.weekly-schedule-card:hover{color:#0f766e;transform:translateY(-1px)}
.weekly-schedule-card .patient-name{display:block;font-weight:900;line-height:1.18}
.weekly-schedule-card .schedule-meta{display:block;font-size:.84em;color:#52666c;line-height:1.25;margin-top:2px}
.weekly-schedule-card .schedule-status{display:inline-block;margin-top:5px;font-size:.76em;font-weight:800;border-radius:999px;padding:2px 7px;background:rgba(255,255,255,.75);color:#0f766e}
.weekly-schedule-card.status-hadir{background:#ecfdf3;border-color:#bbf7d0}
.weekly-schedule-card.status-izin{background:#fff8e6;border-color:#fde68a}
.weekly-schedule-card.status-tidak_hadir{background:#fef2f2;border-color:#fecaca}
.weekly-schedule-card.status-selesai{background:#eef6ff;border-color:#bfdbfe}
.weekly-schedule-card.status-batal,.weekly-schedule-card.status-reschedule{background:#f8fafc;border-color:#cbd5e1;color:#64748b}
.weekly-room-summary .badge{font-weight:700;color:#475569!important}
@media(max-width: 992px){
    .weekly-board{min-height:calc(100vh - 150px)}
    .weekly-calendar-scroll{height:72vh;min-height:520px;max-height:none}
    .weekly-calendar-table{min-width:1180px}
}
@media(max-width: 576px){
    .weekly-calendar-scroll{height:74vh;min-height:500px}
    .weekly-board:fullscreen{padding:8px}
}
@media print{
    .weekly-calendar-scroll{max-height:none;overflow:visible}
    .weekly-calendar-table{min-width:0;font-size:9px}
    .weekly-calendar-table .schedule-cell{height:auto;min-height:55px}
    .weekly-schedule-card{box-shadow:none;break-inside:avoid}
}
