/* Ndarama design system: navy and teal from the Ndarama logo.
   1. tokens (light / dark)   2. daisyUI retheme, so every existing page picks up the new look
   3. app shell: sidebar + top bar   4. component polish   5. building blocks for new-style pages   6. login */

/* ---------- 1. Tokens ---------- */
:root {
  --gold: #D9952A; --gold-bg: #FBF1DE;
  --ground: #F3F6F9; --surface: #FFFFFF; --surface-2: #F7F9FB; --surface-3: #EDF2F6;
  --ink: #0E2240; --body: #33465E; --muted: #62738A; --faint: #9AA8B8;
  --rule: #DDE5EC; --rule-2: #EAF0F4;
  --plum: #0B3766; --plum-2: #072A4F; --plum-wash: #E8EFF7; --plum-line: #B9CDE3;
  --money: #12846E; --money-2: #0E6F5C; --money-wash: #E0F3EE; --on-money: #FFFFFF;
  --side: #FFFFFF; --side-2: #F3F6F9; --side-ink: #33465E; --side-mute: #8A99AB; --side-on: #0B3766;
  --ok: #15803D; --ok-bg: #E1F4E8; --bad: #C0392B; --bad-bg: #FBE6E3;
  --warn: #A8620A; --warn-bg: #FBF0DC; --pend: #5B45C2; --pend-bg: #EEEAFB; --info: #2563A8; --info-bg: #E6EFF9;
  --neutral-bg: #EEF2F6;
  --shadow: 0 1px 2px rgba(14, 34, 64, .05);
  --side-w: 252px;
  --font-ui: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
  --gold: #E8B04E; --gold-bg: #3A2D12;
  --ground: #0A1424; --surface: #101D31; --surface-2: #15243B; --surface-3: #1C2D47;
  --ink: #E8EFF7; --body: #C3D0DF; --muted: #8EA1B8; --faint: #63768E;
  --rule: #22344F; --rule-2: #1A2B43;
  --plum: #8FB8E8; --plum-2: #B5D0F0; --plum-wash: #16304F; --plum-line: #2D4E78;
  --money: #3CC4A6; --money-2: #5ED3B9; --money-wash: #10352E; --on-money: #07170E;
  --side: #0C1729; --side-2: #13223A; --side-ink: #C3D0DF; --side-mute: #7489A3; --side-on: #FFFFFF;
  --ok: #5AD186; --ok-bg: #15321F; --bad: #F08477; --bad-bg: #3A1A18; --warn: #EDB05A; --warn-bg: #3A2A12;
  --pend: #B2A4F5; --pend-bg: #28224D; --info: #7DB0EE; --info-bg: #172A45; --neutral-bg: #1C2A40;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
/* The sign-in page follows the computer's light or dark setting, as the application does (nd.css), unless a theme was chosen with the toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):has(body.nd-login) {
    --gold: #E8B04E; --gold-bg: #3A2D12;
    --ground: #0A1424; --surface: #101D31; --surface-2: #15243B; --surface-3: #1C2D47;
    --ink: #E8EFF7; --body: #C3D0DF; --muted: #8EA1B8; --faint: #63768E;
    --rule: #22344F; --rule-2: #1A2B43;
    --plum: #8FB8E8; --plum-2: #B5D0F0; --plum-wash: #16304F; --plum-line: #2D4E78;
    --money: #3CC4A6; --money-2: #5ED3B9; --money-wash: #10352E; --on-money: #07170E;
    --side: #0C1729; --side-2: #13223A; --side-ink: #C3D0DF; --side-mute: #7489A3; --side-on: #FFFFFF;
    --ok: #5AD186; --ok-bg: #15321F; --bad: #F08477; --bad-bg: #3A1A18; --warn: #EDB05A; --warn-bg: #3A2A12;
    --pend: #B2A4F5; --pend-bg: #28224D; --info: #7DB0EE; --info-bg: #172A45; --neutral-bg: #1C2A40;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]):has(body.nd-login) .logo-l { display: none; }
  :root:not([data-theme="light"]):has(body.nd-login) .logo-d { display: block; }
}
.logo-d, .nd-brand img.logo-d { display: none; }
:root[data-theme="dark"] .logo-l, :root[data-theme="dark"] .nd-brand img.logo-l { display: none; }
:root[data-theme="dark"] .logo-d { display: block; }
:root[data-theme="dark"] .nd-brand img.logo-d { display: block; }
html:has(body.nd-shell) { background: var(--ground); }

/* ---------- 2. daisyUI retheme (the compiled main.css reads these variables) ---------- */
:root, html[data-theme], html[data-theme="light"], html[data-theme="dark"] {
  --color-base-100: var(--surface);
  --color-base-200: var(--ground);
  --color-base-300: var(--rule);
  --color-base-content: var(--body);
  --color-primary: var(--money);
  --color-primary-content: var(--on-money);
  --color-secondary: var(--plum);
  --color-secondary-content: #FFFFFF;
  --color-accent: var(--gold);
  --color-accent-content: #1F1500;
  --color-neutral: var(--ink);
  --color-neutral-content: var(--surface);
  --color-info: var(--info);
  --color-info-content: #FFFFFF;
  --color-success: var(--ok);
  --color-success-content: #FFFFFF;
  --color-warning: var(--warn);
  --color-warning-content: #FFFFFF;
  --color-error: var(--bad);
  --color-error-content: #FFFFFF;
  --radius-selector: .5rem;
  --radius-field: .5rem;
  --radius-box: .75rem;
  --depth: 0;
  --noise: 0;
  --border: 1px;
}

/* ---------- 3. App shell ---------- */
body.nd-shell {
  margin: 0;
  background: var(--ground);
  color: var(--body);
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-left: var(--side-w);
}
body.nd-shell a { color: var(--plum); }
body.nd-shell h1, body.nd-shell h2, body.nd-shell h3, body.nd-shell h4 { color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
body.nd-shell .container { padding-top: 22px; }
.nd-mono { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: .9em; }

.nd-side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40;
  background: var(--side); color: var(--side-ink); border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; padding: 18px 14px 16px; overflow-y: auto; scrollbar-width: thin;
  font-family: var(--font-ui); font-size: 13.5px;
}
.nd-brand { padding: 2px 8px 14px; }
.nd-brand img { width: 170px; height: auto; display: block; }
.nd-brand small { display: block; margin-top: 6px; font-size: 10px; letter-spacing: .14em; color: var(--side-mute); font-weight: 500; }
.nd-side a.nd-back-new { display: block; margin: 0 4px 10px; padding: 9px 12px; border-radius: 8px; background: var(--plum); color: var(--ground); font-weight: 600; font-size: 13px; text-align: center; text-decoration: none; }
.nd-side a.nd-back-new:hover { filter: brightness(1.1); }
.nd-side h5 { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--side-mute); margin: 14px 10px 5px; font-weight: 600; }
.nd-side a.nd-link {
  display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 8px;
  color: var(--side-ink); font-size: 13.5px; text-decoration: none; white-space: nowrap;
}
.nd-side a.nd-link svg { opacity: .8; flex: none; }
.nd-side a.nd-link:hover { background: var(--side-2); color: var(--side-on); }
.nd-side a.nd-link.on { background: var(--plum-wash); color: var(--side-on); font-weight: 500; }
.nd-side a.nd-link.on svg { opacity: 1; color: var(--money); }
.nd-side a.nd-sub { padding-left: 41px; font-size: 13px; color: var(--muted); display: none; }
.nd-side a.nd-sub.show { display: flex; }
.nd-side .nd-row { display: flex; align-items: center; }
.nd-side .nd-row > a.nd-link { flex: 1; min-width: 0; }
.nd-side .nd-tog { border: 0; background: none; color: var(--side-mute); cursor: pointer; padding: 6px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.nd-side .nd-tog:hover { background: var(--side-2); color: var(--side-on); }
.nd-side .nd-tog svg { transition: transform .15s; }
.nd-side .nd-tog.open svg { transform: rotate(90deg); }
.nd-side a.nd-sub.on { background: none; color: var(--ink); font-weight: 500; }
.nd-side a.nd-sub.on::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--money); margin-left: -13px; margin-right: 8px; flex: none; }
.nd-side a.nd-link { min-width: 0; }
.nd-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--rule); font-size: 11px; color: var(--side-mute); display: flex; flex-direction: column; gap: 4px; }
.nd-foot b { color: var(--side-ink); font-weight: 500; }
.nd-foot .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #43C06C; margin-right: 6px; }

