/* TraderMitra Circle portal. Design tokens match the main website (app/globals.css). */
:root {
  --bg: #0A1628;
  --surface: #101F35;
  --surface2: #14253F;
  --border: rgba(241, 245, 249, 0.09);
  --gold: #E8C84A;
  --teal: #4ECDC4;
  --green: #26A69A;
  --red: #EF5350;
  --text: #F1F5F9;
  --muted: #94A3B8;
  --font-head: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font-body);
  font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.25; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
main { flex: 1; padding: 28px 0 40px; }

/* Header */
.topbar { background: rgba(10, 22, 40, .92); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar .wrap { display: flex; align-items: center; gap: 18px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); display: inline-block; }
.brand .circle { color: var(--teal); }
.nav { display: flex; align-items: center; gap: 16px; margin-left: auto; flex-wrap: wrap; font-size: 13.5px; }
.nav a { color: var(--muted); }
.nav a.on, .nav a:hover { color: var(--text); text-decoration: none; }
.nav form { display: inline; }
.who { color: var(--muted); font-size: 12.5px; }

.trust { background: var(--surface); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); text-align: center; padding: 7px 12px; }
.trust b { color: var(--teal); font-weight: 600; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 20px;
  border-radius: 9px; font-weight: 700; font-size: 14px; border: 1px solid transparent; cursor: pointer;
  font-family: var(--font-body); }
.btn-primary { background: var(--gold); color: #1A1306; }
.btn-primary:hover { filter: brightness(1.06); text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
.btn-danger { background: transparent; border-color: rgba(239, 83, 80, .5); color: #FFB4B2; }
.btn-link { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.btn-link:hover { color: var(--text); }
.btn-block { width: 100%; }

label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=search],
select, textarea {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 11px 12px; border-radius: 9px; font-size: 14.5px; font-family: var(--font-body); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); }
textarea { min-height: 80px; resize: vertical; }
.field { margin-bottom: 16px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); margin-bottom: 8px; }
.check input { width: auto; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.alert { border-radius: 10px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 16px; }
.alert-error { background: rgba(239, 83, 80, .1); border: 1px solid rgba(239, 83, 80, .35); color: #FFCFCE; }
.alert-ok { background: rgba(38, 166, 154, .12); border: 1px solid rgba(38, 166, 154, .4); color: #BDF0E9; }
.alert-info { background: rgba(78, 205, 196, .08); border: 1px solid rgba(78, 205, 196, .3); color: #CFF5F2; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; }
.card + .card { margin-top: 18px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat .label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat .value { font-family: var(--font-mono); font-size: 26px; font-weight: 600; margin-top: 6px; }

/* Login */
.login-shell { display: flex; align-items: center; justify-content: center; padding: 48px 16px; }
.login-card { width: 100%; max-width: 420px; }
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.login-foot { text-align: center; margin-top: 16px; font-size: 12.5px; color: var(--muted); }

/* Dashboard */
.dash { display: grid; grid-template-columns: 250px 1fr; gap: 22px; align-items: start; }
.side { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; position: sticky; top: 76px; }
.side h4 { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--gold); margin: 12px 6px 6px; }
.side h4:first-child { margin-top: 2px; }
.side a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px;
  border-radius: 8px; color: var(--text); font-size: 13.5px; }
.side a:hover { background: var(--surface2); text-decoration: none; }
.side a.on { background: rgba(232, 200, 74, .12); color: var(--gold); }
.tag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.tag-testing { background: rgba(232, 200, 74, .14); color: var(--gold); }
.tag-live { background: rgba(38, 166, 154, .15); color: #8FE3D9; }
.tag-daily { background: rgba(148, 163, 184, .14); color: var(--muted); }
.tag-active { background: rgba(38, 166, 154, .15); color: #8FE3D9; }
.tag-expired, .tag-disabled, .tag-hidden { background: rgba(239, 83, 80, .14); color: #FFB4B2; }

.scanner-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.scanner-frame { width: 100%; height: calc(100vh - 210px); min-height: 640px; border: 1px solid var(--border);
  border-radius: 12px; background: #fff; display: block; }
.placeholder { text-align: center; padding: 60px 20px; color: var(--muted); }
.welcome-list { list-style: none; margin-top: 10px; }
.welcome-list li { padding: 8px 0 8px 22px; position: relative; color: #C9D2DC; }
.welcome-list li::before { content: "\2713"; position: absolute; left: 0; color: var(--teal); font-weight: 700; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  font-weight: 600; padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
.ok { color: #8FE3D9; }
.bad { color: #FFB4B2; }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.inline { display: inline; }

/* Footer */
footer { border-top: 1px solid var(--border); background: var(--surface); padding: 18px 0; font-size: 11.5px; color: var(--muted); }
footer .nism { color: var(--gold); font-weight: 600; }

@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .side { position: static; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .scanner-frame { min-height: 520px; height: 75vh; }
  h1 { font-size: 22px; }
}
