/* ============================================================
   E-KEPEGAWAIAN - DESKTOP & CORE STYLESHEET
   SD Muhammadiyah Serut
   - Token & Variabel Tema (Gojek Green Native + Material Design 3)
   - Reset & Tipografi Dasar
   - Komponen Inti: Tombol, Badge, Formulir, Tooltip, Toast & Animasi
   - Layout & Komponen Desktop (Sidebar 260px, Header, Tabel, Modal)
   ============================================================ */

:root {
    /* Primary — Gojek Signature Green (disamakan dgn Portal Pegawai) */
    --accent:            #00AA13;
    --accent-light:      #E6F6E8;
    --accent-container:  #F0FDF4;
    --accent-dark:       #00880C;
    --accent-gradient:   linear-gradient(135deg, #00AA13 0%, #00C853 100%);
    --on-accent:         #ffffff;

    /* Semantic */
    --success:     #00AA13; --success-bg:#E6F6E8;
    --warning:     #FF9900; --warning-bg:#FFF5E6;
    --danger:      #ED2736; --danger-bg:#FDEAEB;

    /* Surface */
    --bg-app:          #F9F9F9;
    --bg-card:         #ffffff;
    --text-primary:    #101820;
    --text-secondary:  #687176;
    --border:          #EAEAEA;

    /* Sidebar — hijau tua, satu keluarga warna dengan accent */
    --sidebar-bg:      #0D2B12;
    --sidebar-bg-alt:  #123818;
    --sidebar-text:    rgba(255,255,255,0.72);

    --th-bg:           #F0FDF4;
    --th-color:        #3f6b45;
    --sidebar-width:   260px;

    /* Elevation — Gojek Soft Shadow */
    --shadow-sm: 0 1px 4px rgba(0,170,19,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 14px rgba(0,170,19,0.10), 0 2px 6px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 30px rgba(0,170,19,0.15), 0 4px 10px rgba(0,0,0,0.08);

    /* Radius System */
    --radius-xs:   8px;
    --radius-sm:   12px;
    --radius-md:   16px;
    --radius-lg:   20px;
    --radius-xl:   24px;
    --radius-pill: 100px;

    /* Easing native-app */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --accent:            #00E676;
    --accent-light:      rgba(0,230,118,0.18);
    --accent-container:  rgba(0,230,118,0.12);
    --accent-dark:       #00AA13;
    --accent-gradient:   linear-gradient(135deg, #00E676 0%, #00AA13 100%);
    --on-accent:         #0d1117;

    --success: #00E676; --success-bg: rgba(0,230,118,0.12);
    --warning: #FFB74D; --warning-bg: rgba(255,183,77,0.12);
    --danger:  #FF5252; --danger-bg:  rgba(255,82,82,0.15);

    --bg-app:          #0D190E;
    --bg-card:         #162518;
    --text-primary:    #F5F5F5;
    --text-secondary:  #9E9E9E;
    --border:          #243D27;

    --sidebar-bg:      #0A1A0C;
    --sidebar-bg-alt:  #0D2B12;
    --sidebar-text:    rgba(255,255,255,0.68);

    --th-bg:           #1C331E;
    --th-color:        #9ecfa4;

    --shadow-sm: 0 1px 4px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.6);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.7);
}

/* RESET & DASAR */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-app);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

/* ANIMASI INTI */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}


.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeUp 0.25s var(--ease); }

/* TOMBOL (BUTTONS) — Material 3 Filled, Pill & Tactile */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.1s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
    background: var(--accent-gradient);
    color: var(--on-accent);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0,170,19,0.28);
}
.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(0,170,19,0.38);
    filter: brightness(1.03);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-outline:hover { background: var(--bg-app); }

.btn-sm { padding: 6px 12px; font-size: 11px; }
.btn .material-icons-round { font-size: 16px; }

/* BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}
.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-gray    { background: var(--th-bg);      color: var(--text-secondary); }

/* FORMS */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.form-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 2px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.input-control {
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
    outline: none;
    width: 100%;
}
.input-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.input-hint {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 3px;
    font-style: italic;
}
.required { color: var(--danger); }

