/* ===== DESIGN TOKENS ===== */
:root {
  --primary: #007BB5;
  --primary-light: #00A3E0;
  --primary-dark: #003B63;
  --primary-bg: #E1F4FD;
  --surface: #FFFFFF;
  --surface-2: #F8FAFF;
  --surface-3: #EEF4FF;
  --text-primary: #0D1B2A;
  --text-secondary: #3D5A80;
  --text-muted: #7A90A8;
  --success: #1B8C4E;
  --success-bg: #E8F8F0;
  --warning: #D4760A;
  --warning-bg: #FFF4E0;
  --error: #C62828;
  --error-bg: #FFEBEE;
  --border: #D8E6F3;
  --shadow-sm: 0 1px 4px rgba(21,101,192,0.08);
  --shadow: 0 4px 16px rgba(21,101,192,0.12);
  --shadow-lg: 0 8px 32px rgba(21,101,192,0.18);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --nav-height: 64px;
  --header-height: 60px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface-2);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
input, select, textarea, button { font-family: inherit; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ===== APP SHELL ===== */
#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ===== HEADER ===== */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  box-shadow: var(--shadow-sm);
}
.header-logo { display: flex; align-items: center; gap: 10px; }
.header-logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 14px; letter-spacing: -0.5px;
}
.header-separator {
  width: 1px;
  height: 16px;
  background: var(--border, rgba(0,0,0,0.12));
  margin: 0 4px;
}
.header-page-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #0F172A);
  letter-spacing: -0.2px;
}
.dark-theme .header-separator {
  background: rgba(255,255,255,0.18);
}
.dark-theme .header-page-title {
  color: #FFFFFF;
}
.header-logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
  display: block;
}
.logo-dark {
  display: none;
}
.dark-theme .logo-light {
  display: none;
}
.dark-theme .logo-dark {
  display: block;
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-3); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: all 0.2s;
}
.icon-btn:active { transform: scale(0.94); background: var(--primary-bg); }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: 6px; padding-right: 6px;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; cursor: pointer;
  padding: 8px 4px; border: none; background: transparent;
  color: var(--text-muted); transition: all 0.2s; position: relative;
}
.nav-item.active { color: var(--primary); }
.nav-item.active .nav-icon {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  color: var(--primary);
}
.nav-icon { font-size: 24px; line-height: 1; transition: all 0.2s; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.material-symbols-outlined {
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: 50px;
  direction: ltr;
  display: inline-block;
  vertical-align: middle;
}
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: 0.1px; }

/* ===== PAGE CONTAINER ===== */
.page {
  flex: 1;
  margin-top: var(--header-height);
  margin-bottom: var(--nav-height);
  overflow-y: auto;
  padding: 16px;
  min-height: calc(100vh - var(--header-height) - var(--nav-height));
}
.page-no-nav { margin-bottom: 0; }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.card-subtitle { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* ===== STAT CARDS ===== */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 14px; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; top: -20px; right: -20px;
  width: 70px; height: 70px; border-radius: 50%;
  background: var(--primary-bg); opacity: 0.6;
}
.stat-value { font-size: 28px; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 4px; }
.stat-icon { font-size: 22px; margin-bottom: 6px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0.3px;
}
.form-label .required { color: var(--error); margin-left: 2px; }
.form-control {
  width: 100%; padding: 12px 14px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s; outline: none;
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(66,165,245,0.15);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A90A8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px;
}
textarea.form-control { resize: vertical; min-height: 80px; }
input[type="date"].form-control {
  min-height: 45px;
  -webkit-appearance: listbox;
  appearance: listbox;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; border: none; cursor: pointer;
  transition: all 0.2s; letter-spacing: 0.2px; width: 100%;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; box-shadow: 0 4px 12px rgba(21,101,192,0.35);
}
.btn-primary:active { box-shadow: 0 2px 6px rgba(21,101,192,0.25); }
.btn-secondary {
  background: var(--surface-3); color: var(--primary); border: 1.5px solid var(--border);
}
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--error); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-sm { padding: 8px 14px; font-size: 12px; }
.btn-icon { width: auto; padding: 10px; border-radius: 50%; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
}
.badge-primary { background: var(--primary-bg); color: var(--primary-dark); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-muted { background: var(--surface-3); color: var(--text-secondary); }

/* ===== LIST ITEMS ===== */
.lead-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 14px;
  margin-bottom: 10px; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: all 0.2s; position: relative;
}
.lead-card:active { transform: scale(0.99); box-shadow: var(--shadow); }
.lead-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.lead-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.lead-mobile { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.lead-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.lead-city { font-size: 12px; color: var(--text-secondary); }
.lead-assigned { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.lead-stripe {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; border-radius: var(--radius) 0 0 var(--radius);
}
.stripe-confirmed { background: var(--success); }
.stripe-quoted { background: var(--primary-light); }
.stripe-visited { background: #7B61FF; }
.stripe-notinterested { background: var(--error); }
.stripe-default { background: var(--border); }

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; margin-top: 4px;
}
.section-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.section-count {
  font-size: 12px; font-weight: 600;
  background: var(--primary-bg); color: var(--primary);
  padding: 3px 10px; border-radius: 20px;
}

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px;
}
.search-bar input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--text-primary);
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-muted); font-size: 16px; }

