/* Iklavya Portal — brand styles. No build step needed. */
:root {
  --bg: #08080B;
  --bg-2: #0B0D0C;
  --panel: #121214;
  --panel-2: #17191A;
  --line: #1E2420;
  --line-2: #2A302C;
  --text: #FFFFFF;
  --text-2: #D4D8D6;
  --muted: #A1A6A3;
  --muted-2: #8C918E;
  --green: #136E35;
  --green-hover: #15873F;
  --green-mid: #199A52;
  --green-deep: #0F5A2C;
  --glow: #43BF74;
  --glow-soft: rgba(67, 191, 116, 0.12);
  --amber: #F5C26B;
  --blue: #9CB8FF;
  --red: #FF9C9C;
  --radius: 20px;
  --font: Inter, system-ui, -apple-system, sans-serif;
  --serif: 'DM Serif Display', Georgia, serif;
  --num: 'Space Grotesk', Inter, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; }
a { color: var(--glow); }
a:hover { color: #7ADBA0; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
.serif { font-family: var(--serif); font-weight: 400; }
.num { font-family: var(--num); font-weight: 700; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Top bar */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand img { width: 36px; height: auto; }
.brand span { font-family: var(--serif); font-size: 22px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 360px; }
.nav a { padding: 9px 14px; border-radius: 10px; color: #B4B9B6; font-size: 14px; font-weight: 500; text-decoration: none; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: var(--panel-2); color: var(--text); font-weight: 600; }
.nav a .soon { font-size: 11px; color: var(--muted-2); margin-left: 4px; }
.me { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-2); font-family: var(--num); font-weight: 700; font-size: 14px; }
.chip.glow { background: var(--glow-soft); border-color: var(--green); color: var(--glow); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--green); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; background: var(--line); }
.who { display: flex; flex-direction: column; line-height: 1.25; }
.who small { color: var(--muted); font-size: 12px; }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.linkbtn:hover { color: var(--text); background: var(--panel-2); }

/* Layout */
.container { max-width: 1280px; margin: 0 auto; padding: 32px 24px 56px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--glow); }
.title { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.1; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card.hero { background: radial-gradient(circle at 85% 20%, rgba(67,191,116,0.22), rgba(18,18,20,0) 55%), var(--panel); }
.card h2 { font-size: 18px; font-weight: 700; }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.tile { background: var(--bg-2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.tile .num { font-size: 22px; }
.tile small { font-size: 12px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

/* Level ring + progress */
.level-ring { width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--glow); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 24px rgba(67,191,116,0.35); font-family: var(--num); font-size: 30px; font-weight: 700; color: var(--glow); flex-shrink: 0; }
.progress { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress.thin { height: 8px; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green), var(--glow)); }

/* Buttons + forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.btn-primary { background: var(--green); color: #FFFFFF; border-color: var(--green-mid); }
.btn-primary:hover { background: var(--green-hover); color: #FFFFFF; }
.btn-primary:active { background: var(--green-deep); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; height: 52px; font-size: 16px; }
.btn-glow { box-shadow: 0 0 0 1px var(--green-mid) inset, 0 8px 28px rgba(67,191,116,0.25); }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.input, select.input { height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: inherit; font-size: 15px; width: 100%; }
.input.sm { height: 38px; font-size: 14px; border-radius: 9px; padding: 0 10px; }
.input:focus { outline: 2px solid var(--glow); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.error { color: var(--red); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 14px; font-size: 14px; border: 1px solid var(--green); background: var(--glow-soft); color: var(--glow); }
.alert.warn { border-color: #6B5522; background: rgba(245,194,107,0.08); color: var(--amber); }
.alert.error { border-color: #6B2C2C; background: rgba(255,156,156,0.08); color: var(--red); }
.secret { font-family: var(--num); font-size: 16px; color: var(--text); background: var(--bg-2); border: 1px dashed var(--line-2); padding: 4px 10px; border-radius: 8px; user-select: all; }

/* Pills */
.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; border: 1px solid var(--line-2); color: var(--text-2); }
.pill.green { color: #08080B; background: var(--glow); border-color: var(--glow); }
.pill.outline-green { color: var(--glow); border-color: var(--green); }
.pill.amber { color: var(--amber); border-color: #6B5522; }
.pill.blue { color: var(--blue); border-color: #2C3D66; }
.pill.red { color: var(--red); border-color: #6B2C2C; }
.pill.dim { color: var(--muted-2); border-style: dashed; }

/* Tables */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.table th { text-align: left; padding: 14px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; background: var(--bg-2); }
.table td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr.inactive td { opacity: 0.55; }
.table td.nowrap { white-space: nowrap; }
details.edit summary { cursor: pointer; list-style: none; color: var(--glow); font-size: 13px; font-weight: 600; }
details.edit summary::-webkit-details-marker { display: none; }
details.edit[open] { grid-column: 1 / -1; }
.edit-panel { margin-top: 12px; padding: 14px; background: var(--bg-2); border-radius: 12px; display: flex; flex-direction: column; gap: 12px; min-width: 520px; }

/* Leaderboard */
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid transparent; }
.lb-row.me { background: var(--glow-soft); border-color: var(--green); }
.lb-rank { width: 26px; font-family: var(--num); font-size: 16px; font-weight: 700; color: #6F7571; }
.lb-rank.r1 { color: var(--glow); } .lb-rank.r2 { color: var(--text-2); } .lb-rank.r3 { color: #C8945A; }
.tabs { display: inline-flex; gap: 4px; background: var(--bg-2); border-radius: 10px; padding: 4px; }
.tabs a { padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: #B4B9B6; text-decoration: none; }
.tabs a.active { background: var(--green); color: #FFFFFF; }

/* Empty states */
.empty { border: 1px dashed var(--line-2); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; color: var(--muted); font-size: 14px; }
.empty strong { color: var(--text); font-size: 15px; }

/* Login */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-brand { flex: 1 1 520px; min-height: 420px; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; background: radial-gradient(circle at 70% 40%, rgba(67,191,116,0.16), rgba(8,8,11,0) 60%), var(--bg-2); border-right: 1px solid var(--line); }
.auth-brand .big { width: 200px; height: auto; }
.auth-brand h1 { font-family: var(--serif); font-weight: 400; font-size: 50px; line-height: 1.08; max-width: 560px; }
.auth-form { flex: 1 1 420px; padding: 56px 24px; display: flex; align-items: center; justify-content: center; }
.auth-form .inner { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 22px; }
.badge-tag { font-size: 12px; font-weight: 600; letter-spacing: 1.5px; color: var(--glow); border: 1px solid var(--green); border-radius: 999px; padding: 4px 10px; text-transform: uppercase; }
.features { display: flex; gap: 10px; flex-wrap: wrap; }
.feature { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-size: 14px; color: var(--text-2); }

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .container { padding: 24px 16px 40px; }
  .title { font-size: 32px; }
  .auth-brand { padding: 32px 20px; min-height: 0; }
  .auth-brand h1 { font-size: 36px; }
  .edit-panel { min-width: 0; }
}

/* Phase 2: clients & requirements */
textarea.input { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
textarea.input.tall { min-height: 320px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.field small, .hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.form-section { display: flex; flex-direction: column; gap: 14px; }
.form-section + .form-section { border-top: 1px solid var(--line); padding-top: 18px; }
.form-section h3 { font-size: 15px; font-weight: 700; color: var(--text-2); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 2px; }
.kpi .num { font-size: 30px; }
.kpi small { color: var(--muted); font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters a { padding: 8px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #B4B9B6; border: 1px solid var(--line-2); text-decoration: none; }
.filters a.active { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.filters form { margin-left: auto; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.step { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--line-2); color: var(--muted-2); }
.step.done { background: var(--glow-soft); border: 1px solid var(--green); color: var(--glow); }
.step strong { font-size: 13px; }
.step small { font-size: 12px; opacity: 0.9; }
.req-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.req-card:hover { border-color: #2F6B45; color: var(--text); }
.req-card .who small { white-space: normal; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.fact { background: var(--bg-2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.fact small { color: var(--muted); font-size: 12px; }
.fact span { font-size: 15px; font-weight: 600; }
.tabbar { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.tabbar a { padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; color: #B4B9B6; border: 1px solid var(--line-2); text-decoration: none; }
.tabbar a.active { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.prose { font-size: 15px; line-height: 1.65; color: var(--text-2); }
.prose h1, .prose h2, .prose h3 { color: var(--text); margin: 18px 0 8px; font-size: 17px; }
.prose h1:first-child, .prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 20px; margin: 6px 0 12px; }
.prose li { margin: 4px 0; }
.prose p { margin: 6px 0 12px; }
.prose table { border-collapse: collapse; margin: 10px 0; }
.prose th, .prose td { border: 1px solid var(--line-2); padding: 6px 10px; text-align: left; }
.prose code { background: var(--bg-2); padding: 1px 6px; border-radius: 6px; }
.jd-text { white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: var(--text-2); background: var(--bg-2); border-radius: 12px; padding: 16px; max-height: 640px; overflow: auto; }
.file-link { display: inline-flex; align-items: center; gap: 8px; }

/* Phase 3: calling desk */
.outcome { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; cursor: pointer; background: var(--bg-2); border: 2px solid var(--line); }
.outcome input { position: absolute; opacity: 0; pointer-events: none; }
.outcome strong { font-size: 15px; }
.outcome small { font-size: 12px; color: var(--muted); }
.outcome:has(input:focus-visible) { outline: 2px solid var(--glow); outline-offset: 2px; }
.outcome-shortlisted:has(input:checked) { border-color: var(--glow); background: var(--glow-soft); color: var(--glow); }
.outcome-no_answer:has(input:checked) { border-color: var(--blue); background: rgba(156,184,255,0.10); color: var(--blue); }
.outcome-on_hold:has(input:checked) { border-color: var(--amber); background: rgba(245,194,107,0.10); color: var(--amber); }
.outcome-rejected:has(input:checked) { border-color: var(--red); background: rgba(255,156,156,0.10); color: var(--red); }
.reason { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.reason input { accent-color: #43BF74; }
.reason:has(input:checked) { background: #FFFFFF; color: #08080B; border-color: #FFFFFF; }
.celebrate { background: radial-gradient(circle at 50% 0%, rgba(67,191,116,0.25), rgba(18,18,20,0) 60%), var(--panel); border-color: var(--green); text-align: center; align-items: center; }
.quest-ring { width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: conic-gradient(var(--glow) var(--pct), var(--line) 0); }
.quest-ring > span { width: 48px; height: 48px; border-radius: 50%; background: var(--bg-2); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.quest-ring b { font-size: 15px; }
.quest-ring small { font-size: 10px; color: var(--muted); }

/* Phase 7: badges, leaderboard, reports */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border-radius: 14px; text-align: center; background: var(--bg-2); border: 1px dashed var(--line-2); }
.badge-tile.on { background: var(--glow-soft); border: 1px solid var(--green); }
.badge-tile strong { font-size: 13px; }
.badge-tile small { font-size: 11px; color: var(--muted); line-height: 1.35; }
.badge-tile.off strong { color: var(--muted); }
.chart { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 180px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hbar .track { height: 14px; background: var(--bg-2); border-radius: 4px; position: relative; }
.hbar .fill { height: 100%; background: #43BF74; border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .val { font-family: var(--num); font-weight: 700; min-width: 36px; text-align: right; }
.vbars { display: flex; align-items: flex-end; gap: 2px; height: 160px; padding-top: 8px; border-bottom: 1px solid var(--line-2); }
.vbars .col { flex: 1 1 0; display: flex; align-items: flex-end; height: 100%; position: relative; min-width: 3px; }
.vbars .bar { width: 100%; background: #43BF74; border-radius: 4px 4px 0 0; min-height: 1px; }
.vbars .col:hover .bar, .hbar:hover .fill { background: #7ADBA0; }
.vbars .col .tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); font-size: 12px; padding: 4px 8px; border-radius: 8px; white-space: nowrap; z-index: 2; }
.vbars .col:hover .tip, .vbars .col:focus .tip { display: block; }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.podium .spot { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); text-align: center; }
.podium .spot.first { border-color: var(--green); background: radial-gradient(circle at 50% 0%, rgba(67,191,116,0.2), rgba(18,18,20,0) 60%), var(--panel); }
.podium .medal { font-family: var(--num); font-weight: 700; font-size: 13px; letter-spacing: 1px; }
