/* ============================================================
   AAMOD GROUP SYSTEM — RESPONSIVE STYLESHEET
   Mobile-first | Breakpoints: 320, 480, 768, 1024, 1280, 1440px
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── CSS Custom Properties ─────────────────────────────── */
:root {
  /* Colors */
  --bg:            #f5f4f0;
  --bg-warm:       #eeece6;
  --surface:       #ffffff;
  --surface-2:     #f9f8f5;
  --border:        #e4e1d8;
  --border-strong: #ccc9be;
  --navy:          #0f1f3d;
  --text:          #1a2540;
  --text-mid:      #4a5568;
  --text-muted:    #8a94a6;
  --accent:        #f97316;
  --accent-dark:   #ea6500;
  --accent-light:  #fff7ed;
  --cyan:          #0284c7;
  --cyan-light:    #e0f2fe;
  --purple:        #7c3aed;
  --purple-light:  #f3effe;
  --green:         #16a34a;
  --green-light:   #f0fdf4;
  --red:           #dc2626;
  --red-light:     #fef2f2;

  /* Spacing scale (rem) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Fluid page padding */
  --page-x: clamp(1rem, 5vw, 2.5rem);

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(15,31,61,0.06), 0 1px 2px rgba(15,31,61,0.04);
  --shadow-md:   0 4px 16px rgba(15,31,61,0.08), 0 2px 6px rgba(15,31,61,0.05);
  --shadow-lg:   0 12px 40px rgba(15,31,61,0.12), 0 4px 12px rgba(15,31,61,0.06);
  --shadow-card: 0 2px 8px rgba(15,31,61,0.06), 0 0 0 1px rgba(15,31,61,0.04);

  /* Radius */
  --r-sm:  0.5rem;
  --r-md:  0.75rem;
  --r-lg:  1rem;
  --r-xl:  1.25rem;
  --r-2xl: 1.5rem;

  /* Nav height */
  --nav-h: 3.75rem;        /* 60px mobile */
  --nav-h-lg: 4.125rem;   /* 66px desktop */
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
      font-family: 'sora', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

img, svg { display: block; max-width: 100%; }

button { font-family: inherit; cursor: pointer; }

a { text-decoration: none; color: inherit; }

/* ── Utility ───────────────────────────────────────────── */
.font-sora { font-family: 'Sora', sans-serif; }

.fade-in { animation: fadeInUp 0.55s ease both; opacity: 0; }
.fade-in-1 { animation-delay: 0.08s; }
.fade-in-2 { animation-delay: 0.18s; }
.fade-in-3 { animation-delay: 0.28s; }
.fade-in-4 { animation-delay: 0.38s; }
.fade-in-5 { animation-delay: 0.48s; }
.fade-in-6 { animation-delay: 0.58s; }
.fade-in-7 { animation-delay: 0.68s; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(1rem); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

@keyframes orbFloat {
  from { transform: scale(1) translate(0,0); }
  to   { transform: scale(1.08) translate(1rem,-1rem); }
}

@keyframes barGrow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

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


/* ╔══════════════════════════════════════════════════════╗
   ║                    LOGIN PAGE                        ║
   ╚══════════════════════════════════════════════════════╝ */

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  position: relative;
  overflow: hidden;
}
.logo-wrap_amod {
      display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
/* Background layers */
.login-bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #f5f4f0 0%, #eeece6 50%, #f0ede6 100%);
  z-index: 0;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(15,31,61,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,31,61,0.04) 1px, transparent 1px);
  background-size: 3rem 3rem;
  z-index: 0;
}