/* ===== FILTER CHIPS ===== */
.filter-chips { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; }
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 6px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text-secondary); transition: all 0.2s;
}
.chip.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ===== FAB ===== */
.fab {
  position: fixed; right: 20px; bottom: calc(var(--nav-height) + 16px);
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border: none; cursor: pointer;
  box-shadow: 0 6px 20px rgba(21,101,192,0.45);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; transition: all 0.2s; z-index: 50;
}
.fab:active { transform: scale(0.93); box-shadow: 0 3px 10px rgba(21,101,192,0.3); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(13,27,42,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-height: 92vh; overflow-y: auto;
  padding: 20px 16px 32px;
  animation: slideUp 0.3s cubic-bezier(0.32,0.72,0,1);
}
.modal-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--border); margin: 0 auto 18px;
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 18px; color: var(--text-primary); }
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px 24px;
  background-color: #030812;
  background-image: 
    radial-gradient(ellipse at top right, rgba(0, 212, 255, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at bottom left, rgba(0, 114, 255, 0.15) 0%, transparent 60%),
    linear-gradient(135deg, #02060D 0%, #061122 100%);
  position: relative;
  overflow: hidden;
}

/* Subtle animated light streaks */
.login-page::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: 
    linear-gradient(45deg, transparent 40%, rgba(0, 212, 255, 0.05) 50%, transparent 60%),
    linear-gradient(-45deg, transparent 45%, rgba(0, 114, 255, 0.04) 50%, transparent 55%);
  background-size: 150% 150%;
  animation: streakMove 15s linear infinite;
  z-index: 0;
}
@keyframes streakMove {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

.login-page::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 100px rgba(0,0,0,0.8);
  z-index: 0;
  pointer-events: none;
}

