/* ============================================================
   SISTEM MUTASI SPKT — Premium UI Stylesheet
   Font: Plus Jakarta Sans + Space Mono
   Theme: Navy/Gold — Dark/Light Mode
   ============================================================ */

/* ---- CSS VARIABLES ---- */
:root {
    --sidebar-w: 260px;
    --topbar-h: 60px;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-base:    #0d1117;
    --bg-surface: #161b22;
    --bg-card:    #1c2128;
    --bg-hover:   #21262d;
    --bg-input:   #161b22;
    --border:     #30363d;
    --border-light: #21262d;

    --sidebar-bg: #0d1117;
    --sidebar-border: #21262d;
    --nav-text:   #8b949e;
    --nav-active-bg: rgba(30, 144, 255, 0.12);
    --nav-active-text: #58a6ff;
    --nav-active-border: #1e90ff;
    --nav-badge-bg: #21262d;

    --text-primary:   #e6edf3;
    --text-secondary: #8b949e;
    --text-muted:     #6e7681;

    --gold:       #d4a820;
    --gold-light: #f1c40f;
    --gold-dim:   rgba(212, 168, 32, 0.15);
    --blue:       #1e90ff;
    --blue-dim:   rgba(30, 144, 255, 0.12);
    --green:      #2ea043;
    --green-dim:  rgba(46, 160, 67, 0.12);
    --red:        #da3633;
    --red-dim:    rgba(218, 54, 51, 0.12);
    --orange:     #e3a42a;
    --orange-dim: rgba(227, 164, 42, 0.12);
    --purple:     #8957e5;
    --purple-dim: rgba(137, 87, 229, 0.12);

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
    --topbar-bg: rgba(13,17,23,0.92);
}

[data-theme="light"] {
    --bg-base:    #f0f4f8;
    --bg-surface: #ffffff;
    --bg-card:    #ffffff;
    --bg-hover:   #f6f8fa;
    --bg-input:   #ffffff;
    --border:     #d0d7de;
    --border-light: #eaeef2;

    --sidebar-bg: #1a2332;
    --sidebar-border: #253143;
    --nav-text:   #8ba0b5;
    --nav-active-bg: rgba(88,166,255,0.15);
    --nav-active-text: #58a6ff;
    --nav-active-border: #1e90ff;
    --nav-badge-bg: #253143;

    --text-primary:   #1c2128;
    --text-secondary: #57606a;
    --text-muted:     #848d97;

    --gold:       #b08800;
    --gold-light: #d4a820;
    --gold-dim:   rgba(176, 136, 0, 0.12);
    --blue:       #0969da;
    --blue-dim:   rgba(9, 105, 218, 0.08);
    --green:      #1a7f37;
    --green-dim:  rgba(26, 127, 55, 0.08);
    --red:        #cf222e;
    --red-dim:    rgba(207, 34, 46, 0.08);
    --orange:     #9a6700;
    --orange-dim: rgba(154, 103, 0, 0.08);
    --purple:     #6639ba;
    --purple-dim: rgba(102, 57, 186, 0.08);

    --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
    --topbar-bg: rgba(255,255,255,0.92);
}

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #1a2332;
    font-size: 18px;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(212, 168, 32, 0.4);
}

.brand-title {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 1px;
}

.brand-sub {
    display: block;
    font-size: 10px;
    color: var(--nav-text);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 14px 20px 4px;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--nav-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 0;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: #c9d1d9;
}

.nav-item.active {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
    border-left-color: var(--nav-active-border);
}

.nav-item i { width: 18px; font-size: 15px; flex-shrink: 0; }

.nav-badge {
    margin-left: auto;
    background: var(--nav-badge-bg);
    color: var(--gold);
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 28px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-sm);
}

.user-avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    flex-shrink: 0;
}

.user-meta { flex: 1; min-width: 0; }
.user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #c9d1d9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.logout-btn {
    color: var(--text-muted);
    font-size: 16px;
    transition: color 0.2s;
    flex-shrink: 0;
}
.logout-btn:hover { color: var(--red); }

/* ============================================================
   MAIN WRAPPER & TOPBAR
   ============================================================ */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s;
}

