/* Palette: black (structure), blue (actions), green (done/filed), saffron (highlights, attention). */
:root {
  --bg: #f4f6fb; --panel: #ffffff; --ink: #0b1220; --muted: #5d677a; --line: #e2e7f0;
  --accent: #1f4fd8; --accent-hover: #1a43b8; --accent-ink: #ffffff; --accent-soft: #e8eefc;
  --saffron: #f28c1b; --saffron-soft: #fff1e0; --green: #128a3e; --green-soft: #e3f4e8;
  --ok: #128a3e; --ok-bg: #e3f4e8; --warn: #b85f00; --warn-bg: #fff1e0; --bad: #c62828; --bad-bg: #fde8e8; --na: #6b7486; --na-bg: #eef1f6;
  --side-bg: #0a0e17; --side-ink: #e7eaf1; --side-muted: #8c95a8; --side-hover: #161c2a; --side-line: #1c2333;
  --brand: linear-gradient(135deg, #f28c1b 0%, #1f4fd8 55%, #128a3e 100%);
  --shadow: 0 1px 2px rgba(10, 14, 23, .06), 0 6px 18px rgba(10, 14, 23, .06); --radius: 12px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #07090f; --panel: #0f1420; --ink: #e8ecf4; --muted: #94a0b8; --line: #1f2737;
  --accent: #4f7dff; --accent-hover: #6a91ff; --accent-ink: #050810; --accent-soft: #14213f;
  --saffron: #ffa53d; --saffron-soft: #33210b; --green: #3cc46a; --green-soft: #0f2a19;
  --ok: #3cc46a; --ok-bg: #0f2a19; --warn: #ffa53d; --warn-bg: #33210b; --bad: #ff7b72; --bad-bg: #3a1414; --na: #94a0b8; --na-bg: #1a2130;
  --side-bg: #030508; --side-hover: #121826; --side-line: #161d2b; --shadow: none; } }
:root[data-theme="dark"] {
  --bg: #07090f; --panel: #0f1420; --ink: #e8ecf4; --muted: #94a0b8; --line: #1f2737;
  --accent: #4f7dff; --accent-hover: #6a91ff; --accent-ink: #050810; --accent-soft: #14213f;
  --saffron: #ffa53d; --saffron-soft: #33210b; --green: #3cc46a; --green-soft: #0f2a19;
  --ok: #3cc46a; --ok-bg: #0f2a19; --warn: #ffa53d; --warn-bg: #33210b; --bad: #ff7b72; --bad-bg: #3a1414; --na: #94a0b8; --na-bg: #1a2130;
  --side-bg: #030508; --side-hover: #121826; --side-line: #161d2b; --shadow: none; }

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* .gate/.shell set display:grid, which would otherwise override the hidden attribute */
body { margin: 0; font: 14px/1.45 "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--ink); }
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
/* Black sidebar with a saffron-blue-green stripe on top */
.side { background: var(--side-bg); color: var(--side-ink); padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow: auto; border-top: 4px solid; border-image: var(--brand) 1; box-shadow: inset -1px 0 0 var(--side-line); }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 6px 10px; border-bottom: 1px solid var(--side-line); }
.brand b { display: block; font-size: 15px; letter-spacing: .01em; } .brand small { color: var(--side-muted); font-size: 11px; }
.logo { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 19px; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
nav { display: flex; flex-direction: column; gap: 3px; }
nav button, .groups button { text-align: left; border: 0; background: none; color: var(--side-ink); padding: 9px 12px; border-radius: 8px; font: inherit; cursor: pointer; border-left: 3px solid transparent; }
nav button:hover, .groups button:hover { background: var(--side-hover); }
nav button.active { background: #1f4fd8; color: #fff; font-weight: 600; border-left-color: var(--saffron); }
.groups { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--side-line); padding-top: 10px; }
.groups button { font-size: 13px; color: var(--side-muted); } .groups button.active { color: #fff; background: var(--side-hover); font-weight: 600; border-left-color: var(--green); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; } .side-foot small { color: var(--side-muted); font-size: 11px; word-break: break-all; }
.side button.ghost { color: var(--side-ink); border-color: var(--side-line); } .side button.ghost:hover { background: var(--side-hover); color: #fff; border-color: var(--side-muted); }

main { padding: 0 28px 40px; min-width: 0; }
.top { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-end; padding: 18px 0; position: sticky; top: 0; background: var(--bg); z-index: 5; border-bottom: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 4px; } .field > span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
select, input[type=text], input[type=search] { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); min-width: 120px; }
select:focus, input:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: none; padding: 8px 12px; font: inherit; color: var(--muted); cursor: pointer; } .seg button.active { background: var(--accent); color: var(--accent-ink); }
button.primary { background: var(--accent); color: var(--accent-ink); border: 0; padding: 10px 18px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 1px 2px rgba(31, 79, 216, .25); }
button.primary:hover:not(:disabled) { background: var(--accent-hover); }
button.primary:disabled { opacity: .5; cursor: not-allowed; }
button.ghost { background: none; border: 1px solid var(--line); color: var(--ink); padding: 8px 12px; border-radius: 8px; font: inherit; cursor: pointer; }
button.ghost:hover { border-color: var(--accent); color: var(--accent); }
button.danger { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad); padding: 10px 16px; border-radius: 8px; font: inherit; cursor: pointer; }
.muted { color: var(--muted); }

section#view { padding-top: 22px; display: flex; flex-direction: column; gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
h1 { font-size: 20px; margin: 0 0 4px; } h2 { font-size: 15px; margin: 0 0 12px; } p { margin: 0 0 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--bg); border-radius: 10px; padding: 12px 14px; } .stat b { font-size: 22px; display: block; } .stat span { color: var(--muted); font-size: 12px; }

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); } .chip.na { background: var(--na-bg); color: var(--na); }
.legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