/* Orbs — scaled with vw so they're proportionate on all screens */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(6rem);
  opacity: 0.5;
  z-index: 0;
  animation: orbFloat 10s ease-in-out infinite alternate;
  pointer-events: none;
}
.orb-1 {
  width: clamp(12rem, 40vw, 30rem);
  height: clamp(12rem, 40vw, 30rem);
  background: radial-gradient(circle, #fde8d0, transparent);
  top: -8rem; left: -5rem;
}
.orb-2 {
  width: clamp(10rem, 32vw, 22rem);
  height: clamp(10rem, 32vw, 22rem);
  background: radial-gradient(circle, #dbeafe, transparent);
  bottom: -4rem; right: -4rem;
  animation-delay: 4s;
}
.orb-3 {
  width: clamp(8rem, 22vw, 16rem);
  height: clamp(8rem, 22vw, 16rem);
  background: radial-gradient(circle, #ede9fe, transparent);
  top: 45%; left: 55%;
  animation-delay: 7s;
}

.chart-deco { position: fixed; z-index: 0; opacity: 0.1; pointer-events: none; }

/* ── Login Layout ───────────────────────────────────────── */
.login-split {
  display: flex;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}

/* Left panel hidden by default (mobile-first) */
.login-left {
  display: none;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem);
}

.login-left-content { max-width: 30rem; width: 100%; }

/* Brand badge */
.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--accent-light);
  border: 1px solid rgba(249,115,22,0.22);
  border-radius: 6.25rem;
  padding: var(--sp-1) var(--sp-4);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--sp-6);
}
.brand-badge::before {
  content: '';
  width: 0.375rem; height: 0.375rem;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.left-headline {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.75rem, 3.5vw, 3.125rem);
  font-weight: 800;
  line-height: 1.12;
  color: var(--navy);
  margin-bottom: var(--sp-4);
}
.left-headline .highlight {
  background: linear-gradient(90deg, #f97316, #ea6500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.left-desc {
  font-size: clamp(0.875rem, 1.2vw, 0.9375rem);
  line-height: 1.75;
  color: var(--text-mid);
  margin-bottom: var(--sp-10);
}

.stat-row { display: flex; gap: clamp(1.25rem, 3vw, 2.25rem); flex-wrap: wrap; }

.stat-num {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.375rem, 2.5vw, 1.75rem);
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  margin-bottom: var(--sp-1);
}
.stat-num span { color: var(--accent); }

.stat-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.mini-chart {
  margin-top: clamp(1.5rem, 3vw, 2.75rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(1rem, 2vw, 1.25rem) clamp(1rem, 2vw, 1.5rem);
  box-shadow: var(--shadow-md);
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}
.chart-title-sm { font-size: 0.8125rem; font-weight: 600; color: var(--text-mid); }
.chart-badge {
  font-size: 0.6875rem;
  background: #dcfce7;
  color: #16a34a;
  padding: 0.1875rem 0.625rem;
  border-radius: 6.25rem;
  font-weight: 700;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.375rem;
  height: 3.5rem;
}
.bar {
  flex: 1;
  border-radius: 0.25rem 0.25rem 0 0;
  background: linear-gradient(180deg, #f97316, rgba(249,115,22,0.18));
  animation: barGrow 0.8s ease-out both;
  transform-origin: bottom;
}
.bar:nth-child(1) { height: 42%; animation-delay: 0.10s; }
.bar:nth-child(2) { height: 62%; animation-delay: 0.15s; }
.bar:nth-child(3) { height: 48%; animation-delay: 0.20s; }
.bar:nth-child(4) { height: 80%; animation-delay: 0.25s; }
.bar:nth-child(5) { height: 55%; animation-delay: 0.30s; }
.bar:nth-child(6) { height: 92%; animation-delay: 0.35s;
  background: linear-gradient(180deg, #ea6500, rgba(234,101,0,0.2)); }
.bar:nth-child(7) { height: 68%; animation-delay: 0.40s; }
.bar:nth-child(8) { height: 83%; animation-delay: 0.45s; }

/* ── Right (form) panel ─────────────────────────────────── */
.login-right {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 2.5rem) var(--page-x);
  /* Extra top padding so logo isn't pressed against screen top on mobile */
  padding-top: clamp(2rem, 6vh, 4rem);
  padding-bottom: clamp(2rem, 6vh, 4rem);
}

.login-card {
  width: 100%;
  max-width: 26rem;
  /* Card background on mobile only */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: clamp(1.5rem, 5vw, 2.25rem);
  box-shadow: var(--shadow-md);
}

/* Logo */
.logo-wrap { text-align: center; margin-bottom: var(--sp-6); }

.logo-mark {
  width: clamp(3rem, 8vw, 4rem);
  height: clamp(3rem, 8vw, 4rem);
  background: linear-gradient(135deg, #f97316, #ea6500);
  border-radius: clamp(0.75rem, 2vw, 1.125rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: clamp(1rem, 3vw, 1.375rem);
  color: #fff;
  margin-bottom: var(--sp-3);
  box-shadow: 0 0.5rem 1.5rem rgba(249,115,22,0.3);
  position: relative;
  overflow: hidden;
}
.logo-mark::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
  animation: logoShine 3s infinite;
}

.logo-name {
  font-family: 'Sora', sans-serif;
  font-size: clamp(0.9375rem, 2.5vw, 1.0625rem);
  font-weight: 700;
  color: var(--navy);
}
.logo-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.1875rem;
  font-weight: 500;
}

.login-card h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.0625rem, 3vw, 1.3125rem);
  font-weight: 700;
  text-align: center;
  color: var(--navy);
  margin-bottom: var(--sp-2);
  line-height: 1.25;
}

.login-card .subtitle {
  font-size: clamp(0.75rem, 2vw, 0.8125rem);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.55;
  margin-bottom: var(--sp-6);
}

/* Form controls */
.form-group { margin-bottom: var(--sp-4); }

.form-label-custom {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: var(--sp-2);
}

.input-wrap { position: relative; }

.input-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
  z-index: 2;
  transition: color 0.2s;
  pointer-events: none;
}

