/* ==============================================
   KOLEGA ACADEMY - ABSENSI DIGITAL
   Color System: Navy + Sky Blue
   ============================================== */

:root {
    --navy-950:  #0a1628;
    --navy-900:  #0d2045;
    --navy-800:  #112b5e;
    --navy-700:  #163574;
    --navy-600:  #1a4090;
    --navy-500:  #1d4baa;
    --navy-400:  #2a5fc4;
    --navy-300:  #4476d4;

    --sky-600:   #0284c7;
    --sky-500:   #0ea5e9;
    --sky-400:   #38bdf8;
    --sky-300:   #7dd3fc;
    --sky-100:   #e0f2fe;
    --sky-50:    #f0f9ff;

    --accent:    #06b6d4;        /* cyan accent */
    --success:   #16a34a;
    --warning:   #d97706;
    --danger:    #dc2626;
    --info:      #0ea5e9;

    --text-dark:  #0f172a;
    --text-mid:   #334155;
    --text-light: #64748b;
    --text-muted: #94a3b8;

    --bg-page:    #f1f5f9;
    --bg-card:    #ffffff;
    --border:     #e2e8f0;

    --sidebar-w:  260px;
    --navbar-h:   64px;
    --bottom-nav: 68px;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:  0 4px 16px rgba(13,32,69,.10);
    --shadow-lg:  0 8px 32px rgba(13,32,69,.16);
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-xl:  20px;

    --font-sans: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    color: var(--text-dark);
    background: var(--bg-page);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--navy-300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy-500); }

/* ===== TYPOGRAPHY ===== */
h1,h2,h3,h4,h5,h6 { font-weight: 600; line-height: 1.3; color: var(--text-dark); }
a { color: var(--navy-500); text-decoration: none; transition: color .2s; }
a:hover { color: var(--navy-300); }

/* ===== LAYOUT ===== */
.layout-admin {
    display: flex;
    min-height: 100vh;
}

/* ===== ADMIN SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 40%, var(--navy-800) 100%);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo .logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--sky-500), var(--accent));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-logo .logo-text {
    font-size: .85rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.sidebar-logo .logo-sub {
    font-size: .68rem;
    color: var(--sky-300);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-label {
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--navy-300);
    padding: 12px 10px 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.65);
    font-size: .875rem;
    font-weight: 500;
    transition: all .2s;
    cursor: pointer;
    position: relative;
}
.sidebar-link:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}
.sidebar-link.active {
    background: linear-gradient(90deg, var(--sky-600), var(--navy-500));
    color: #fff;
    box-shadow: 0 2px 12px rgba(14,165,233,.3);
}
.sidebar-link .icon {
    width: 20px; height: 20px;
    opacity: .85;
    flex-shrink: 0;
}
.sidebar-link .badge-nav {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    border-radius: 99px;
    padding: 1px 6px;
    min-width: 18px;
    text-align: center;
}

.sidebar-user {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-user img {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--sky-400);
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: .8rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { font-size: .68rem; color: var(--sky-300); }

/* ===== ADMIN MAIN CONTENT ===== */
.admin-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    height: var(--navbar-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky; top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.topbar-title { font-size: 1rem; font-weight: 600; color: var(--text-dark); }
.topbar-subtitle { font-size: .75rem; color: var(--text-light); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-light);
    font-size: 16px;
    transition: all .2s;
    position: relative;
}
.topbar-btn:hover {
    background: var(--sky-50);
    border-color: var(--sky-300);
    color: var(--navy-600);
}
.topbar-btn .dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 7px; height: 7px;
    background: var(--danger);
    border-radius: 50%;
    border: 1.5px solid #fff;
}

.admin-content {
    flex: 1;
    padding: 24px;
    overflow-x: hidden;
}

/* ===== EMPLOYEE LAYOUT (MOBILE-FIRST) ===== */
.layout-employee {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--bottom-nav);
    background: var(--bg-page);
}

