/* ============================================================
   KELINDO — Clean Enterprise Design System
   Dual-theme (dark default / light), performance-first:
   - Tanpa backdrop-filter (hemat GPU mobile)
   - System font stack (tanpa download webfont)
   - Animasi hanya transform/opacity
   ============================================================ */

/* ===== DARK THEME (default) ===== */
:root, [data-theme="dark"] {
  --bg-base:        #0B0D12;
  --bg-surface:     #12151C;
  --bg-card:        #12151C;
  --bg-elevated:    #171B24;
  --bg-hover:       #1B202B;
  --border:         #1F242E;
  --border-strong:  #2A303C;
  --text-primary:   #F3F4F6;
  --text-secondary: #9CA3AF;
  --text-muted:     #6B7280;

  --primary:        #6366F1;
  --primary-hover:  #818CF8;
  --primary-active: #4F46E5;
  --primary-soft:   rgba(99,102,241,0.14);
  --on-primary:     #FFFFFF;

  --success:        #34D399;
  --success-soft:   rgba(52,211,153,0.13);
  --danger:         #F87171;
  --danger-soft:    rgba(248,113,113,0.13);
  --warning:        #FBBF24;
  --warning-soft:   rgba(251,191,36,0.13);
  --violet:         #A78BFA;
  --violet-soft:    rgba(167,139,250,0.13);

  --shadow-card:    0 1px 2px rgba(0,0,0,0.25);
  --shadow-pop:     0 12px 32px rgba(0,0,0,0.45);
  --nav-bg:         #0E1117;
  --overlay:        rgba(0,0,0,0.6);
  --track:          #1F242E;
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
  --bg-base:        #F6F7F9;
  --bg-surface:     #FFFFFF;
  --bg-card:        #FFFFFF;
  --bg-elevated:    #F3F4F6;
  --bg-hover:       #EEF0F3;
  --border:         #E5E7EB;
  --border-strong:  #D1D5DB;
  --text-primary:   #111827;
  --text-secondary: #4B5563;
  --text-muted:     #9CA3AF;

  --primary:        #4F46E5;
  --primary-hover:  #4338CA;
  --primary-active: #4338CA;
  --primary-soft:   rgba(79,70,229,0.09);
  --on-primary:     #FFFFFF;

  --success:        #059669;
  --success-soft:   rgba(5,150,105,0.10);
  --danger:         #DC2626;
  --danger-soft:    rgba(220,38,38,0.09);
  --warning:        #D97706;
  --warning-soft:   rgba(217,119,6,0.10);
  --violet:         #7C3AED;
  --violet-soft:    rgba(124,58,237,0.09);

  --shadow-card:    0 1px 2px rgba(16,24,40,0.05), 0 1px 3px rgba(16,24,40,0.05);
  --shadow-pop:     0 12px 32px rgba(16,24,40,0.14);
  --nav-bg:         #FFFFFF;
  --overlay:        rgba(17,24,39,0.45);
  --track:          #E5E7EB;
}

/* ===== SHARED TOKENS ===== */
:root {
  --radius-sm:   8px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-full: 9999px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ===== RESET & BASE ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100%;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  transition: background 0.25s ease, color 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}
