/* LexQuora design system — one source for website, web app, Super Admin and mobile app.
   Brand: concept 1 logo. Ink, gold, ivory, with teal for "done". */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&family=Noto+Sans+Tamil:wght@400;500&display=swap');

:root {
  --ink: #0E0E10; --ink-2: #19191C; --ink-3: #26262B; --ink-line: #34343A;
  --gold: #C9A24A; --gold-2: #D9B866; --gold-deep: #9A7628; --gold-text: #7A5C1C; --gold-wash: #F6EBD2;
  --ivory: #F8F4EA; --paper: #FBF8F1; --white: #FFFFFF; --line: #E6DFCF; --line-2: #EFE9DC;
  --stone: #4A4740; --stone-2: #6B675E; --mist: #CFC7B4;
  --teal: #14968C; --teal-text: #0E6F68; --teal-wash: #E3F3F1;
  --red: #B42318; --red-wash: #FBE4E1; --blue-wash: #E6EEFA; --blue-text: #234E9E;
  --radius: 12px; --radius-sm: 8px; --radius-lg: 18px;
  --shadow-1: 0 1px 2px rgba(14,14,16,.06), 0 1px 1px rgba(14,14,16,.04);
  --shadow-2: 0 6px 18px rgba(14,14,16,.08), 0 2px 6px rgba(14,14,16,.05);
  --shadow-3: 0 18px 48px rgba(14,14,16,.18);
  --focus: 0 0 0 3px rgba(201,162,74,.45);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--ivory); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--gold-text); text-decoration: none; }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
:lang(ta), .ta { font-family: 'Noto Sans Tamil', var(--font); }
::selection { background: var(--gold-wash); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

/* ---------- Buttons: each kind has one job ---------- */
.btn { --b: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent; font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s, color .2s, border-color .2s; text-decoration: none; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
/* Primary action on light surfaces: ink with gold text */
.btn-primary { background: var(--ink); color: var(--gold); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.btn-primary:hover { color: var(--gold-2); box-shadow: 0 8px 22px rgba(14,14,16,.28); }
/* Hero / conversion action: solid gold with a gentle shine */
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--ink); box-shadow: 0 6px 18px rgba(201,162,74,.35), inset 0 1px 0 rgba(255,255,255,.35); position: relative; overflow: hidden; }
.btn-gold::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease); }
.btn-gold:hover::after { transform: translateX(120%); }
.btn-gold:hover { box-shadow: 0 10px 28px rgba(201,162,74,.5), inset 0 1px 0 rgba(255,255,255,.35); color: var(--ink); }
/* Secondary */
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--ivory); }
/* On dark surfaces */
.btn-light { background: rgba(248,244,234,.06); border-color: rgba(248,244,234,.4); color: var(--ivory); backdrop-filter: blur(6px); }
.btn-light:hover { background: var(--ivory); color: var(--ink); }
/* Quiet */
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(14,14,16,.06); color: var(--ink); }
/* Money and completion */
.btn-teal { background: var(--teal-text); color: #fff; }
.btn-teal:hover { background: var(--teal); color: #fff; box-shadow: 0 8px 20px rgba(20,150,140,.3); }
.btn-danger { background: transparent; color: var(--red); border-color: #F1C9C4; }
.btn-danger:hover { background: var(--red-wash); color: var(--red); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; }
.btn-icon.btn-sm { width: 34px; min-height: 34px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--gold-text); cursor: pointer; }
.link-btn:hover { color: var(--ink); text-decoration: underline; }
/* Choice pills and segmented control */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); font: 500 13px var(--font); cursor: pointer; color: var(--ink); transition: all .15s; }
.pill:hover { border-color: var(--gold); }
.pill.on { background: var(--ink); border-color: var(--ink); color: var(--gold); font-weight: 600; }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--line-2); border-radius: 12px; }
.seg button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; font: 500 13px var(--font); color: var(--stone); cursor: pointer; }
.seg button.on { background: var(--white); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }
.seg.dark { background: var(--ink-2); } .seg.dark button { color: var(--mist); } .seg.dark button.on { background: var(--gold); color: var(--ink); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--stone); font-weight: 500; }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white);
  font: 400 15px var(--font); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 88px; resize: vertical; line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus); }
