/* Kōkako design system, applied to the Board portal's Bootstrap 5.3 markup.
   Tokens come from kokako/app/design/kokako.tokens.json (Kōkako v2). Build UI with role tokens only. */
@import url("../vendor/fonts/fonts.css");

:root {
  color-scheme: light dark;

  /* Palette: the bird's colours. Fixed. */
  --parchment: #f4f1ea;
  --feather: #dce4f0;
  --hairline: #c4cedc;
  --mask: #111317;
  --plumage: #4f6280;
  --slate: #33445e;
  --wattle-blue: #1a5cf0;
  --wattle-blue-ink: #1848c8;
  --wattle-orange: #ffa114;
  --wattle-orange-ink: #954f00;
  --wattle-blue-deep: #1449c4;
  --wattle-orange-deep: #f08c00;
  --berry: #a8243c;
  --night: #10151d;
  --night-raised: #1b2433;
  --mist: #a9b6c9;
  --dusk: #6b7c96;
  --wattle-blue-light: #7aa5ff;
  --berry-light: #ff8fa0;

  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Figtree", "Helvetica Neue", Arial, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-4: 16px;
  --space-8: 32px;
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-full: 999px;
}

/* Role tokens: light */
:root,
[data-theme="light"] {
  --bg: #f4f1ea;
  --surface: #dce4f0;
  --border-subtle: #c4cedc;
  --border: #4f6280;
  --text: #111317;
  --text-muted: #4f6280;
  --link: #1848c8;
  --accent: #1a5cf0;
  --accent-hover: #1449c4;
  --on-accent: #f4f1ea;
  --primary: #ffa114;
  --primary-hover: #f08c00;
  --on-primary: #111317;
  --warning: #954f00;
  --danger: #a8243c;
  --focus: #1a5cf0;
  /* derived for this app */
  --accent-soft: rgba(26, 92, 240, .10);
  --danger-soft: rgba(168, 36, 60, .08);
  --warning-soft: rgba(255, 161, 20, .14);
  --row-hover: rgba(79, 98, 128, .07);
  --raised: #fbfaf6;
}

/* Role tokens: dark */
[data-theme="dark"] {
  --bg: #10151d;
  --surface: #1b2433;
  --border-subtle: #33445e;
  --border: #6b7c96;
  --text: #f4f1ea;
  --text-muted: #a9b6c9;
  --link: #7aa5ff;
  --accent: #1a5cf0;
  --accent-hover: #1449c4;
  --on-accent: #f4f1ea;
  --primary: #ffa114;
  --primary-hover: #f08c00;
  --on-primary: #111317;
  --warning: #ffa114;
  --danger: #ff8fa0;
  --focus: #7aa5ff;
  --accent-soft: rgba(122, 165, 255, .14);
  --danger-soft: rgba(255, 143, 160, .10);
  --warning-soft: rgba(255, 161, 20, .12);
  --row-hover: rgba(169, 182, 201, .07);
  --raised: #222d3f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10151d;
    --surface: #1b2433;
    --border-subtle: #33445e;
    --border: #6b7c96;
    --text: #f4f1ea;
    --text-muted: #a9b6c9;
    --link: #7aa5ff;
    --accent: #1a5cf0;
    --accent-hover: #1449c4;
    --on-accent: #f4f1ea;
    --primary: #ffa114;
    --primary-hover: #f08c00;
    --on-primary: #111317;
    --warning: #ffa114;
    --danger: #ff8fa0;
    --focus: #7aa5ff;
    --accent-soft: rgba(122, 165, 255, .14);
    --danger-soft: rgba(255, 143, 160, .10);
    --warning-soft: rgba(255, 161, 20, .12);
    --row-hover: rgba(169, 182, 201, .07);
    --raised: #222d3f;
  }
}