h1, h2, h3, h4 { letter-spacing: -0.015em; font-weight: 700; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }
::selection { background: var(--primary-soft); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ===== CARD ===== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.card-elevated {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent; border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  outline: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent  { background: var(--success); color: #fff; }
[data-theme="dark"] .btn-accent { color: #052e22; }
.btn-ghost   { background: var(--bg-surface); border-color: var(--border); color: var(--text-primary); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-lg      { padding: 15px 28px; font-size: 0.9375rem; }
.btn-icon {
  width: 38px; height: 38px; padding: 0; border-radius: var(--radius-md);
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text-secondary); flex-shrink: 0;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ===== ABSEN BUTTON ===== */
.absen-btn-wrap {
  position: relative; display: flex; align-items: center; justify-content: center;
  margin: 28px auto; width: 176px; height: 176px;
}
.absen-btn-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--primary); opacity: 0.35;
  animation: ring-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
.absen-btn {
  position: relative; width: 152px; height: 152px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary); color: var(--on-primary);
  font-size: 0.9375rem; font-weight: 700; cursor: pointer; border: none;
  box-shadow: 0 8px 24px var(--primary-soft), var(--shadow-pop);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, transform 0.15s ease;
}
.absen-btn svg { width: 34px; height: 34px; }
.absen-btn:hover { background: var(--primary-hover); }
.absen-btn:active { transform: scale(0.96); }
.absen-btn:disabled { background: var(--bg-elevated); color: var(--text-muted); box-shadow: var(--shadow-card); cursor: not-allowed; }
.absen-btn.pulang-mode { background: var(--success); }
[data-theme="dark"] .absen-btn.pulang-mode { color: #052e22; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em;
  line-height: 1.5; white-space: nowrap;
}
.badge-normal  { background: var(--success-soft); color: var(--success); }
.badge-anomali { background: var(--danger-soft);  color: var(--danger); }
.badge-pending { background: var(--warning-soft); color: var(--warning); }
.badge-masuk   { background: var(--primary-soft); color: var(--primary); }
.badge-pulang  { background: var(--violet-soft);  color: var(--violet); }

/* ===== GPS INDICATOR ===== */
.gps-indicator {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--radius-full);
  background: var(--bg-surface); border: 1px solid var(--border);
  font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary);
  box-shadow: var(--shadow-card);
}
.gps-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.gps-dot.valid   { background: var(--success); }
.gps-dot.warning { background: var(--warning); }
.gps-dot.bad     { background: var(--danger); }
.gps-dot.loading { background: var(--text-muted); animation: pulse-dot 1.2s ease-in-out infinite; }
.gps-label { line-height: 1.4; }

/* ===== THEME TOGGLE ===== */
.theme-toggle-btn svg { width: 18px; height: 18px; display: block; margin: auto; }

/* ===== STEP INDICATOR ===== */
.step-indicator { display: flex; align-items: flex-start; justify-content: center; margin-bottom: 24px; }
.step-item { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; position: relative; }
.step-item:not(:last-child)::after {
  content: ''; position: absolute; top: 15px; left: calc(50% + 20px);
  width: calc(100% - 40px); height: 2px; background: var(--border);
  transition: background 0.3s ease;
}
.step-item.done:not(:last-child)::after { background: var(--success); }
.step-circle {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border-strong); color: var(--text-muted);
  font-size: 0.75rem; font-weight: 700; background: var(--bg-surface);
  transition: all 0.25s ease; z-index: 1;
}
.step-item.active .step-circle { border-color: var(--primary); color: var(--primary); }
.step-item.done .step-circle { background: var(--success); border-color: var(--success); color: #fff; }
.step-label { font-size: 0.6875rem; color: var(--text-muted); text-align: center; font-weight: 500; }
.step-item.active .step-label { color: var(--primary); }
.step-item.done .step-label { color: var(--success); }

/* ===== MODAL (bottom sheet) ===== */
.modal-overlay {
  position: fixed; inset: 0; background: var(--overlay);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-sheet {
  width: 100%; max-width: 480px; background: var(--bg-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border: 1px solid var(--border); border-bottom: none; padding: 24px;
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
  max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-pop);
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }
.modal-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 0 auto 20px; }

/* ===== CAMERA ===== */
.camera-wrap {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: #000; aspect-ratio: 3/4; max-height: 340px; margin: 0 auto;
  border: 1px solid var(--border);
}
.camera-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 16px; background: linear-gradient(transparent 55%, rgba(0,0,0,0.65));
}
.face-guide {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-60%);
  width: 160px; height: 200px; border: 2px solid rgba(255,255,255,0.55);
  border-radius: 50% 50% 40% 40% / 60% 60% 40% 40%;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.3);
}