.nd-top {
  height: 62px; background: var(--surface); border-bottom: 1px solid var(--rule); box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px; padding: 0 28px; position: sticky; top: 0; z-index: 30;
  font-family: var(--font-ui);
}
.nd-burger { display: none; border: 0; background: none; color: var(--ink); padding: 6px; cursor: pointer; }
.nd-ctx { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nd-ctx b { color: var(--ink); font-weight: 500; }
.nd-search {
  margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--rule);
  border-radius: 9px; padding: 0 12px; width: min(340px, 40vw); height: 36px;
}
.nd-search input { border: 0 !important; outline: 0 !important; box-shadow: none !important; background: none !important; width: 100%; font-size: 13px; height: 34px !important; padding: 0 !important; color: var(--ink); }
.nd-search kbd { font-family: inherit; font-size: 11px; color: var(--faint); border: 1px solid var(--rule); border-radius: 4px; padding: 0 5px; }
.nd-ibtn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--rule); background: var(--surface); display: grid;
  place-items: center; color: var(--ink); cursor: pointer; flex: none;
}
.nd-ibtn:hover { border-color: var(--plum-line); }
.nd-me { position: relative; flex: none; }
.nd-me > button { display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; text-align: left; border-radius: 10px; padding: 4px 6px; color: inherit; }
.nd-me > button:hover { background: var(--surface-2); }
.nd-av { width: 34px; height: 34px; border-radius: 50%; background: var(--plum); color: var(--surface); display: grid; place-items: center; font-size: 12px; font-weight: 600; text-transform: uppercase; }
.nd-me strong { display: block; color: var(--ink); font-weight: 500; font-size: 13px; line-height: 1.2; }
.nd-me small { display: block; color: var(--muted); font-size: 11.5px; }
.nd-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 220px; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 12px; box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .35); padding: 6px; z-index: 50; display: none;
}
.nd-menu.on { display: block; }
.nd-menu a, .nd-menu button {
  display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px;
  color: var(--ink); font-size: 13px; cursor: pointer; text-decoration: none; font-family: inherit;
}
.nd-menu a:hover, .nd-menu button:hover { background: var(--surface-2); }
.nd-scrim { position: fixed; inset: 0; background: rgba(16, 14, 34, .45); z-index: 35; display: none; }
.nd-scrim.on { display: block; }
@media (max-width: 980px) {
  body.nd-shell { padding-left: 0; }
  .nd-side { transform: translateX(-102%); transition: transform .2s; width: 272px; z-index: 60; }
  .nd-side.on { transform: none; }
  .nd-burger { display: block; }
  .nd-top { padding: 0 16px; }
  .nd-me div, .nd-search kbd { display: none; }
}
@media (max-width: 620px) { .nd-ctx { display: none; } .nd-search { width: auto; flex: 1; } }