/* ---------- Bootstrap variables -> Kōkako roles ---------- */
:root, [data-bs-theme] {
  --bs-font-sans-serif: var(--font-sans);
  --bs-body-font-family: var(--font-sans);
  --bs-body-font-size: 15px;
  --bs-body-line-height: 1.55;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-emphasis-color: var(--text);
  --bs-secondary-color: var(--text-muted);
  --bs-tertiary-color: var(--text-muted);
  --bs-secondary-bg: var(--surface);
  --bs-tertiary-bg: var(--surface);
  --bs-border-color: var(--border-subtle);
  --bs-border-color-translucent: var(--border-subtle);
  --bs-heading-color: var(--text);
  --bs-link-color: var(--link);
  --bs-link-hover-color: var(--link);
  --bs-link-color-rgb: 24, 72, 200;
  --bs-link-hover-color-rgb: 24, 72, 200;
  --bs-primary: var(--accent);
  --bs-primary-rgb: 26, 92, 240;
  --bs-primary-text-emphasis: var(--link);
  --bs-primary-bg-subtle: var(--accent-soft);
  --bs-primary-border-subtle: var(--accent);
  --bs-border-radius: var(--radius-sm);
  --bs-border-radius-sm: var(--radius-sm);
  --bs-border-radius-lg: var(--radius-md);
  --bs-border-radius-pill: var(--radius-full);
  --bs-box-shadow: none;
  --bs-box-shadow-sm: none;
  --bs-focus-ring-color: var(--focus);
  --bs-code-color: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bs-link-color-rgb: 122, 165, 255; --bs-link-hover-color-rgb: 122, 165, 255; }
}
[data-theme="dark"] { --bs-link-color-rgb: 122, 165, 255; --bs-link-hover-color-rgb: 122, 165, 255; }

body { background: var(--bg); color: var(--text); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 0; }
a { color: var(--link); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.list-group-item-action):not(.badge) { text-decoration: none; }
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.list-group-item-action):not(.badge):hover { text-decoration: underline; }
::selection { background: var(--accent); color: var(--on-accent); }
hr { border-color: var(--border-subtle); opacity: 1; }