/* ===== TOAST ===== */
#toast-container {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  z-index: 200; width: 100%; max-width: 360px; padding: 0 16px; pointer-events: none;
}
.toast {
  padding: 12px 16px; border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 500;
  background: var(--bg-surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  animation: toast-in 0.25s ease; pointer-events: all; width: 100%;
  display: flex; align-items: center; gap: 10px; color: var(--text-primary);
}
.toast svg { flex-shrink: 0; }
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-info    { border-left: 3px solid var(--primary); }
.toast-success svg { color: var(--success); }
.toast-error svg   { color: var(--danger); }
.toast-info svg    { color: var(--primary); }

/* ===== PAGE TOP BAR WITH BACK BUTTON ===== */
.page-top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.btn-back {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.btn-back:hover {
  background: var(--bg-hover);
}
.btn-back:active {
  transform: scale(0.94);
}
.btn-back svg {
  width: 18px;
  height: 18px;
}
.page-top-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 64px !important;
  background: var(--nav-bg) !important;
  border-top: 1px solid var(--border) !important;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05) !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 50 !important;
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
}
.bottom-nav-inner {
  width: 100% !important;
  max-width: 480px !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-around !important;
  margin: 0 auto !important;
  padding: 0 8px !important;
}
.nav-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  padding: 6px 10px !important;
  border-radius: var(--radius-sm) !important;
  cursor: pointer !important;
  color: var(--text-muted) !important;
  font-size: 0.625rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  transition: color 0.15s ease, transform 0.1s ease !important;
  text-decoration: none !important;
  border: none !important;
  background: transparent !important;
  -webkit-tap-highlight-color: transparent !important;
  min-width: 56px !important;
  flex: 1 !important;
  max-width: 100px !important;
}
.nav-item:active { transform: scale(0.94); }
.nav-item svg { width: 22px !important; height: 22px !important; flex-shrink: 0 !important; }
.nav-item.active { color: var(--primary) !important; font-weight: 700 !important; }

/* ===== FEATURE MENU GRID ===== */
.feature-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.feature-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px; border-radius: var(--radius-md);
  background: var(--bg-surface); border: 1px solid var(--border);
  cursor: pointer; text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.feature-item:hover { background: var(--bg-hover); }
