:root {
    --primary:   #1a4b8c;
    --primary-dk:#12336a;
    --primary-lt:#e8f0fb;
    --accent:    #f0a500;
    --sidebar-w: 220px;
    --header-h:  64px;
    --text:      #1e293b;
    --muted:     #64748b;
    --border:    #e2e8f0;
    --bg:        #f4f7fc;
    --card:      #ffffff;
    --danger:    #dc3545;
    --success:   #198754;
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--primary);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0,0,0,.18);
}

.sidebar-brand {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    background: var(--primary-dk);
    text-decoration: none;
}
.sidebar-brand img {
    width: 34px; height: 34px;
    border-radius: 6px;
}
.sidebar-brand-text {
    line-height: 1.2;
}
.sidebar-brand-text strong {
    display: block;
    font-size: .85rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .4px;
}
.sidebar-brand-text span {
    font-size: .62rem;
    color: rgba(255,255,255,.6);
    font-weight: 500;
    letter-spacing: .3px;
}

.nav-section {
    padding: 20px 12px 6px;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,.4);
    text-transform: uppercase;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding-bottom: 16px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.nav-item { padding: 2px 10px; }
.nav-link-sb {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: .82rem;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.nav-link-sb i { font-size: 1rem; flex-shrink: 0; }
.nav-link-sb:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-link-sb.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }
.nav-link-sb.active i { color: var(--accent); }

/* ── HEADER ──────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0; left: var(--sidebar-w);
    right: 0;
    height: var(--header-h);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 90;
    box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.topbar-title {
    color: #fff;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar-title i { color: var(--accent); font-size: 1.1rem; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.btn-topbar {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: background .15s;
}
.btn-topbar:hover { background: rgba(255,255,255,.22); }
.avatar {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--accent);
    color: var(--primary-dk);
    font-size: .8rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}

/* ── MAIN ────────────────────────────────────── */
.main {
    margin-left: var(--sidebar-w);
    margin-top: var(--header-h);
    flex: 1;
    padding: 28px 28px 40px;
    min-width: 0;
}

/* ── PAGE HEADER ─────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.page-header p {
    font-size: .82rem;
    color: var(--muted);
    margin: 2px 0 0;
}
.breadcrumb-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .75rem;
    color: var(--muted);
    margin-bottom: 4px;
}
.breadcrumb-bar a { color: var(--primary); text-decoration: none; }
.breadcrumb-bar i { font-size: .65rem; }

/* ── STAT CARDS ──────────────────────────────── */
.stat-card {
    background: var(--card);
    border-radius: 12px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-icon {
    width: 46px; height: 46px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.stat-card .value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-card .label { font-size: .75rem; color: var(--muted); margin-top: 2px; }

/* ── CARD ────────────────────────────────────── */
.panel {
    background: var(--card);
    border-radius: 14px;
    border: 1px solid var(--border);
    overflow: hidden;
}
.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.panel-header h5 {
    font-size: .92rem;
    font-weight: 700;
    margin: 0;
    display: flex; align-items: center; gap: 8px;
}
.panel-header h5 i { color: var(--primary); }
.panel-body { padding: 20px; }
.panel-body p { font-size: 12px; line-height: 1.3; }

/* ── TABLE ───────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}
.tbl thead th {
    background: var(--primary-lt);
    color: var(--primary-dk);
    font-weight: 700;
    font-size: .73rem;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 11px 14px;
    border: none;
    white-space: nowrap;
}
.tbl tbody tr { border-bottom: 1px solid var(--border); }
.tbl tbody tr:last-child { border-bottom: none; }
.tbl tbody tr:hover { background: #f8faff; }
.tbl tbody td { padding: 11px 14px; vertical-align: middle; }
.tbl tbody td.no { color: var(--muted); font-size: .75rem; }

.badge-akses {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
}
.badge-superadmin { background: #fef3c7; color: #92400e; }
.badge-admin      { background: #dbeafe; color: #1e40af; }
.badge-operator   { background: #dcfce7; color: #166534; }

.btn-act {
    width: 30px; height: 30px;
    border-radius: 7px;
    border: none;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .85rem;
    cursor: pointer;
    transition: background .12s;
}
.btn-act.edit   { background: #e0f2fe; color: #0369a1; }
.btn-act.edit:hover { background: #bae6fd; }
.btn-act.del    { background: #fee2e2; color: #dc2626; }
.btn-act.del:hover  { background: #fecaca; }

/* search box */
.search-box {
    position: relative;
}
.search-box i {
    position: absolute; left: 10px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted); font-size: .85rem;
    pointer-events: none;
}
.search-box input {
    padding-left: 32px;
    font-size: .82rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    height: 30px;
    width: 220px;
}
.search-box input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26,75,140,.1);
}