.topbar {
    position: sticky;
    top: 0; z-index: 999;
    height: var(--topbar-h);
    background: var(--topbar-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
}

.sidebar-toggle {
    background: none; border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
    display: none;
}
.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

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

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

.clock {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: var(--gold);
    letter-spacing: 1px;
}

.theme-toggle {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 34px; height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: var(--transition);
}
.theme-toggle:hover { border-color: var(--gold); color: var(--gold); }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content { flex: 1; padding: 20px; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header-left h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
}

.page-header-left .breadcrumb {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-header h5 {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex; align-items: center; gap: 8px;
}

.card-body { padding: 20px; }

/* ---- STAT CARDS ---- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

.stat-card.blue::before  { background: linear-gradient(90deg, var(--blue), #00bfff); }
.stat-card.gold::before  { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.stat-card.green::before { background: linear-gradient(90deg, var(--green), #40d980); }
.stat-card.red::before   { background: linear-gradient(90deg, var(--red), #ff6b6b); }
.stat-card.purple::before { background: linear-gradient(90deg, var(--purple), #bf8aff); }

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

.stat-card.blue .stat-icon   { background: var(--blue-dim);   color: var(--blue); }
.stat-card.gold .stat-icon   { background: var(--gold-dim);   color: var(--gold); }
.stat-card.green .stat-icon  { background: var(--green-dim);  color: var(--green); }
.stat-card.red .stat-icon    { background: var(--red-dim);    color: var(--red); }
.stat-card.purple .stat-icon { background: var(--purple-dim); color: var(--purple); }

.stat-info { flex: 1; min-width: 0; }
.stat-value {
    font-family: 'Space Mono', monospace;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}
.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #1a1a1a;
    font-weight: 700;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-gold:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(212,168,32,0.4); color: #1a1a1a; }

.btn-primary-custom {
    background: var(--blue);
    color: #fff;
    font-weight: 600;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-primary-custom:hover { filter: brightness(1.1); color: #fff; }

/* ============================================================
   DATATABLES
   ============================================================ */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 13px;
    outline: none;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text-secondary) !important;
    font-size: 13px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--blue) !important;
    border-color: var(--blue) !important;
    color: #fff !important;
    border-radius: 6px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--bg-hover) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

table.dataTable thead th {
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border) !important;
    padding: 10px 14px;
}

table.dataTable tbody td {
    border-bottom: 1px solid var(--border-light) !important;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 13.5px;
    vertical-align: middle;
}

table.dataTable tbody tr:hover { background: var(--bg-hover) !important; }
table.dataTable { border-collapse: separate !important; }

/* ============================================================
   FORMS
   ============================================================ */
.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control, .form-select {
    background: var(--bg-input) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    padding: 9px 12px !important;
    font-size: 13.5px !important;
    transition: border-color 0.2s !important;
    width: 100%;
}

.form-control:focus, .form-select:focus {
    border-color: var(--blue) !important;
    box-shadow: 0 0 0 3px rgba(30,144,255,0.12) !important;
    outline: none !important;
}

.form-control::placeholder { color: var(--text-muted) !important; }
.form-select option { background: var(--bg-card); color: var(--text-primary); }

.section-divider {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 8px 0 12px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-divider i { font-size: 14px; }

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge-register {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    background: var(--blue-dim);
    color: var(--blue);
    border: 1px solid rgba(30,144,255,0.2);
}

.status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.status-proses  { background: var(--orange-dim); color: var(--orange); }
.status-selesai { background: var(--green-dim);  color: var(--green); }
.status-ditutup { background: var(--red-dim);    color: var(--red); }

/* ============================================================
   ACTION BUTTONS IN TABLE
   ============================================================ */
.btn-action {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.btn-action.view  { color: var(--blue);  border-color: rgba(30,144,255,0.3); }
.btn-action.edit  { color: var(--gold);  border-color: rgba(212,168,32,0.3); }
.btn-action.del   { color: var(--red);   border-color: rgba(218,54,51,0.3); }
.btn-action:hover { opacity: 0.75; transform: scale(1.1); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    font-size: 13.5px;
    padding: 12px 16px;
}
.alert-success { background: var(--green-dim); color: var(--green); }
.alert-danger  { background: var(--red-dim);   color: var(--red); }
.alert-info    { background: var(--blue-dim);  color: var(--blue); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
}
.modal-header {
    border-bottom: 1px solid var(--border-light);
    padding: 16px 20px;
}
.modal-footer {
    border-top: 1px solid var(--border-light);
    padding: 12px 20px;
}
.modal-title { font-weight: 700; font-size: 15px; }
.btn-close { filter: invert(0.5); }
[data-theme="dark"] .btn-close { filter: invert(0.8); }

/* ============================================================
   DETAIL VIEW
   ============================================================ */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.detail-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.detail-item label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: block;
    margin-bottom: 4px;
}

.detail-item span {
    font-size: 13.5px;
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.login-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 20%, rgba(30, 144, 255, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(212, 168, 32, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo .logo-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    border-radius: 16px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 28px;
    color: #1a2332;
    margin-bottom: 12px;
    box-shadow: 0 4px 20px rgba(212,168,32,0.35);
}

.login-logo h1 {
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 3px;
}

.login-logo p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================================
   CHART CONTAINER
   ============================================================ */
.chart-container {
    position: relative;
    height: 280px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0,0,0,0.5);
    }
    .main-wrapper { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .stat-grid { grid-template-columns: 1fr; }
    .page-content { padding: 16px; }
    .login-card { padding: 28px 20px; }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner-gold {
    width: 20px; height: 20px;
    border: 2px solid var(--gold-dim);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; }