.form-control-custom {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  /* Min touch target height 44px */
  padding: 0.8125rem 0.875rem 0.8125rem 2.625rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.22s, box-shadow 0.22s, background 0.22s;
  -webkit-appearance: none;
}

.form-control-custom::placeholder { color: var(--text-muted); opacity: 0.7; }

.form-control-custom:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
}

.input-wrap:focus-within .input-icon { color: var(--accent); }

.toggle-pw {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  /* Touch-friendly hitbox */
  padding: 0.5rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: color 0.2s;
}
.toggle-pw:hover { color: var(--navy); }

.remember-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.custom-check {
  width: 1.125rem; height: 1.125rem;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.remember-label {
  font-size: 0.8125rem;
  color: var(--text-mid);
  cursor: pointer;
  line-height: 1.4;
}

/* Submit button — min 48px height for touch */
.btn-login {
  width: 100%;
  min-height: 3rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #f97316, #ea6500);
  border: none;
  border-radius: var(--r-md);
  font-family: 'Sora', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: transform 0.22s, box-shadow 0.22s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0.375rem 1.25rem rgba(249,115,22,0.32);
  -webkit-tap-highlight-color: transparent;
}
.btn-login::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transition: left 0.4s;
}
.btn-login:hover   { transform: translateY(-2px); box-shadow: 0 0.625rem 1.75rem rgba(249,115,22,0.4); }
.btn-login:hover::before { left: 100%; }
.btn-login:active  { transform: translateY(0); }

.login-footer {
  text-align: center;
  margin-top: var(--sp-5);
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.error-msg {
  background: var(--red-light);
  border: 1px solid rgba(220,38,38,0.15);
  border-radius: var(--r-sm);
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--red);
  margin-bottom: var(--sp-4);
  display: none;
  align-items: center;
  gap: var(--sp-2);
}


/* ── Breakpoints: Login ─────────────────────────────────── */

/* 480px — slightly larger card, smaller orbs scale handled by clamp */
@media (min-width: 30rem) {
  .login-card { border-radius: var(--r-2xl); }
}

/* 768px — tablet: card floats with more breathing room */
@media (min-width: 48rem) {
  .login-right {
    /* Remove card border on right panel when big enough */
    background: transparent;
  }
  .login-card {
    padding: 2rem 2.25rem;
  }
}

