:root {
    --navy: #0f2d5e;
    --navy-mid: #163a78;
    --navy-light: #1e4d9a;
    --blue-accent: #2563eb;
    --blue-soft: #dbeafe;
    --blue-border: #bfdbfe;
    --purple-accent: #7c3aed;
    --purple-soft: #ede9fe;
    --white: #ffffff;
    --surface: #f8fafc;
    --surface-2: #f1f5f9;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --sidebar-w: 248px;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --info: #0284c7;
    --info-bg: #e0f2fe;
    --radius: 8px;
    --radius-lg: 12px;
    --bs-border-radius: var(--radius);
    --bs-border-radius-lg: var(--radius-lg);
    --bs-border-radius-sm: 6px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family:
        "Plus Jakarta Sans",
        system-ui,
        -apple-system,
        sans-serif;
    font-size: 14px;
    background: var(--surface);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   APP WRAP
   ========================================= */
.app-wrap {
    min-height: 100vh;
}

/* =========================================
   SIDEBAR
   ========================================= */
.sidebar {
    width: var(--sidebar-w);
    background: var(--navy);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.25s ease;
}

@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0);
    }
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.sidebar-brand {
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar-brand .brand-icon {
    width: 34px;
    height: 34px;
    background: var(--blue-accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
}

.sidebar-brand .brand-sub {
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    font-weight: 400;
}

.sidebar-close {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 1;
}
.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

/* ── Nav ── */
.sidebar-nav {
    flex: 1;
    padding: 8px 6px;
}

.sidebar-section {
    padding: 14px 12px 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.07em;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    position: relative;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.65);
    border-radius: 6px;
    margin: 1px 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 13.5px;
    transition:
        background 0.15s,
        color 0.15s;
}

.menu-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.menu-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.menu-link .nav-chevron {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s;
}

.menu-link.expanded .nav-chevron {
    transform: rotate(90deg);
}

.menu-item.active > .menu-link {
    background: var(--blue-accent);
    color: #fff;
}

.menu-item .nav-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.75);
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 20px;
}

.menu-item.active .nav-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Sub-nav */
.sub-nav {
    display: none;
    padding: 0 6px;
}

.sub-nav.open {
    display: block;
}

.sub-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 34px;
    color: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition:
        background 0.15s,
        color 0.15s;
    font-size: 13px;
}

.sub-nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
}

.sub-nav-link.active {
    color: #93c5fd;
}

.sub-nav-link::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* ── Sidebar footer / user card ── */
.sidebar-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}

.user-card:hover {
    background: rgba(255, 255, 255, 0.07);
}

.user-avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--blue-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-name-sm {
    color: #fff;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.2;
}

.user-role-sm {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
}

.user-card .logout-icon {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.35);
    font-size: 15px;
}

/* =========================================
   MAIN WRAP
   ========================================= */
.main-wrap {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.main-wrap.collapsed {
    margin-left: 0;
}

/* =========================================
   TOPBAR
   ========================================= */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 71px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.topbar-toggler {
    display: block;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
}

.topbar-info {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-info strong {
    color: var(--text-primary);
}

.topbar-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.topbar-breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 4px;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-cabang .form-select {
    height: 32px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 28px 0 10px;
    background-color: var(--white);
    background-position: right 8px center;
    background-size: 12px;
    min-width: 160px;
}

.topbar-cabang .form-select:focus {
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    transition:
        background 0.15s,
        border-color 0.15s;
    position: relative;
}

.btn-icon:hover {
    background: var(--surface-2);
    border-color: var(--border-dark);
}

.notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
    border: 1.5px solid white;
}

/* Notification dropdown */
.notif-dropdown {
    width: 320px;
    padding: 0;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-lg);
}

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 13px;
}

.btn-notif-read {
    background: none;
    border: none;
    color: var(--blue-accent);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
}

.notif-list {
    max-height: 320px;
    overflow-y: auto;
}