/* ---------- 4. Component polish for the existing (daisyUI) pages ---------- */
body.nd-shell .btn { height: 36px; min-height: 36px; font-size: 13px; font-weight: 500; border-radius: 8px; box-shadow: none; text-shadow: none; }
body.nd-shell .btn-sm { height: 30px; min-height: 30px; font-size: 12.5px; }
body.nd-shell .btn-xs { height: 24px; min-height: 24px; font-size: 12px; }
body.nd-shell .btn-lg { height: 44px; min-height: 44px; font-size: 14px; }
body.nd-shell .btn-primary { background: var(--money); border-color: var(--money); color: var(--on-money); }
body.nd-shell .btn-primary:hover { background: var(--money-2); border-color: var(--money-2); }
body.nd-shell .btn-secondary { background: var(--plum); border-color: var(--plum); color: var(--surface); }
body.nd-shell .btn-outline { background: var(--surface); border-color: var(--rule); color: var(--ink); }
body.nd-shell .btn-outline:hover { border-color: var(--plum-line); background: var(--surface-2); color: var(--ink); }
body.nd-shell .btn-ghost { color: var(--body); }
body.nd-shell .btn-error { background: var(--surface); border-color: var(--bad); color: var(--bad); }
body.nd-shell .btn-error:hover { background: var(--bad-bg); }

