/* Khursheed CEO Dashboard — Atvista brand tokens, dense operational layout. */

:root {
  --navy: #112d4e;
  --navy-2: #17354e;
  --teal: #217a80;
  --teal-dark: #176975;
  --mist: #eef7fc;
  --line: #d6e3e8;
  --paper: #ffffff;
  --ink: #1b2b3a;
  --muted: #5b7183;
  --ok: #1d7a52;
  --warn: #9a6206;
  --bad: #a32d2d;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, "Noto Nastaliq Urdu", "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: #f5f9fb;
}

h1, h2 { color: var(--navy); margin: 0; }
h1 { font-size: 22px; letter-spacing: -0.01em; }
h2 { font-size: 16px; }
.eyebrow {
  margin: 0 0 4px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--teal-dark); font-weight: 700;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--navy); color: #fff; padding: 10px 14px; z-index: 20;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px;
  background: var(--navy); color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { border-radius: 8px; background: #fff; padding: 2px; }
.brand strong { display: block; font-size: 15px; letter-spacing: 0.12em; }
.brand small { display: block; font-size: 11.5px; opacity: 0.78; letter-spacing: 0.04em; }

.who { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.who-name { font-weight: 700; }
.who-role {
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22);
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px;
}
.signout { color: #cfe6ea; text-decoration: none; font-size: 12.5px; border-bottom: 1px solid rgba(207,230,234,0.4); }
.signout:hover { color: #fff; }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 58px); }

.rail { background: var(--paper); border-right: 1px solid var(--line); padding: 18px 14px; }
.rail-label { margin: 0 0 8px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.rail ul { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 4px; }
.rail button {
  width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 9px 10px; border-radius: 8px; font: inherit; color: var(--navy-2);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.rail button > span:first-child { flex: 1 1 auto; min-width: 0; }
.rail button:hover { background: var(--mist); }
.rail button[aria-current="true"] { background: var(--navy); color: #fff; font-weight: 700; }
.rail button[disabled] { color: #9aabb7; cursor: not-allowed; }
.rail button[disabled]:hover { background: transparent; }
.rail .tag { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; white-space: nowrap; flex: 0 0 auto; padding-top: 3px; }
.rail-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin: 0; }

main { padding: 22px 24px 40px; min-width: 0; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 62ch; line-height: 1.55; }

.btn {
  border: 1px solid var(--navy); background: var(--navy); color: #fff;
  border-radius: 8px; padding: 9px 14px; font: inherit; cursor: pointer;
}
.btn:hover { background: var(--navy-2); }
.btn.ghost { background: #fff; color: var(--navy); }
.btn.ghost:hover { background: var(--mist); }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.bad { background: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.small { padding: 6px 10px; font-size: 12.5px; }

.banner {
  margin: 0 0 16px; padding: 10px 14px; border-radius: 10px;
  background: var(--mist); border: 1px solid var(--line); color: var(--navy-2);
}
.banner.bad { background: #fdf1f1; border-color: #f0c9c9; color: var(--bad); }

/* ------------------------------------------------------------------- KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; min-width: 0;
}
.kpi dt { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.kpi dd { margin: 0; font-size: 24px; font-weight: 700; color: var(--navy); }
.kpi.money dd { font-size: 20px; letter-spacing: -0.01em; }
.kpi small { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; }

/* ----------------------------------------------------------------- panels */
.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 16px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.count { font-size: 12px; color: var(--muted); }

.stack { display: grid; gap: 10px; }
.card {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fcfeff;
}
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card h3 { margin: 0 0 4px; font-size: 14.5px; color: var(--navy); }
.card p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  border: 1px solid var(--line); background: #fff; color: var(--navy-2);
}
.pill.strong { border-color: #bfe3d2; background: #eefaf4; color: var(--ok); }
.pill.weak { border-color: #f0d7c0; background: #fff7ec; color: var(--warn); }

.empty { color: var(--muted); font-size: 13px; padding: 10px 2px; }

/* ----------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
tbody tr:hover { background: var(--mist); }
td.wrap { white-space: normal; }

/* --------------------------------------------------------------- activity */
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.activity li { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: var(--navy-2); }
.activity li > * { min-width: 0; overflow-wrap: anywhere; }
.activity time { color: var(--muted); min-width: 128px; flex: 0 0 auto; }
.activity .who { color: var(--teal-dark); font-weight: 700; }

/* ------------------------------------------------------------------ users */
.user-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; align-items: end; margin-bottom: 14px; }
.user-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.user-form input, .user-form select {
  font: inherit; padding: 8px 9px; border: 1px solid #b9cbd4; border-radius: 7px; width: 100%; background: #fff;
}
.hint { color: var(--muted); font-size: 12.5px; margin: 0 0 12px; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 700px) {
  .activity li { flex-direction: column; gap: 2px; }
  .activity time { min-width: 0; }
  .card .actions .btn { flex: 1 1 auto; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 14px; }
  .rail ul { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 4px; margin: 0 0 6px; }
  .rail li { flex: 0 0 auto; }
  .rail button { width: auto; white-space: nowrap; align-items: center; border: 1px solid var(--line); padding: 7px 12px; }
  .rail button[aria-current="true"] { border-color: var(--navy); }
  .rail .tag { padding-top: 0; }
  .rail-note { display: none; }
  main { padding: 18px 14px 32px; }
  .topbar { flex-wrap: wrap; }
  .who { width: 100%; justify-content: space-between; }
}