/* ---------- Type ---------- */
h1, .h1, h2, .h2, h3, .h3 { font-family: var(--font-serif); font-weight: 500; letter-spacing: -0.005em; color: var(--text); }
h1, .h1 { font-size: 32px; line-height: 38px; }
h2, .h2 { font-size: 26px; line-height: 32px; }
h3, .h3 { font-size: 22px; line-height: 28px; }
h4, .h4 { font-family: var(--font-sans); font-size: 18px; line-height: 26px; font-weight: 600; }
h5, .h5 { font-family: var(--font-sans); font-size: 16px; line-height: 24px; font-weight: 600; }
h6, .h6 { font-family: var(--font-sans); font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: .04em; }
.small, small { font-size: 13px; }
.fw-semibold, strong, b { font-weight: 600; }
.text-muted, .text-secondary, .text-body-secondary { color: var(--text-muted) !important; }
.link-secondary { color: var(--text-muted) !important; }
.text-primary { color: var(--link) !important; }
.text-success { color: var(--link) !important; }
.text-info { color: var(--link) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-dark, .text-body { color: var(--text) !important; }
.kk-eyebrow, .kk-label { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.kk-serif { font-family: var(--font-serif); font-weight: 500; }
code { color: var(--text); background: var(--surface); padding: 1px 5px; border-radius: var(--radius-sm); font-size: .875em; }

/* ---------- Surfaces ---------- */
.bg-white, .bg-body { background-color: var(--raised) !important; }
.bg-light, .bg-body-tertiary, .bg-body-secondary { background-color: var(--surface) !important; }
.bg-dark { background-color: var(--slate) !important; color: var(--parchment); }
.bg-info-subtle, .bg-primary-subtle { background-color: var(--accent-soft) !important; }
.bg-warning-subtle { background-color: var(--warning-soft) !important; }
.bg-success-subtle { background-color: var(--accent-soft) !important; }
.bg-danger-subtle { background-color: var(--danger-soft) !important; }
.bg-success { background-color: var(--accent) !important; color: var(--on-accent); }
.bg-danger { background-color: var(--berry) !important; color: var(--parchment); }
.bg-warning { background-color: var(--primary) !important; color: var(--on-primary); }
.bg-secondary { background-color: var(--plumage) !important; color: var(--parchment); }
.border, .border-top, .border-bottom, .border-start, .border-end { border-color: var(--border-subtle) !important; }
.border-danger { border-color: var(--danger) !important; }
.border-warning { border-color: var(--primary) !important; }
.border-primary, .border-success { border-color: var(--accent) !important; }
.shadow, .shadow-sm, .shadow-lg { box-shadow: none !important; }
.rounded { border-radius: var(--radius-md) !important; }

.card {
  --bs-card-bg: var(--raised);
  --bs-card-border-color: var(--border-subtle);
  --bs-card-border-radius: var(--radius-md);
  --bs-card-inner-border-radius: calc(var(--radius-md) - 1px);
  --bs-card-cap-bg: transparent;
  --bs-card-cap-padding-y: 12px;
  --bs-card-cap-padding-x: var(--space-4);
  --bs-card-color: var(--text);
  border: 1px solid var(--border-subtle);
  box-shadow: none;
}
.card-header { border-bottom: 1px solid var(--border-subtle); font-weight: 600; }
.card-header.bg-white, .card-header.bg-light { background: transparent !important; }
.card-header strong { font-weight: 600; }
.card-footer { background: transparent; border-top: 1px solid var(--border-subtle); }
.card.kk-tone-slate, .card.text-bg-dark { background: var(--slate) !important; border-color: var(--slate); color: var(--parchment) !important; }

.list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: var(--border-subtle); --bs-list-group-color: var(--text);
  --bs-list-group-action-hover-bg: var(--row-hover); --bs-list-group-action-hover-color: var(--text);
  --bs-list-group-active-bg: var(--accent); --bs-list-group-active-border-color: var(--accent); --bs-list-group-active-color: var(--on-accent); }
.list-group-flush > .list-group-item { padding: 11px var(--space-4); }

/* ---------- Buttons (pills) ---------- */
.btn {
  --bs-btn-font-family: var(--font-sans);
  --bs-btn-font-weight: 600;
  --bs-btn-font-size: 13px;
  --bs-btn-line-height: 18px;
  --bs-btn-padding-y: 9px;
  --bs-btn-padding-x: 20px;
  --bs-btn-border-radius: var(--radius-full);
  --bs-btn-box-shadow: none;
  --bs-btn-focus-box-shadow: none;
  --bs-btn-disabled-opacity: .45;
  letter-spacing: .04em;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn.d-block, .btn.w-100 { display: flex; }
.btn-sm, .btn-group-sm > .btn { --bs-btn-font-size: 12px; --bs-btn-line-height: 16px; --bs-btn-padding-y: 5px; --bs-btn-padding-x: 12px; --bs-btn-border-radius: var(--radius-full); }
.btn-lg { --bs-btn-font-size: 15px; --bs-btn-padding-y: 12px; --bs-btn-padding-x: 26px; --bs-btn-border-radius: var(--radius-full); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: none; }

/* secondary (blue) is the default action */
.btn-primary, .btn-success, .btn-info {
  --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-color: var(--on-accent);
  --bs-btn-hover-bg: var(--accent-hover); --bs-btn-hover-border-color: var(--accent-hover); --bs-btn-hover-color: var(--on-accent);
  --bs-btn-active-bg: var(--accent-hover); --bs-btn-active-border-color: var(--accent-hover); --bs-btn-active-color: var(--on-accent);
  --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent); --bs-btn-disabled-color: var(--on-accent);
}
/* orange: the one main action in a view */
.btn-kk-primary, .btn-warning {
  --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-color: var(--on-primary);
  --bs-btn-hover-bg: var(--primary-hover); --bs-btn-hover-border-color: var(--primary-hover); --bs-btn-hover-color: var(--on-primary);
  --bs-btn-active-bg: var(--primary-hover); --bs-btn-active-border-color: var(--primary-hover); --bs-btn-active-color: var(--on-primary);
  --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary); --bs-btn-disabled-color: var(--on-primary);
}
.btn-outline-secondary, .btn-outline-dark, .btn-light, .btn-secondary, .btn-outline-light {
  --bs-btn-bg: transparent; --bs-btn-border-color: var(--border); --bs-btn-color: var(--text);
  --bs-btn-hover-bg: var(--surface); --bs-btn-hover-border-color: var(--border); --bs-btn-hover-color: var(--text);
  --bs-btn-active-bg: var(--surface); --bs-btn-active-border-color: var(--border); --bs-btn-active-color: var(--text);
  --bs-btn-disabled-bg: transparent; --bs-btn-disabled-border-color: var(--border); --bs-btn-disabled-color: var(--text);
}
.btn-outline-primary, .btn-outline-success, .btn-outline-info {
  --bs-btn-bg: transparent; --bs-btn-border-color: var(--accent); --bs-btn-color: var(--link);
  --bs-btn-hover-bg: var(--accent-soft); --bs-btn-hover-border-color: var(--accent); --bs-btn-hover-color: var(--link);
  --bs-btn-active-bg: var(--accent); --bs-btn-active-border-color: var(--accent); --bs-btn-active-color: var(--on-accent);
  --bs-btn-disabled-bg: transparent; --bs-btn-disabled-border-color: var(--accent); --bs-btn-disabled-color: var(--link);
}
.btn-outline-warning {
  --bs-btn-bg: transparent; --bs-btn-border-color: var(--primary); --bs-btn-color: var(--warning);
  --bs-btn-hover-bg: var(--warning-soft); --bs-btn-hover-border-color: var(--primary); --bs-btn-hover-color: var(--warning);
  --bs-btn-active-bg: var(--primary); --bs-btn-active-border-color: var(--primary); --bs-btn-active-color: var(--on-primary);
}
.btn-danger {
  --bs-btn-bg: var(--berry); --bs-btn-border-color: var(--berry); --bs-btn-color: var(--parchment);
  --bs-btn-hover-bg: #8f1e33; --bs-btn-hover-border-color: #8f1e33; --bs-btn-hover-color: var(--parchment);
  --bs-btn-active-bg: #8f1e33; --bs-btn-active-border-color: #8f1e33; --bs-btn-active-color: var(--parchment);
}
.btn-outline-danger {
  --bs-btn-bg: transparent; --bs-btn-border-color: var(--danger); --bs-btn-color: var(--danger);
  --bs-btn-hover-bg: var(--danger-soft); --bs-btn-hover-border-color: var(--danger); --bs-btn-hover-color: var(--danger);
  --bs-btn-active-bg: var(--danger); --bs-btn-active-border-color: var(--danger); --bs-btn-active-color: var(--bg);
}
.btn-dark {
  --bs-btn-bg: var(--slate); --bs-btn-border-color: var(--slate); --bs-btn-color: var(--parchment);
  --bs-btn-hover-bg: var(--mask); --bs-btn-hover-border-color: var(--mask); --bs-btn-hover-color: var(--parchment);
}
.btn-link { --bs-btn-color: var(--link); --bs-btn-hover-color: var(--link); --bs-btn-active-color: var(--link); --bs-btn-disabled-color: var(--text-muted);
  text-decoration: none; --bs-btn-padding-x: 12px; }