.emp-topbar {
    height: 56px;
    background: linear-gradient(90deg, var(--navy-900), var(--navy-700));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky; top: 0;
    z-index: 50;
}
.emp-topbar .page-title { font-size: .95rem; font-weight: 600; }
.emp-topbar .topbar-right { display: flex; align-items: center; gap: 8px; }
.emp-topbar .notif-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 15px;
    position: relative;
}
.emp-topbar .notif-btn .dot {
    position: absolute;
    top: 4px; right: 4px;
    width: 7px; height: 7px;
    background: #f87171;
    border-radius: 50%;
    border: 1.5px solid transparent;
}

.emp-content { flex: 1; padding: 16px; max-width: 480px; margin: 0 auto; width: 100%; }

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav);
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    transition: all .2s;
    color: var(--text-muted);
    font-size: .65rem;
    font-weight: 500;
    text-decoration: none;
}
.bottom-nav-item .nav-icon { font-size: 20px; transition: transform .2s; }
.bottom-nav-item:hover .nav-icon { transform: translateY(-2px); }
.bottom-nav-item.active { color: var(--navy-600); }
.bottom-nav-item.active .nav-icon { transform: translateY(-2px); }
.bottom-nav-item.nav-center {
    position: relative;
    margin-top: -16px;
}
.bottom-nav-item.nav-center .center-btn {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy-600), var(--sky-500));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(13,75,170,.4);
    font-size: 22px;
    color: #fff;
    margin-bottom: 4px;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-title { font-size: .9rem; font-weight: 600; color: var(--text-dark); }
.card-body { padding: 20px; }

