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

:root {
  --background: 40 20% 98%;
  --foreground: 220 15% 12%;
  --card: 0 0% 100%;
  --primary: 220 20% 14%;
  --primary-foreground: 45 100% 60%;
  --secondary: 45 100% 55%;
  --secondary-foreground: 220 20% 14%;
  --muted: 40 15% 94%;
  --muted-foreground: 220 10% 40%;
  --accent: 45 100% 55%;
  --destructive: 0 75% 52%;
  --success: 145 65% 38%;
  --border: 40 15% 88%;
  --radius: 1rem;
  --gradient-hero: radial-gradient(circle at 15% -10%, hsl(45 100% 55% / .18), transparent 45%), linear-gradient(135deg, hsl(220 28% 9%), hsl(220 26% 14%));
  --gradient-yellow: linear-gradient(135deg, hsl(48 100% 60%), hsl(38 100% 50%));
  --gradient-card: linear-gradient(160deg, hsl(var(--card)), hsl(40 25% 96%));
  --shadow-industrial: 0 8px 24px -8px hsl(220 20% 14% / .18), 0 2px 6px -2px hsl(220 20% 14% / .10);
  --shadow-glow: 0 0 32px hsl(45 100% 55% / .35);
  --shadow-lift: 0 16px 40px -14px hsl(220 20% 14% / .28);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: 220 26% 7%; --foreground: 40 15% 95%; --card: 220 22% 11%;
    --primary: 45 100% 55%; --primary-foreground: 220 25% 10%;
    --muted: 220 18% 17%; --muted-foreground: 40 10% 65%; --border: 220 18% 20%;
    --gradient-card: linear-gradient(160deg, hsl(220 22% 12%), hsl(220 24% 9%));
  }
}
:root[data-theme="dark"] {
  --background: 220 26% 7%; --foreground: 40 15% 95%; --card: 220 22% 11%;
  --primary: 45 100% 55%; --primary-foreground: 220 25% 10%;
  --muted: 220 18% 17%; --muted-foreground: 40 10% 65%; --border: 220 18% 20%;
  --gradient-card: linear-gradient(160deg, hsl(220 22% 12%), hsl(220 24% 9%));
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: hsl(var(--background)); color: hsl(var(--foreground));
  font-family: 'Inter', 'Noto Sans Devanagari', system-ui, sans-serif;
  padding-bottom: 92px; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand { font-family: 'Oswald', 'Noto Sans Devanagari', sans-serif; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
svg.ic { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.15em; }

/* ---------- hero ---------- */
.hero {
  background: var(--gradient-hero); color: #fff; padding: 30px 18px 40px;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: auto -10% -60% auto; width: 240px; height: 240px;
  background: var(--gradient-yellow); opacity: .12; border-radius: 50%; filter: blur(10px);
}
.hero-eyebrow { display:flex; align-items:center; gap:8px; font-size:.78rem; letter-spacing:.06em; text-transform:uppercase; color: hsl(var(--secondary)); opacity:.9; margin-bottom:6px; }
.hero h1 { margin: 0; font-size: 2rem; color: #fff; display:flex; align-items:center; gap:10px; }
.hero p { margin: 6px 0 0; opacity: .78; font-size: .92rem; }
.hero-actions { display:flex; gap:8px; margin-top: 4px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; display:flex; align-items:center; justify-content:center;
  background: hsl(0 0% 100% / .08); color:#fff; border: 1px solid hsl(0 0% 100% / .12); backdrop-filter: blur(4px);
}

.wrap { max-width: 760px; margin: -22px auto 0; padding: 0 16px 16px; position: relative; z-index: 1; }

/* ---------- cards ---------- */
.card {
  background: var(--gradient-card); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-industrial); margin-bottom: 14px; border: 1px solid hsl(var(--border));
  animation: fade-in .45s cubic-bezier(.16,1,.3,1) both; transition: box-shadow .2s, transform .2s;
}
.card.hover:hover, .card:has(a:hover) { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.card > h3:first-child, .card > .topbar:first-child { margin-top: 0; }
@keyframes fade-in { from { opacity: 0; transform: translateY(14px);} to { opacity:1; transform:none; } }
@keyframes scale-in { from { opacity:0; transform: scale(.94);} to { opacity:1; transform:scale(1);} }
.stat-hero {
  background: var(--gradient-yellow); color: hsl(var(--secondary-foreground)); border: none;
  box-shadow: var(--shadow-glow); animation: scale-in .4s ease-out both;
}
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3,1fr); }
@media (max-width: 480px) { .grid-3 { grid-template-columns: 1fr; } }
.stat { display:flex; flex-direction:column; gap:2px; }
.stat .ico { width:34px; height:34px; border-radius:10px; display:flex; align-items:center; justify-content:center; background: hsl(var(--secondary) / .16); color: hsl(38 90% 42%); margin-bottom:6px; }
.big-num { font-family: 'Oswald', sans-serif; font-size: 1.7rem; font-weight: 600; line-height:1.1; }
.pos { color: hsl(var(--success)); } .neg { color: hsl(var(--destructive)); }
.muted { color: hsl(var(--muted-foreground)); font-size: .85rem; }
.label-row { display:flex; align-items:center; gap:8px; justify-content:space-between; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--gradient-yellow); color: hsl(var(--secondary-foreground));
  border: none; border-radius: 12px; padding: 13px 20px; font-weight: 700;
  cursor: pointer; box-shadow: var(--shadow-glow); font-size: 1rem; transition: transform .15s, filter .15s;
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.outline { background: transparent; color: hsl(var(--foreground)); border: 1px solid hsl(var(--border)); box-shadow: none; }
.btn.danger { background: hsl(var(--destructive)); color: #fff; box-shadow: none; }
.btn.sm { padding: 8px 14px; font-size: .85rem; border-radius: 10px; }
.btn.block { width: 100%; margin-top: 16px; }

/* ---------- forms ---------- */
input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1.5px solid hsl(var(--border));
  background: hsl(var(--background)); color: hsl(var(--foreground)); font-size: 1rem; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: hsl(var(--secondary)); box-shadow: 0 0 0 3px hsl(var(--secondary) / .18); }
label { font-size: .82rem; font-weight: 700; display: flex; align-items:center; gap:6px; margin: 12px 0 5px; color: hsl(var(--muted-foreground)); }
.seg { display:flex; gap:8px; }
.seg label { flex:1; margin:0; }
.seg input[type=radio] { display:none; }
.seg span { display:flex; align-items:center; justify-content:center; gap:6px; padding:12px; border-radius:10px; border:1.5px solid hsl(var(--border)); cursor:pointer; font-weight:600; }
.seg input:checked + span { background: var(--gradient-yellow); border-color: transparent; color: hsl(var(--secondary-foreground)); box-shadow: var(--shadow-glow); }

/* ---------- table / rows ---------- */
.row-list .item {
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  padding: 12px 4px; border-bottom: 1px solid hsl(var(--border));
}
.row-list .item:last-child { border-bottom: none; }
.row-icon { width:36px; height:36px; border-radius:10px; background: hsl(var(--muted)); display:flex; align-items:center; justify-content:center; flex-shrink:0; color: hsl(var(--muted-foreground)); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 6px; border-bottom: 1px solid hsl(var(--border)); }
th { color: hsl(var(--muted-foreground)); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing:.03em; }
tr { transition: background .12s; }
tbody tr:hover { background: hsl(var(--muted) / .5); }

/* ---------- progress bars ---------- */
.bar-track { height: 9px; border-radius: 99px; background: hsl(var(--muted)); overflow:hidden; margin-top:6px; }
.bar-fill { height:100%; border-radius:99px; background: var(--gradient-yellow); transition: width .5s ease-out; }
.bar-fill.over { background: hsl(var(--destructive)); }

/* ---------- left sidebar (desktop) ---------- */
.sidebar {
  display: none; position: fixed; inset: 0 auto 0 0; width: 250px; flex-direction: column;
  background: hsl(220 25% 9%); color: #fff; padding: 22px 16px; z-index: 30;
  border-right: 1px solid hsl(0 0% 100% / .06);
}
.sb-brand { display:flex; align-items:center; gap:10px; padding: 0 6px 22px; }
.sb-logo { width:38px; height:38px; border-radius:10px; background: var(--gradient-yellow); color: hsl(var(--secondary-foreground)); display:flex; align-items:center; justify-content:center; font-weight:800; box-shadow: var(--shadow-glow); }
.sb-brand .brand { color: hsl(var(--secondary)); font-size: 1.2rem; }
.sb-nav { display:flex; flex-direction:column; gap:3px; flex:1; }
.sb-nav a { display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:11px; color: hsl(0 0% 100% / .7); font-weight:600; font-size:.92rem; transition: background .15s, color .15s; }
.sb-nav a svg.ic { width:1.15em; height:1.15em; flex-shrink:0; }
.sb-nav a:hover { background: hsl(0 0% 100% / .06); color:#fff; }
.sb-nav a.active { background: hsl(0 0% 100% / .1); color: hsl(var(--secondary)); }
.sb-foot { display:flex; flex-direction:column; gap:10px; padding-top: 14px; border-top: 1px solid hsl(0 0% 100% / .08); }
.sb-logout { display:flex; align-items:center; justify-content:center; gap:8px; padding:9px; color: hsl(0 0% 100% / .55); font-size:.82rem; font-weight:600; border-radius:10px; }
.sb-logout:hover { color:#fff; background: hsl(0 0% 100% / .06); }
@media (min-width: 900px) {
  .sidebar { display: flex; }
  main.with-sidebar { margin-left: 250px; }
  main.with-sidebar .hero, main.with-sidebar .wrap { max-width: 900px; }
  .nav { display: none; }
  .hero-actions { display: none; }
  body { padding-bottom: 0; }
}

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; background: hsl(var(--card) / .92); backdrop-filter: blur(10px);
  border-top: 1px solid hsl(var(--border)); display: flex; justify-content: space-around;
  padding: 8px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px -10px hsl(220 20% 14% / .2);
}
.nav a { font-size: .68rem; color: hsl(var(--muted-foreground)); display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 8px; border-radius: 10px; transition: color .15s; }
.nav a svg.ic { width: 1.3em; height: 1.3em; }
.nav a.active { color: hsl(38 90% 45%); font-weight: 700; }
.nav a.fab { margin-top: -22px; background: var(--gradient-yellow); color: hsl(var(--secondary-foreground)); width:52px; height:52px; border-radius:16px; justify-content:center; box-shadow: var(--shadow-glow); font-weight:700; }
.nav a.fab svg.ic { width:1.5em; height:1.5em; }

.topbar { display: flex; justify-content: space-between; align-items: center; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 10px; font-size: .9rem; font-weight:600; display:flex; align-items:center; gap:8px; }
.flash.ok { background: hsl(var(--success) / .13); color: hsl(var(--success)); }
.flash.error { background: hsl(var(--destructive) / .12); color: hsl(var(--destructive)); }
.pill { display:inline-flex; align-items:center; gap:4px; padding: 4px 11px; border-radius: 999px; font-size:.74rem; font-weight:600; background: hsl(var(--muted)); }
.pill.gold { background: hsl(var(--secondary) / .18); color: hsl(38 90% 40%); }

.login-wrap { min-height: 100vh; display:flex; align-items:center; justify-content:center; padding:20px; background: var(--gradient-hero); position:relative; }
.login-card { background: hsl(var(--card)); border-radius: 22px; padding: 36px 28px; max-width: 340px; width:100%; text-align:center; box-shadow: 0 30px 70px -20px hsl(220 30% 5% / .5); animation: scale-in .5s cubic-bezier(.16,1,.3,1) both; }
.login-card .icon { width:76px; height:76px; border-radius:22px; background:var(--gradient-yellow); display:flex; align-items:center; justify-content:center; font-size:2.1rem; font-weight:800; margin: 0 auto 16px; box-shadow: var(--shadow-glow); color: hsl(var(--secondary-foreground)); }