.btn-link:hover { background: var(--surface); text-decoration: none; }
.btn-link.text-danger:hover { background: var(--danger-soft); }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child, .btn-group > .btn-check:first-child + .btn { border-top-left-radius: var(--radius-full); border-bottom-left-radius: var(--radius-full); }
.btn-group > .btn:last-child, .btn-group > .btn:last-of-type { border-top-right-radius: var(--radius-full); border-bottom-right-radius: var(--radius-full); }
.btn-check:checked + .btn { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-close { --bs-btn-close-focus-shadow: none; }
.btn-close:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-close { filter: invert(1) grayscale(100%) brightness(200%); } }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* ---------- Tags (badges) ---------- */
.badge { --bs-badge-font-size: 12px; --bs-badge-font-weight: 600; --bs-badge-padding-y: 3px; --bs-badge-padding-x: 9px;
  border-radius: var(--radius-full) !important; letter-spacing: .04em; line-height: 16px; border: 1px solid transparent; vertical-align: 1px; }
.text-bg-light, .text-bg-secondary, .bg-light.badge, .text-bg-info { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border-subtle); }
.text-bg-primary, .text-bg-success, .badge.bg-primary, .badge.bg-success { background: var(--accent) !important; color: var(--on-accent) !important; }
.text-bg-warning, .badge.bg-warning { background: var(--primary) !important; color: var(--on-primary) !important; }
.text-bg-danger, .badge.bg-danger { background: var(--berry) !important; color: var(--parchment) !important; }
.text-bg-dark, .badge.bg-dark { background: var(--slate) !important; color: var(--parchment) !important; }
.badge.text-bg-light.text-decoration-none:hover { border-color: var(--border); }

/* ---------- Alerts: flat panel with a role-coloured rule ---------- */
.alert { --bs-alert-bg: var(--raised); --bs-alert-color: var(--text); --bs-alert-border-color: var(--border-subtle); --bs-alert-link-color: var(--link);
  border-radius: var(--radius-md); border-left-width: 4px; padding: 12px var(--space-4); }