/* Stats Cards */
.stat-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform .2s, box-shadow .2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-icon.blue   { background: var(--sky-100); color: var(--sky-600); }
.stat-icon.navy   { background: #dbeafe; color: var(--navy-600); }
.stat-icon.green  { background: #dcfce7; color: var(--success); }
.stat-icon.yellow { background: #fef9c3; color: var(--warning); }
.stat-icon.red    { background: #fee2e2; color: var(--danger); }
.stat-icon.cyan   { background: #cffafe; color: var(--accent); }

.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-dark); line-height: 1.2; }
.stat-label { font-size: .78rem; color: var(--text-light); margin-top: 2px; }
.stat-change { font-size: .72rem; margin-top: 4px; font-weight: 500; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* Employee stat card (compact) */
.emp-stat-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border);
    text-align: center;
}
.emp-stat-card .big-num { font-size: 1.8rem; font-weight: 700; color: var(--navy-700); line-height: 1; }
.emp-stat-card .label   { font-size: .7rem; color: var(--text-light); margin-top: 4px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: .85rem; font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all .2s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(135deg, var(--navy-600), var(--navy-500));
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,64,144,.25);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
    box-shadow: 0 4px 16px rgba(26,64,144,.35);
    transform: translateY(-1px);
    color: #fff;
}
.btn-sky {
    background: linear-gradient(135deg, var(--sky-500), var(--sky-600));
    color: #fff;
}
.btn-sky:hover:not(:disabled) { background: linear-gradient(135deg, var(--sky-600), var(--sky-600)); color: #fff; }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--navy-400);
    color: var(--navy-500);
}
.btn-outline:hover:not(:disabled) { background: var(--sky-50); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-ghost {
    background: transparent;
    color: var(--text-mid);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-page); }
.btn-sm { padding: 5px 12px; font-size: .78rem; }
.btn-lg { padding: 12px 24px; font-size: .95rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; min-width: 36px; height: 36px; }

/* Employee action buttons */
.absen-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 12px;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all .2s;
    font-weight: 600;
    font-size: .8rem;
    text-decoration: none;
}
.absen-btn .icon { font-size: 28px; }
.absen-btn.masuk  { background: linear-gradient(135deg, var(--navy-700), var(--navy-500)); color: #fff; }
.absen-btn.pulang { background: linear-gradient(135deg, var(--sky-600), var(--accent)); color: #fff; }
.absen-btn.visit  { background: linear-gradient(135deg, #7c3aed, #a78bfa); color: #fff; }
.absen-btn:hover  { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .82rem; font-weight: 500; color: var(--text-mid); margin-bottom: 6px; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control {
    display: block; width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .875rem;
    color: var(--text-dark);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    font-family: inherit;
}
.form-control:focus {
    border-color: var(--sky-400);
    box-shadow: 0 0 0 3px rgba(56,189,248,.15);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control.error { border-color: var(--danger); }
.form-hint  { font-size: .72rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .75rem; color: var(--danger); margin-top: 4px; }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ===== TABLES ===== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: #fff;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .83rem;
}
.table thead th {
    padding: 12px 14px;
    background: var(--navy-950);
    color: rgba(255,255,255,.8);
    font-weight: 500;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}
.table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-mid);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--sky-50); }
.table .action-td { white-space: nowrap; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.badge-success   { background: #dcfce7; color: #15803d; }
.badge-warning   { background: #fef9c3; color: #a16207; }
.badge-danger    { background: #fee2e2; color: #b91c1c; }
.badge-info      { background: #e0f2fe; color: #0369a1; }
.badge-primary   { background: #dbeafe; color: var(--navy-700); }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-purple    { background: #ede9fe; color: #7c3aed; }

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info    { background: #f0f9ff; border: 1px solid #bae6fd; color: #0369a1; }

/* ===== AVATAR ===== */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
}
.avatar-sm  { width: 28px; height: 28px; }
.avatar-md  { width: 40px; height: 40px; }
.avatar-lg  { width: 64px; height: 64px; }
.avatar-xl  { width: 96px; height: 96px; }
.avatar-placeholder {
    background: linear-gradient(135deg, var(--navy-600), var(--sky-500));
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 600;
}

/* ===== STATUS INDICATOR ===== */
.status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.online  { background: var(--success); box-shadow: 0 0 0 3px rgba(22,163,74,.2); }
.status-dot.offline { background: var(--text-muted); }
.status-dot.away    { background: var(--warning); }

/* ===== CAMERA MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 200;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.modal-box {
    background: #fff;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    padding: 16px 20px;
    background: linear-gradient(90deg, var(--navy-900), var(--navy-700));
    color: #fff;
    display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: .95rem; font-weight: 600; }
.modal-close {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
}
.modal-body { padding: 20px; }
.modal-footer {
    padding: 14px 20px;
    background: var(--bg-page);
    display: flex; gap: 10px; justify-content: flex-end;
}

#cameraPreview {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: var(--radius-md);
    background: #0a0a0a;
    object-fit: cover;
    display: block;
}
#capturedPhoto {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: var(--radius-md);
    object-fit: cover;
    display: none;
}

/* ===== LOCATION CARD ===== */
.location-card {
    background: var(--sky-50);
    border: 1.5px solid var(--sky-300);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .82rem;
}
.location-card .loc-icon { font-size: 20px; flex-shrink: 0; }
.location-card .loc-status { font-weight: 600; color: var(--navy-700); }
.location-card .loc-detail { color: var(--text-light); font-size: .75rem; }

.location-card.valid   { background: #f0fdf4; border-color: #86efac; }
.location-card.invalid { background: #fef2f2; border-color: #fca5a5; }
.location-card.loading { background: var(--sky-50); border-color: var(--sky-300); }

/* ===== PROGRESS BAR ===== */
.progress {
    height: 8px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--navy-500), var(--sky-500));
    border-radius: 99px;
    transition: width .4s ease;
}

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 6px; top: 0; bottom: 0;
    width: 1.5px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding-bottom: 20px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -17px; top: 5px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--navy-600);
    border: 2px solid #fff;
    box-shadow: 0 0 0 3px rgba(26,64,144,.2);
}
.timeline-item .time { font-size: .7rem; color: var(--text-muted); }
.timeline-item .event { font-size: .83rem; font-weight: 500; color: var(--text-dark); }

/* ===== HERO BANNER (employee) ===== */
.emp-hero {
    background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-600) 50%, var(--sky-600) 100%);
    border-radius: var(--radius-lg);
    padding: 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}
.emp-hero::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
}
.emp-hero::after {
    content: '';
    position: absolute;
    bottom: -20px; right: 40px;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
}
.emp-hero .hero-greeting { font-size: .78rem; opacity: .75; }
.emp-hero .hero-name     { font-size: 1.2rem; font-weight: 700; margin: 2px 0 6px; }
.emp-hero .hero-status   {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.15);
    padding: 4px 12px;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header-left h1 { font-size: 1.25rem; font-weight: 700; }
.page-header-left p  { font-size: .8rem; color: var(--text-light); margin-top: 2px; }
.breadcrumb { font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb .sep { opacity: .5; }

/* ===== FILTER BAR ===== */
.filter-bar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.filter-bar .filter-label { font-size: .78rem; font-weight: 600; color: var(--text-mid); white-space: nowrap; }

/* ===== PAGINATION ===== */
.pagination { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.page-link {
    padding: 6px 11px;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    border: 1px solid var(--border);
    color: var(--text-mid);
    background: #fff;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    display: flex; align-items: center; justify-content: center;
    min-width: 34px;
}
.page-link:hover       { background: var(--sky-50); border-color: var(--sky-300); color: var(--navy-600); }
.page-link.active      { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.page-link.disabled    { opacity: .4; cursor: default; pointer-events: none; }

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.divider-text {
    display: flex; align-items: center; gap: 12px;
    font-size: .75rem; color: var(--text-muted);
    margin: 16px 0;
}
.divider-text::before, .divider-text::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 999;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 10px;
    font-size: .85rem;
    min-width: 280px;
    max-width: 360px;
    border-left: 4px solid transparent;
    animation: toastIn .3s ease;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }
.toast.info    { border-color: var(--sky-500); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ===== MAP PLACEHOLDER ===== */
.map-container {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    background: #e5e7eb;
    min-height: 300px;
}
#adminMap, #branchMap { width: 100%; height: 100%; min-height: 350px; }

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-800) 50%, var(--navy-600) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute; top: -100px; right: -100px;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(14,165,233,.1);
}
.login-page::after {
    content: '';
    position: absolute; bottom: -100px; left: -50px;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(38,100,212,.1);
}
.login-card {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 60px rgba(0,0,0,.3);
    position: relative; z-index: 1;
}
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo .logo-circle {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--navy-700), var(--sky-500));
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    margin: 0 auto 12px;
    box-shadow: 0 8px 24px rgba(26,64,144,.3);
}
.login-logo h1 { font-size: 1.3rem; color: var(--navy-900); }
.login-logo p  { font-size: .8rem; color: var(--text-light); margin-top: 4px; }

/* ===== GRID HELPERS ===== */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 16px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.mt-1{margin-top:4px} .mt-2{margin-top:8px} .mt-3{margin-top:12px}
.mt-4{margin-top:16px} .mt-5{margin-top:20px} .mt-6{margin-top:24px}
.mb-4{margin-bottom:16px} .mb-6{margin-bottom:24px}
.text-sm{font-size:.8rem} .text-xs{font-size:.72rem}
.text-center{text-align:center} .text-right{text-align:right}
.text-muted{color:var(--text-muted)} .text-light{color:var(--text-light)}
.text-navy{color:var(--navy-600)} .font-bold{font-weight:700} .font-semibold{font-weight:600}
.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.w-full{width:100%} .h-full{height:100%}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); width: 260px; }
    .admin-main { margin-left: 0; }
    .admin-topbar { padding: 0 16px; }
    .admin-content { padding: 16px; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .hide-mobile { display: none !important; }
}

