/* ===== DESIGN TOKENS ===== */
    :root {
      --brand:        #ff7a1a;
      --brand-dark:   #ef5f19;
      --brand-soft:   #fff1e6;
      --orange-50:    #fff7ed;
      --orange-100:   #ffedd5;
      --orange-300:   #fdba74;
      --orange-500:   #f97316;
      --orange-700:   #c2410c;
      --bg:           #f6f7fb;
      --surface:      #ffffff;
      --text:         #1f2933;
      --muted:        #7b8794;
      --line:         #edf0f5;
      --success:      #16a34a;
      --success-soft: #eaf8ef;
      --warning:      #d97706;
      --warning-soft: #fff7e6;
      --error:        #dc2626;
      --error-soft:   #fff0f0;
      --shadow-sm:    0 4px 14px rgba(31,41,51,.07);
      --shadow-md:    0 14px 34px rgba(31,41,51,.10);
    }

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

    /* ===== BASE ===== */
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background: linear-gradient(135deg, #ff8a2a 0%, #ffb15a 35%, #f7efe7 100%);
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      color: var(--text);
    }

    /* ===== CONTAINER ===== */
    .container {
      width: 100%;
      max-width: 420px;
      height: 100vh;
      background: rgba(255,255,255,.88);
      backdrop-filter: blur(18px);
      border-radius: 24px;
      box-shadow: var(--shadow-md);
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    /* ===== PAGES ===== */
    .page {
      display: none;
      flex-direction: column;
      flex: 1;
      min-height: 0;
      animation: fadeIn .3s ease;
    }
    .page.active { display: flex; }

    .page-scroll {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding-bottom: 32px;
    }

    @keyframes fadeIn {
      from { opacity: 0; }
      to   { opacity: 1; }
    }

    /* ===== SESSION LOADING ===== */
    .session-loading {
      position: fixed;
      inset: 0;
      background: var(--bg);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 999;
    }
    .session-loading.hidden { display: none; }
    .session-loading .spinner { width: 28px; height: 28px; border-width: 3px; margin: 0; }

    /* ===== LOGIN ===== */
    #loginPage .page-scroll {
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding: 32px 24px;
    }

    .login-card {
      background: rgba(255,255,255,.85);
      backdrop-filter: blur(18px);
      border-radius: 24px;
      padding: 28px 24px;
      box-shadow: 0 20px 40px rgba(0,0,0,.08);
    }

    .header {
      text-align: center;
      margin-bottom: 24px;
    }

    .login-title {
      font-size: 32px;
      font-weight: 900;
      background: linear-gradient(135deg, #ff7a1a, #ffb347);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      margin-bottom: 4px;
    }

    .header p {
      color: var(--muted);
      font-size: 13px;
    }

    /* ===== FORM ===== */
    .form-group { margin-bottom: 16px; }

    label {
      display: block;
      margin-bottom: 6px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: .5px;
    }

    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="text"],
    select,
    textarea {
      width: 100%;
      padding: 10px 12px;
      border: none;
      border-radius: 12px;
      font-size: 13px;
      font-family: inherit;
      background: #f7f8fb;
      color: var(--text);
      transition: box-shadow .2s, background .2s;
    }

    textarea {
      resize: vertical;
      min-height: 90px;
      line-height: 1.5;
    }

    input:focus, select:focus, textarea:focus {
      outline: none;
      background: #fff;
      box-shadow: 0 0 0 3px rgba(255,122,26,.14);
    }

    /* Date input: paksa tampilan native browser ikut tone form lain */
    input[type="date"] {
      color: var(--text);
      -webkit-appearance: none;
      appearance: none;
    }
    input[type="date"]::-webkit-calendar-picker-indicator {
      filter: invert(.45) sepia(1) saturate(4) hue-rotate(2deg);
      cursor: pointer;
      opacity: .8;
    }
    input[type="date"]::-webkit-calendar-picker-indicator:hover {
      opacity: 1;
    }

    .password-field { position: relative; }
    .password-field input { padding-right: 40px; }

    .toggle-password {
      position: absolute;
      top: 50%; right: 8px;
      transform: translateY(-50%);
      width: auto;
      padding: 4px;
      margin: 0;
      background: none;
      box-shadow: none;
      color: var(--muted);
      display: flex;
      align-items: center;
    }
    .toggle-password:hover  { background: none; box-shadow: none; color: var(--text); }
    .toggle-password:active { transform: translateY(-50%) scale(.95); }

    /* ===== BUTTONS ===== */
    button {
      width: 100%;
      padding: 12px;
      background: var(--brand);
      color: #fff;
      border: none;
      border-radius: 14px;
      font-size: 14px;
      font-weight: 800;
      font-family: inherit;
      cursor: pointer;
      transition: transform .1s, box-shadow .2s, background .2s;
      margin-top: 10px;
      box-shadow: 0 10px 24px rgba(255,122,26,.22);
    }
    button:hover   { background: var(--brand-dark); box-shadow: 0 12px 26px rgba(255,122,26,.28); }
    button:active  { transform: scale(.98); }
    button:disabled { opacity: .55; cursor: not-allowed; }

    .secondary-btn {
      background: #f5f6f9;
      color: var(--text);
      box-shadow: none;
    }
    .secondary-btn:hover { background: #eef1f5; box-shadow: none; }

    /* ===== SPINNER ===== */
    .spinner {
      display: inline-block;
      width: 14px; height: 14px;
      border: 2px solid #ff9500;
      border-top-color: transparent;
      border-radius: 50%;
      animation: spin .8s linear infinite;
      margin-right: 6px;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ===== ALERTS ===== */
    .error {
      background: var(--error-soft);
      color: var(--error);
      padding: 10px 12px;
      border-radius: 14px;
      margin-bottom: 16px;
      font-size: 12px;
    }

    .success {
      background: var(--success-soft);
      color: var(--success);
      padding: 14px 16px;
      border-radius: 16px;
      margin-bottom: 16px;
      font-size: 13px;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 10px;
      animation: successPop .3s ease-out;
    }
    .success .success-icon {
      flex-shrink: 0;
      width: 28px; height: 28px;
      border-radius: 50%;
      background: var(--success);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      font-weight: 800;
    }
    @keyframes successPop {
      from { opacity: 0; transform: scale(.92); }
      to   { opacity: 1; transform: scale(1); }
    }

    /* ===== HERO / TOP BAR ===== */
    .top-bar {
      background: linear-gradient(135deg, #ff7a1a, #ff9a3c);
      padding: 18px;
      margin: 14px 14px 0;
      border-radius: 22px;
      transition: background .25s ease, box-shadow .25s ease, transform .25s ease;
    }

    .attendance-hero.state-pending {
      background: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
      box-shadow: 0 12px 24px rgba(245, 158, 11, 0.18);
    }

    .attendance-hero.state-ready {
      background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
      box-shadow: 0 12px 24px rgba(22, 163, 74, 0.2);
    }

    .attendance-hero.state-complete {
      background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
      box-shadow: 0 12px 24px rgba(15, 118, 110, 0.18);
    }

    .attendance-hero.state-pending .hero-badge,
    .attendance-hero.state-pending .hero-next,
    .attendance-hero.state-pending .hero-meta-item {
      background: rgba(255,255,255,.18);
      color: #fff;
    }

    .attendance-hero.state-ready .hero-badge,
    .attendance-hero.state-ready .hero-next,
    .attendance-hero.state-ready .hero-meta-item {
      background: rgba(255,255,255,.2);
      color: #fff;
    }

    .attendance-hero.state-complete .hero-badge,
    .attendance-hero.state-complete .hero-next,
    .attendance-hero.state-complete .hero-meta-item {
      background: rgba(255,255,255,.2);
      color: #fff;
    }

    .attendance-hero .hero-badge::before {
      content: '●';
      font-size: 10px;
      line-height: 1;
      opacity: .95;
      margin-right: 4px;
    }

    .attendance-hero.state-pending .hero-badge::before { color: #fde68a; }
    .attendance-hero.state-ready .hero-badge::before { color: #bbf7d0; }
    .attendance-hero.state-complete .hero-badge::before { color: #ccfbf1; }

    /* Hero absensi sekarang berada di dalam .content-area (bukan lagi
       elemen global), jadi spacing kiri/kanan/atas sudah ditangani oleh
       padding .content-area itu sendiri — margin di sini perlu dihapus
       supaya tidak terjadi spacing ganda. */
    .content-area .attendance-hero {
      margin: 0 0 14px;
    }

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

    .brand-mark {
      color: rgba(255,255,255,.78);
      font-size: 13px;
      font-weight: 900;
    }

    .hero-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 5px 10px;
      border-radius: 999px;
      background: rgba(255,255,255,.22);
      color: #fff;
      font-size: 11px;
      font-weight: 900;
    }

    .top-bar p,
    .top-bar h1 { color: #fff; }

    .top-bar p { font-size: 12px; opacity: .9; font-weight: 600; }

    .top-bar h1 {
      font-size: 22px;
      font-weight: 900;
      line-height: 1.15;
      margin: 4px 0 6px;
    }

    .hero-subtitle {
      font-size: 12px;
      color: rgba(255,255,255,.88);
      line-height: 1.5;
      margin-bottom: 12px;
    }

    .hero-meta {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-bottom: 10px;
    }

    .hero-meta-item {
      background: rgba(255,255,255,.18);
      backdrop-filter: blur(8px);
      border-radius: 14px;
      padding: 10px;
    }
    .hero-meta-item span {
      display: block;
      color: rgba(255,255,255,.72);
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: .5px;
      margin-bottom: 3px;
    }
    .hero-meta-item strong {
      display: block;
      color: #fff;
      font-size: 12px;
      line-height: 1.3;
    }

    .hero-next {
      background: rgba(255,255,255,.18);
      border-radius: 14px;
      color: #fff;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.45;
      padding: 10px 12px;
    }

    /* ===== QUICK TABS ===== */
    .quick-tabs {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 8px;
      padding: 12px 14px 0;
    }

    .quick-tab {
      margin: 0;
      padding: 11px 6px;
      border: none;
      border-radius: 16px;
      background: #fff;
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      font-family: inherit;
      box-shadow: 0 3px 10px rgba(0,0,0,.06);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 5px;
      cursor: pointer;
      transition: background .2s, color .2s, box-shadow .2s, transform .1s;
    }

    .quick-tab:hover {
      background: var(--orange-50);
      color: var(--brand-dark);
      box-shadow: 0 4px 14px rgba(255,122,26,.12);
    }

    .quick-tab:active { transform: scale(.96); }

    .quick-tab.active {
      background: var(--brand);
      color: #fff;
      box-shadow: 0 6px 18px rgba(255,122,26,.28);
    }

    /* ===== ADMIN TABS (2 grup: 3 atas + 2 bawah center) ===== */
    .admin-tabs {
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 12px 14px 0;
    }
    .admin-tabs-row {
      display: grid;
      gap: 8px;
    }
    .admin-tabs-row.row-3 { grid-template-columns: repeat(3, 1fr); }
    .admin-tabs-row.row-2 {
      grid-template-columns: repeat(2, 1fr);
      width: calc(66.666% + 8px / 3 * 2);
      margin: 0 auto;
    }

    .admin-tab {
      margin: 0;
      padding: 11px 6px;
      border: none;
      border-radius: 16px;
      background: #fff;
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      font-family: inherit;
      box-shadow: 0 3px 10px rgba(0,0,0,.06);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 5px;
      cursor: pointer;
      transition: background .2s, color .2s, box-shadow .2s, transform .1s;
      white-space: nowrap;
    }
    .admin-tab:hover {
      background: var(--orange-50);
      color: var(--brand-dark);
      box-shadow: 0 4px 14px rgba(255,122,26,.12);
    }
    .admin-tab:active { transform: scale(.96); }
    .admin-tab.active {
      background: var(--brand);
      color: #fff;
      box-shadow: 0 6px 18px rgba(255,122,26,.28);
    }
    .admin-tab-icon { font-size: 18px; line-height: 1; }
    .admin-tab-label { font-size: 10px; font-weight: 700; }

    .admin-section { display: none; }
    .admin-section.active { display: block; }

    /* Toggle kecil di dalam tab Absensi: Hari Ini vs Rekap Bulanan */
    .sub-toggle {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-bottom: 14px;
    }
    .sub-toggle button {
      margin: 0;
      padding: 10px;
      font-size: 12px;
      background: #fff;
      color: var(--muted);
      box-shadow: 0 3px 10px rgba(0,0,0,.06);
    }
    .sub-toggle button.active {
      background: var(--brand);
      color: #fff;
      box-shadow: 0 6px 18px rgba(255,122,26,.28);
    }

    .tab-icon {
      font-size: 18px;
      line-height: 1;
    }

    .tab-label {
      font-size: 11px;
      font-weight: 700;
    }

    /* ===== CONTENT AREA ===== */
    .content-area {
      padding: 14px 14px 32px;
    }

    .app-section { display: none; }
    .app-section.active { display: block; }

    /* ===== SECTION HEADER ===== */
    .section-title { margin-bottom: 14px; }
    .section-title h2 { color: var(--text); font-size: 20px; font-weight: 900; margin-bottom: 3px; }
    .section-title p  { color: var(--muted); font-size: 12px; }

    /* ===== USER INFO BAR ===== */
    .user-info {
      background: var(--surface);
      padding: 12px 14px;
      border-radius: 18px;
      margin-bottom: 12px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      box-shadow: var(--shadow-sm);
    }
    .user-name { font-weight: 800; color: var(--text); font-size: 14px; margin-bottom: 2px; }
    .user-role { font-size: 11px; color: var(--muted); font-weight: 600; }

    .logout-btn {
      width: auto;
      background: var(--brand-soft);
      color: var(--brand-dark);
      padding: 6px 12px;
      font-size: 11px;
      border-radius: 999px;
      margin-top: 0;
      flex-shrink: 0;
      box-shadow: none;
    }
    .logout-btn:hover { background: #ffe3cc; box-shadow: none; }

    /* ===== INFO BOX / CARDS ===== */
    .info-box {
      background: var(--surface);
      padding: 14px;
      border-radius: 18px;
      margin-bottom: 10px;
      font-size: 12px;
      color: var(--muted);
      box-shadow: var(--shadow-sm);
      border: 1px solid rgba(255,122,26,.06);
    }

    .workflow-card { position: relative; overflow: hidden; }
    .workflow-card::before {
      content: "";
      position: absolute;
      top: 14px; right: 14px;
      width: 8px; height: 8px;
      border-radius: 50%;
      background: var(--orange-300);
      opacity: .6;
    }

    .status-card { background: linear-gradient(160deg, #fff 0%, var(--orange-50) 100%); }

    /* ===== DASHBOARD RINGKASAN (kartu statistik) ===== */
    .stat-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-bottom: 14px;
    }
    .stat-card {
      background: var(--surface);
      border-radius: 18px;
      padding: 14px;
      box-shadow: var(--shadow-sm);
      border: 1px solid rgba(255,122,26,.06);
    }
    .stat-card .stat-label {
      font-size: 11px;
      color: var(--muted);
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: .5px;
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      gap: 5px;
    }
    .stat-card .stat-value {
      font-size: 24px;
      font-weight: 800;
      color: var(--text);
      line-height: 1.1;
    }
    .stat-card .stat-sub {
      font-size: 11px;
      color: var(--muted);
      margin-top: 4px;
    }
    .stat-card.accent .stat-value { color: var(--brand); }
    .stat-card.danger .stat-value { color: var(--error); }
    .stat-card.success .stat-value { color: var(--success); }

    /* Toggle kecil (mis. per individu vs keseluruhan) */
    .mini-toggle {
      display: flex;
      gap: 6px;
      margin-bottom: 10px;
      flex-wrap: wrap;
    }
    .mini-toggle button {
      flex: 1;
      min-width: 100px;
      padding: 8px 10px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--surface);
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
    }
    .mini-toggle button.active {
      background: var(--brand);
      color: #fff;
      border-color: var(--brand);
    }
    .mini-toggle select {
      flex: 1;
      min-width: 140px;
      padding: 8px 10px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--surface);
      color: var(--text);
      font-size: 12px;
      font-weight: 700;
    }

    /* Ranking list (siapa paling sering telat/tidak hadir) */
    .ranking-list { display: flex; flex-direction: column; gap: 8px; }
    .ranking-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px;
      border-radius: 14px;
      background: var(--bg);
    }
    .ranking-rank {
      width: 24px; height: 24px;
      border-radius: 50%;
      background: var(--surface);
      display: flex; align-items: center; justify-content: center;
      font-size: 11px; font-weight: 800; color: var(--muted);
      flex-shrink: 0;
      box-shadow: var(--shadow-sm);
    }
    .ranking-item:nth-child(1) .ranking-rank { background: #fff1e6; color: var(--brand-dark); }
    .ranking-info { flex: 1; min-width: 0; }
    .ranking-name { font-size: 13px; font-weight: 700; color: var(--text); }
    .ranking-meta { font-size: 11px; color: var(--muted); }
    .ranking-count {
      font-size: 15px;
      font-weight: 800;
      color: var(--error);
      flex-shrink: 0;
    }

    /* Chart container */
    .chart-wrap {
      position: relative;
      width: 100%;
      height: 220px;
      margin: 6px 0 4px;
    }

    /* Kalender mini */
    .cal-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 4px;
      margin-top: 8px;
    }
    .cal-weekday {
      text-align: center;
      font-size: 10px;
      font-weight: 800;
      color: var(--muted);
      padding-bottom: 2px;
    }
    .cal-day {
      aspect-ratio: 1;
      border-radius: 8px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      font-weight: 700;
      color: var(--text);
      background: var(--bg);
      position: relative;
    }
    .cal-day.empty { background: transparent; }
    .cal-day.hadir { background: var(--success-soft); color: var(--success); }
    .cal-day.telat { background: var(--warning-soft); color: var(--warning); }
    .cal-day.cuti { background: var(--orange-100); color: var(--orange-700); }
    .cal-day.absen { background: var(--error-soft); color: var(--error); }
    .cal-day.libur { background: #eef2f7; color: #64748b; }
    .cal-day.today { box-shadow: inset 0 0 0 2px var(--brand); }
    .cal-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 10px;
      font-size: 11px;
      color: var(--muted);
    }
    .cal-legend span { display: inline-flex; align-items: center; gap: 4px; }
    .cal-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }


    .info-label {
      color: var(--muted);
      font-size: 11px;
      margin-bottom: 6px;
      text-transform: uppercase;
      letter-spacing: .6px;
      font-weight: 800;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .info-value { font-size: 14px; font-weight: 700; color: var(--text); }

    /* ===== STATUS PILLS ===== */
    .status-ok {
      color: var(--success); background: var(--success-soft);
      font-weight: 800;
      display: inline-flex; align-items: center; gap: 5px;
      padding: 5px 10px; border-radius: 999px;
    }
    .status-error {
      color: var(--error); background: var(--error-soft);
      font-weight: 800;
      display: inline-flex; align-items: center; gap: 5px;
      padding: 5px 10px; border-radius: 999px;
    }
    .status-warning {
      color: var(--warning); background: var(--warning-soft);
      font-weight: 800;
      display: inline-flex; align-items: center; gap: 5px;
      padding: 5px 10px; border-radius: 999px;
    }

    /* ===== ICON CHIP ===== */
    .icon {
      display: inline-flex;
      width: 22px; height: 22px;
      border-radius: 8px;
      align-items: center; justify-content: center;
      background: var(--brand-soft);
      color: var(--brand-dark);
      font-size: 12px;
      line-height: 1;
    }

    /* ===== CAMERA / PHOTO ===== */
    .photo-preview {
      width: 100%;
      max-width: 200px;
      aspect-ratio: 3/4;
      background: #f7f8fb;
      border-radius: 16px;
      margin: 12px auto;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
    }
    .photo-preview img { width: 100%; height: 100%; object-fit: cover; }
    .photo-preview.empty { color: #999; font-size: 12px; text-align: center; padding: 0 16px; }

    video {
      width: 100%;
      max-width: 200px;
      aspect-ratio: 3/4;
      background: #000;
      border-radius: 16px;
      object-fit: cover;
      display: block;
      margin: 0 auto;
    }

    canvas { display: none; }

    /* ===== BUTTON GROUP ===== */
    .button-group {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-top: 14px;
    }
    .button-group button { margin-top: 0; }

    #absenMasukBtn { background: var(--success); box-shadow: 0 10px 24px rgba(22,163,74,.22); }
    #absenMasukBtn:hover { background: #128a3e; box-shadow: 0 12px 26px rgba(22,163,74,.28); }

    #absenKeluarBtn { background: var(--error); box-shadow: 0 10px 24px rgba(220,38,38,.22); }
    #absenKeluarBtn:hover { background: #b91c1c; box-shadow: 0 12px 26px rgba(220,38,38,.28); }

    /* ===== ATTENDANCE LIST ===== */
    .attendance-item {
      background: var(--surface);
      padding: 14px;
      border-radius: 18px;
      margin-bottom: 10px;
      font-size: 12px;
      box-shadow: var(--shadow-sm);
    }
    .attendance-date  { font-weight: 600; color: var(--text); margin-bottom: 4px; }
    .attendance-shift { color: var(--brand-dark); font-weight: 700; margin-bottom: 4px; }
    .attendance-time  { color: var(--muted); margin-bottom: 6px; }
    .attendance-status {
      font-size: 11px;
      padding: 4px 9px;
      border-radius: 999px;
      background: var(--brand-soft);
      color: var(--brand-dark);
      font-weight: 800;
    }

    .empty-state {
      text-align: center;
      color: var(--muted);
      padding: 24px 18px;
      font-size: 12px;
      background: var(--surface);
      border-radius: 18px;
      box-shadow: var(--shadow-sm);
      line-height: 1.5;
    }

    /* ===== ADMIN: LEAVE CARDS ===== */
    .admin-leave-card {
      background: var(--surface);
      padding: 14px;
      border-radius: 18px;
      margin-top: 10px;
      box-shadow: var(--shadow-sm);
      font-size: 12px;
    }
    .admin-leave-card .admin-leave-name {
      font-weight: 800;
      color: var(--text);
      font-size: 14px;
      margin-bottom: 4px;
    }
    .admin-leave-card .admin-leave-reason {
      color: var(--muted);
      margin-bottom: 6px;
    }
    .admin-leave-card .admin-leave-date {
      color: var(--muted);
      margin-bottom: 8px;
    }
    .admin-leave-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-top: 10px;
    }
    .admin-leave-actions button {
      margin-top: 0;
      padding: 9px;
      font-size: 12px;
    }
    .btn-approve { background: var(--success); box-shadow: 0 8px 18px rgba(22,163,74,.20); }
    .btn-approve:hover { background: #128a3e; box-shadow: 0 10px 20px rgba(22,163,74,.26); }
    .btn-reject { background: var(--error); box-shadow: 0 8px 18px rgba(220,38,38,.20); }
    .btn-reject:hover { background: #b91c1c; box-shadow: 0 10px 20px rgba(220,38,38,.26); }

    /* ===== ADMIN: EMPLOYEE CARDS ===== */
    .employee-card {
      background: var(--surface);
      padding: 14px;
      border-radius: 18px;
      margin-top: 10px;
      box-shadow: var(--shadow-sm);
      font-size: 12px;
    }
    .employee-card.inactive { opacity: .55; }
    .employee-card .employee-name {
      font-weight: 800;
      color: var(--text);
      font-size: 14px;
      margin-bottom: 2px;
    }
    .employee-card .employee-meta {
      color: var(--muted);
      margin-bottom: 8px;
      line-height: 1.6;
    }
    .employee-card .employee-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-top: 8px;
    }
    .employee-card .employee-actions button {
      margin-top: 0;
      padding: 9px;
      font-size: 12px;
    }
    .btn-neutral { background: #f5f6f9; color: var(--text); box-shadow: none; }
    .btn-neutral:hover { background: #eef1f5; box-shadow: none; }

    /* ===== FORM MODAL (tambah/edit karyawan) ===== */
    .form-modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(17, 24, 39, 0.5);
      backdrop-filter: blur(3px);
      display: flex;
      align-items: flex-end;
      justify-content: center;
      z-index: 1000;
      opacity: 0;
      pointer-events: none;
      transition: opacity .2s ease;
    }
    .form-modal-overlay.active {
      opacity: 1;
      pointer-events: auto;
    }
    .form-modal-box {
      background: var(--surface);
      border-radius: 24px 24px 0 0;
      padding: 22px 20px 28px;
      max-width: 420px;
      width: 100%;
      max-height: 85vh;
      overflow-y: auto;
      box-shadow: 0 -10px 40px rgba(0,0,0,.2);
      transform: translateY(20px);
      transition: transform .25s ease;
    }
    .form-modal-overlay.active .form-modal-box {
      transform: translateY(0);
    }
    .form-modal-title {
      font-size: 16px;
      font-weight: 900;
      color: var(--text);
      margin-bottom: 4px;
    }
    .form-modal-subtitle {
      font-size: 12px;
      color: var(--muted);
      margin-bottom: 16px;
      line-height: 1.5;
    }
    .form-modal-actions {
      display: flex;
      gap: 8px;
      margin-top: 18px;
    }
    .form-modal-actions button { margin-top: 0; flex: 1; }

    .uid-instruction-box {
      background: var(--brand-soft);
      border-radius: 14px;
      padding: 12px 14px;
      font-size: 12px;
      color: var(--text);
      line-height: 1.6;
      margin-bottom: 14px;
    }
    .uid-instruction-box code {
      background: rgba(255,255,255,.6);
      padding: 1px 6px;
      border-radius: 6px;
      font-size: 11px;
    }

    /* ===== PROFILE ===== */
    .profile-row {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 0;
      border-bottom: 1px solid var(--line);
      font-size: 12px;
    }
    .profile-row:last-child { border-bottom: none; }
    .profile-label { color: var(--muted); }
    .profile-value { color: var(--text); font-weight: 800; text-align: right; }

    /* ===== SALDO CUTI (hierarki: angka besar jadi fokus utama) ===== */
    .leave-balance-value {
      font-size: 36px;
      font-weight: 900;
      color: var(--brand-dark);
      line-height: 1.1;
      margin-top: 2px;
    }
    .leave-entitlement-note {
      margin-top: 10px;
      color: var(--muted);
      font-size: 12px;
      padding-top: 10px;
      border-top: 1px solid var(--line);
    }

    /* ===== MOBILE ===== */
    @media (max-width: 480px) {
      body { padding: 0; align-items: flex-start; }

      .container {
        border-radius: 0;
        max-width: 100%;
        min-height: 100vh;
        box-shadow: none;
      }

      .top-bar { margin: 10px 10px 0; padding: 14px; border-radius: 18px; }
      .top-bar h1 { font-size: 19px; }

      .quick-tabs { padding: 10px 10px 0; gap: 6px; }

      .quick-tab { padding: 10px 4px; border-radius: 14px; }
      .tab-icon  { font-size: 17px; }
      .tab-label { font-size: 10px; }

      .content-area { padding: 12px 10px 28px; }

      .photo-preview, video { max-width: 170px; }

      button { padding: 10px; font-size: 13px; }

      input[type="email"],
      input[type="password"],
      select { padding: 9px 10px; font-size: 12px; }

      .section-title h2 { font-size: 18px; }
    }
    /* ===== MODAL SYSTEM ===== */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(17, 24, 39, 0.5);
      backdrop-filter: blur(3px);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      z-index: 1000;
      opacity: 0;
      pointer-events: none;
      transition: opacity .2s ease;
    }
    .modal-overlay.active {
      opacity: 1;
      pointer-events: auto;
    }

    .modal-box {
      background: var(--surface);
      border-radius: 22px;
      padding: 26px 22px 20px;
      max-width: 320px;
      width: 100%;
      box-shadow: 0 24px 60px rgba(0,0,0,.25);
      text-align: center;
      transform: scale(.9) translateY(8px);
      transition: transform .2s ease;
    }
    .modal-overlay.active .modal-box {
      transform: scale(1) translateY(0);
    }

    .modal-icon {
      width: 52px;
      height: 52px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 14px;
      font-size: 26px;
      font-weight: 800;
    }
    .modal-icon.success { background: var(--success-soft); color: var(--success); }
    .modal-icon.error   { background: var(--error-soft);   color: var(--error); }
    .modal-icon.warning { background: var(--warning-soft); color: var(--warning); }
    .modal-icon.confirm { background: var(--brand-soft);   color: var(--brand-dark); }

    .modal-title {
      font-size: 16px;
      font-weight: 900;
      color: var(--text);
      margin-bottom: 6px;
    }

    .modal-message {
      font-size: 13px;
      color: var(--muted);
      line-height: 1.55;
      margin-bottom: 20px;
    }

    .modal-actions {
      display: flex;
      gap: 8px;
    }
    .modal-actions button {
      margin-top: 0;
      flex: 1;
    }
    .modal-actions .modal-btn-cancel {
      background: #f5f6f9;
      color: var(--text);
      box-shadow: none;
    }
    .modal-actions .modal-btn-cancel:hover { background: #eef1f5; box-shadow: none; }

    @media (max-width: 480px) {
      .modal-box { padding: 22px 18px 18px; }
    }

/* Jadwal libur mingguan */
.dayoff-week { border:1px solid var(--line); border-radius:12px; padding:12px; margin-bottom:10px; }
.dayoff-week-head { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:8px; }
.dayoff-week-label { font-weight:700; font-size:13px; color:var(--text); }
.dayoff-week-range { font-weight:600; color:var(--muted); font-size:12px; }
.dayoff-select { width:100%; padding:9px 10px; border:1px solid var(--line); border-radius:10px; font-size:13px; margin-bottom:8px; background:var(--surface); color:var(--text); }
.dayoff-actions { display:flex; gap:8px; }
.dayoff-actions button { flex:1; }
.dayoff-actions .secondary { background:var(--surface); color:var(--text); border:1px solid var(--line); }
.dayoff-picked { font-size:13px; color:var(--text); }

.dayoff-home { border-left:4px solid var(--line); }
.dayoff-home-approved { border-left-color: var(--success); }
.dayoff-home-pending { border-left-color: var(--warning); }
.dayoff-home-rejected { border-left-color: var(--error); }
.dayoff-home-none { border-left-color: #94a3b8; }
.dayoff-home-body { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:6px; }
.dayoff-home-detail { font-size:13px; color:var(--text); }