.alert-primary, .alert-info, .alert-success { --bs-alert-bg: var(--accent-soft); border-left-color: var(--accent); }
.alert-warning { --bs-alert-bg: var(--warning-soft); border-left-color: var(--primary); }
.alert-danger { --bs-alert-bg: var(--danger-soft); border-left-color: var(--danger); }
.alert-secondary, .alert-light { --bs-alert-bg: var(--surface); border-left-color: var(--border); }
.alert .alert-link { font-weight: 600; }

/* ---------- Forms ---------- */
.form-label, .col-form-label { font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: .04em; color: var(--text); margin-bottom: 6px; }
.form-text { font-size: 12px; line-height: 16px; color: var(--text-muted); margin-top: 5px; }
.form-control, .form-select {
  background-color: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; line-height: 22px; padding: 8px 12px; box-shadow: none !important;
}
.card .form-control, .card .form-select, .modal .form-control, .modal .form-select { background-color: var(--bg); }
.form-control-sm, .form-select-sm { font-size: 13px; padding: 5px 10px; border-radius: var(--radius-sm); }
.form-control-lg { font-size: 18px; }
.form-select { padding-right: 36px; }
.form-control::placeholder { color: var(--text-muted); opacity: .85; }
.form-control:focus, .form-select:focus { background-color: var(--bg); color: var(--text); border-color: var(--border); outline: 2px solid var(--focus); outline-offset: 2px; }
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background-color: var(--surface); opacity: .75; }
.form-control[type=file] { padding: 6px 8px; }
.form-control::file-selector-button { background: var(--surface); color: var(--text); border: 1px solid var(--border-subtle); border-radius: var(--radius-full);
  padding: 3px 12px; margin: 0 10px 0 0; font-weight: 600; font-size: 12px; letter-spacing: .04em; }
.form-control:hover:not(:disabled):not([readonly])::file-selector-button { background: var(--feather); }
.form-check-input { background-color: var(--bg); border: 1px solid var(--border); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { box-shadow: none; outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--border); }
.form-switch .form-check-input:focus { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%234f6280'/%3e%3c/svg%3e"); }
.input-group-text { background: var(--surface); border-color: var(--border); color: var(--text-muted); }
.input-group > .form-control, .input-group > .form-select { border-radius: var(--radius-sm); }
.is-invalid, .form-control.is-invalid { border-color: var(--danger) !important; border-width: 2px; }
.invalid-feedback { color: var(--danger); font-weight: 600; font-size: 12px; }
details > summary { cursor: pointer; font-weight: 600; }
fieldset legend { font-size: 13px; font-weight: 600; letter-spacing: .04em; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border-subtle);
  --bs-table-hover-bg: var(--row-hover); --bs-table-hover-color: var(--text); --bs-table-striped-bg: var(--row-hover);
  --bs-table-active-bg: var(--accent-soft); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: 10px 12px; border-bottom-color: var(--border-subtle); }
.table-sm > :not(caption) > * > * { padding: 7px 10px; }
.table > thead > tr > th, .table > thead > tr > td {
  font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle); white-space: nowrap; background: transparent;
}
.table-light, .table > thead.table-light > tr > * { --bs-table-bg: transparent; --bs-table-color: var(--text-muted); --bs-table-border-color: var(--border-subtle); background: transparent; }
.table-warning { --bs-table-bg: var(--warning-soft); --bs-table-color: var(--text); }
.table > tbody > tr:last-child > * { border-bottom-width: 0; }
.table > tfoot > tr > * { font-weight: 600; border-top: 1px solid var(--border); }
.card > .table, .card > .table-responsive > .table { margin-bottom: 0; }
.card > .table > :not(caption) > * > *:first-child, .card > .table-responsive > .table > :not(caption) > * > *:first-child { padding-left: var(--space-4); }
.card > .table > :not(caption) > * > *:last-child, .card > .table-responsive > .table > :not(caption) > * > *:last-child { padding-right: var(--space-4); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--row-hover); }