.field .hint { font-weight: 400; color: var(--stone-2); font-size: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--mist); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s var(--ease); box-shadow: var(--shadow-1); }
.switch input:checked + span { background: var(--teal-text); }
.switch input:checked + span::before { transform: translateX(18px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- Surfaces ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card-pad { padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-head h2, .card-head h3 { font-size: 16px; font-weight: 600; }
.card-dark { background: var(--ink); color: var(--ivory); border: 1px solid var(--ink-line); border-radius: var(--radius); }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.kpi .label { font-size: 13px; color: var(--stone); }
.kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.kpi .sub { font-size: 12px; color: var(--stone-2); }
.kpi::after { content: ''; position: absolute; right: -18px; top: -18px; width: 64px; height: 64px; border-radius: 50%; background: var(--gold-wash); opacity: .7; }
.kpi > * { position: relative; z-index: 1; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #EFEAE0; color: var(--stone); }
.badge.gold { background: var(--gold-wash); color: var(--gold-text); }
.badge.teal { background: var(--teal-wash); color: var(--teal-text); }
.badge.red { background: var(--red-wash); color: var(--red); }
.badge.blue { background: var(--blue-wash); color: var(--blue-text); }
.badge.ink { background: var(--ink); color: var(--gold); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--stone); background: var(--paper); padding: 10px 16px; white-space: nowrap; }
.table td { padding: 12px 16px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.table tr.click { cursor: pointer; transition: background .12s; }
.table tr.click:hover td { background: #FCFAF4; }
.t-strong { font-weight: 600; }
.t-sub { font-size: 12px; color: var(--stone-2); }

/* ---------- App shell (web app + Super Admin) ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: none; background: var(--ink); color: var(--ivory); display: flex; flex-direction: column; padding: 20px 14px; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 4px 8px 6px; }
.sidebar .brand img { height: 34px; width: auto; }
.sidebar .acct { margin: 0 4px; padding: 10px 12px; border: 1px solid var(--ink-line); border-radius: 10px; font-size: 13px; background: var(--ink-2); }
.sidebar .acct b { display: block; color: var(--ivory); font-weight: 600; }
.sidebar .acct span { color: var(--mist); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .group { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #8E887A; padding: 12px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #E9E2D2; font-size: 14px; position: relative; transition: background .15s, color .15s; }
.nav a svg { width: 18px; height: 18px; opacity: .8; }
.nav a:hover { background: rgba(248,244,234,.06); color: #fff; }
.nav a.on { background: linear-gradient(90deg, rgba(201,162,74,.22), rgba(201,162,74,.06)); color: var(--gold); font-weight: 600; }
.nav a.on::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav a.on svg { opacity: 1; }
.nav .count { margin-left: auto; font-size: 11px; background: var(--gold); color: var(--ink); border-radius: 99px; padding: 1px 7px; font-weight: 700; }
.sidebar .foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 32px; background: rgba(248,244,234,.88); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); }
.topbar .search { flex: 1; max-width: 420px; position: relative; }
.topbar .search input { padding-left: 38px; background: var(--white); }
.topbar .search svg { position: absolute; left: 12px; top: 13px; width: 18px; height: 18px; color: var(--stone-2); }
.content { padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 24px; max-width: 1360px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.page-head h1 { font-size: 30px; }
.page-head .eyebrow { font-size: 13px; color: var(--stone); margin-bottom: 4px; }
.menu-btn { display: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.avatar.ink { background: var(--ink); color: var(--gold); }

/* ---------- Layout helpers ---------- */
.row { display: flex; align-items: center; gap: 12px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.grow { flex: 1; min-width: 0; } .right { margin-left: auto; } .center { text-align: center; }
.muted { color: var(--stone-2); } .small { font-size: 13px; } .tiny { font-size: 12px; } .strong { font-weight: 600; } .red { color: var(--red); } .teal { color: var(--teal-text); } .goldt { color: var(--gold-text); }
.hr { height: 1px; background: var(--line-2); border: 0; margin: 4px 0; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-2); }
.list-item:first-child { border-top: 0; }
.stack-gap { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 12px 14px; font: 500 14px var(--font); color: var(--stone); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--gold); font-weight: 600; }
.tabs button .n { font-size: 11px; background: var(--line-2); border-radius: 99px; padding: 1px 7px; margin-left: 6px; }

/* ---------- Modal, drawer, toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(14,14,16,.5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .18s; }
.modal { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-3); width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: rise .22s var(--ease); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { font-size: 18px; font-weight: 600; flex: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line-2); background: var(--paper); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--ivory); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-3); font-size: 14px; display: flex; gap: 10px; align-items: center; animation: rise .25s var(--ease); pointer-events: auto; max-width: 90vw; }
.toast.ok::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.toast.err::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #F04438; }
@keyframes fade { from { opacity: 0 } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) } }
@keyframes shimmer { 100% { background-position: -200% 0 } }
.skel { background: linear-gradient(90deg, #EFEAE0 25%, #F7F3EA 50%, #EFEAE0 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; min-height: 16px; }

/* ---------- Empty states, notices ---------- */
.empty { padding: 40px 20px; text-align: center; color: var(--stone); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .arch { width: 56px; height: 72px; border-radius: 28px 28px 6px 6px; border: 2px solid var(--gold); position: relative; }
.empty .arch::after { content: ''; position: absolute; inset: 6px; border-radius: 22px 22px 3px 3px; background: var(--gold-wash); }
.notice { padding: 12px 16px; border-radius: 10px; background: var(--gold-wash); color: var(--gold-text); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice.teal { background: var(--teal-wash); color: var(--teal-text); } .notice.red { background: var(--red-wash); color: var(--red); } .notice.ink { background: var(--ink); color: var(--ivory); }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 26px; display: flex; flex-direction: column; gap: 18px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; }
.tl-item::before { content: ''; position: absolute; left: -24px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 2px solid var(--gold); }
.tl-item.done::before { background: var(--teal-text); border-color: var(--teal-text); }

/* ---------- Auth screens ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: radial-gradient(1200px 600px at 20% 0%, #2A2418 0%, var(--ink) 60%); color: var(--ivory); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ''; position: absolute; right: -120px; bottom: -160px; width: 420px; height: 540px; border-radius: 210px 210px 0 0; border: 2px solid rgba(201,162,74,.35); }
.auth-art::before { content: ''; position: absolute; right: -80px; bottom: -160px; width: 340px; height: 460px; border-radius: 170px 170px 0 0; background: rgba(201,162,74,.06); }
.auth-art h1 { font-size: 40px; max-width: 520px; color: var(--ivory); }
.auth-art .gold { color: var(--gold); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; }
.otp { display: flex; gap: 8px; } .otp input { width: 48px; height: 54px; text-align: center; font-size: 22px; font-weight: 600; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.otp input:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus); }
.demo-chip { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px dashed var(--mist); border-radius: 12px; background: var(--paper); cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .15s, background .15s; width: 100%; }
.demo-chip:hover { border-color: var(--gold); background: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-3); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; } .content { padding: 20px 16px 40px; }
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .g3 { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .g2, .g4 { grid-template-columns: 1fr; } .page-head h1 { font-size: 24px; } .hide-sm { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* default icon sizing (icons inherit text colour) */
svg:where([aria-hidden="true"]) { width: 18px; height: 18px; flex: none; }
:where(.small, .tiny, .badge) svg:where([aria-hidden="true"]) { width: 14px; height: 14px; vertical-align: -2px; }
:where(.field > .row) svg { width: 15px; height: 15px; }
@media (max-width: 900px) { .sidebar:not(.open) { box-shadow: none; visibility: hidden; } .sidebar.open { visibility: visible; } }
@media (max-width: 600px) { .grid.g4 { grid-template-columns: 1fr 1fr; gap: 12px; } .kpi .value { font-size: 24px; } }
.tealt { color: var(--teal-text); } .goldt { color: var(--gold-text); }
.prose { font-size: 15px; line-height: 1.65; } .prose h2 { font-family: var(--serif); font-size: 22px; margin: 18px 0 8px; } .prose h3 { font-size: 17px; margin: 14px 0 6px; } .prose p { margin: 0 0 12px; } .prose ul { padding-left: 20px; margin: 0 0 12px; }
.card-dark .goldt, .auth-art .goldt, .notice.ink .goldt, .sidebar .goldt { color: var(--gold); }
.switch { display: inline-block; vertical-align: middle; }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 8px; }
.switch input:disabled + span { opacity: .55; cursor: not-allowed; }
[hidden] { display: none !important; }
