/* Nova 23 admin — hand-written CSS, no build step. Palette matches
   Design/DESIGN-GUIDELINES.md at the repo root. */

:root {
  --cream: #fbf9f5;
  --espresso: #2b2625;
  --mocha: #3c3736;
  --gold: #c5a059;
  --gold-light: #f8eedd;
  --sand: #ebe3d5;
  --sage: #9ec1a3;
  --mist: #88a0c4;
  --coral: #e8a598;
  --navy: #1e2a38;
  --walnut: #4a3728;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--espresso);
  font-family: -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  font-size: 14px;
}

h1,
h2,
.brand-wordmark {
  font-family: Georgia, "Cormorant Garamond", serif;
}

a {
  color: inherit;
}

/* ---------- Login ---------- */

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .login-shell {
    grid-template-columns: 1.05fr 1fr;
  }
}

/* Brand panel — navy so the gold-on-transparent logo has the dark backing it
   was designed for. A subtle gold wash keeps it from reading as a flat block. */
.login-brand {
  background:
    radial-gradient(120% 80% at 15% 12%, rgba(197, 160, 89, 0.16) 0%, rgba(197, 160, 89, 0) 55%),
    var(--navy);
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-brand::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  background: rgba(197, 160, 89, 0.07);
}

.login-brand-inner {
  margin: auto 0;
  position: relative;
  z-index: 1;
}

.login-logo {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
}

.login-tagline {
  font-family: Georgia, "Cormorant Garamond", serif;
  font-size: 21px;
  color: var(--gold);
  margin: 22px 0 0;
  letter-spacing: 0.01em;
}

.login-brand-foot {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 899px) {
  .login-brand {
    padding: 32px 28px;
  }
  .login-logo {
    max-width: 200px;
    margin: 0 auto;
  }
  .login-tagline {
    text-align: center;
    font-size: 18px;
  }
  .login-brand-foot {
    display: none;
  }
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: var(--cream);
}

.login-card {
  width: 100%;
  max-width: 380px;
}

.login-title {
  font-size: 30px;
  margin: 0 0 6px;
}

.login-sub {
  color: rgba(60, 55, 54, 0.65);
  margin: 0 0 32px;
}

.login-foot {
  margin: 26px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--sand);
  font-size: 12px;
  color: rgba(60, 55, 54, 0.45);
  text-align: center;
}

.btn-lg {
  padding: 13px 18px;
  font-size: 15px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--sand);
  background: #fff;
  font-size: 14px;
  color: var(--espresso);
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: #fff;
}

.btn-primary:hover {
  background: #b8934f;
}

.btn-block {
  width: 100%;
}

.btn-ghost {
  background: transparent;
  color: rgba(60, 55, 54, 0.7);
}

.btn-ghost:hover {
  color: var(--espresso);
}

.alert {
  background: rgba(232, 165, 152, 0.15);
  border: 1px solid rgba(232, 165, 152, 0.4);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
}

/* ---------- Admin shell ---------- */

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

.sidebar {
  width: 288px;
  flex-shrink: 0;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.brand-wordmark {
  font-size: 18px;
  margin: 0;
  line-height: 1.2;
}

.brand-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.nav-label {
  padding: 0 12px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.4);
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item a {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}

.nav-item a:hover {
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active a {
  background: var(--gold);
  color: var(--navy);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.nav-text-label {
  font-size: 14px;
  font-weight: 600;
  display: block;
}

.nav-text-desc {
  font-size: 12px;
  display: block;
  color: rgba(255, 255, 255, 0.4);
}

.nav-item.active .nav-text-desc {
  color: rgba(30, 42, 56, 0.7);
}

.nav-soon {
  font-size: 9px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 6px;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 12px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-card-name {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card-email {
  font-size: 11px;
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 0;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
}

.badge-gold {
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold);
}

/* ---------- Workspace ---------- */

.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 64px;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--sand);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

.breadcrumb {
  font-size: 14px;
  color: rgba(60, 55, 54, 0.6);
}

.breadcrumb strong {
  color: var(--espresso);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(158, 193, 163, 0.15);
  color: var(--sage);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--sage);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 40px 32px;
}

.page-title {
  font-size: 24px;
  margin: 0 0 4px;
}

.page-sub {
  color: rgba(60, 55, 54, 0.7);
  margin: 0 0 32px;
}

/* ---------- Cards / grid ---------- */

.stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 32px;
}

.card {
  background: #fff;
  border: 1px solid var(--sand);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(43, 38, 37, 0.04);
  padding: 24px;
}

.stat-card {
  flex: 1 1 200px;
  min-width: 200px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(60, 55, 54, 0.5);
  margin: 0;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  margin: 8px 0 4px;
}

.stat-sub {
  font-size: 13px;
  color: rgba(60, 55, 54, 0.5);
  margin: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

@media (min-width: 1024px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

.card-desc {
  font-size: 13px;
  color: rgba(60, 55, 54, 0.6);
  margin: 0 0 20px;
}

.sample-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(232, 165, 152, 0.2);
  color: var(--espresso);
  border-radius: 999px;
  padding: 2px 8px;
}

/* list rows */

.row-list {
  border-top: 1px solid rgba(235, 227, 213, 0.7);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(235, 227, 213, 0.7);
}

.row-title {
  font-weight: 600;
  margin: 0;
}

.row-sub {
  font-size: 13px;
  color: rgba(60, 55, 54, 0.6);
  margin: 2px 0 0;
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
}

.pill-gold {
  background: var(--gold-light);
  color: var(--espresso);
}

.pill-sage {
  background: rgba(158, 193, 163, 0.2);
  color: #4f7d56;
}

.pill-sand {
  background: var(--sand);
  color: rgba(60, 55, 54, 0.7);
}

/* ---------- Charts (server-computed, plain markup) ---------- */

.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 132px;
  margin-top: 24px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: rgba(197, 160, 89, 0.7);
}

.bar-label {
  font-size: 10px;
  color: rgba(60, 55, 54, 0.5);
}

.donut {
  width: 128px;
  height: 128px;
  border-radius: 999px;
  flex-shrink: 0;
  position: relative;
}

.donut-hole {
  position: absolute;
  inset: 12px;
  background: #fff;
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-hole strong {
  font-size: 20px;
}

.donut-hole span {
  font-size: 10px;
  color: rgba(60, 55, 54, 0.5);
}

.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.legend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
}

.legend-key {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(60, 55, 54, 0.8);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.donut-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 20px;
}

.table-wrap {
  background: #fff;
  border: 1px solid var(--sand);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(43, 38, 37, 0.04);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

thead tr {
  background: rgba(251, 249, 245, 0.6);
  border-bottom: 1px solid var(--sand);
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(60, 55, 54, 0.6);
  font-weight: 600;
  padding: 12px 24px;
}

td {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(235, 227, 213, 0.7);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: rgba(60, 55, 54, 0.6);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}

/* ---------- Modal (native <dialog>, no JS framework) ---------- */

dialog.modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(43, 38, 37, 0.2);
}

dialog.modal::backdrop {
  background: rgba(30, 26, 25, 0.4);
}

.modal-body {
  padding: 24px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 18px;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: rgba(60, 55, 54, 0.5);
  line-height: 1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.profile-card {
  max-width: 480px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-head .avatar {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

.profile-name {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.mono {
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 12px;
  color: rgba(60, 55, 54, 0.6);
}
