@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&display=swap');

:root {
  --bg: #ffffff;
  --canvas: #f7f8fa;
  --ink: #101828;
  --muted: #5a6473;
  --faint: #8a94a3;
  --line: #d5dbe3;
  --line-soft: #e8ebf0;
  --accent: #0a66c2;
  --accent-dark: #004182;
  --accent-weak: #e9f1fb;
  --green: #067647;
  --green-weak: #ecfdf3;
  --amber: #b54708;
  --amber-weak: #fffaeb;
  --red: #d92d20;
  --red-weak: #fef3f2;
  --shadow: 0 1px 2px rgba(16,24,40,.05);
  --shadow-md: 0 4px 14px rgba(16,24,40,.08);
  --radius: 10px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); color: var(--ink); background: var(--canvas); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---- Shell ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: none; background: linear-gradient(180deg, #eef5fc 0%, #e4eef9 100%); border-right: 1px solid #d5e3f2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 18px 20px; }
.bmark { font-family: "Syne", var(--sans); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; color: var(--ink); }
.bmark span { color: var(--accent); margin-left: 4px; }
.side-nav { padding: 10px; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 7px; color: var(--muted); font-weight: 500; font-size: 13.5px; margin-bottom: 1px; }
.side-nav a:hover { background: rgba(255,255,255,.6); color: var(--ink); text-decoration: none; }
.side-nav a.active { background: #ffffff; color: var(--accent-dark); font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.1); }
.side-nav a svg { width: 17px; height: 17px; opacity: .9; }
.side-group { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 16px 11px 6px; }
.side-foot { border-top: 1px solid #d5e3f2; padding: 12px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 7px 9px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: none; }
.side-user .who { min-width: 0; }
.side-user .who .e { font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.side-user .who .p { font-size: 11.5px; color: var(--faint); }
.signout { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; padding: 8px 9px; border-radius: 7px; cursor: pointer; margin-top: 2px; }
.signout:hover { background: var(--canvas); color: var(--ink); }

/* ---- Main ---- */
.main { flex: 1; min-width: 0; }
.topbar { background: var(--bg); border-bottom: 1px solid var(--line-soft); padding: 0 32px; height: 60px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 17px; }
.content { padding: 26px 34px 64px; max-width: none; }
.subtle { color: var(--muted); }
.sec-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; margin: 30px 0 14px; }

/* Prokerala-style overview cards */
.banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--accent-weak); border: 1px solid #dde1fb; border-radius: var(--radius); padding: 14px 20px; margin-bottom: 18px; flex-wrap: wrap; }
.banner p { margin: 0; font-size: 13.5px; color: var(--ink); }
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 1120px) { .cards3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .cards3 { grid-template-columns: 1fr; } }

.applist .arow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.applist .arow:last-child { border-bottom: 0; }
.aicon { width: 38px; height: 38px; border-radius: 9px; background: var(--accent-weak); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.aicon svg { width: 18px; height: 18px; }
.arow .ameta { min-width: 0; }
.arow .ameta .an { font-weight: 600; font-size: 13.5px; }
.arow .ameta .ad { font-size: 12px; color: var(--faint); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.quota + .quota { margin-top: 18px; }
.quota .qh { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; margin-bottom: 7px; }
.quota .qh b { font-weight: 600; }
.quota .qh .qn { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

.quicklinks a { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; color: var(--ink); font-weight: 500; }
.quicklinks a:last-child { border-bottom: 0; }
.quicklinks a:hover { color: var(--accent); text-decoration: none; }
.quicklinks a svg { width: 16px; height: 16px; color: var(--muted); flex: none; }

/* ---- Stat tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tile { background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.tile .th { display: flex; align-items: center; justify-content: space-between; }
.tile .tl { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tile .ti { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-weak); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.tile .ti svg { width: 16px; height: 16px; }
.tile .tv { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; margin-top: 12px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .tv small { font-size: 14px; font-weight: 600; color: var(--muted); }
.tile .tc { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.bar { height: 6px; background: var(--line-soft); border-radius: 99px; overflow: hidden; margin-top: 14px; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* ---- Plan strip ---- */
.strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); margin-top: 16px; flex-wrap: wrap; }
.strip .s1 { font-size: 13.5px; color: var(--muted); }
.strip .s1 b { color: var(--ink); font-weight: 600; }

/* ---- Cards ---- */
.card { background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card, .mt { margin-top: 16px; }
.card-h { padding: 15px 20px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-h h2 { font-size: 14.5px; }
.card-h p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.card-b { padding: 20px; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 600; font-size: 13.5px; padding: 8px 15px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; box-shadow: var(--shadow); }
.btn:hover { background: var(--canvas); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { color: var(--red); border-color: var(--line); box-shadow: none; }
.btn.danger:hover { background: var(--red-weak); border-color: #fda29b; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn.link { border: 0; box-shadow: none; background: none; color: var(--accent); padding: 6px 2px; }
.btn.link:hover { background: none; text-decoration: underline; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---- Tables ---- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .02em; color: var(--faint); font-weight: 600; padding: 11px 20px; border-bottom: 1px solid var(--line-soft); background: #fbfcfd; }
.tbl td { padding: 13px 20px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .mono { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }
.empty svg { width: 26px; height: 26px; color: var(--faint); display: block; margin: 0 auto 10px; }

/* ---- Forms ---- */
.field { margin-bottom: 16px; }
.lbl { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.inp { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); }
.inp:disabled { background: var(--canvas); color: var(--muted); }
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---- Credentials ---- */
.cred { display: flex; align-items: center; gap: 8px; background: var(--canvas); border: 1px solid var(--line-soft); border-radius: 7px; padding: 9px 12px; font-family: var(--mono); font-size: 12.5px; color: var(--ink); word-break: break-all; }
.cred .v { flex: 1; min-width: 0; }
.copy { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-weight: 600; font-size: 12.5px; flex: none; }
.notice { background: var(--amber-weak); border: 1px solid #fedf89; border-radius: 7px; padding: 11px 13px; font-size: 13px; color: var(--amber); }

/* ---- Tags ---- */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.tag.ok { background: var(--green-weak); color: var(--green); }
.tag.ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.tag.off { background: var(--red-weak); color: var(--red); }
.tag.neutral { background: var(--line-soft); color: var(--muted); }

/* ---- Code ---- */
pre.code { background: #0c1222; color: #d6deee; padding: 14px 16px; border-radius: 9px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; margin: 0; }

/* ---- Modal ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(15,20,30,.5); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-bg.open { display: flex; }
.modal { background: var(--bg); border-radius: 12px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-h { padding: 18px 22px; border-bottom: 1px solid var(--line-soft); font-weight: 600; font-size: 16px; }
.modal-b { padding: 22px; }
.modal-f { padding: 16px 22px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 10px; }

/* ---- Auth ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { display: flex; align-items: center; justify-content: center; font-family: "Syne", var(--sans); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; margin-bottom: 24px; }
.auth-logo svg { display: none; }
.auth-box { background: var(--bg); border: 1px solid var(--line-soft); border-radius: 12px; padding: 28px; box-shadow: var(--shadow-md); }
.auth-box h1 { font-size: 20px; margin-bottom: 4px; }
.auth-box .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.msg { font-size: 13px; padding: 10px 12px; border-radius: 7px; margin-bottom: 16px; display: none; }
.msg.err { display: block; background: var(--red-weak); color: var(--red); }
.msg.ok { display: block; background: var(--green-weak); color: var(--green); }

/* ---- Mobile ---- */
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; cursor: pointer; font-size: 16px; }
@media (max-width: 860px) { .tiles { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .sidebar { position: fixed; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-md); }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: inline-flex; }
  .content, .topbar { padding-left: 18px; padding-right: 18px; }
}
