/* =====================================================================
   Sabah Tourism Board — Research Insights Portal
   Design system. Brand palette & "Explore Sabah" mark ("Enchanting Sabah")
   ===================================================================== */

/* ---- Design tokens ---- */
:root {
  /* Brand palette (sampled from the live site + Explore Sabah logo) */
  --brand-blue:    #0048ff;
  --brand-blue-2:  #2059c4;
  --brand-blue-3:  #2073f0;
  --brand-pink:    #ee0979;
  --brand-gold:    #ffb733;
  --brand-teal:    #009b8e;
  --brand-green:   #3fa535;
  --brand-orange:  #e8662a;
  --ink:           #1d2233;
  --ink-soft:      #34394d;
  --muted:         #6b7280;
  --line:          #e7eaf3;
  --bg:            #f5f7fc;
  --bg-2:          #eef2fb;
  --card:          #ffffff;
  --white:         #ffffff;

  /* Signature gradients */
  --grad-brand:  linear-gradient(120deg, #0048ff 0%, #2073f0 45%, #009b8e 100%);
  --grad-warm:   linear-gradient(120deg, #ee0979 0%, #ff6a3d 55%, #ffb733 100%);
  --grad-hero:   linear-gradient(120deg, #001a66 0%, #0048ff 40%, #009b8e 100%);
  --grad-glass:  linear-gradient(135deg, rgba(255,255,255,.85), rgba(255,255,255,.55));

  /* Type */
  --font-display: "Arima", "Arima Madurai", system-ui, cursive;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(20,30,80,.06), 0 2px 8px rgba(20,30,80,.05);
  --shadow-md: 0 6px 18px rgba(20,40,120,.10);
  --shadow-lg: 0 18px 50px rgba(15,35,110,.18);
  --shadow-glow: 0 10px 40px rgba(0,72,255,.28);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;

  --ease: cubic-bezier(.22,.61,.36,1);
  --maxw: 1240px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
ul { list-style: none; }
h1,h2,h3,h4 { line-height: 1.15; font-weight: 700; color: var(--ink); }
:focus-visible { outline: 3px solid rgba(0,72,255,.45); outline-offset: 2px; border-radius: 6px; }

/* ---- Utilities ---- */
.container { width: min(100% - 2.4rem, var(--maxw)); margin-inline: auto; }
.brand-font { font-family: var(--font-display); }
.text-grad { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.text-grad-warm { background: var(--grad-warm); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }
.pill {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .35rem .8rem; border-radius: 999px; font-size: .76rem;
  font-weight: 600; letter-spacing: .02em;
}
.pill-blue  { background: rgba(0,72,255,.10); color: var(--brand-blue-2); }
.pill-pink  { background: rgba(238,9,121,.10); color: var(--brand-pink); }
.pill-gold  { background: rgba(255,183,51,.16); color: #b07700; }
.pill-teal  { background: rgba(0,155,142,.12); color: var(--brand-teal); }
.pill-green { background: rgba(63,165,53,.12); color: var(--brand-green); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .8rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, opacity .2s;
  white-space: nowrap; border: 1.5px solid transparent;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 44px rgba(0,72,255,.36); }
.btn-warm { background: var(--grad-warm); color: #fff; box-shadow: 0 10px 34px rgba(238,9,121,.30); }
.btn-warm:hover { transform: translateY(-2px); }
.btn-ghost { background: #fff; color: var(--brand-blue-2); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--brand-blue); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-soft { background: var(--bg-2); color: var(--ink-soft); }
.btn-soft:hover { background: #e2e8fb; }
.btn-danger { background: rgba(238,9,121,.10); color: var(--brand-pink); }
.btn-danger:hover { background: var(--brand-pink); color: #fff; }
.btn-sm { padding: .5rem .9rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* =====================================================================
   Landing page
   ===================================================================== */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 0; backdrop-filter: blur(14px);
  background: rgba(255,255,255,.72); border-bottom: 1px solid rgba(255,255,255,.4);
  transition: box-shadow .3s, background .3s;
}
.site-nav.scrolled { box-shadow: var(--shadow-sm); background: rgba(255,255,255,.9); }
.site-nav .inner { display: flex; align-items: center; justify-content: space-between; width: min(100% - 2.4rem, var(--maxw)); margin-inline: auto; }
.logo-lockup { display: flex; align-items: center; gap: .7rem; }
.logo-lockup img { height: 42px; width: auto; }
.logo-lockup .sub { font-size: .72rem; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.nav-actions { display: flex; align-items: center; gap: .7rem; }

.hero {
  position: relative; overflow: hidden;
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(4rem, 10vw, 8rem);
  background: var(--grad-hero); color: #fff;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(800px 400px at 12% 10%, rgba(255,183,51,.32), transparent 60%),
    radial-gradient(700px 460px at 90% 20%, rgba(238,9,121,.30), transparent 60%),
    radial-gradient(900px 500px at 70% 110%, rgba(0,155,142,.40), transparent 60%);
  pointer-events: none; mix-blend-mode: screen;
}
.hero .blob {
  position: absolute; border-radius: 50%; filter: blur(40px); opacity: .55;
  animation: float 14s ease-in-out infinite;
}
.hero .blob.b1 { width: 320px; height: 320px; background: var(--brand-gold); top: -60px; left: -40px; }
.hero .blob.b2 { width: 280px; height: 280px; background: var(--brand-pink); bottom: -80px; right: 8%; animation-delay: -4s; }
.hero .blob.b3 { width: 220px; height: 220px; background: var(--brand-teal); top: 30%; right: 30%; animation-delay: -8s; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1);} 50%{ transform: translate(20px,-30px) scale(1.08);} }

.hero .container { position: relative; z-index: 2; max-width: 820px; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6.5vw, 4.6rem); color: #fff; line-height: 1.02;
  letter-spacing: -.01em; margin: 1.1rem 0 1rem;
}
.hero h1 .accent { background: linear-gradient(90deg,#ffd86b,#ffb733); -webkit-background-clip:text; background-clip:text; color: transparent; }
.hero p.lead { font-size: clamp(1.05rem,2.4vw,1.3rem); color: rgba(255,255,255,.92); max-width: 640px; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2rem; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem; padding: .45rem 1rem;
  border-radius: 999px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3);
  font-size: .82rem; font-weight: 600; backdrop-filter: blur(6px);
}
.hero-stats { display: flex; flex-wrap: wrap; gap: 2.4rem; margin-top: 3rem; }
.hero-stats .s-num { font-family: var(--font-display); font-size: clamp(1.8rem,4vw,2.6rem); font-weight: 700; }
.hero-stats .s-lbl { font-size: .82rem; color: rgba(255,255,255,.8); letter-spacing: .03em; }

.section { padding: clamp(3rem,7vw,5.5rem) 0; }
.section-head { max-width: 640px; margin-bottom: 2.6rem; }
.section-head .eyebrow { color: var(--brand-blue-2); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(1.9rem,4.4vw,2.9rem); margin: .5rem 0 .6rem; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px,1fr)); gap: 1.3rem; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.8rem; box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s;
  position: relative; overflow: hidden;
}
.feature:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.feature .ic {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
  font-size: 1.5rem; color: #fff; margin-bottom: 1rem;
}
.feature h3 { font-size: 1.2rem; margin-bottom: .4rem; }
.feature p { color: var(--muted); font-size: .95rem; }

.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 1.5rem; }
.role-card {
  border-radius: var(--r-xl); padding: 2.2rem; color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--shadow-md); transition: transform .35s var(--ease);
}
.role-card:hover { transform: translateY(-6px); }
.role-card.user  { background: var(--grad-brand); }
.role-card.admin { background: linear-gradient(135deg, #34394d, #1d2233); }
.role-card h3 { color: #fff; font-family: var(--font-display); font-size: 1.7rem; }
.role-card p { color: rgba(255,255,255,.85); margin: .6rem 0 1.4rem; }
.role-card .ic-lg { font-size: 2.4rem; margin-bottom: .6rem; }

.site-footer { background: var(--ink); color: rgba(255,255,255,.7); padding: 2.6rem 0; margin-top: 2rem; }
.site-footer .inner { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.site-footer img { height: 38px; filter: brightness(0) invert(1); opacity: .9; }

/* =====================================================================
   Auth pages
   ===================================================================== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-aside {
  position: relative; overflow: hidden; color: #fff; padding: 3rem;
  display: flex; flex-direction: column; justify-content: space-between; background: var(--grad-hero);
}
.auth-aside::after {
  content:""; position:absolute; inset:0;
  background: radial-gradient(600px 300px at 20% 20%, rgba(255,183,51,.3), transparent 60%),
              radial-gradient(600px 360px at 90% 90%, rgba(238,9,121,.32), transparent 60%);
  mix-blend-mode: screen;
}
.auth-aside > * { position: relative; z-index: 2; }
.auth-aside .logo-lockup img { height: 48px; }
.auth-aside h2 { color: #fff; font-family: var(--font-display); font-size: clamp(1.8rem,3vw,2.6rem); margin-top: 2rem; }
.auth-aside p { color: rgba(255,255,255,.88); max-width: 420px; }
.auth-aside .mini-stats { display: flex; gap: 1.8rem; }
.auth-aside .mini-stats b { font-family: var(--font-display); font-size: 1.6rem; display: block; }
.auth-aside .mini-stats span { font-size: .8rem; color: rgba(255,255,255,.78); }

.auth-main { display: grid; place-items: center; padding: 2.5rem 1.4rem; background: var(--bg); }
.auth-card {
  width: min(440px, 100%); background: #fff; border-radius: var(--r-xl);
  padding: clamp(1.8rem, 4vw, 2.8rem); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  animation: rise .6s var(--ease) both;
}
.auth-card h1 { font-family: var(--font-display); font-size: 1.9rem; margin-bottom: .3rem; }
.auth-card .sub { color: var(--muted); margin-bottom: 1.6rem; }
.auth-tag { display:inline-flex; align-items:center; gap:.4rem; margin-bottom:1rem; }

.field { margin-bottom: 1.05rem; }
.field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .4rem; color: var(--ink-soft); }
.field .input-wrap { position: relative; }
.field input, .field select, .field textarea {
  width: 100%; padding: .85rem 1rem; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: #fbfcff; transition: border-color .2s, box-shadow .2s; font-size: .95rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand-blue); box-shadow: 0 0 0 4px rgba(0,72,255,.12); background: #fff; outline: none;
}
.field .hint { font-size: .76rem; color: var(--muted); margin-top: .35rem; }
.field .toggle-eye { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); padding: .3rem; }
.form-row { display: flex; gap: 1rem; }
.form-row .field { flex: 1; }

.auth-msg { font-size: .85rem; padding: .7rem .9rem; border-radius: var(--r-sm); margin-bottom: 1rem; display: none; }
.auth-msg.show { display: block; animation: rise .35s var(--ease) both; }
.auth-msg.error { background: rgba(238,9,121,.10); color: #c20862; }
.auth-msg.ok { background: rgba(63,165,53,.12); color: #2c7a24; }
.auth-foot { margin-top: 1.3rem; text-align: center; font-size: .9rem; color: var(--muted); }
.auth-foot a { color: var(--brand-blue-2); font-weight: 600; }

@keyframes rise { from { opacity: 0; transform: translateY(16px);} to { opacity: 1; transform: none; } }

/* =====================================================================
   App shell (dashboard + admin)
   ===================================================================== */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
  background: #fff; border-right: 1px solid var(--line); padding: 1.3rem 1rem;
  display: flex; flex-direction: column; gap: .4rem; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem 1.2rem; }
.sidebar .brand img { height: 38px; }
.sidebar .brand .t { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1; }
.sidebar .brand .t small { display:block; font-family: var(--font-ui); font-size: .64rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.nav-link {
  display: flex; align-items: center; gap: .75rem; padding: .75rem .85rem; border-radius: var(--r-sm);
  color: var(--ink-soft); font-weight: 500; font-size: .94rem; transition: background .2s, color .2s, transform .2s;
}
.nav-link i { width: 20px; text-align: center; color: var(--muted); transition: color .2s; }
.nav-link:hover { background: var(--bg-2); transform: translateX(3px); }
.nav-link.active { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-glow); }
.nav-link.active i { color: #fff; }
.sidebar .spacer { flex: 1; }
.side-user {
  display: flex; align-items: center; gap: .6rem; padding: .75rem; border-radius: var(--r-md);
  background: var(--bg-2); margin-top: .5rem;
}
.side-user .av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; background: var(--grad-warm); flex: none; }
.side-user .meta { overflow: hidden; }
.side-user .meta b { font-size: .85rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .meta span { font-size: .72rem; color: var(--muted); }

.main { padding: 1.6rem clamp(1rem, 3vw, 2.2rem) 3rem; max-width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.topbar h1 { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.1rem); }
.topbar .sub { color: var(--muted); font-size: .92rem; }
.topbar-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.hamburger { display: none; }

.search-box { position: relative; }
.search-box input { padding: .6rem .9rem .6rem 2.2rem; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; min-width: 220px; }
.search-box i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* Stat cards */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); gap: 1.1rem; margin-bottom: 1.6rem; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s; opacity: 0; transform: translateY(14px);
}
.stat-card.in { opacity: 1; transform: none; }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-card::before { content:""; position: absolute; right:-30px; top:-30px; width:110px; height:110px; border-radius:50%; opacity:.12; }
.stat-card.c1::before { background: var(--brand-blue); }
.stat-card.c2::before { background: var(--brand-pink); }
.stat-card.c3::before { background: var(--brand-gold); }
.stat-card.c4::before { background: var(--brand-teal); }
.stat-card .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 1.2rem; margin-bottom: .9rem; }
.stat-card.c1 .ic { background: var(--brand-blue); }
.stat-card.c2 .ic { background: var(--brand-pink); }
.stat-card.c3 .ic { background: var(--brand-gold); }
.stat-card.c4 .ic { background: var(--brand-teal); }
.stat-card .val { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-card .lbl { color: var(--muted); font-size: .86rem; margin-top: .25rem; }
.stat-card .delta { font-size: .76rem; font-weight: 600; margin-top: .5rem; display: inline-flex; gap: .25rem; align-items: center; }
.delta.up { color: var(--brand-green); }
.delta.down { color: var(--brand-pink); }

/* Panels / cards grid */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.4rem; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.panel-head h3 { font-size: 1.15rem; }
.section-title { font-family: var(--font-display); font-size: 1.4rem; margin: 2rem 0 1rem; display:flex; align-items:center; gap:.6rem; }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.2rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.2rem; }

.data-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s;
  display: flex; flex-direction: column; opacity: 0; transform: translateY(16px);
}
.data-card.in { opacity: 1; transform: none; }
.data-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.data-card .cardtop { padding: 1.1rem 1.2rem .4rem; display: flex; justify-content: space-between; align-items: start; gap: .6rem; }
.data-card .chart-mini { padding: .2rem 1rem .6rem; height: 168px; position: relative; }
.data-card h4 { font-size: 1.05rem; margin: 0 0 .3rem; }
.data-card .desc { color: var(--muted); font-size: .86rem; padding: 0 1.2rem; }
.data-card .meta-row { display: flex; gap: .8rem; color: var(--muted); font-size: .76rem; padding: .7rem 1.2rem 0; flex-wrap: wrap; }
.data-card .card-actions { display: flex; gap: .5rem; padding: 1rem 1.2rem 1.2rem; margin-top: auto; flex-wrap: wrap; }

.report-card { display: flex; gap: 1rem; align-items: center; }
.file-ic { width: 52px; height: 52px; border-radius: 14px; flex: none; display: grid; place-items: center; color: #fff; font-size: 1.3rem; font-weight: 700; }
.file-ic.pdf { background: linear-gradient(135deg,#ee0979,#ff6a3d); }
.file-ic.csv { background: linear-gradient(135deg,#009b8e,#3fa535); }

/* Table */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
table.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th { text-align: left; padding: .8rem 1rem; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr { transition: background .2s; }
.data-table tbody tr:hover { background: var(--bg-2); }
.row-title { font-weight: 600; }
.table-actions { display: flex; gap: .4rem; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-soft); transition: background .2s, color .2s, transform .2s; }
.icon-btn:hover { transform: translateY(-2px); }
.icon-btn.edit:hover { background: var(--brand-blue); color:#fff; }
.icon-btn.del:hover { background: var(--brand-pink); color:#fff; }
.icon-btn.dl:hover { background: var(--brand-teal); color:#fff; }

/* Chart type segmented control */
.seg { display: inline-flex; background: var(--bg-2); border-radius: 999px; padding: .25rem; gap: .15rem; }
.seg button { padding: .4rem .75rem; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--muted); transition: all .2s; display: inline-flex; align-items: center; gap: .35rem; }
.seg button.active { background: #fff; color: var(--brand-blue-2); box-shadow: var(--shadow-sm); }

.chart-shell { height: 360px; position: relative; }

.filter-bar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.2rem; }
.chip {
  padding: .5rem 1rem; border-radius: 999px; font-size: .85rem; font-weight: 600; background: #fff;
  border: 1.5px solid var(--line); color: var(--ink-soft); transition: all .2s;
}
.chip:hover { border-color: var(--brand-blue); }
.chip.active { background: var(--grad-brand); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,28,60,.5); backdrop-filter: blur(4px);
  display: none; place-items: center; z-index: 100; padding: 1.2rem; opacity: 0; transition: opacity .25s;
}
.modal-overlay.open { display: grid; opacity: 1; }
.modal {
  background: #fff; border-radius: var(--r-xl); width: min(620px, 100%); max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); transform: translateY(24px) scale(.98); transition: transform .3s var(--ease);
}
.modal-overlay.open .modal { transform: none; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1.4rem 1.6rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h3 { font-family: var(--font-display); font-size: 1.4rem; }
.modal-body { padding: 1.4rem 1.6rem; }
.modal-foot { padding: 1.1rem 1.6rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: .7rem; position: sticky; bottom: 0; background:#fff; }
.modal .close { width: 38px; height: 38px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; transition: background .2s; }
.modal .close:hover { background: var(--brand-pink); color: #fff; }

/* Toast */
.toast-wrap { position: fixed; bottom: 1.4rem; right: 1.4rem; z-index: 200; display: flex; flex-direction: column; gap: .6rem; }
.toast {
  background: var(--ink); color: #fff; padding: .85rem 1.2rem; border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: .6rem; font-size: .9rem;
  animation: toastIn .35s var(--ease) both; max-width: 340px;
}
.toast.ok { background: linear-gradient(120deg,#2c7a24,#3fa535); }
.toast.err { background: linear-gradient(120deg,#c20862,#ee0979); }
.toast.info { background: linear-gradient(120deg,#2059c4,#0048ff); }
@keyframes toastIn { from { opacity:0; transform: translateX(40px);} to { opacity:1; transform:none; } }

/* Empty state */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty i { font-size: 2.6rem; color: var(--line); margin-bottom: .6rem; }

/* Data-value editor rows (admin) */
.kv-row { display: flex; gap: .6rem; margin-bottom: .5rem; }
.kv-row input { flex: 1; }
.kv-row .icon-btn { flex: none; }

/* Login lock badge for restricted */
.locked-note { display:flex; gap:.6rem; align-items:center; background: rgba(255,183,51,.14); color:#8a5d00; padding:.7rem 1rem; border-radius: var(--r-md); font-size:.85rem; margin-bottom:1rem; }

/* Animations on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 90; width: 270px; height: 100vh;
    transform: translateX(-105%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .hamburger { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
  .scrim { position: fixed; inset: 0; background: rgba(15,20,45,.45); z-index: 80; display: none; }
  .scrim.show { display: block; }
}
@media (max-width: 560px) {
  .hero-stats { gap: 1.4rem; }
  .form-row { flex-direction: column; gap: 0; }
  .nav-actions .btn span { display: none; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .01ms !important; }
}