.login-logo-wrap { 
  position: relative; z-index: 1; 
  margin-bottom: 60px; 
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.login-logo-img {
  width: 100%;
  max-width: 320px;
  height: auto;
  object-fit: contain;
}
.login-logo-sub {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: rgba(255,255,255,0.45);
  letter-spacing: 6px;
  text-transform: uppercase;
  margin-top: 8px;
}

.login-card {
  position: relative; z-index: 1;
  width: 100%;
  max-width: 360px;
  background: rgba(10, 16, 28, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: 
    0 20px 40px rgba(0,0,0,0.6),
    inset 0 0 20px rgba(0, 212, 255, 0.05),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

.login-card .form-group {
  margin-bottom: 24px;
}

.login-card .form-label {
  color: rgba(255,255,255,0.9);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
  display: block;
  letter-spacing: 0.5px;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-wrap .input-icon {
  position: absolute;
  left: 16px;
  color: rgba(255,255,255,0.4);
  font-size: 16px;
  display: flex;
  transition: color 0.3s;
}

.login-input-wrap .eye-icon {
  position: absolute;
  right: 16px;
  color: rgba(255,255,255,0.4);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  transition: color 0.3s;
}

.login-card .form-control {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 14px 14px 44px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.login-card .form-control:focus {
  border-color: rgba(0, 212, 255, 0.6);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.15), inset 0 0 5px rgba(0, 212, 255, 0.1);
  background: rgba(255,255,255,0.06);
}

.login-card .form-control:focus + .input-icon,
.login-input-wrap:focus-within .input-icon {
  color: rgba(0, 212, 255, 0.9);
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.login-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  cursor: pointer;
}

.login-options input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}
.login-options input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #0072FF, #00C6FF);
  border-color: transparent;
}
.login-options input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  width: 4px; height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  top: 40%; left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}

.login-options a {
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  text-decoration: none;
  transition: color 0.2s;
}
.login-options a:hover {
  color: #00C6FF;
}

.login-card .btn-primary {
  background: linear-gradient(135deg, #0072FF 0%, #00C6FF 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 114, 255, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: all 0.3s ease;
  display: block;
}

.login-card .btn-primary:hover {
  box-shadow: 0 10px 25px rgba(0, 198, 255, 0.4), inset 0 1px 0 rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

.login-card .btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(0, 114, 255, 0.3);
}

.login-bottom-text {
  position: absolute;
  bottom: 30px;
  left: 0; right: 0;
  text-align: center;
  color: rgba(255,255,255,0.3);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  z-index: 1;
}

/* ===== AVATAR ===== */
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0;
}

/* ===== ATTENDANCE ===== */
.attendance-status-card {
  border-radius: var(--radius-lg); padding: 24px 20px; text-align: center;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  color: #fff; margin-bottom: 16px;
}
.attendance-status-icon { font-size: 48px; margin-bottom: 10px; }
.attendance-status-text { font-size: 18px; font-weight: 700; }
.attendance-status-sub { font-size: 13px; opacity: 0.8; margin-top: 4px; }
.selfie-preview {
  width: 100%; aspect-ratio: 1; border-radius: var(--radius);
  object-fit: cover; background: var(--surface-3);
  border: 2px dashed var(--border);
}

/* ===== EXPENSES ===== */
.expense-week-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius); padding: 16px; color: #fff; margin-bottom: 14px;
}
.expense-total { font-size: 28px; font-weight: 800; }
.expense-week-label { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.expense-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.expense-row:last-child { border-bottom: none; }
.expense-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.expense-amount { font-size: 14px; font-weight: 700; color: var(--text-primary); }

/* ===== STATUS STEPS ===== */
.status-steps { display: flex; gap: 4px; margin: 12px 0; }
.status-step {
  flex: 1; height: 4px; border-radius: 2px; background: var(--border);
  transition: background 0.3s;
}
.status-step.done { background: var(--success); }
.status-step.current { background: var(--primary-light); }

/* ===== PIPELINE STAGE TABS ===== */
.stage-tabs {
  display: flex; overflow-x: auto; gap: 6px;
  margin-bottom: 16px; padding-bottom: 2px;
}
.stage-tabs::-webkit-scrollbar { display: none; }
.stage-tab {
  flex-shrink: 0; display: flex; flex-direction: column;
  align-items: center; padding: 10px 16px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s;
}
.stage-tab.active {
  background: var(--primary); border-color: var(--primary);
}
.stage-tab-num { font-size: 18px; font-weight: 800; color: var(--text-muted); line-height: 1; }
.stage-tab-label { font-size: 10px; font-weight: 600; color: var(--text-muted); margin-top: 2px; }
.stage-tab.active .stage-tab-num,
.stage-tab.active .stage-tab-label { color: #fff; }

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.divider-label {
  display: flex; align-items: center; gap: 10px; margin: 14px 0;
  font-size: 11px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.5px;
  text-transform: uppercase;
}
.divider-label::before, .divider-label::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--text-muted);
}
.empty-icon { font-size: 52px; margin-bottom: 14px; opacity: 0.5; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-desc { font-size: 13px; line-height: 1.6; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: calc(var(--nav-height) + 16px); left: 50%;
  transform: translateX(-50%); z-index: 300;
  background: var(--text-primary); color: #fff;
  padding: 10px 20px; border-radius: 30px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease, toastOut 0.25s ease 2.5s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== PAGE TRANSITIONS ===== */
.page-enter { animation: pageIn 0.25s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }

/* ===== UTILITIES ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ===== RESPONSIVE DESKTOP/WEB ADJUSTMENTS ===== */
@media (min-width: 768px) {
  body {
    background: var(--surface-3);
    display: flex;
    justify-content: center;
  }
  #app {
    width: 100%;
    max-width: 480px;
    background: var(--surface-2);
    box-shadow: var(--shadow-lg);
    position: relative;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    min-height: 100vh;
  }
  .app-header {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
  }
  .bottom-nav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
  .fab {
    right: calc(50% - 220px); /* 480/2 = 240, minus 20px padding */
  }
  .modal-overlay {
    align-items: center;
  }
  .modal {
    max-width: 480px;
    border-radius: var(--radius-lg);
    animation: scaleUp 0.3s cubic-bezier(0.32,0.72,0,1);
  }
  .toast {
    bottom: calc(var(--nav-height) + 30px);
  }
  @keyframes scaleUp {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
  }
}

/* ===== DARK THEME ===== */
.dark-theme {
  --surface: #1A1A1D;
  --surface-2: #121212;
  --surface-3: #2A2A2F;
  --text-primary: #E0E0E0;
  --text-secondary: #B0B0B0;
  --text-muted: #808080;
  --border: #333333;
  --primary-bg: #1A3A5A;
  --success-bg: #0D4A2B;
  --warning-bg: #6B3D05;
  --error-bg: #5C1515;
}
.dark-theme .header-logo-mark { color: #fff; }
.dark-theme .form-control { background: var(--surface); color: var(--text-primary); }
.dark-theme .btn-secondary { background: var(--surface-3); color: var(--primary-light); }
.dark-theme select.form-control { background-color: var(--surface); }
.dark-theme .badge-primary { color: var(--primary-light); }
.dark-theme .badge-success { color: #4ADE80; }
.dark-theme .badge-warning { color: #FBBF24; }
.dark-theme .badge-error { color: #F87171; }

/* ===== MORE MENU DRAWER ===== */
.more-menu-overlay {
  transition: opacity 0.25s ease-out;
}
.more-menu-drawer {
  font-family: 'Manrope', 'Inter', sans-serif;
}
.more-menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
  text-align: left;
  width: 100%;
  font-family: 'Manrope', 'Inter', sans-serif;
  box-sizing: border-box;
}
.more-menu-item:hover, .more-menu-item:focus {
  background: rgba(255, 255, 255, 0.05);
  color: var(--primary);
}
.more-menu-item:active {
  transform: scale(0.97);
}
.more-menu-item.active {
  background: rgba(0, 123, 181, 0.12); /* transparent primary */
  color: var(--primary);
}
.more-menu-item.active .nav-item-icon {
  color: var(--primary);
  font-variation-settings: 'FILL' 1;
}
.more-menu-item .nav-item-icon {
  font-size: 24px;
  color: var(--primary);
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
  transition: color 0.2s;
}
.more-menu-item .nav-item-label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
/* Error state for Logout */
.more-menu-item.error-item {
  color: var(--error);
}
.more-menu-item.error-item .nav-item-icon {
  color: var(--error);
}
.more-menu-item.error-item:hover {
  background: rgba(239, 83, 80, 0.08);
}

/* ===== NEW PREMIUM DASHBOARD STYLES ===== */
.dash-greeting-card {
  background: linear-gradient(135deg, #275782 0%, #153452 100%);
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 8px 20px rgba(21, 87, 130, 0.12);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}
.dark-theme .dash-greeting-card {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}
.dash-greeting-title {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2px;
  font-weight: 500;
}
.dash-greeting-name-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.dash-greeting-name {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
}
.dash-greeting-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
}

/* Stats Grid */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.dash-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
}
.dark-theme .dash-stat-card {
  background: #1C1E22;
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.dash-stat-card:active {
  transform: scale(0.97);
}
/* Decorative card background circle */
.dash-stat-circle {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(0, 123, 181, 0.04);
  pointer-events: none;
}
.dark-theme .dash-stat-circle {
  background: #213248;
  opacity: 0.6;
}
.dash-stat-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}
.dash-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 2px;
  line-height: 1.1;
  letter-spacing: -0.3px;
}
.dark-theme .dash-stat-value {
  color: #3b8ce3;
}
.dash-stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.dark-theme .dash-stat-label {
  color: #9CA3AF;
}
.stat-svg-icon {
  margin-bottom: 6px;
  transition: transform 0.2s;
  width: 28px !important;
  height: 28px !important;
}
.dash-stat-card:hover .stat-svg-icon {
  transform: scale(1.05);
}

/* ===== SKELETON SCREENS ===== */
.skeleton-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  display: flex;
}

.skeleton-stripe {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--surface-3);
}

.skeleton-content {
  padding-left: 10px;
  width: 100%;
}

.skeleton-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.skeleton-block {
  background: var(--surface-3);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-block::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}

.dark-theme .skeleton-block::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
}