/* ---------- Navigation components ---------- */
.nav-tabs { --bs-nav-tabs-border-color: var(--border-subtle); --bs-nav-tabs-link-active-bg: transparent; --bs-nav-tabs-link-active-color: var(--text);
  --bs-nav-tabs-link-active-border-color: transparent; --bs-nav-tabs-link-hover-border-color: transparent; gap: var(--space-2); }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--text-muted); font-weight: 600; font-size: 14px; padding: 8px 4px; margin-right: 12px; background: none; }
.nav-tabs .nav-link:hover { color: var(--text); border-bottom-color: var(--border-subtle); }
.nav-tabs .nav-link.active { color: var(--text); border-bottom-color: var(--accent); background: none; }
.nav-pills { --bs-nav-pills-border-radius: var(--radius-full); --bs-nav-pills-link-active-bg: var(--accent); --bs-nav-pills-link-active-color: var(--on-accent); gap: 4px; }
.nav-pills .nav-link { color: var(--text); font-weight: 600; font-size: 13px; letter-spacing: .02em; padding: 6px 14px; }
.nav-pills .nav-link:not(.active):hover { background: var(--surface); }
.nav-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: none; }

.dropdown-menu { --bs-dropdown-bg: var(--raised); --bs-dropdown-color: var(--text); --bs-dropdown-border-color: var(--border-subtle);
  --bs-dropdown-border-radius: var(--radius-md); --bs-dropdown-link-color: var(--text); --bs-dropdown-link-hover-bg: var(--surface);
  --bs-dropdown-link-hover-color: var(--text); --bs-dropdown-link-active-bg: var(--accent); --bs-dropdown-link-active-color: var(--on-accent);
  --bs-dropdown-header-color: var(--text-muted); --bs-dropdown-divider-bg: var(--border-subtle); --bs-dropdown-font-size: 14px;
  --bs-dropdown-item-padding-y: 7px; --bs-dropdown-item-padding-x: 14px; --bs-dropdown-padding-y: 6px;
  box-shadow: 0 8px 24px rgba(17, 19, 23, .10); }