/* ── FORM ────────────────────────────────────── */
.form-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}
.form-label .req { color: var(--danger); margin-left: 2px; }

/* Base control */
.form-control,
.form-select {
    font-size: .83rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    height: 38px;
    line-height: 1.4;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,75,140,.12);
    outline: none;
}

/* ── form-control-sm ─────────────────────────── */
.form-control-sm,
.form-select-sm {
    font-size: .77rem;
    border-radius: 6px;
    padding: 5px 10px;
    height: 30px;
    line-height: 1.4;
}
.form-control-sm:focus,
.form-select-sm:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,75,140,.10);
    outline: none;
}

/* sm inside input-group */
.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text {
    font-size: .77rem;
    padding: 5px 10px;
    height: 30px;
    border-radius: 6px;
}

/* sm search-box override */
.search-box.search-box-sm input {
    height: 30px;
    font-size: .77rem;
    border-radius: 6px;
    padding-left: 28px;
}
.search-box.search-box-sm i {
    font-size: .78rem;
}

/* sm password toggle */
.input-pw .form-control-sm { padding-right: 32px; }
.input-pw .form-control-sm + .pw-toggle {
    font-size: .8rem;
    right: 8px;
}

/* Select2 sm override */
.select2-container--bootstrap-5.select2-container--sm .select2-selection {
    border-radius: 6px !important;
    font-size: .77rem !important;
    min-height: 30px !important;
    padding: 3px 8px !important;
}

/* ─────────────────────────────────────────────── */

.form-text { font-size: .73rem; color: var(--muted); }
textarea.form-control { resize: vertical; min-height: 90px; height: auto; }
textarea.form-control-sm { min-height: 64px; font-size: .77rem; padding: 5px 10px; height: auto; }

/* password eye */
.input-pw { position: relative; }
.input-pw input { padding-right: 38px; }
.pw-toggle {
    position: absolute; right: 10px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--muted); font-size: .9rem; cursor: pointer;
    padding: 0;
}
.pw-toggle:focus { outline: none; }

/* Select2 override */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: 8px !important;
    font-size: .83rem !important;
}

/* Datepicker override */
.datepicker { font-size: .82rem; }

/* btn primary */
.btn-primary-custom {
    background: var(--primary);
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: .83rem;
    padding: 9px 20px;
    border-radius: 9px;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background .15s;
}
.btn-primary-custom:hover { background: var(--primary-dk); color: #fff; }
.btn-secondary-custom {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    font-size: .83rem;
    padding: 9px 20px;
    border-radius: 9px;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background .15s;
}
.btn-secondary-custom:hover { background: #e4e9f0; }

/* modal */
.modal-content { border-radius: 14px; border: none; box-shadow: 0 20px 60px rgba(0,0,0,.18); }
.modal-header {
    background: var(--primary);
    border-radius: 14px 14px 0 0;
    padding: 16px 22px;
    border: none;
}
.modal-title { color: #fff; font-size: .95rem; font-weight: 700; }
.modal-header .btn-close { filter: invert(1); opacity: .8; }
.modal-body { padding: 24px 22px; }
.modal-footer { border-top: 1px solid var(--border); padding: 14px 22px; }

/* divider */
.form-divider {
    display: flex; align-items: center; gap: 10px;
    margin: 20px 0 16px;
    color: var(--muted); font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .8px;
}
.form-divider::before, .form-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

/* toast */
.toast-container { z-index: 9999; }

/* pagination */
.page-link {
    font-size: .8rem; border-radius: 7px !important;
    margin: 0 2px; border-color: var(--border); color: var(--primary);
}
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* confirm modal */
.confirm-icon {
    width: 60px; height: 60px; border-radius: 50%;
    background: #fee2e2; color: #dc2626;
    font-size: 1.6rem;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
}

.avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.dropdown-toggle::after {
    display: none;
}