@media (min-width: 769px) {
    .layout-employee .emp-content { max-width: 100%; }
    .show-mobile-only { display: none !important; }
}

@media (max-width: 480px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .login-card { padding: 28px 20px; }
    .card-body { padding: 16px; }
}

/* ===== UTILITIES ===== */
.rounded { border-radius: var(--radius-md); }
.shadow   { box-shadow: var(--shadow-md); }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.hidden   { display: none; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Pulse animation for live badge */
.pulse {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%,100% { opacity: 1; }
    50% { opacity: .5; }
}

/* ========================================================
   RESPONSIVE BREAKPOINTS - MOBILE FIRST
   ======================================================== */

/* ---- Tablet (≥ 640px) ---- */
@media (min-width: 640px) {
    .emp-content { max-width: 600px; }
    .grid-2 { grid-template-columns: repeat(2,1fr); }
}

/* ---- Large Tablet / Small Desktop (≥ 768px) ---- */
@media (min-width: 768px) {
    :root { --bottom-nav: 0px; }

    /* Employee goes sidebar mode on tablet+ */
    .layout-employee {
        padding-bottom: 0;
        flex-direction: row;
    }
    .bottom-nav { display: none; }
    .emp-topbar { display: none; }

    /* Employee side menu */
    .emp-content {
        max-width: 100%;
        padding: 24px 28px;
        flex: 1;
    }

    /* Admin sidebar always visible */
    .sidebar { transform: translateX(0) !important; }
    .admin-main { margin-left: var(--sidebar-w); }
    .show-mobile-only { display: none !important; }

    .grid-3 { grid-template-columns: repeat(3,1fr); }
    .grid-4 { grid-template-columns: repeat(4,1fr); }
}

/* ---- Desktop (≥ 1024px) ---- */
@media (min-width: 1024px) {
    .admin-content { padding: 28px 32px; }
    .emp-content   { padding: 28px 32px; }
}

/* ---- Mobile specific overrides ---- */
@media (max-width: 639px) {
    :root {
        --sidebar-w: 0px;
        --navbar-h:  56px;
    }
    .layout-admin { flex-direction: column; }
    .admin-main   { margin-left: 0; }
    .admin-content { padding: 14px; }
    .grid-4 { grid-template-columns: repeat(2,1fr); gap: 10px; }
    .grid-3 { grid-template-columns: repeat(2,1fr); gap: 10px; }
    .grid-2 { grid-template-columns: repeat(2,1fr); gap: 10px; }
    .stat-card { padding: 14px; gap: 10px; }
    .stat-value { font-size: 1.2rem; }
    .hide-mobile { display: none !important; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .card-body { padding: 14px; }
    .table { font-size: .78rem; }
    .table thead th { padding: 10px 10px; font-size: .68rem; }
    .table tbody td { padding: 10px 10px; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar form { flex-direction: column; }
    .filter-bar .form-control { max-width: 100% !important; }
    .modal-box { margin: 0 8px; }
}

/* ---- Laporan Bulanan Responsive ---- */
@media (max-width: 639px) {
    .laporan-stats { grid-template-columns: repeat(2,1fr) !important; }
}

/* ---- Employee Tablet Sidebar ---- */
@media (min-width: 768px) and (max-width: 1023px) {
    :root { --sidebar-w: 220px; }
    .emp-sidebar { width: 220px; }
}

/* ---- Print styles ---- */
@media print {
    .sidebar, .admin-topbar, .bottom-nav, .emp-topbar,
    .btn, .filter-bar, nav { display: none !important; }
    .admin-main { margin-left: 0 !important; }
    .admin-content, .emp-content { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ===== LAPORAN BULANAN SPECIFIC ===== */
.star-btn {
    font-size: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    transition: transform .15s, color .15s;
    color: #d1d5db;
    line-height: 1;
}
.star-btn.active, .star-btn:hover { color: #f59e0b; transform: scale(1.15); }

.period-badge-open  { background: rgba(134,239,172,.15); border: 1px solid rgba(134,239,172,.4); color: #15803d; }
.period-badge-close { background: rgba(248,113,113,.15); border: 1px solid rgba(248,113,113,.4); color: #b91c1c; }

/* Omset input styling */
.omset-prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
}

/* ===== ADMIN TABLE RESPONSIVE ===== */
@media (max-width: 900px) {
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table { min-width: 700px; }
}

/* ===== CHART CONTAINER ===== */
.chart-container {
    position: relative;
    height: 200px;
    width: 100%;
}

/* ===== PWA INSTALL BANNER ===== */
.pwa-banner {
    position: fixed;
    bottom: calc(var(--bottom-nav) + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--navy-800);
    color: #fff;
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .8rem;
    box-shadow: var(--shadow-lg);
    z-index: 150;
    max-width: 340px;
    width: calc(100% - 32px);
    animation: slideUp .3s ease;
}
@keyframes slideUp {
    from { opacity:0; transform: translateX(-50%) translateY(20px); }
    to   { opacity:1; transform: translateX(-50%) translateY(0); }
}