.dropdown-menu .dropdown-item { border-radius: var(--radius-sm); width: calc(100% - 12px); margin: 0 6px; }
.dropdown-header { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

.modal { --bs-modal-bg: var(--bg); --bs-modal-color: var(--text); --bs-modal-border-color: var(--border-subtle); --bs-modal-border-radius: var(--radius-md);
  --bs-modal-header-border-color: var(--border-subtle); --bs-modal-footer-border-color: var(--border-subtle); --bs-modal-box-shadow: none; }
.modal-title { font-family: var(--font-serif); font-weight: 500; font-size: 22px; }
.modal-backdrop { --bs-backdrop-bg: var(--mask); --bs-backdrop-opacity: .45; }
.offcanvas { --bs-offcanvas-bg: var(--slate); --bs-offcanvas-color: var(--parchment); }

.pagination { --bs-pagination-color: var(--text); --bs-pagination-bg: transparent; --bs-pagination-border-color: var(--border-subtle);
  --bs-pagination-hover-bg: var(--surface); --bs-pagination-hover-color: var(--text); --bs-pagination-hover-border-color: var(--border-subtle);
  --bs-pagination-active-bg: var(--accent); --bs-pagination-active-border-color: var(--accent); --bs-pagination-active-color: var(--on-accent);
  --bs-pagination-disabled-bg: transparent; --bs-pagination-disabled-color: var(--text-muted); --bs-pagination-focus-box-shadow: none; gap: 4px; }
.page-link { border-radius: var(--radius-full) !important; min-width: 34px; text-align: center; font-weight: 600; font-size: 13px; }

.progress { --bs-progress-bg: var(--surface); --bs-progress-bar-bg: var(--accent); --bs-progress-border-radius: var(--radius-full); height: 8px; }
.progress-bar.bg-success { background-color: var(--accent) !important; }
.progress-bar.bg-warning { background-color: var(--primary) !important; }
.progress-bar.bg-danger { background-color: var(--danger) !important; }

.accordion { --bs-accordion-bg: transparent; --bs-accordion-color: var(--text); --bs-accordion-border-color: var(--border-subtle);
  --bs-accordion-active-bg: var(--surface); --bs-accordion-active-color: var(--text); --bs-accordion-btn-focus-box-shadow: none; }
.tooltip { --bs-tooltip-bg: var(--slate); --bs-tooltip-color: var(--parchment); }
.popover { --bs-popover-bg: var(--raised); --bs-popover-border-color: var(--border-subtle); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ================================================================
   App shell: slate sidebar + parchment workspace
   ================================================================ */
.kk-shell { display: flex; min-height: 100vh; }
.kk-sidebar {
  --kk-side-fg: var(--parchment);
  --kk-side-muted: #b9c4d6;
  --kk-side-hover: rgba(244, 241, 234, .08);
  --kk-side-active: rgba(244, 241, 234, .13);
  width: 252px; flex: 0 0 252px; background: var(--slate); color: var(--kk-side-fg);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kk-sidebar { background: #161d29; border-right: 1px solid var(--border-subtle); } }
[data-theme="dark"] .kk-sidebar { background: #161d29; border-right: 1px solid var(--border-subtle); }
.kk-sidebar :focus-visible { outline-color: var(--wattle-orange); }
.kk-brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px 18px; color: var(--kk-side-fg) !important; text-decoration: none !important; }
.kk-brand-mark { width: 32px; height: 32px; flex: 0 0 32px; border-radius: var(--radius-full); background: var(--mask); display: grid; place-items: center; position: relative; }
.kk-brand-mark::before, .kk-brand-mark::after { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; bottom: 5px; }
.kk-brand-mark::before { background: var(--wattle-blue-light); left: 6px; }
.kk-brand-mark::after { background: var(--wattle-orange); right: 6px; width: 5px; height: 5px; bottom: 7px; }
.kk-brand-logo { height: 30px; max-width: 120px; object-fit: contain; border-radius: var(--radius-sm); background: var(--parchment); padding: 3px; }
.kk-brand-name { font-family: var(--font-serif); font-weight: 500; font-size: 20px; line-height: 24px; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kk-nav { list-style: none; margin: 0; padding: 4px 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.kk-nav-section { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--kk-side-muted); padding: 16px 10px 6px; }
.kk-nav a, .kk-nav button.kk-nav-link {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; background: none;
  color: var(--kk-side-fg); font-size: 14px; font-weight: 500; text-decoration: none !important; position: relative; text-align: left;
}
.kk-nav a .bi, .kk-nav button.kk-nav-link .bi { font-size: 16px; width: 18px; text-align: center; color: var(--kk-side-muted); flex: 0 0 18px; }
.kk-nav a:hover, .kk-nav button.kk-nav-link:hover { background: var(--kk-side-hover); }
.kk-nav a.active { background: var(--kk-side-active); font-weight: 600; }
.kk-nav a.active .bi { color: var(--kk-side-fg); }
.kk-nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--wattle-orange); }
.kk-nav .kk-caret { margin-left: auto; font-size: 11px !important; transition: transform .15s ease; }
.kk-nav button.kk-nav-link[aria-expanded="true"] .kk-caret { transform: rotate(180deg); }
.kk-subnav { list-style: none; margin: 2px 0 4px; padding: 0 0 0 29px; display: flex; flex-direction: column; gap: 1px; }
.kk-subnav a { font-size: 13px; padding: 6px 10px; color: var(--kk-side-muted); font-weight: 500; }
.kk-subnav a:hover { color: var(--kk-side-fg); }
.kk-subnav a.active { color: var(--kk-side-fg); }
.kk-subnav a.active::before { left: -41px; }
.kk-sidebar-foot { margin-top: auto; padding: 14px 20px 18px; border-top: 1px solid rgba(244, 241, 234, .12); font-size: 12px; color: var(--kk-side-muted); }
.kk-sidebar-foot a { color: var(--kk-side-muted) !important; }

.kk-workspace { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.kk-topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 28px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--border-subtle); }
.kk-topbar .kk-menu-btn { display: none; }
.kk-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: var(--radius-full); border: 1px solid var(--border-subtle);
  background: var(--raised); color: var(--text); font-size: 14px; font-weight: 600; max-width: 340px; }
.kk-chip:hover, .kk-chip[aria-expanded="true"] { border-color: var(--border); background: var(--raised); color: var(--text); }
.kk-chip .kk-chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kk-chip.dropdown-toggle::after { margin-left: 2px; border-top-color: var(--text-muted); }
.kk-avatar { width: 28px; height: 28px; flex: 0 0 28px; border-radius: var(--radius-full); background: var(--surface); color: var(--text); display: grid; place-items: center;
  font-size: 12px; font-weight: 600; letter-spacing: .02em; border: 1px solid var(--border-subtle); }
.kk-avatar.kk-avatar--org { background: var(--slate); color: var(--parchment); border-color: var(--slate); border-radius: 8px; }
.kk-topbar .dropdown-menu { min-width: 240px; }
.kk-main { padding: 28px 28px 40px; width: 100%; max-width: 1360px; margin: 0 auto; flex: 1 0 auto; }
.kk-main.container-fluid { max-width: none; }
.kk-banner { font-size: 13px; padding: 7px 28px; border-bottom: 1px solid var(--border-subtle); display: flex; gap: 8px; align-items: center; justify-content: center; }
.kk-footer { padding: 0 28px 24px; font-size: 12px; color: var(--text-muted); }

@media (max-width: 991.98px) {
  .kk-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1045; transform: translateX(-100%); transition: transform .2s ease; }
  .kk-sidebar.show { transform: none; }
  .kk-scrim { position: fixed; inset: 0; background: rgba(17, 19, 23, .45); z-index: 1040; display: none; }
  .kk-scrim.show { display: block; }
  .kk-topbar { padding: 10px 16px; }
  .kk-topbar .kk-menu-btn { display: inline-flex; }
  .kk-main { padding: 20px 16px 32px; }
  .kk-banner, .kk-footer { padding-left: 16px; padding-right: 16px; }
  .kk-chip { max-width: 200px; }
}
@media (max-width: 575.98px) { .kk-chip .kk-chip-text.kk-hide-xs { display: none; } }