body.nd-shell input.input, body.nd-shell select.select, body.nd-shell textarea.textarea,
body.nd-shell .input, body.nd-shell .select, body.nd-shell .textarea,
body.nd-shell input[type="text"], body.nd-shell input[type="date"], body.nd-shell input[type="number"], body.nd-shell input[type="email"], body.nd-shell input[type="password"], body.nd-shell select, body.nd-shell textarea {
  border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px;
}
body.nd-shell input:focus, body.nd-shell select:focus, body.nd-shell textarea:focus {
  outline: 2px solid var(--plum-line) !important; border-color: var(--plum) !important; box-shadow: none !important;
}
body.nd-shell .label-text, body.nd-shell label.label { font-size: 12px; color: var(--muted); font-weight: 500; }
body.nd-shell .checkbox:checked, body.nd-shell .toggle:checked { background-color: var(--money); border-color: var(--money); color: var(--on-money); }

body.nd-shell .table { font-size: 13px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; border-collapse: separate; border-spacing: 0; }
body.nd-shell .table :where(thead th) {
  background: var(--surface); color: var(--muted); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; font-weight: 600;
  border-bottom: 1px solid var(--rule); padding: 10px 14px; white-space: nowrap;
}
body.nd-shell .table :where(tbody td) { border-bottom: 1px solid var(--rule-2); padding: 11px 14px; vertical-align: middle; color: var(--body); }
body.nd-shell .table :where(tbody tr:last-child td) { border-bottom: 0; }
body.nd-shell .table-zebra tbody tr:nth-child(even) > * { background: var(--surface-2); }
body.nd-shell .table tbody tr:hover > * { background: var(--surface-2); }

body.nd-shell .card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow); }
body.nd-shell .card-title { font-size: 14.5px; font-weight: 600; color: var(--ink); }

body.nd-shell .alert { border-radius: 10px; border: 0; font-size: 13px; box-shadow: none; background: var(--plum-wash); color: var(--body); }
body.nd-shell .alert-success { background: var(--ok-bg); color: var(--ok); }
body.nd-shell .alert-error { background: var(--bad-bg); color: var(--bad); }
body.nd-shell .alert-warning { background: var(--warn-bg); color: var(--warn); }
body.nd-shell .alert-info { background: var(--info-bg); color: var(--info); }

body.nd-shell .badge { border-radius: 99px; font-size: 12px; font-weight: 500; }
body.nd-shell .modal-box { border-radius: 14px; background: var(--surface); color: var(--body); }
body.nd-shell .tabs-bordered .tab, body.nd-shell .tab-bordered { color: var(--muted); }
body.nd-shell .tab-active, body.nd-shell .tab.tab-active { color: var(--ink); border-color: var(--money); font-weight: 500; }
body.nd-shell .tab-btn.active { color: var(--ink); border-bottom: 2px solid var(--money); }
body.nd-shell .link { color: var(--plum); }

/* ---------- 5. Building blocks for new-style pages ---------- */
.nd-ph { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.nd-ph .eb { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--money); font-weight: 600; margin-bottom: 4px; }
.nd-ph h1 { font-size: 24px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.nd-ph p { margin: 4px 0 0; color: var(--muted); max-width: 74ch; }
.nd-ph .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.nd-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--rule); margin: 14px 0 22px; overflow-x: auto; scrollbar-width: none; }
.nd-tabs a { padding: 9px 0 10px; color: var(--muted); font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; text-decoration: none; }
.nd-tabs a:hover { color: var(--ink); }
.nd-tabs a.on { color: var(--ink); border-bottom-color: var(--money); font-weight: 500; }
.nd-card { background: var(--surface); border-radius: 12px; border: 1px solid var(--rule); box-shadow: var(--shadow); }
.nd-card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--rule-2); flex-wrap: wrap; }
.nd-card-h h3 { font-size: 14.5px; margin: 0; }
.nd-card-b { padding: 16px 18px; }
.nd-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--neutral-bg); color: var(--muted); }
.nd-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.nd-pill.ok { background: var(--ok-bg); color: var(--ok); } .nd-pill.bad { background: var(--bad-bg); color: var(--bad); }
.nd-pill.warn { background: var(--warn-bg); color: var(--warn); } .nd-pill.pend { background: var(--pend-bg); color: var(--pend); }
.nd-pill.info { background: var(--info-bg); color: var(--info); }
.nd-note { display: flex; gap: 10px; padding: 11px 14px; border-radius: 10px; background: var(--plum-wash); color: var(--body); font-size: 13px; }
.nd-note.warn { background: var(--warn-bg); } .nd-note.ok { background: var(--ok-bg); }