/* 1024px — desktop: show left panel, right panel becomes sidebar */
@media (min-width: 64rem) {
  .login-left { display: flex; }

  .login-right {
    width: clamp(26rem, 38vw, 34rem);
    flex-shrink: 0;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -0.5rem 0 2.5rem rgba(15,31,61,0.06);
    align-items: center;
    /* No card styling needed — panel IS the card surface */
  }

  /* On desktop: card blends into panel (no double borders) */
  .login-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    max-width: 25rem;
  }
}

/* 1440px — large desktop */
@media (min-width: 90rem) {
  .login-left { padding: 5rem clamp(3rem, 6vw, 6rem); }
}


/* ╔══════════════════════════════════════════════════════╗
   ║                    HOME PAGE                         ║
   ╚══════════════════════════════════════════════════════╝ */

.home-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ── Navbar ─────────────────────────────────────────────── */
.main-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  padding: 0 var(--page-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  gap: var(--sp-3);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;   /* allow text to truncate */
  flex: 1;
}

.nav-logo-mark {
  width: 2.25rem; height: 2.25rem;
  min-width: 2.25rem;
  background: linear-gradient(135deg, #f97316, #ea6500);
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 0.8125rem;
  color: #fff;
  box-shadow: 0 0.25rem 0.75rem rgba(249,115,22,0.25);
}

.nav-brand-text {
  font-family: 'Sora', sans-serif;
  font-size: clamp(0.75rem, 2.5vw, 0.9375rem);
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-brand-sub {
  font-size: 0.625rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

/* Nav right group */
.nav-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

/* User info — hidden on small screens */
.nav-user { display: flex; align-items: center; gap: var(--sp-2); }

.user-text-wrap { display: none; } /* hidden on mobile */

.user-avatar {
  width: 2.125rem; height: 2.125rem;
  min-width: 2.125rem;
  background: linear-gradient(135deg, #f97316, #ea6500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  color: #fff;
  font-weight: 700;
  font-family: 'Sora', sans-serif;
  box-shadow: 0 0.125rem 0.5rem rgba(249,115,22,0.22);
}

.user-name { font-size: 0.8125rem; font-weight: 600; color: var(--navy); }
.user-role { font-size: 0.6875rem; color: var(--text-muted); }

/* Logout — icon-only on mobile, text+icon on desktop */
.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  background: var(--red-light);
  border: 1.5px solid rgba(220,38,38,0.15);
  color: var(--red);
  border-radius: var(--r-sm);
  /* Touch-friendly: min 44×44 */
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0 0.75rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn-logout:hover {
  background: #fee2e2;
  border-color: rgba(220,38,38,0.28);
  transform: translateY(-1px);
  box-shadow: 0 0.25rem 0.75rem rgba(220,38,38,0.1);
}
.btn-logout-text { display: none; } /* hidden on mobile */

/* Hamburger — visible only on mobile */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.3125rem;
  width: 2.75rem; height: 2.75rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.hamburger:hover { background: var(--bg-warm); }

.hamburger span {
  display: block;
  width: 1.25rem; height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Hamburger → X when open */
.hamburger.open span:nth-child(1) { transform: translateY(0.4375rem) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-0.4375rem) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 0.5rem 2rem rgba(15,31,61,0.1);
  z-index: 99;
  padding: var(--sp-4) var(--page-x);
  flex-direction: column;
  gap: var(--sp-3);
  transform: translateY(-1rem);
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
}
.mobile-nav-drawer.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}
.drawer-user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.drawer-user-name { font-size: 0.9375rem; font-weight: 600; color: var(--navy); }
.drawer-user-role { font-size: 0.75rem; color: var(--text-muted); }

.drawer-logout {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--red-light);
  border: 1.5px solid rgba(220,38,38,0.15);
  color: var(--red);
  border-radius: var(--r-md);
  min-height: 3rem;
  padding: 0 var(--sp-4);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}


/* ── Page Wrapper ───────────────────────────────────────── */
.page-wrapper {
  flex: 1;
  width: 100%;
  max-width: 90rem;       /* 1440px */
  margin: 0 auto;
  padding: 0 var(--page-x);
}

/* ── Hero ───────────────────────────────────────────────── */
.home-hero {
  padding-top: clamp(1.75rem, 5vh, 3.5rem);
  padding-bottom: clamp(1.25rem, 3vh, 2rem);
  justify-content: center;
        display: flex;
        flex-direction: column;
                align-items: center;

  
    
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--sp-3);
}
.hero-eyebrow::before {
  content: '';
  width: 1.125rem; height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.hero-title {
  font-family: 'sora', sans-serif;
  font-size: clamp(1.5rem, 5vw, 2.75rem);
  font-weight: 800;
  color: var(--navy);
  line-height: 1.15;
  margin-bottom: var(--sp-3);
}
.hero-title .gradient-text {
  background: linear-gradient(90deg, #f97316 0%, #ea6500 55%, #0284c7 110%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: clamp(0.875rem, 2vw, 0.9375rem);
  line-height: 1.75;
  color: var(--text-mid);
  max-width: 40rem;
  text-align: center  ;
}

/* ── Stats Strip ────────────────────────────────────────── */
.stats-strip {
  display: grid;
  /* 2 columns on mobile, 4 on large */
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.625rem, 2vw, 1rem);
  padding: clamp(1.25rem, 3vh, 2.5rem) 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: clamp(0.75rem, 2vw, 0.875rem);
  padding: clamp(0.875rem, 2.5vw, 1.25rem) clamp(0.875rem, 2.5vw, 1.375rem);
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.stat-card:hover {
  border-color: rgba(249,115,22,0.22);
  box-shadow: 0 0.375rem 1.25rem rgba(15,31,61,0.08);
  transform: translateY(-2px);
}

.stat-card-value {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.25rem, 4vw, 1.625rem);
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.stat-card-value .unit { font-size: 0.875rem; color: var(--accent); }
.stat-card-label { font-size: 0.75rem; color: var(--text-muted); }

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  color: var(--green);
  margin-top: var(--sp-2);
  font-weight: 600;
}

/* ── Dashboard Cards Section ────────────────────────────── */
.cards-section {
  padding-bottom: clamp(2rem, 6vh, 4rem);
}

.section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-4);
}