.feature-item:active { transform: scale(0.97); }
.feature-icon {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.feature-icon svg { width: 20px; height: 20px; }
.feature-label { font-size: 0.6875rem; font-weight: 500; color: var(--text-secondary); text-align: center; line-height: 1.3; }

/* ===== STATUS CARD ===== */
.status-row { display: flex; gap: 12px; align-items: center; }
.status-col { flex: 1; min-width: 0; }
.status-time { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.status-divider { width: 1px; align-self: stretch; background: var(--border); flex-shrink: 0; }

/* ===== INFO BANNER / KETERANGAN ===== */
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}
.info-banner strong { color: var(--text-primary); }
.info-banner-icon {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
  flex-shrink: 0;
  margin-top: 2px;
}
.info-banner.masuk {
  background: var(--primary-soft);
  border-color: rgba(99,102,241,0.25);
  color: var(--text-primary);
}
.info-banner.masuk .info-banner-icon { color: var(--primary); }
.info-banner.pulang {
  background: var(--violet-soft);
  border-color: rgba(167,139,250,0.25);
  color: var(--text-primary);
}
.info-banner.pulang .info-banner-icon { color: var(--violet); }
.info-banner.success {
  background: var(--success-soft);
  border-color: rgba(52,211,153,0.25);
  color: var(--text-primary);
}
.info-banner.success .info-banner-icon { color: var(--success); }
.info-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 3px;
}
.info-tag.tag-masuk { background: var(--primary); color: #fff; }
.info-tag.tag-pulang { background: var(--violet); color: #fff; }
.info-tag.tag-done { background: var(--success); color: #fff; }
[data-theme="dark"] .info-tag.tag-done { color: #052e22; }

/* ===== APP LAYOUT & HEADER ===== */
.app-layout {
  min-height: 100vh;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding-bottom: 74px;
  background: var(--bg-base);
  position: relative;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

@media (max-width: 480px) {
  .app-layout {
    border-left: none;
    border-right: none;
  }
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.header-inner {
  width: 100%;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9375rem;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 6px var(--primary-soft);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-clock {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  background: var(--bg-elevated);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.dropdown-wrapper {
  position: relative;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.header-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

/* ===== PAGE LAYOUT ===== */
.page { min-height: 100vh; padding-bottom: 84px; animation: page-in 0.25s ease both; }
.page-header {
  position: sticky; top: 0; z-index: 40; padding: 12px 20px;
  background: var(--bg-base); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.25s ease;
}
.page-content { padding: 16px; width: 100%; flex: 1; }
.section-label {
  font-size: 0.6875rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* ===== AVATAR ===== */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }
.avatar-sm { width: 38px; height: 38px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 80px; height: 80px; }
.avatar-placeholder {
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: var(--on-primary); font-weight: 700;
}

/* ===== PROFILE ===== */
.profile-card { padding: 28px 24px; text-align: center; }
.profile-card .avatar-lg { margin: 0 auto 14px; }
.profile-info-row {
  display: flex; align-items: center; gap: 14px; padding: 15px 16px;
  border-bottom: 1px solid var(--border);
}
.profile-info-row:last-child { border-bottom: none; }
.profile-info-icon {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.profile-info-icon svg { width: 19px; height: 19px; }

/* ===== HISTORY ITEM ===== */
.history-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }
.history-icon {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.history-icon svg { width: 19px; height: 19px; }
.history-icon.masuk  { background: var(--primary-soft); color: var(--primary); }
.history-icon.pulang { background: var(--violet-soft); color: var(--violet); }

/* ===== SKELETON LOADING ===== */
.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--track) 37%, var(--bg-elevated) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.skeleton-circle { border-radius: 50%; }

/* ===== FORM ===== */
.form-group {
  margin-bottom: 12px;
}
.form-group.mb-0 { margin-bottom: 0; }
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-sizing: border-box;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-input::placeholder {
  color: var(--text-muted);
}
.form-input:disabled, .form-input[readonly] {
  background: var(--bg-elevated);
  border-color: var(--border);
  cursor: default;
  opacity: 0.9;
}
select.form-input {
  cursor: pointer;
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239CA3AF' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
select.form-input option {
  background: var(--bg-surface);
  color: var(--text-primary);
}
textarea.form-input {
  resize: vertical;
  min-height: 68px;
  font-family: inherit;
  line-height: 1.45;
}
.select-field {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text-primary);
  padding: 10px 36px 10px 14px; font-size: 0.875rem; font-weight: 500; cursor: pointer; outline: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239CA3AF' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  transition: border-color 0.15s ease;
}
.select-field:focus { border-color: var(--primary); }
.select-field option { background: var(--bg-surface); color: var(--text-primary); }

/* ===== MISC ===== */
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--border); border-top-color: var(--primary);
  animation: spin 0.7s linear infinite; flex-shrink: 0;
}
.spinner-lg { width: 40px; height: 40px; border-width: 3.5px; }
.progress-bar { height: 6px; border-radius: var(--radius-full); background: var(--track); overflow: hidden; }
.progress-fill { height: 100%; border-radius: var(--radius-full); background: var(--primary); transition: width 0.3s ease; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 44px 24px; text-align: center; }
.empty-icon {
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  background: var(--bg-elevated); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.empty-icon svg { width: 26px; height: 26px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ===== UTILITIES ===== */
.flex { display: flex; } .flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.w-full { width: 100%; } .text-center { text-align: center; }
.text-sm { font-size: 0.875rem; } .text-xs { font-size: 0.75rem; }
.text-primary { color: var(--text-primary); } .text-secondary { color: var(--text-secondary); } .text-muted { color: var(--text-muted); }
.text-accent { color: var(--success); } .text-danger { color: var(--danger); }
.font-bold { font-weight: 700; } .font-semibold { font-weight: 600; }
.mb-4{margin-bottom:4px;} .mb-8{margin-bottom:8px;} .mb-12{margin-bottom:12px;}
.mb-16{margin-bottom:16px;} .mb-20{margin-bottom:20px;} .mb-24{margin-bottom:24px;}
.mt-4{margin-top:4px;} .mt-8{margin-top:8px;} .mt-16{margin-top:16px;}
.hidden { display: none !important; }

/* ===== ANIMATIONS ===== */
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ring-pulse {
  0%   { transform: scale(1);    opacity: 0.35; }
  70%  { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.animate-in { animation: fade-in-up 0.35s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

@media (max-width: 400px) {
  .feature-grid { gap: 8px; }
  .feature-icon { width: 36px; height: 36px; }
  .page-content { padding: 16px; }
}

/* ===== DROPDOWN MENU ===== */
.dropdown-wrap, .dropdown-wrapper { position: relative; }
.dropdown-menu {
  position: absolute; top: 100%; right: 0; margin-top: 8px;
  width: 240px; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-pop);
  padding: 8px 0; z-index: 100;
  transform-origin: top right;
  animation: fade-in-up 0.2s ease;
}
.dropdown-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  color: var(--text-primary); font-size: 0.875rem; text-decoration: none;
  cursor: pointer; transition: background 0.15s ease;
  width: 100%; border: none; background: transparent; text-align: left;
}
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item svg, .theme-icon svg { width: 18px; height: 18px; color: var(--text-secondary); flex-shrink: 0; }
.theme-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown-header { padding: 10px 16px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-header .name { font-weight: 600; font-size: 0.875rem; color: var(--text-primary); }
.dropdown-header .role-branch { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