/* ---------- 6. Login ---------- */
.nd-login *, .nd-login *::before, .nd-login *::after { box-sizing: border-box; }
body.nd-login { margin: 0; font-family: var(--font-ui); font-size: 13.5px; color: var(--body); background: var(--surface); -webkit-font-smoothing: antialiased; }
.nd-login .login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.nd-login .lg-brand {
  background: radial-gradient(120% 90% at 0% 100%, rgba(47, 165, 147, .35) 0%, transparent 55%), linear-gradient(160deg, #0B3766 0%, #072A4F 70%);
  color: #E6EEF7; padding: 48px 56px; display: flex; flex-direction: column; gap: 40px; position: relative; overflow: hidden;
}
.nd-login .lg-brand::after { content: ""; position: absolute; right: -140px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .04); }
.nd-login .lg-brand img { width: 300px; max-width: 100%; height: auto; }
.nd-login .lg-copy { margin-top: auto; max-width: 480px; position: relative; z-index: 1; }
.nd-login .lg-copy h1 { color: #fff; font-size: 34px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.nd-login .lg-copy p { color: #C6D5E6; font-size: 15px; margin: 12px 0 26px; }
.nd-login .lg-copy ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.nd-login .lg-copy li { padding-left: 22px; position: relative; font-size: 13.5px; color: #C6D5E6; }
.nd-login .lg-copy li::before { content: ""; position: absolute; left: 0; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: #3CC4A6; }
.nd-login .lg-copy li b { color: #fff; font-weight: 500; }
.nd-login .lg-foot { font-size: 11.5px; color: #8FA6C0; position: relative; z-index: 1; }
.nd-login .lg-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--ground); }
.nd-login .lg-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 32px 30px; box-shadow: 0 20px 50px -30px rgba(14, 34, 64, .35); }
.nd-login .lg-m { display: none; margin-bottom: 22px; }
.nd-login .lg-m img { width: 220px; height: auto; }
.nd-login .lg-card h2 { font-size: 22px; margin: 0 0 4px; color: var(--ink); font-weight: 600; }
.nd-login .lead { color: var(--muted); margin: 0 0 22px; font-size: 13.5px; }
.nd-login form { display: flex; flex-direction: column; gap: 14px; }
.nd-login .field { display: flex; flex-direction: column; gap: 5px; }
.nd-login .field label { font-size: 12px; color: var(--muted); font-weight: 500; }
.nd-login .inp { border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; font-size: 14px; background: var(--surface); color: var(--ink); width: 100%; font-family: inherit; }
.nd-login .inp:focus { outline: 2px solid var(--plum-line); border-color: var(--plum); }
.nd-login .pw { position: relative; }
.nd-login .pw button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--plum); font-size: 12.5px; font-weight: 500; cursor: pointer; font-family: inherit; }
.nd-login .btn-p { display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 8px; padding: 11px 16px; font-size: 14px; font-weight: 500; cursor: pointer; background: var(--money); color: var(--on-money); font-family: inherit; }
.nd-login .btn-p:hover { background: var(--money-2); }
.nd-login .lg-err { background: var(--bad-bg); color: var(--bad); border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.nd-login .lg-info { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.nd-login .lg-ok { background: var(--ok-bg); color: var(--ok); border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.nd-login .lg-theme { position: absolute; top: 18px; right: 18px; }
@media (max-width: 900px) { .nd-login .login { grid-template-columns: minmax(0, 1fr); } .nd-login .lg-brand { display: none; } .nd-login .lg-m { display: block; } }

/* ---------- 7. Utilities the compiled main.css lacks but a few templates use ---------- */
.col-span-2 { grid-column: span 2 / span 2; }
.ml-6 { margin-left: 1.5rem; }
.rounded-box { border-radius: var(--radius-box); }
@media (min-width: 768px) {
  .md\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .md\:col-span-2 { grid-column: span 2 / span 2; }
  .md\:col-span-3 { grid-column: span 3 / span 3; }
}

/* ---------- 8. Page titles follow the design's page header: left aligned, ink, 24px ---------- */
body.nd-shell .container .text-center:has(> h1:only-child) { text-align: left; }
body.nd-shell .container h1.text-2xl, body.nd-shell .container h1.text-3xl, body.nd-shell .container h1.text-xl {
  font-size: 24px; font-weight: 600; color: var(--ink); letter-spacing: -.01em;
}
body.nd-shell .container h1 { color: var(--ink); }
body.nd-shell .text-gray-900, body.nd-shell .text-gray-800, body.nd-shell .text-gray-700 { color: var(--ink); }
body.nd-shell .text-gray-600, body.nd-shell .text-gray-500 { color: var(--muted); }
body.nd-shell .shadow-xl, body.nd-shell .shadow-lg, body.nd-shell .shadow-md { box-shadow: var(--shadow); }

/* the legacy global table rule draws a grid; the design uses row rules only */
body.nd-shell .table th, body.nd-shell .table td { border-left: 0; border-right: 0; border-top: 0; }
body.nd-shell .table th:hover { background: var(--surface); }

/* ---------- 9. Standalone pages (errors): a plain ground instead of the pastel gradients ---------- */
body[class*="bg-gradient"] { background: var(--ground) !important; font-family: var(--font-ui); color: var(--body); }
body[class*="bg-gradient"] h1, body[class*="bg-gradient"] h2, body[class*="bg-gradient"] h3 { color: var(--ink); }

/* ---------- 10. Set-up flow: stepper and field grid (used by the screens that follow the lifecycle) ---------- */
.nd-steps { display: flex; gap: 0; overflow-x: auto; margin: 14px 0 22px; }
.nd-steps a { flex: 1; min-width: 110px; padding: 10px 14px 10px 0; border-top: 3px solid var(--rule); text-decoration: none; display: block; }
.nd-steps a strong { display: block; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.nd-steps a small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.nd-steps a.done { border-top-color: var(--money); }
.nd-steps a.done strong { color: var(--ink); }
.nd-steps a.on { border-top-color: var(--plum); }
.nd-steps a.on strong { color: var(--plum); font-weight: 600; }
.nd-fgrid { display: grid; gap: 14px 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nd-fgrid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nd-fgrid .wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .nd-fgrid, .nd-fgrid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .nd-fgrid, .nd-fgrid.c2 { grid-template-columns: minmax(0, 1fr); } }
.nd-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.nd-field > label { font-size: 12px; color: var(--muted); font-weight: 500; }
.nd-field > label em { color: var(--bad); font-style: normal; }
.nd-field .hint { font-size: 11.5px; color: var(--faint); }
.nd-field input, .nd-field select, .nd-field textarea { width: 100%; height: 36px; padding: 0 11px; }
.nd-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.nd-grid.g-wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .nd-grid.g-wide { grid-template-columns: minmax(0, 1fr); } }
.nd-kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 13px; margin: 0; }
.nd-kv dt { color: var(--muted); } .nd-kv dd { margin: 0; color: var(--ink); font-weight: 500; }
.nd-rowset { display: flex; flex-direction: column; }
.nd-rowset > form, .nd-rowset > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--rule-2); }
.nd-rowset > :last-child { border-bottom: 0; }
.nd-rowset .what { flex: 1 1 100%; min-width: 0; }
.nd-rowset .what strong { display: block; color: var(--ink); font-weight: 500; }
.nd-rowset .what small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.nd-rowset select { height: 34px; flex: 1 1 160px; min-width: 0; }
.nd-flash { margin: 0 0 16px; }
