/* ==========================================================================
   BETTER TIMEOFF — PREMIUM RESPONSIVE DESIGN SYSTEM
   ========================================================================== */

:root {
  --bg-dark: #070A12;
  --bg-card: rgba(18, 24, 40, 0.65);
  --bg-card-hover: rgba(28, 38, 64, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-active: rgba(99, 102, 241, 0.4);
  
  --primary: #6366F1;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --accent: #38BDF8;
  --accent-glow: rgba(56, 189, 248, 0.3);
  --success: #10B981;
  --success-glow: rgba(16, 185, 129, 0.25);
  --warning: #F59E0B;
  --danger: #EF4444;

  --text-main: #F8FAFC;
  --text-sub: #CBD5E1;
  --text-muted: #64748B;
  
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 90%, rgba(56, 189, 248, 0.15) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 16px 40px;
}

/* Main Wrapper */
.app-container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  position: relative;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* PASSCODE LOCK OVERLAY */
.lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(7, 10, 18, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lock-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lock-card {
  width: 100%;
  max-width: 360px;
  padding: 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lock-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.lock-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.lock-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.pin-dots {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  transition: all 0.2s ease;
}

.dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.lock-error {
  min-height: 20px;
  font-size: 13px;
  color: var(--danger);
  margin-bottom: 16px;
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 260px;
}

.key-btn {
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.key-btn:active {
  transform: scale(0.92);
  background: rgba(99, 102, 241, 0.3);
}

.key-btn.action-btn {
  font-size: 15px;
  color: var(--text-muted);
  background: transparent;
  border-color: transparent;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.shake { animation: shake 0.4s ease-in-out; }

/* DASHBOARD LAYOUT */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard.hidden { display: none; }

/* Top Header */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-glow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 2px;
}

.avatar {
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
}

.user-name {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}

.user-role {
  font-size: 12px;
  color: var(--text-muted);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }

/* GRID LAYOUT FOR DESKTOP */
.main-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
}

@media (max-width: 860px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

/* SIDEBAR / LEFT COLUMN */
.sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* HERO STAT CARD */
.hero-stat-card {
  padding: 22px 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(56, 189, 248, 0.12));
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
}

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

.hero-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--accent);
  text-transform: uppercase;
}

.badge-live {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.hero-main-val {
  font-family: var(--font-heading);
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  margin-bottom: 6px;
}

.hero-main-val span {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-sub);
}

.hero-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.hero-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  text-align: center;
}

.m-label {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.m-val {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.m-val.highlight { color: var(--accent); }

/* STATS ROW */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sub-stat-card {
  padding: 16px;
}

.sub-label {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.sub-val {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.sub-foot {
  font-size: 11px;
  color: var(--text-muted);
}

/* BUFFER METER */
.buffer-meter-card {
  padding: 18px;
}

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

.meter-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
}

.meter-ratio {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.progress-track {
  height: 10px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  margin-bottom: 10px;
}

.progress-buffer {
  background: linear-gradient(90deg, var(--primary), #818CF8);
}

.progress-spendable {
  background: linear-gradient(90deg, var(--accent), #7DD3FC);
}

.meter-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

.leg-shield { background: var(--primary); }
.leg-spend { background: var(--accent); }

/* HEURISTICS BOX */
.heuristics-box {
  padding: 18px;
}

.h-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.h-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.h-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.h-item strong {
  font-size: 12px;
  display: block;
  margin-bottom: 2px;
}

.h-item p {
  font-size: 11px;
  color: var(--text-sub);
  line-height: 1.35;
}

/* RIGHT COLUMN / CONTENT AREA */
.content-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* NAVIGATION TABS */
.nav-tabs {
  display: flex;
  padding: 4px;
  gap: 6px;
  border-radius: var(--radius-md);
}

.tab-btn {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover { color: var(--text-main); }

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

/* TAB PANELS */
.tab-panel {
  display: none;
}

.tab-panel.active { display: block; }

.panel-header {
  margin-bottom: 16px;
}

.panel-header h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

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

/* SCENARIO CARDS */
.scenario-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sc-card {
  padding: 20px;
  transition: all 0.25s ease;
  position: relative;
}

.sc-card.active-option {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.sc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.sc-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
}

.sc-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.sc-desc {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.4;
  margin-bottom: 14px;
}

.sc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.pill {
  padding: 5px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  font-size: 12px;
  font-weight: 600;
}

.pill strong { color: var(--accent); }

.pill-shield {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

.b-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px dashed var(--glass-border);
  padding-top: 12px;
}

.b-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
}

.b-name {
  font-size: 13px;
  font-weight: 600;
}

.b-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.b-tag {
  padding: 3px 8px;
  border-radius: 10px;
  background: var(--primary-glow);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

/* ACCRUAL TIMELINE */
.timeline-card {
  padding: 20px;
}

.t-line {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.t-line::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--glass-border);
}

.t-item {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.t-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.t-item.earned .t-dot {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-glow);
}

.t-item.upcoming .t-dot {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.t-month {
  font-size: 13px;
  font-weight: 600;
}

.t-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* HISTORY FILTER & CARDS */
.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.f-pill {
  padding: 5px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}

.f-pill.active {
  background: var(--accent);
  color: #000;
  font-weight: 700;
}

.h-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.h-card {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.h-t { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.h-d { font-size: 11px; color: var(--text-muted); }

.s-badge {
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.s-approved { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.s-pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.s-cancelled { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
