/* DistrictSeal dashboard — dense Stripe/Linear inspired */

body.ds-app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  background: #0b0d14;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

/* ============ Sidebar ============ */
.ds-side {
  background: #0a0c12;
  border-right: 1px solid rgba(255,255,255,.06);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.ds-side-brand {
  padding: 6px 10px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  margin-bottom: 12px;
}
.ds-side-brand .ds-logo {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 17px;
  color: #e9c46a;
  text-decoration: none;
  letter-spacing: .02em;
}
.ds-side-section {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #4a5162;
  font-weight: 700;
  padding: 10px 12px 4px 12px;
}
#side-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}
#side-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  border-radius: 6px;
  font-size: 13px;
  color: #b6bdd1;
  text-decoration: none;
  opacity: .85;
  transition: background .1s ease, color .1s ease;
}
#side-nav a:hover { background: rgba(255,255,255,.035); opacity: 1; }
#side-nav a.active { background: rgba(233,196,106,.10); color: #e9c46a; opacity: 1; }
#side-nav a svg { width: 14px; height: 14px; flex-shrink: 0; }
#side-nav a kbd {
  margin-left: auto;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: #4a5162;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 3px;
  padding: 1px 5px;
  opacity: 0;
  transition: opacity .12s ease;
}
#side-nav a:hover kbd { opacity: 1; }
.ds-badge {
  margin-left: auto;
  background: rgba(229,72,77,.18);
  color: #e5484d;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
}
.ds-badge:empty { display: none; }

.ds-side-foot {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.05);
}
.ds-upgrade {
  background: linear-gradient(180deg, rgba(233,196,106,.10), rgba(233,196,106,.02));
  border: 1px solid rgba(233,196,106,.25);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}
