/* Safarix admin console — a single stylesheet, no build step. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #14171c;
  --muted: #6b7280;
  --brand: #c85212;
  --brand-soft: #fdf1e8;
  --ok: #12805c;
  --ok-soft: #e6f5ef;
  --warn: #9a6700;
  --warn-soft: #fff5da;
  --bad: #c62f3b;
  --bad-soft: #fdeced;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 14px; }
h3 { font-size: 14px; margin: 20px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Layout ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px; flex: none; background: var(--surface);
  border-right: 1px solid var(--border); padding: 20px 14px;
  display: flex; flex-direction: column; gap: 24px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  padding: 9px 12px; border-radius: 8px; color: var(--text); font-weight: 500;
}
.sidebar nav a:hover { background: var(--bg); text-decoration: none; }
.sidebar nav a.active { background: var(--brand-soft); color: var(--brand); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.who { display: flex; flex-direction: column; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.role { color: var(--muted); font-size: 12px; }

.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; }
.brand em { font-style: normal; color: var(--muted); font-weight: 500; }
.brand.big { justify-content: center; font-size: 20px; margin-bottom: 6px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-weight: 700;
}

.content { flex: 1; padding: 26px 30px 60px; min-width: 0; }
.page-head { margin-bottom: 20px; }

.centered { display: grid; place-items: center; min-height: 100vh; padding: 20px; }

/* ---------- Cards, grids ---------- */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.auth-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }

/* ---------- Tiles ---------- */

.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.tiles.inline { margin-bottom: 0; }
.tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
}
.tile-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.tile-value { font-size: 26px; font-weight: 650; line-height: 1.15; }
.tile-value.attn { color: var(--brand); }
.tile-foot { color: var(--muted); font-size: 12px; }

/* ---------- Tables ---------- */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table.compact td, .table.compact th { padding: 7px 8px; }
.num, .right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Badges, tags ---------- */

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.neutral { background: var(--bg); color: var(--muted); }

.tag {
  display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--bg);
  border: 1px solid var(--border); font-size: 11px; color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 5px; }
.dot.on { background: var(--ok); }

/* ---------- Banners ---------- */

.banner {
  padding: 11px 14px; border-radius: 8px; margin-bottom: 16px;
  font-size: 14px; border: 1px solid transparent;
}
.banner.ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe5d6; }
.banner.warn { background: var(--warn-soft); color: var(--warn); border-color: #f0dfa8; }
.banner.bad { background: var(--bad-soft); color: var(--bad); border-color: #f3c8cc; }

/* ---------- Forms ---------- */

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: 8px; font: inherit; background: #fff; color: var(--text);
  margin-top: 4px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand);
}
textarea { resize: vertical; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.inline-form { display: inline; }
.hint { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }

button, .btn {
  display: inline-block; padding: 9px 15px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
button:hover, .btn:hover { background: var(--bg); text-decoration: none; }
button.primary, .btn.primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
button.primary:hover { filter: brightness(1.06); }
button.danger, .btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.danger:hover { filter: brightness(1.06); }
.btn.tiny, button.tiny { padding: 4px 10px; font-size: 12.5px; }
.linkish {
  border: none; background: none; padding: 0; color: var(--brand);
  font-weight: 500; cursor: pointer; text-align: left;
}
.quiet { color: var(--muted); font-size: 13px; }

.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px;
}
.toolbar input, .toolbar select { width: auto; min-width: 180px; margin-top: 0; }

.tabs { display: flex; gap: 4px; background: var(--surface); padding: 4px;
        border: 1px solid var(--border); border-radius: 9px; }
.tabs a { padding: 6px 13px; border-radius: 6px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.tabs a:hover { background: var(--bg); text-decoration: none; }
.tabs a.on { background: var(--brand-soft); color: var(--brand); }

.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; }

/* ---------- Definition lists ---------- */

.facts { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* ---------- Chart ---------- */

.chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 8px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; }
.bar {
  width: 100%; background: var(--brand-soft); border-radius: 4px 4px 0 0;
  margin-top: auto; position: relative; display: flex; align-items: flex-end;
  min-height: 3px;
}
.bar-done { width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; }
.bar-label { font-size: 11px; color: var(--muted); }
.legend { font-size: 12px; color: var(--muted); margin: 10px 0 0; display: flex; gap: 14px; align-items: center; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.swatch.total { background: var(--brand-soft); border: 1px solid var(--border); }
.swatch.done { background: var(--brand); }

/* ---------- KYC documents ---------- */

.docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.docs figure { margin: 0; }
.docs figcaption { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.docs img {
  width: 100%; height: 200px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg);
}

/* ---------- Credentials callout ---------- */

.credentials { border-color: var(--brand); background: var(--brand-soft); }
.cred-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.cred-row span { width: 170px; color: var(--muted); font-size: 13px; }
.cred-row code {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 11px; font-size: 15px; font-weight: 600; user-select: all;
}

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .content { padding: 18px 16px 40px; }
}