/* SEARCH BAR */
.search-wrapper { position: relative; }
.search-icon-mini {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-secondary);
    pointer-events: none;
}
.search-input-mini {
    padding: 8px 10px 8px 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    min-width: 180px;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.search-input-mini:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* UTILITY (FILTER & DROPDOWN) */
.filter-segment {
    display: flex;
    gap: 5px;
    background: var(--bg-app);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
}
.filter-segment::-webkit-scrollbar { display: none; }
.filter-segment .btn { flex-shrink: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 110%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    min-width: 220px;
    max-width: calc(100vw - 32px);
    z-index: 999;
    overflow: hidden;
}

/* TOOLTIP */
.field-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent-dark);
    font-size: 9px;
    font-weight: 800;
    cursor: help;
    margin-left: 4px;
    position: relative;
}
.field-hint::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    font-size: 10px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    white-space: pre-line;
    min-width: 180px;
    max-width: 260px;
    line-height: 1.5;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s var(--ease);
    box-shadow: var(--shadow-md);
}
.field-hint:hover::after { opacity: 1; }

/* TOAST */
.toast-notif {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: #1e293b;
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s var(--ease);
    max-width: 320px;
}
.toast-notif.show { transform: translateY(0); opacity: 1; }

/* ============================================================
   LAYOUT & KOMPONEN DESKTOP (LAYAR LEBAR / KOMPUTER / LAPTOP)
   ============================================================ */

/* SIDEBAR NAVIGATION (DESKTOP) */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-alt) 100%);
    overflow-y: auto;
    z-index: 200;
    transition: transform 0.3s var(--ease);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    box-shadow: 0 4px 12px rgba(0,170,19,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.brand-text h1 {
    color: white;
    font-size: 13px;
    font-weight: 700;
}
.brand-text p {
    color: var(--sidebar-text);
    font-size: 10px;
    margin-top: 2px;
}

.sidebar-menu {
    padding: 12px 8px;
}

.menu-category {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.35);
    padding: 12px 10px 4px;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    color: var(--sidebar-text);
    cursor: pointer;
    transition: background 0.15s var(--ease), transform 0.1s var(--ease), color 0.15s var(--ease);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}
.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}
.nav-item:active {
    transform: scale(0.98);
}
.nav-item.active {
    background: var(--accent);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,170,19,0.35);
}
.nav-item.active .material-icons-round {
    color: white;
}
.nav-item .material-icons-round {
    font-size: 18px;
    flex-shrink: 0;
}

.back-btn {
    color: #6ee888;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    border-radius: 0;
    padding-bottom: 12px;
}

/* MAIN WRAPPER & HEADER (DESKTOP) */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}
.title-mobile {
    display: none;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.datetime-container div:first-child {
    font-size: 11px;
    color: var(--text-secondary);
}
.live-time {
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.theme-switch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--accent);
    transition: transform 0.15s var(--ease);
}
.theme-switch:active { transform: scale(0.92); }
.theme-switch::after { content: '🌙'; font-size: 16px; }
[data-theme="dark"] .theme-switch::after { content: '☀️'; }

.content-area {
    flex: 1;
    padding: 24px;
}

/* CARDS & PANELS (DESKTOP) */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}

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

.card-title {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

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

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon .material-icons-round { font-size: 22px; }
.stat-info h3 { font-size: 22px; font-weight: 800; }
.stat-info p  { font-size: 10px; color: var(--text-secondary); margin-top: 2px; }

/* DATA TABLES (DESKTOP) */
.table-wrapper { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
thead tr { background: var(--th-bg); }
th {
    padding: 10px 12px;
    font-size: 10px;
    font-weight: 700;
    color: var(--th-color);
    text-transform: uppercase;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tbody tr { transition: background 0.15s var(--ease); }
tbody tr:hover { background: var(--accent-light); }
.text-left { text-align: left !important; }

/* HALAMAN FORM (pengganti modal — form & konfirmasi tampil sebagai halaman penuh) */
.form-page-card { max-width: 960px; overflow: visible; }
.form-page-card.sm { max-width: 560px; }
.form-page-header { justify-content: flex-start; flex-wrap: nowrap; gap: 12px; }
.form-page-header h3 { font-size: 15px; font-weight: 700; }
.form-page-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.form-page-footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* STATUS DEFAULT TAMPILAN DESKTOP */
#sidebarOverlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 150; }
.mobile-toggle  { display: none; background: none; border: none; cursor: pointer; color: var(--text-primary); }