.notif-item {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.notif-item:hover {
    background: var(--surface);
}

.notif-item.unread {
    background: var(--blue-soft);
}

.notif-text {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.notif-time {
    font-size: 11.5px;
    color: var(--text-muted);
}

.notif-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* User topbar button */
.topbar-user .btn-user {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: background 0.15s;
}

.topbar-user .btn-user:hover {
    background: var(--surface-2);
}

/* =========================================
   CONTENT
   ========================================= */
.content {
    padding: 24px;
    flex: 1;
}

/* =========================================
   AUTH PAGE
   ========================================= */
.auth-page {
    background: #f1f5f9;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-container {
    display: flex;
    max-width: 960px;
    width: 100%;
    background: #fff;
    border-radius: 20px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    min-height: 560px;
}

.auth-left {
    flex: 1.2;
    background: var(--navy);
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-left-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}

.auth-left-brand-icon {
    width: 40px;
    height: 40px;
    background: var(--blue-accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
}

.auth-left-brand-text {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

.auth-left h2 {
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.auth-left-features {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-left-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
}

.auth-left-feature i {
    color: var(--blue-accent);
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.auth-right {
    flex: 1;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-right-header {
    margin-bottom: 28px;
}

.auth-right-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.auth-right-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-field {
    margin-bottom: 18px;
}

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap > i:first-child {
    position: absolute;
    left: 12px;
    font-size: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.auth-input {
    width: 100%;
    height: 44px;
    padding: 0 38px 0 38px;
    font-size: 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    color: var(--text-primary);
    outline: none;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.auth-input:focus {
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-input.is-invalid {
    border-color: var(--danger);
}

.auth-pw-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    padding: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    z-index: 1;
}

.auth-pw-toggle:hover {
    color: var(--text-primary);
}

.auth-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--blue-accent);
    cursor: pointer;
}

.auth-remember label {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.auth-forgot {
    font-size: 13px;
    color: var(--blue-accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-forgot:hover {
    text-decoration: underline;
}

.auth-btn {
    width: 100%;
    height: 44px;
    background: var(--blue-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-btn:hover {
    background: #1d4ed8;
}

.auth-btn:active {
    transform: scale(0.98);
}

@media (max-width: 768px) {
    .auth-page {
        padding: 0;
        align-items: flex-start;
    }
    .auth-container {
        flex-direction: column;
        border-radius: 0;
        min-height: auto;
        box-shadow: none;
    }
    .auth-left {
        padding: 32px 24px;
    }
    .auth-left-features {
        margin-top: 16px;
    }
    .auth-right {
        padding: 32px 24px;
    }
}

/* =========================================
   STAT CARDS
   ========================================= */
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-body {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 3px;
}

.stat-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* =========================================
   CARDS
   ========================================= */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header-custom {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-weight: 600;
    font-size: 13.5px;
}

.card-header-custom .header-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.card-body-custom {
    padding: 18px;
}

/* =========================================
   TABLES
   ========================================= */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-custom thead tr {
    border-bottom: 1.5px solid var(--border);
}

.table-custom th {
    padding: 9px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 11.5px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.table-custom tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.table-custom tbody tr:last-child {
    border-bottom: none;
}

.table-custom tbody tr:hover {
    background: var(--surface);
}

.table-custom td {
    padding: 10px 14px;
    vertical-align: middle;
}

/* =========================================
   BADGES
   ========================================= */
.badge-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    display: inline-block;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-navy {
    background: var(--blue-soft);
    color: var(--navy-light);
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius);
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn-outline-custom {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0 12px;
    height: 32px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none;
}

.btn-outline-custom:hover {
    background: var(--surface-2);
    border-color: var(--border-dark);
    color: var(--text-primary);
}

.btn-sm-action {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
    text-decoration: none;
}

.btn-sm-action:hover {
    background: var(--surface-2);
    border-color: var(--border-dark);
    color: var(--text-primary);
}

.btn-sm-action.danger:hover {
    background: var(--danger-bg);
    border-color: #fca5a5;
    color: var(--danger);
}

/* =========================================
   FORMS
   ========================================= */
.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: block;
}

.form-control,
.form-select {
    height: 34px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 10px;
    background: var(--white);
    color: var(--text-primary);
    outline: none;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    height: auto;
    padding: 8px 10px;
}

/* =========================================
   PAGE HEADER
   ========================================= */
.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text-primary);
}

.page-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* =========================================
   TOOLBAR FILTER
   ========================================= */
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.toolbar .form-control,
.toolbar .form-select {
    width: auto;
    min-width: 140px;
}

/* =========================================
   ROOM MONITORING
   ========================================= */
.room-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
}

.room-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.room-name {
    font-weight: 600;
    font-size: 13.5px;
}

.room-capacity {
    font-size: 11.5px;
    color: var(--text-muted);
}

.room-progress {
    height: 5px;
    background: var(--surface-2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.room-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.room-students {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.room-student {
    font-size: 11.5px;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 8px;
}

/* =========================================
   CABANG PILL
   ========================================= */
.cabang-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--blue-soft);
    color: var(--navy-light);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
}

/* =========================================
   PAGINATION
   ========================================= */
.pagination {
    margin-top: 16px;
}

.page-link {
    color: var(--text-primary);
    border-color: var(--border);
    font-size: 13px;
    padding: 6px 12px;
}

.page-item.active .page-link {
    background: var(--blue-accent);
    border-color: var(--blue-accent);
}

/* =========================================
   SIDEBAR OVERLAY (mobile)
   ========================================= */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1035;
}

.sidebar-overlay.show {
    display: block;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .sidebar-close {
        display: block;
    }

    .main-wrap {
        margin-left: 0;
    }

    .topbar-toggler {
        display: block;
    }
}

@media (max-width: 575.98px) {
    .topbar {
        padding: 0 12px;
    }

    .topbar-cabang .form-select {
        min-width: 0;
        width: 120px;
    }

    .content {
        padding: 16px 12px;
    }

    .stat-card {
        padding: 12px 14px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-icon {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }

    .notif-dropdown {
        width: 280px;
    }

    /* Form elements full-width on mobile */
    .toolbar .form-control,
    .toolbar .form-select,
    .form-select-sm2,
    .form-control-sm2 {
        width: 100% !important;
        min-width: 0;
    }
    form .btn-primary-custom,
    form .btn-outline-custom {
        width: 100%;
    }
    .toolbar .reset-link,
    .reset-link {
        margin-left: 0;
    }
}

/* =========================================
   CUSTOM FORM CONTROLS (compact)
   ========================================= */
.form-control-sm2,
.form-select-sm2 {
    height: 32px;
    line-height: 32px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 10px;
    background: var(--white);
    color: var(--text-primary);
    outline: none;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.form-control-sm2:focus,
.form-select-sm2:focus {
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-select-sm2 {
    padding-right: 28px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}
.form-select-sm2[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
}
@supports (-moz-appearance: none) {
    .form-select-sm2[type="date"] {
        background-image: none !important;
        padding-right: 10px;
    }
}
.card-header-custom .input-date-header {
    font-size: 12px;
    padding: 3px 8px;
    max-width: 170px;
}

.form-control-full {
    width: 100%;
    height: 34px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 10px;
    background: var(--white);
    color: var(--text-primary);
    outline: none;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
    font-family: inherit;
}
.form-control-full:focus {
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
select.form-control-full {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 28px;
}
textarea.form-control-full {
    height: auto;
    padding: 8px 10px;
}

.form-label-sm {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: block;
}

/* =========================================
   CUSTOM BUTTONS
   ========================================= */
.btn-primary-custom {
    background: var(--blue-accent);
    color: #fff;
    border: none;
    padding: 0 14px;
    height: 32px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
    text-decoration: none;
}
.btn-primary-custom:hover {
    background: #1d4ed8;
    color: #fff;
}

/* =========================================
   STUDENT CHIP
   ========================================= */
.student-chip {
    display: inline-block;
    background: var(--blue-soft);
    color: var(--navy-light);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11.5px;
    font-weight: 500;
    margin: 2px 2px 2px 0;
    white-space: nowrap;
}

/* =========================================
   SCHEDULE GRID
   ========================================= */
.schedule-grid {
    display: grid;
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.schedule-cell {
    background: var(--white);
    padding: 8px 10px;
    font-size: 12px;
    min-height: 64px;
}
.schedule-cell.header {
    background: var(--surface);
    font-weight: 600;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-height: auto;
    display: flex;
    align-items: center;
}

/* =========================================
   INVOICE PREVIEW
   ========================================= */
.invoice-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.invoice-header {
    background: var(--navy);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.invoice-body {
    padding: 20px;
}
.invoice-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.invoice-row:last-child {
    border-bottom: none;
}
.invoice-row .label {
    color: var(--text-secondary);
}
.invoice-total {
    background: var(--blue-soft);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}
.invoice-total .label {
    font-weight: 600;
    font-size: 13px;
    color: var(--navy-light);
}
.invoice-total .amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
}

/* =========================================
   CALISTUNG LEVEL TRACK
   ========================================= */
.level-track {
    display: flex;
    align-items: center;
}
.level-step {
    flex: 1;
    text-align: center;
    position: relative;
}
.level-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    margin: 0 auto 4px;
    border: 2px solid var(--border);
    background: var(--white);
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}
.level-dot.done {
    background: var(--blue-accent);
    border-color: var(--blue-accent);
    color: #fff;
}
.level-dot.current {
    background: var(--white);
    border-color: var(--blue-accent);
    color: var(--blue-accent);
}
.level-line {
    position: absolute;
    top: 13px;
    left: 50%;
    right: -50%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.level-line.done {
    background: var(--blue-accent);
}
.level-label {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}
.level-date {
    font-size: 9.5px;
    color: var(--blue-accent);
    white-space: nowrap;
}

/* =========================================
   TABS
   ========================================= */
.tab-bar {
    display: flex;
    gap: 2px;
    border-bottom: 1.5px solid var(--border);
    padding: 0 18px;
    background: var(--white);
}
.tab-item {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1.5px;
    transition:
        color 0.15s,
        border-color 0.15s;
    text-decoration: none;
}
.tab-item:hover {
    color: var(--text-primary);
}
.tab-item.active {
    color: var(--blue-accent);
    border-bottom-color: var(--blue-accent);
}

/* =========================================
   SECTION DIVIDER
   ========================================= */
.section-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

/* =========================================
   HEADER ICON COLOR UTILITIES
   ========================================= */
.header-icon-info {
    background: var(--blue-soft);
    color: var(--blue-accent);
}
.header-icon-warning {
    background: var(--warning-bg);
    color: var(--warning);
}
.header-icon-danger {
    background: var(--danger-bg);
    color: var(--danger);
}
.header-icon-indigo {
    background: #e0e7ff;
    color: #4f46e5;
}
.header-icon-indigo-dark {
    background: #e0e7ff;
    color: #4338ca;
}
.header-icon-success {
    background: var(--success-bg);
    color: var(--success);
}
.header-icon-emerald {
    background: #d1fae5;
    color: #059669;
}

/* Stat-icon soft-color utilities */
.stat-icon-info {
    background: var(--blue-soft);
    color: var(--blue-accent);
}
.stat-icon-warning {
    background: var(--warning-bg);
    color: var(--warning);
}
.stat-icon-success {
    background: var(--success-bg);
    color: var(--success);
}
.stat-icon-purple {
    background: #ede9fe;
    color: #7c3aed;
}

/* =========================================
   CUSTOM SCROLLBAR
   ========================================= */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}

/* ===== Select2 Custom ===== */
.select2-student + .select2-container {
    min-width: 280px;
}
.select2-container .select2-selection--single {
    height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 32px;
    padding-left: 10px;
    padding-right: 20px;
    color: var(--text-primary);
    font-size: 13px;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-muted);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 30px;
    right: 4px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text-muted) transparent transparent transparent;
    border-width: 5px 4px 0 4px;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--text-muted) transparent;
    border-width: 0 4px 5px 4px;
}
.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    padding: 4px 8px;
    outline: none;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.select2-dropdown {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-size: 13px;
}
.select2-results__option {
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text-primary);
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--blue-soft);
    color: var(--text-primary);
}
.select2-container--default .select2-results__option[aria-selected=true] {
    background: var(--surface-2);
}
.select2-container--default .select2-selection--single .select2-selection__clear {
    color: var(--text-muted);
    font-size: 16px;
    margin-right: 4px;
}
.select2-container--default.select2-container--disabled .select2-selection--single {
    background: var(--surface);
    border-color: var(--border);
}
.select2-container--default .select2-results > .select2-results__options {
    max-height: 240px;
}
.select2-container--open .select2-dropdown--below {
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
}
.select2-container--open .select2-dropdown--above {
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}

/* =========================================
   TEXT UTILITIES
   ========================================= */
.text-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.text-subdued {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.uppercase-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-help-text {
    font-size: 11px;
    color: var(--text-muted);
}

.form-hint {
    font-size: 12.5px;
    color: var(--text-muted);
}

/* =========================================
   RESET / FILTER LINK
   ========================================= */
.reset-link {
    padding: 4px 10px;
    font-size: 12px;
}

/* =========================================
   BORDER BOX (content card variant)
   ========================================= */
.border-box {
    border: 1px solid var(--border);
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 13.5px;
    line-height: 1.6;
}

.border-box-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

/* =========================================
   ROLE SUMMARY CARD
   ========================================= */
.role-card {
    background: var(--surface-2);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.role-card:last-child {
    margin-bottom: 0;
}

.role-card-title {
    font-weight: 600;
    font-size: 13px;
}

.role-card-title.danger  { color: var(--danger); }
.role-card-title.warning { color: var(--warning); }
.role-card-title.info    { color: var(--info); }
.role-card-title.navy    { color: var(--navy-light); }

.role-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* =========================================
   EMPTY STATE
   ========================================= */
.empty-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

/* =========================================
   SECTION TITLE
   ========================================= */
.section-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
}

/* =========================================
   COLOR UTILITIES
   ========================================= */
.text-navy {
    color: var(--navy-light);
}

/* =========================================
   TARIF CARD
   ========================================= */
.tarif-card {
    text-align: center;
    background: var(--surface-2);
    border-radius: 8px;
    padding: 12px 8px;
}

.tarif-card-title {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.tarif-card-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