.ds-upgrade strong { display: block; color: #e9c46a; font-size: 12.5px; margin-bottom: 4px; }
.ds-upgrade p { margin: 0 0 8px 0; font-size: 11.5px; color: #8b93a7; line-height: 1.45; }
.ds-upgrade a { font-size: 11.5px; color: #e9c46a; text-decoration: none; font-weight: 600; }

.ds-me {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
}
.ds-me:hover { background: rgba(255,255,255,.035); }
.ds-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(233,196,106,.16);
  color: #e9c46a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11.5px;
  flex-shrink: 0;
}
.ds-me-text {
  display: flex;
  flex-direction: column;
  font-size: 11.5px;
  min-width: 0;
  flex: 1;
}
.ds-me-text strong {
  color: #e6e8ef;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ds-me-text span {
  color: #6b7285;
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ds-me svg { width: 12px; height: 12px; color: #6b7285; }

/* ============ Main layout ============ */
.ds-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}
.ds-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 22px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: #0b0d14;
  flex-shrink: 0;
  gap: 14px;
}
.ds-topbar-search {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 7px;
  padding: 6px 10px;
  width: 300px;
  max-width: 40vw;
  transition: border-color .15s ease;
}
.ds-topbar-search:focus-within { border-color: rgba(233,196,106,.4); }
.ds-topbar-search svg { width: 13px; height: 13px; color: #6b7285; flex-shrink: 0; }
.ds-topbar-search input {
  background: transparent;
  border: 0;
  outline: 0;
  color: #e6e8ef;
  font-size: 13px;
  width: 100%;
  font-family: inherit;
}
.ds-topbar-search input::placeholder { color: #4a5162; }
.ds-topbar-search kbd {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: #6b7285;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 3px;
  padding: 1px 4px;
}
.ds-topbar-right { display: flex; align-items: center; gap: 8px; }

/* ============ Content ============ */
.ds-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 60px 22px;
}
.ds-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 14px;
}
.ds-page-head h1 {
  font-family: Georgia, serif;
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 3px 0;
  color: #fff;
  line-height: 1.2;
}
.ds-page-head .sub {
  color: #6b7285;
  font-size: 13px;
  margin: 0;
}

/* Compact stat cards */
.ds-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.ds-stat {
  background: #121723;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
}
.ds-stat-label {
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #6b7285;
  font-weight: 600;
}
.ds-stat-num {
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 500;
  margin-top: 4px;
  color: #fff;
  line-height: 1;
}
.ds-stat-delta {
  font-size: 11px;
  color: #6b7285;
  margin-top: 4px;
}
.ds-stat-delta.up { color: #3ddc84; }
.ds-stat-delta.down { color: #e5484d; }
.ds-stat-ok .ds-stat-num { color: #3ddc84; }
.ds-stat-fail .ds-stat-num { color: #e5484d; }
.ds-stat-pending .ds-stat-num { color: #e9c46a; }

/* Two-column grid: spark + usage on top */
.ds-grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.ds-card {
  background: #121723;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 16px 18px;
}
.ds-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.ds-card-head h3 {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}
.ds-card-head span { font-size: 11.5px; color: #6b7285; }
.ds-spark-svg { display: block; width: 100%; height: 66px; }

/* Usage meter */
.ds-usage { }
.ds-usage-num {
  font-family: Georgia, serif;
  font-size: 22px;
  color: #fff;
  font-weight: 500;
  margin: 4px 0 8px 0;
}
.ds-usage-num small { font-size: 12px; color: #6b7285; font-family: inherit; }
.ds-usage-bar {
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.ds-usage-fill {
  height: 100%;
  background: linear-gradient(90deg, #e9c46a, #f4a261);
  border-radius: 999px;
  transition: width .3s ease;
}
.ds-usage-note { font-size: 11.5px; color: #6b7285; line-height: 1.5; }

/* System status */
.ds-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12.5px;
  color: #b6bdd1;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.ds-status-row:last-child { border-bottom: 0; }
.ds-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ddc84;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(61,220,132,.15);
}
.ds-status-dot.warn { background: #e9c46a; box-shadow: 0 0 0 2px rgba(233,196,106,.15); }
.ds-status-label { color: #8b93a7; flex: 1; }
.ds-status-value { color: #e6e8ef; font-weight: 500; }

/* Quick actions */
.ds-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.ds-quick-btn {
  background: #121723;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 14px;
  text-align: left;
  text-decoration: none;
  color: #e6e8ef;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all .12s ease;
  cursor: pointer;
}
.ds-quick-btn:hover {
  border-color: rgba(233,196,106,.35);
  background: rgba(233,196,106,.03);
}
.ds-quick-btn svg {
  width: 18px;
  height: 18px;
  color: #e9c46a;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}
.ds-quick-btn strong { font-size: 13px; font-weight: 600; }
.ds-quick-btn span { font-size: 11.5px; color: #6b7285; line-height: 1.4; }

/* Table */
.ds-table-wrap {
  background: #121723;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  overflow: hidden;
}
.ds-table {
  width: 100%;
  border-collapse: collapse;
}
.ds-table th, .ds-table td {
  text-align: left;
  padding: 9px 14px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.ds-table th {
  font-size: 10.5px;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: #6b7285;
  font-weight: 600;
  background: rgba(255,255,255,.015);
  user-select: none;
  white-space: nowrap;
}
.ds-table th.sortable { cursor: pointer; }
.ds-table th.sortable:hover { color: #e6e8ef; }
.ds-table tr:last-child td { border-bottom: 0; }
.ds-table tbody tr { cursor: pointer; transition: background .1s ease; }
.ds-table tbody tr:hover { background: rgba(255,255,255,.025); }
.ds-table .ds-mono {
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 12px;
  color: #b6bdd1;
}
.ds-table .ds-muted { color: #6b7285; font-size: 11.5px; }

/* Signer cell with avatar */
.ds-signer-cell { display: flex; align-items: center; gap: 10px; }
.ds-signer-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(233,196,106,.16);
  color: #e9c46a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.ds-signer-name { font-weight: 500; color: #e6e8ef; font-size: 13px; }
.ds-signer-email { color: #6b7285; font-size: 11.5px; }

/* Filter bar */
.ds-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.ds-filters select,
.ds-filters input {
  background: #121723;
  border: 1px solid rgba(255,255,255,.08);
  color: #e6e8ef;
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
}
.ds-filters select:focus,
.ds-filters input:focus { border-color: rgba(233,196,106,.4); }
.ds-filters input { min-width: 200px; }
.ds-filters .ds-count {
  margin-left: auto;
  font-size: 12px;
  color: #6b7285;
}

/* Pills */
.ds-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ds-pill-verified, .ds-pill-ledger_issued { background: rgba(61,220,132,.14); color: #3ddc84; }
.ds-pill-failed { background: rgba(229,72,77,.14); color: #e5484d; }
.ds-pill-created,
.ds-pill-webauthn_verified,
.ds-pill-scroll_complete,
.ds-pill-consent_accepted,
.ds-pill-liveness_captured { background: rgba(233,196,106,.14); color: #e9c46a; }

/* Empty state */
.ds-empty {
  padding: 40px 20px;
  text-align: center;
  color: #6b7285;
  font-size: 13px;
}
.ds-empty svg {
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  opacity: .35;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.4;
}

/* Forms */
.ds-form {
  background: #121723;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 22px;
}
.ds-form h2 { margin: 0 0 3px 0; font-size: 15px; font-weight: 600; color: #fff; }
.ds-form p.muted { color: #6b7285; font-size: 12.5px; margin: 0 0 18px 0; }
.ds-form label {
  display: block;
  font-size: 12px;
  color: #b6bdd1;
  margin: 0 0 5px 0;
  font-weight: 500;
}
.ds-form input,
.ds-form textarea,
.ds-form select {
  width: 100%;
  background: #0b0d14;
  border: 1px solid rgba(255,255,255,.08);
  color: #e6e8ef;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  margin-bottom: 14px;
  transition: border-color .15s ease;
}
.ds-form input:focus,
.ds-form textarea:focus,
.ds-form select:focus { border-color: rgba(233,196,106,.4); }
.ds-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ds-form-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Drop zone */
.ds-drop {
  border: 1.5px dashed rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .15s ease;
  background: rgba(255,255,255,.01);
  margin-bottom: 14px;
}
.ds-drop:hover, .ds-drop.over {
  border-color: rgba(233,196,106,.5);
  background: rgba(233,196,106,.04);
}
.ds-drop svg {
  width: 26px;
  height: 26px;
  color: #e9c46a;
  margin-bottom: 8px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}
.ds-drop strong { color: #e6e8ef; font-size: 13px; display: block; margin-bottom: 3px; }
.ds-drop span { color: #6b7285; font-size: 11.5px; }
.ds-drop input[type="file"] { display: none; }
.ds-drop-filled {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  background: rgba(61,220,132,.06);
  border: 1px solid rgba(61,220,132,.25);
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 12.5px;
}
.ds-drop-filled svg { width: 16px; height: 16px; color: #3ddc84; stroke: currentColor; fill: none; stroke-width: 1.8; }
.ds-drop-filled .name { color: #e6e8ef; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-drop-filled button { background: transparent; border: 0; color: #6b7285; cursor: pointer; padding: 4px; }
.ds-drop-filled button:hover { color: #e5484d; }

/* Buttons */
.ds-btn {
  appearance: none;
  border: 0;
  background: #e9c46a;
  color: #14171f;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .12s ease, transform .04s ease;
  font-family: inherit;
}
.ds-btn:hover { background: #f4a261; }
.ds-btn:active { transform: translateY(1px); }
.ds-btn:disabled { opacity: .5; cursor: not-allowed; }
.ds-btn-sm { padding: 6px 11px; font-size: 12px; }
.ds-btn-lg { padding: 11px 20px; font-size: 13.5px; }
.ds-btn-block { width: 100%; }
.ds-btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,.14); color: #e6e8ef; }
.ds-btn-ghost:hover { background: rgba(255,255,255,.05); }
.ds-btn-danger { background: transparent; border: 1px solid rgba(229,72,77,.35); color: #e5484d; }
.ds-btn-danger:hover { background: rgba(229,72,77,.10); }
.ds-icon-btn {
  background: transparent;
  border: 0;
  color: #6b7285;
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ds-icon-btn:hover { color: #e6e8ef; background: rgba(255,255,255,.04); }
.ds-icon-btn svg { width: 14px; height: 14px; }

/* Tabs */
.ds-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  margin-bottom: 20px;
}
.ds-tab {
  background: transparent;
  border: 0;
  color: #8b93a7;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
  transition: all .12s ease;
}
.ds-tab:hover { color: #e6e8ef; }
.ds-tab.active { color: #e9c46a; border-bottom-color: #e9c46a; }
.ds-tab-panel.hidden { display: none; }

/* Drawer */
.ds-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 94vw);
  background: #121723;
  border-left: 1px solid rgba(255,255,255,.08);
  transform: translateX(100%);
  transition: transform .22s ease;
  z-index: 200;
  display: flex;
  flex-direction: column;
}
.ds-drawer.open { transform: translateX(0); }
.ds-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.ds-drawer-head h2 {
  margin: 3px 0 0 0;
  font-family: Georgia, serif;
  font-weight: 500;
  font-size: 18px;
  color: #fff;
}
.ds-eyebrow {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #6b7285;
  font-weight: 700;
}
.ds-drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.ds-drawer-body h3 {
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #6b7285;
  margin: 20px 0 8px 0;
  font-weight: 700;
}
.ds-drawer-body h3:first-child { margin-top: 0; }
.ds-kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px 12px;
  font-size: 13px;
}
.ds-kv > div:nth-child(odd) { color: #6b7285; }
.ds-kv > div:nth-child(even) { color: #e6e8ef; word-break: break-word; }
.ds-kv .ds-mono { font-family: ui-monospace, monospace; font-size: 11.5px; }

/* Event timeline */
.ds-timeline { position: relative; padding-left: 20px; }
.ds-timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 1px;
  background: rgba(255,255,255,.08);
}
.ds-tl-item { position: relative; padding: 7px 0; font-size: 13px; }
.ds-tl-item::before {
  content: "";
  position: absolute;
  left: -19px; top: 12px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 0 2px #121723;
}
.ds-tl-item.warn::before { background: #e9c46a; }
.ds-tl-item.err::before { background: #e5484d; }
.ds-tl-ts {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  color: #6b7285;
  margin-bottom: 2px;
}
.ds-tl-label { color: #e6e8ef; font-weight: 500; }
.ds-tl-detail { color: #6b7285; font-size: 11.5px; margin-top: 2px; word-break: break-word; }

.ds-drawer-foot {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  gap: 8px;
}
.ds-drawer-foot a, .ds-drawer-foot button { flex: 1; }

/* Toast */
.ds-toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: #171c2b;
  border: 1px solid rgba(255,255,255,.08);
  border-left: 3px solid #3ddc84;
  padding: 12px 16px;
  border-radius: 9px;
  font-size: 13px;
  color: #fff;
  z-index: 500;
  transform: translateY(20px);
  opacity: 0;
  transition: all .22s ease;
  pointer-events: none;
  max-width: 360px;
}
.ds-toast.show { transform: translateY(0); opacity: 1; }
.ds-toast.err { border-left-color: #e5484d; }

/* Skeleton */
.ds-skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.08), rgba(255,255,255,.04));
  background-size: 200% 100%;
  animation: dsShimmer 1.4s infinite;
  border-radius: 8px;
}
@keyframes dsShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Mobile */
@media (max-width: 800px) {
  body.ds-app { grid-template-columns: 1fr; }
  .ds-side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
    gap: 6px;
    overflow-x: auto;
  }
  .ds-side-brand { border-bottom: 0; margin-bottom: 0; padding: 4px 10px 4px 4px; }
  .ds-side-section { display: none; }
  #side-nav { flex-direction: row; gap: 2px; overflow-x: auto; }
  #side-nav a { padding: 6px 9px; font-size: 12px; }
  #side-nav a span { display: none; }
  #side-nav a svg { width: 16px; height: 16px; }
  .ds-side-foot { display: none; }
  .ds-main { height: auto; }
  .ds-content { padding: 16px 14px 40px 14px; }
  .ds-topbar { padding: 10px 14px; flex-wrap: wrap; }
  .ds-topbar-search { width: 100%; max-width: none; order: 2; }
  .ds-form-row, .ds-form-two-col { grid-template-columns: 1fr; }
  .ds-grid-2 { grid-template-columns: 1fr; }
  .ds-quick { grid-template-columns: 1fr; }
}