/* 1 column mobile → 2 columns desktop */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.75rem, 2vw, 1.25rem);
}

.dash-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: clamp(0.875rem, 2vw, 1.25rem);
  padding: clamp(1.125rem, 3vw, 1.875rem);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1),
              border-color 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
  box-shadow: var(--shadow-card);
  -webkit-tap-highlight-color: transparent;
}

/* Coloured top accent line on hover */
.dash-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: inherit;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  opacity: 0;
  transition: opacity 0.3s;
}
.dash-card-1::after { background: linear-gradient(90deg, #f97316, #f59e0b); }
.dash-card-2::after { background: linear-gradient(90deg, #0284c7, #06b6d4); }
.dash-card-3::after { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.dash-card-4::after { background: linear-gradient(90deg, #16a34a, #22c55e); }

/* Tap ripple on mobile */
.dash-card:active  { transform: scale(0.98); }
.dash-card:hover   { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.dash-card:hover::after { opacity: 1; }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: clamp(0.875rem, 2.5vw, 1.375rem);
}

.card-icon-wrap {
  width: clamp(2.5rem, 7vw, 3.25rem);
  height: clamp(2.5rem, 7vw, 3.25rem);
  border-radius: clamp(0.625rem, 2vw, 0.875rem);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1rem, 3vw, 1.375rem);
  flex-shrink: 0;
  transition: transform 0.3s;
}
.dash-card:hover .card-icon-wrap { transform: scale(1.08) rotate(-3deg); }

.icon-orange { background: var(--accent-light);  color: var(--accent-dark); border: 1px solid rgba(249,115,22,0.14); }
.icon-cyan   { background: var(--cyan-light);    color: var(--cyan);        border: 1px solid rgba(2,132,199,0.14);  }
.icon-purple { background: var(--purple-light);  color: var(--purple);      border: 1px solid rgba(124,58,237,0.14); }
.icon-green  { background: var(--green-light);   color: var(--green);       border: 1px solid rgba(22,163,74,0.14);  }

.card-arrow {
  width: 2rem; height: 2rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.3s;
  flex-shrink: 0;
}
.dash-card:hover .card-arrow {
  background: var(--accent-light);
  border-color: rgba(249,115,22,0.2);
  color: var(--accent-dark);
  transform: translate(2px,-2px);
}

.card-title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(0.9375rem, 2.5vw, 1.125rem);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--sp-2);
  line-height: 1.3;
}

.card-desc {
  font-size: clamp(0.8125rem, 1.5vw, 0.84375rem);
  line-height: 1.65;
  color: var(--text-mid);
  margin-bottom: clamp(0.875rem, 2vw, 1.375rem);
}

.card-tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.tag {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 6.25rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.tag-orange { background: var(--accent-light);  color: var(--accent-dark); }
.tag-cyan   { background: var(--cyan-light);    color: var(--cyan);        }
.tag-purple { background: var(--purple-light);  color: var(--purple);      }
.tag-green  { background: var(--green-light);   color: var(--green);       }
.tag-gray   { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

.card-progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 3px;
  margin-top: clamp(0.75rem, 2vw, 1.125rem);
  overflow: hidden;
}
.card-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease 0.5s;
  width: 0;
}
.fill-orange { background: linear-gradient(90deg, #f97316, #f59e0b); }
.fill-cyan   { background: linear-gradient(90deg, #0284c7, #06b6d4); }
.fill-purple { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.fill-green  { background: linear-gradient(90deg, #16a34a, #22c55e); }


/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,31,61,0.3);
  backdrop-filter: blur(0.5rem);
  -webkit-backdrop-filter: blur(0.5rem);
  z-index: 200;
  display: flex;
  align-items: flex-end;      /* sheet from bottom on mobile */
  justify-content: center;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.modal-overlay.show { opacity: 1; visibility: visible; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;  /* bottom sheet */
  padding: clamp(1.5rem, 5vw, 2.25rem);
  width: 100%;
  max-width: 100%;
  text-align: center;
  transform: translateY(2rem);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 -0.5rem 2.5rem rgba(15,31,61,0.12);
}
.modal-overlay.show .modal-box { transform: translateY(0); }

/* Handle bar for bottom sheet */
.modal-box::before {
  content: '';
  display: block;
  width: 2.5rem; height: 0.25rem;
  background: var(--border-strong);
  border-radius: 2px;
  margin: -0.5rem auto 1.25rem;
}

.modal-icon {
  width: 3.5rem; height: 3.5rem;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1rem;
}

.modal-title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.0625rem, 3vw, 1.25rem);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--sp-2);
}

.modal-desc {
  font-size: clamp(0.8125rem, 2vw, 0.875rem);
  color: var(--text-mid);
  line-height: 1.65;
  margin-bottom: var(--sp-6);
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.modal-btn {
  width: 100%;
  min-height: 3rem;
  background: linear-gradient(135deg, #f97316, #ea6500);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0.375rem 1.125rem rgba(249,115,22,0.28);
  -webkit-tap-highlight-color: transparent;
}
.modal-btn:hover { transform: translateY(-2px); box-shadow: 0 0.625rem 1.625rem rgba(249,115,22,0.36); }

.modal-close {
  width: 100%;
  min-height: 3rem;
  background: var(--surface-2);
  color: var(--text-mid);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.modal-close:hover { background: var(--bg-warm); color: var(--navy); }

/* ── Footer ─────────────────────────────────────────────── */
.home-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-4) var(--page-x);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface);
}


/* ╔══════════════════════════════════════════════════════╗
   ║           RESPONSIVE BREAKPOINTS — HOME              ║
   ╚══════════════════════════════════════════════════════╝ */

/* 480px — larger phones */
@media (min-width: 30rem) {
  .stats-strip {
    gap: 0.875rem;
  }
  .stat-trend { display: inline-flex; } /* show trend text */
}

/* 640px — landscape phones / small tablets */
@media (min-width: 40rem) {
  :root { --nav-h: 3.875rem; }

  .hero-title { line-height: 1.12; }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-box {
    border-radius: var(--r-2xl);  /* centered dialog */
    max-width: 26.25rem;
    width: calc(100% - 3rem);
  }
  .modal-overlay {
    align-items: center;
    padding: var(--sp-6);
  }
  .modal-actions { flex-direction: row; }
  .modal-btn, .modal-close { width: auto; flex: 1; }
}

/* 768px — tablets portrait */
@media (min-width: 48rem) {
  :root { --nav-h: var(--nav-h-lg); }

  .btn-logout-text { display: inline; }
  .hamburger       { display: none;   }  /* hide hamburger on tablet+ */
  .user-text-wrap  { display: block;  }  /* show user name/role */

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

  .home-hero { padding-top: clamp(2.5rem, 5vh, 4rem); }
}

/* 1024px — laptops */
@media (min-width: 64rem) {
  .dash-card:active { transform: translateY(-3px); } /* no scale on desktop */

  .cards-grid { gap: 1.25rem; }
}

/* 1280px — desktop */
@media (min-width: 80rem) {
  .page-wrapper { padding: 0 clamp(1.5rem, 3vw, 2.5rem); }
}

/* 1440px — large desktop */
@media (min-width: 90rem) {
  .cards-grid { gap: 1.5rem; }
  .home-hero { padding-top: 4rem; padding-bottom: 2rem; }
}

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

/* ============================================================
   DARK MODE ADDITIONS — appended for theme support
   All component colors already use CSS vars; only hardcoded
   values and special cases need explicit dark overrides.
   ============================================================ */

/* Login page dark bg/orbs */
[data-theme="dark"] .login-bg {
  background: linear-gradient(135deg, #0a0f1e 0%, #0f1117 50%, #111827 100%);
}
[data-theme="dark"] .orb-1 { background: radial-gradient(circle, rgba(249,115,22,0.18), transparent); }
[data-theme="dark"] .orb-2 { background: radial-gradient(circle, rgba(56,189,248,0.12), transparent); }
[data-theme="dark"] .orb-3 { background: radial-gradient(circle, rgba(167,139,250,0.1), transparent);  }

[data-theme="dark"] .grid-overlay {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
}

/* Login right panel dark */
[data-theme="dark"] .login-right {
  background: var(--surface);
  border-left-color: var(--border);
}

/* Mini chart bars keep accent in dark */
[data-theme="dark"] .chart-badge {
  background: rgba(74,222,128,0.15);
  color: #4ade80;
}

/* Stat cards dark */
[data-theme="dark"] .stat-card:hover {
  border-color: rgba(249,115,22,0.3);
}

/* Dash cards accent colors in dark */
[data-theme="dark"] .dash-card-1::after { background: linear-gradient(90deg, #fb923c, #f59e0b); }
[data-theme="dark"] .dash-card-2::after { background: linear-gradient(90deg, #38bdf8, #06b6d4); }
[data-theme="dark"] .dash-card-3::after { background: linear-gradient(90deg, #a78bfa, #c084fc); }
[data-theme="dark"] .dash-card-4::after { background: linear-gradient(90deg, #4ade80, #22c55e); }

/* Modal in dark */
[data-theme="dark"] .modal-box {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

/* Left headline highlight keeps gradient in dark */
[data-theme="dark"] .left-headline .highlight {
  background: linear-gradient(90deg, #fb923c, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hero gradient text in dark */
[data-theme="dark"] .hero-title .gradient-text {
  background: linear-gradient(90deg, #fb923c 0%, #f97316 55%, #38bdf8 110%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* All transition smoothing */
.login-bg, .login-card, .mini-chart, .stat-card,
.dash-card, .modal-box {
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