table { border-collapse: collapse; width: 100%; }
.tablewrap { overflow: auto; max-height: 62vh; border: 1px solid var(--line); border-radius: 10px; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; background: var(--panel); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); cursor: pointer; user-select: none; z-index: 1; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--na-bg); }
tfoot td { position: sticky; bottom: 0; background: var(--panel); font-weight: 700; border-top: 2px solid var(--line); }

.group h2 { margin-top: 6px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; text-align: left; font: inherit; color: var(--ink); display: flex; flex-direction: column; gap: 8px; transition: transform .1s, border-color .1s; }
.rcard:hover { border-color: var(--accent); transform: translateY(-1px); }
.rcard .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.rcard.blocked { opacity: .8; }

.bar { height: 10px; background: var(--na-bg); border-radius: 999px; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.banner { padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); } .banner.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.log { font: 12px/1.5 Consolas, monospace; max-height: 240px; overflow: auto; background: var(--bg); border-radius: 8px; padding: 10px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.checks { display: flex; flex-wrap: wrap; gap: 14px; } .checks label { display: flex; gap: 6px; align-items: center; }
.notes { color: var(--muted); font-size: 12.5px; } .notes li { margin: 2px 0; }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate .card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; }
.gate label, .form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.gate input, .form input, .form select { font: inherit; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.clientnav { display: flex; flex-direction: column; gap: 2px; margin: 6px 0; padding: 8px 0 8px 10px; border-left: 3px solid var(--accent); }
.navhead { font-size: 12px; font-weight: 700; color: var(--muted); padding: 2px 12px 4px; text-transform: uppercase; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.tile { text-align: left; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.tile:hover { border-color: var(--accent); }
.tile b { font-size: 18px; } .tile .big { font-size: 30px; font-weight: 700; }
tr.click { cursor: pointer; }
.logins td { vertical-align: middle; }
.logins input { font: inherit; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); width: 100%; min-width: 140px; }
.iconbtn { border: 1px solid var(--line); background: none; color: var(--ink); border-radius: 8px; padding: 6px 9px; cursor: pointer; font: inherit; }
.iconbtn:hover { background: var(--na-bg); }
.rs select, .rs input { font: inherit; padding: 5px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.rs input.rem { min-width: 180px; width: 100%; }
.saved { color: var(--ok); font-size: 12px; }
.pw { position: relative; display: flex; }
.pw input { flex: 1; width: 100%; padding-right: 40px; }
.pw .eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.pw .eye:hover { color: var(--ink); background: var(--na-bg); }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.secret { font: 13px Consolas, monospace; background: var(--bg); padding: 10px; border-radius: 8px; word-break: break-all; user-select: all; }
code { font: 12.5px Consolas, monospace; }

/* Narrow windows and phones: sidebar becomes a compact bar so the page content starts at the top */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--side-line); }
  .brand { padding: 0; } .brand small { display: none; } .logo { width: 30px; height: 30px; font-size: 15px; }
  nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  nav button { padding: 6px 10px; }
  .groups { display: none; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .side-foot small { display: none; }
  main { padding: 0 16px 32px; }
  .top { position: static; }
}
@media print { .side, .top, .toolbar button, .toolbar input { display: none !important; } .shell { display: block; } .tablewrap { max-height: none; overflow: visible; } body { background: #fff; color: #000; } }

/* Brand accents */
h1 { letter-spacing: -.01em; }
#clientLabel { color: var(--accent); }
.stat { border-top: 3px solid var(--accent); }
.stats .stat:nth-child(1) { border-top-color: var(--green); } .stats .stat:nth-child(3) { border-top-color: var(--saffron); } .stats .stat:nth-child(4) { border-top-color: var(--bad); }
.tile { border-top: 4px solid var(--accent); transition: transform .12s, box-shadow .12s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(10, 14, 23, .12); }
.tile[data-go="clients"] .big { color: var(--accent); }
.tile[data-go="returns"] { border-top-color: var(--saffron); } .tile[data-go="returns"] .big { color: var(--saffron); }
th { color: var(--ink); background: var(--na-bg); }
.rcard { border-left: 4px solid var(--line); }
.rcard.complete { border-left-color: var(--green); } .rcard.partial { border-left-color: var(--saffron); } .rcard.blocked { border-left-color: var(--bad); }
.clientnav { border-left-color: var(--saffron); } .navhead { color: var(--saffron); }
.bar > i { background: linear-gradient(90deg, var(--accent), var(--green)); }
.banner { border-left-width: 4px; }
.gate { background: radial-gradient(1200px 500px at 0% 0%, rgba(242, 140, 27, .18), transparent 60%), radial-gradient(900px 500px at 100% 100%, rgba(18, 138, 62, .16), transparent 60%), var(--side-bg); }
.gate .card { border-top: 4px solid; border-image: var(--brand) 1; border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.gate h1::before { content: "₹"; display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 10px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 17px; vertical-align: middle; }
a { color: var(--accent); }

/* Edge/IE built-in reveal button would duplicate the app's eye button */
input[type=password]::-ms-reveal, input[type=password]::-ms-clear { display: none; }

/* Portal captcha relayed from the server: shown large and crisp so it is easy to read */
.captcha-card { border-top: 4px solid var(--saffron); }
.captcha-img { height: 64px; image-rendering: auto; background: #fff; border-radius: 8px; padding: 4px; border: 1px solid var(--line); }
#capText { font: 600 20px/1.2 Consolas, monospace; letter-spacing: .15em; padding: 10px 12px; border-radius: 8px; border: 2px solid var(--saffron); background: var(--panel); color: var(--ink); width: 200px; }