/* Page header */
.kk-page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 24px; }
.kk-page-header h1 { margin: 0; font-size: 34px; line-height: 40px; }
.kk-page-header .kk-subtitle { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.kk-page-header .kk-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Stat tiles */
.kk-stat { padding: 18px 20px !important; }
.kk-stat .kk-eyebrow { margin-bottom: 8px; }
.stat { font-family: var(--font-sans); font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

/* Unauthenticated pages */
.kk-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.kk-auth-art { background: var(--slate); color: var(--parchment); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.kk-auth-art .kk-brand { padding: 0; }
.kk-auth-art .kk-auth-quote { font-family: var(--font-serif); font-weight: 500; font-size: 44px; line-height: 50px; letter-spacing: -.01em; max-width: 12ch; }
.kk-auth-art .kk-wattles { position: absolute; right: -60px; bottom: -60px; width: 340px; height: 340px; border-radius: 50%; background: var(--mask); }
.kk-auth-art .kk-wattles::before { content: ""; position: absolute; width: 96px; height: 96px; border-radius: 50%; background: var(--wattle-blue); left: 70px; top: 90px; }
.kk-auth-art .kk-wattles::after { content: ""; position: absolute; width: 44px; height: 44px; border-radius: 50%; background: var(--wattle-orange); left: 190px; top: 70px; }
.kk-auth-body { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 20px; }
.kk-auth-body > main { width: 100%; max-width: 420px; }
.kk-auth-foot { padding: 16px; font-size: 12px; text-align: center; color: var(--text-muted); }
@media (max-width: 899.98px) { .kk-auth { grid-template-columns: 1fr; } .kk-auth-art { display: none; } }
.login-wrap { max-width: 420px; margin: 0 auto; }
.login-wrap.card { background: transparent; border: 0; padding: 0 !important; }
.login-wrap h1 { font-size: 32px; line-height: 38px; margin-bottom: 24px !important; }
.kk-auth-mobile-brand { display: none; margin-bottom: 28px; color: var(--text) !important; }
@media (max-width: 899.98px) { .kk-auth-mobile-brand { display: flex; padding: 0; } .kk-auth-mobile-brand .kk-brand-name { color: var(--text); } }

/* Public pages (signing, voting) */
.kk-public-bar { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: var(--slate); color: var(--parchment); }
.kk-public-bar .kk-brand { padding: 0; }
.kk-public-bar .kk-brand-name { font-size: 18px; }

/* select caret readable on the dark theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .form-select { --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23a9b6c9' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
}
[data-theme="dark"] .form-select { --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23a9b6c9' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }

/* wide tables scroll inside their card instead of widening the page */
.card:has(> .table) { overflow-x: auto; }
.kk-main { overflow-x: clip; }
