/* ==========================================================================
   GreyOak CRM — "survey plan" design system in Grey Oak's brand colours
   (greyoak.co.ke logo: green #119447, forest #002f13, sun gold #fac615).
   Calm and precise, like a land register: forest ink, mineral paper, hairline
   rules. The one expressive element is the sidebar's faint contour lines.
   ========================================================================== */

@font-face {
    font-family: "Instrument Sans";
    font-style: normal;
    font-weight: 400 700;
    font-stretch: 75% 100%;
    font-display: swap;
    src: url("lib/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Instrument Sans";
    font-style: italic;
    font-weight: 400 700;
    font-display: swap;
    src: url("lib/fonts/instrument-sans-latin-wght-italic.woff2") format("woff2");
}

:root {
    /* Palette */
    --go-forest: #002f13;       /* brand forest: sidebar, sign-in field */
    --go-ink: #12291c;          /* forest ink: headings, body text */
    --go-ink-2: #3b4a41;        /* secondary text */
    --go-muted: #66736b;        /* labels, hints */
    --go-paper: #f4f6f3;        /* page background */
    --go-surface: #ffffff;
    --go-tint: #edf1ec;         /* table heads, hover */
    --go-rule: #dfe5de;         /* hairlines */
    --go-rule-strong: #cdd6cc;
    --go-green: #119447;        /* brand green, as in the logo */
    --go-primary: #0e7a3b;      /* brand green deepened so white text passes AA */
    --go-primary-dark: #0a6530;
    --go-gold: #fac615;         /* brand sun gold: active place, markers */
    --go-oak: #7a5c00;          /* gold as text, readable on white */
    --go-oak-soft: #fdf4d3;

    /* Status tones: background / text; dots use the text colour */
    --go-good-bg: #e5f1ea;  --go-good: #1f6b43;
    --go-info-bg: #e3eef6;  --go-info: #1f5a85;
    --go-warn-bg: #fbf0d9;  --go-warn: #8a5a00;
    --go-bad-bg: #fbe6e3;   --go-bad: #a2332a;
    --go-idle-bg: #eceeea;  --go-idle: #56625f;

    /* Type scale (1.2) */
    --go-fs-xs: 0.75rem;
    --go-fs-sm: 0.8125rem;
    --go-fs-base: 0.9375rem;
    --go-fs-lg: 1.125rem;
    --go-fs-xl: 1.5rem;

    --go-radius: 8px;
    --go-radius-sm: 6px;

    /* Bootstrap hooks */
    --bs-body-font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-font-size: var(--go-fs-base);
    --bs-body-color: var(--go-ink);
    --bs-body-bg: var(--go-paper);
    --bs-secondary-color: var(--go-muted);
    --bs-border-color: var(--go-rule);
    --bs-primary: var(--go-primary);
    --bs-primary-rgb: 14, 122, 59;
    --bs-link-color: var(--go-primary);
    --bs-link-color-rgb: 14, 122, 59;
    --bs-link-hover-color: var(--go-primary-dark);
    --bs-link-hover-color-rgb: 10, 101, 48;
    --bs-border-radius: var(--go-radius-sm);
    --bs-focus-ring-color: rgba(17, 148, 71, 0.35);
}

html, body {
    background: var(--go-paper);
    color: var(--go-ink);
    font-family: var(--bs-body-font-family);
    font-size: var(--go-fs-base);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "ss01" on;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--go-ink);
    font-weight: 600;
    letter-spacing: -0.01em;
}

h1:focus {
    outline: none;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.text-muted, .form-text {
    color: var(--go-muted) !important;
}

/* Figures line up in columns everywhere numbers appear. */
.num, .table td.text-end, .stat-value, .data-grid td.col-justify-end {
    font-variant-numeric: tabular-nums;
}

/* --- Buttons and forms ---------------------------------------------------- */

.btn {
    --bs-btn-font-weight: 500;
    --bs-btn-font-size: var(--go-fs-sm);
    --bs-btn-padding-y: 0.45rem;
    --bs-btn-padding-x: 0.85rem;
    --bs-btn-border-radius: var(--go-radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-sm {
    --bs-btn-padding-y: 0.25rem;
    --bs-btn-padding-x: 0.55rem;
    --bs-btn-font-size: var(--go-fs-xs);
}

.btn-lg {
    --bs-btn-font-size: var(--go-fs-base);
    --bs-btn-padding-y: 0.6rem;
    --bs-btn-padding-x: 1.1rem;
}

.btn-primary {
    --bs-btn-bg: var(--go-primary);
    --bs-btn-border-color: var(--go-primary);
    --bs-btn-hover-bg: var(--go-primary-dark);
    --bs-btn-hover-border-color: var(--go-primary-dark);
    --bs-btn-active-bg: var(--go-primary-dark);
    --bs-btn-active-border-color: var(--go-primary-dark);
    --bs-btn-disabled-bg: var(--go-primary);
    --bs-btn-disabled-border-color: var(--go-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--go-primary);
    --bs-btn-border-color: var(--go-primary);
    --bs-btn-hover-bg: var(--go-primary);
    --bs-btn-hover-border-color: var(--go-primary);
    --bs-btn-active-bg: var(--go-primary-dark);
}

.btn-outline-secondary {
    --bs-btn-color: var(--go-ink-2);
    --bs-btn-border-color: var(--go-rule-strong);
    --bs-btn-bg: var(--go-surface);
    --bs-btn-hover-color: var(--go-ink);
    --bs-btn-hover-bg: var(--go-tint);
    --bs-btn-hover-border-color: var(--go-rule-strong);
    --bs-btn-active-color: var(--go-ink);
    --bs-btn-active-bg: var(--go-rule);
    --bs-btn-active-border-color: var(--go-rule-strong);
}

.btn-oak {
    --bs-btn-color: var(--go-forest);
    --bs-btn-bg: var(--go-gold);
    --bs-btn-border-color: var(--go-gold);
    --bs-btn-hover-color: var(--go-forest);
    --bs-btn-hover-bg: #e9b400;
    --bs-btn-hover-border-color: #e9b400;
    --bs-btn-active-color: var(--go-forest);
    --bs-btn-active-bg: #d6a500;
    --bs-btn-disabled-color: var(--go-forest);
    --bs-btn-disabled-bg: var(--go-gold);
    --bs-btn-disabled-border-color: var(--go-gold);
}

.btn-link {
    --bs-btn-color: var(--go-primary);
    --bs-btn-hover-color: var(--go-primary-dark);
}

.btn-secondary {
    --bs-btn-bg: var(--go-ink);
    --bs-btn-border-color: var(--go-ink);
    --bs-btn-hover-bg: #1d3d2a;
    --bs-btn-hover-border-color: #1d3d2a;
    --bs-btn-active-bg: var(--go-ink);
    --bs-btn-active-border-color: var(--go-ink);
}

.btn-link {
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Bootstrap's bright text colours, brought onto the palette. */
.text-success { color: var(--go-good) !important; }
.text-danger { color: var(--go-bad) !important; }
.text-warning { color: var(--go-warn) !important; }
.text-info { color: var(--go-info) !important; }

/* Icon-only row actions: quiet until pointed at. */
.btn-icon {
    --bs-btn-padding-y: 0.3rem;
    --bs-btn-padding-x: 0.45rem;
    --bs-btn-color: var(--go-muted);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--go-ink);
    --bs-btn-hover-bg: var(--go-tint);
    --bs-btn-hover-border-color: var(--go-rule);
    --bs-btn-active-bg: var(--go-rule);
    line-height: 1;
}

.btn-icon.danger {
    --bs-btn-hover-color: var(--go-bad);
    --bs-btn-hover-bg: var(--go-bad-bg);
    --bs-btn-hover-border-color: transparent;
}

.btn-icon.good {
    --bs-btn-hover-color: var(--go-good);
    --bs-btn-hover-bg: var(--go-good-bg);
    --bs-btn-hover-border-color: transparent;
}

.form-control, .form-select {
    border-color: var(--go-rule-strong);
    font-size: var(--go-fs-sm);
    padding: 0.45rem 0.7rem;
    background-color: var(--go-surface);
}

.form-select {
    padding-right: 2.1rem;
}

.form-label {
    font-size: var(--go-fs-sm);
    font-weight: 500;
    color: var(--go-ink-2);
    margin-bottom: 0.3rem;
}

.form-check-input:checked {
    background-color: var(--go-primary);
    border-color: var(--go-primary);
}

.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus, a:focus-visible,
.data-grid button.col-title:focus-visible, .paginator nav button:focus-visible {
    outline: none;
    border-color: var(--go-green);
    box-shadow: 0 0 0 3px rgba(17, 148, 71, 0.28);
}

/* A search field with its icon inside. */
.search-field {
    position: relative;
    min-width: 220px;
}

.search-field .bi {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--go-muted);
    pointer-events: none;
    font-size: 0.85rem;
}

.search-field .form-control {
    padding-left: 2rem;
}

/* --- Layout: sidebar ------------------------------------------------------ */

.sidebar {
    background-color: var(--go-forest) !important;
    /* Contour lines: the land the business sells, drawn faintly. */
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520' viewBox='0 0 520 520'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.045' stroke-width='1'%3E%3Cpath d='M-20 120 C 80 60 180 170 280 110 S 460 40 560 100'/%3E%3Cpath d='M-20 160 C 90 100 170 215 290 150 S 450 90 560 140'/%3E%3Cpath d='M-20 205 C 100 150 170 255 300 195 S 440 140 560 185'/%3E%3Cpath d='M-20 250 C 110 205 180 300 310 245 S 440 190 560 235'/%3E%3Cpath d='M-20 300 C 120 260 190 345 320 295 S 450 245 560 285'/%3E%3Cpath d='M-20 350 C 125 315 205 395 330 345 S 455 300 560 335'/%3E%3Cpath d='M-20 400 C 130 370 215 440 340 395 S 460 355 560 385'/%3E%3Cellipse cx='392' cy='96' rx='44' ry='22'/%3E%3Cellipse cx='392' cy='96' rx='22' ry='10'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 520px 520px;
    background-repeat: repeat;
}

.sidebar .top-row {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar .navbar-brand {
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.sidebar .brand-logo {
    height: 2.5rem;
    width: auto;
}

.sidebar .brand-tag {
    color: var(--go-gold);
    font-size: var(--go-fs-xs);
    font-weight: 600;
    letter-spacing: 0.12em;
    border: 1px solid rgba(250, 198, 21, 0.45);
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
}

@media (min-width: 641px) {
    /* A taller brand row so the logo's wordmark stays legible. */
    .sidebar .top-row {
        height: 5.5rem;
    }

    .sidebar .brand-logo {
        height: 4.25rem;
    }

    .sidebar .nav-scrollable {
        height: calc(100vh - 5.5rem) !important;
    }
}

.sidebar .nav-section {
    color: rgba(255, 255, 255, 0.42);
    font-size: var(--go-fs-xs);
    font-weight: 500;
    padding: 1.1rem 1.5rem 0.3rem;
}

.sidebar .nav-item {
    font-size: var(--go-fs-sm);
    padding: 0 0.75rem 1px;
}

.sidebar .nav-item:first-child {
    padding-top: 0.75rem;
}

.sidebar .nav-item .nav-link {
    color: rgba(255, 255, 255, 0.74);
    border-radius: var(--go-radius-sm);
    height: 2.15rem;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    position: relative;
    text-decoration: none;
}

.sidebar .nav-item .nav-link .bi {
    font-size: 0.95rem;
    opacity: 0.8;
}

.sidebar .nav-item .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #fff;
}

/* The active page carries the oak marker. */
.sidebar .nav-item a.active {
    background-color: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.sidebar .nav-item a.active::before {
    content: "";
    position: absolute;
    left: -0.75rem;
    top: 0.35rem;
    bottom: 0.35rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--go-gold);
}

.sidebar .nav-item a.active .bi {
    opacity: 1;
    color: var(--go-gold);
}

/* --- Layout: top bar and content ---------------------------------------- */

main > .top-row {
    background: var(--go-surface) !important;
    border-bottom: 1px solid var(--go-rule) !important;
    height: 3.25rem !important;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--go-ink-2);
    font-size: var(--go-fs-sm);
}

.avatar {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: var(--go-oak-soft);
    color: var(--go-oak);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--go-fs-xs);
}

.content {
    max-width: 1560px;
    padding-top: 1.5rem !important;
    padding-bottom: 3rem !important;
}

.page-header h1 {
    font-size: var(--go-fs-xl);
    line-height: 1.2;
}

.page-header .page-subtitle {
    color: var(--go-muted);
    font-size: var(--go-fs-sm);
    margin-top: 0.15rem;
}

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

.card {
    --bs-card-border-color: var(--go-rule);
    --bs-card-border-radius: var(--go-radius);
    --bs-card-inner-border-radius: calc(var(--go-radius) - 1px);
    --bs-card-cap-bg: var(--go-surface);
    --bs-card-cap-padding-y: 0.75rem;
    --bs-card-cap-padding-x: 1rem;
    box-shadow: none;
}

.card-header {
    font-weight: 600;
    font-size: var(--go-fs-sm);
    color: var(--go-ink);
}

.list-group {
    --bs-list-group-border-color: var(--go-rule);
    --bs-list-group-action-hover-bg: var(--go-tint);
}

.stat-card .card-body {
    padding: 0.9rem 1rem;
}

.stat-card .stat-label {
    color: var(--go-muted);
    font-size: var(--go-fs-sm);
    font-weight: 500;
}

.stat-card .stat-value {
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.25;
    margin-top: 0.15rem;
    letter-spacing: -0.01em;
}

a.stat-card:hover {
    text-decoration: none;
    border-color: var(--go-rule-strong);
}

/* --- Status pills ---------------------------------------------------------- */

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.12rem 0.55rem 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: var(--go-fs-xs);
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    background: var(--go-idle-bg);
    color: var(--go-idle);
}

.status {
    align-self: flex-start;
}

.status::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}

.status.tone-good { background: var(--go-good-bg); color: var(--go-good); }
.status.tone-info { background: var(--go-info-bg); color: var(--go-info); }
.status.tone-warn { background: var(--go-warn-bg); color: var(--go-warn); }
.status.tone-bad  { background: var(--go-bad-bg);  color: var(--go-bad); }
.status.tone-idle { background: var(--go-idle-bg); color: var(--go-idle); }
.status.tone-plain { background: transparent; color: var(--go-ink-2); border: 1px solid var(--go-rule-strong); }
.status.tone-plain::before { display: none; }

/* Bootstrap badges that remain (counts in tabs, notification bell). */
.badge {
    font-weight: 500;
}

/* --- Tables: one look for QuickGrid and plain tables ---------------------- */

.grid-card, .table-card {
    background: var(--go-surface);
    border: 1px solid var(--go-rule);
    border-radius: var(--go-radius);
    overflow: hidden;
}

/* Plain tables have no inner scroller, so the card scrolls sideways itself. */
.table-card {
    overflow-x: auto;
}

.grid-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--go-rule);
}

.grid-toolbar .form-select {
    width: auto;
}

.grid-toolbar .search-field .form-control {
    width: 100%;
}

.grid-toolbar .form-check {
    margin: 0 0.25rem;
    font-size: var(--go-fs-sm);
}

.grid-toolbar-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: var(--go-fs-sm);
    color: var(--go-ink-2);
}

.grid-scroll {
    overflow-x: auto;
    max-height: calc(100vh - 16rem);
    overflow-y: auto;
}

.grid-card.no-cap .grid-scroll {
    max-height: none;
}

.grid-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--go-muted);
    font-size: var(--go-fs-sm);
}

.grid-empty .bi {
    display: block;
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
    color: var(--go-rule-strong);
}

.grid-footer {
    border-top: 1px solid var(--go-rule);
    background: var(--go-surface);
}

/* Shared cell look. `.data-grid` is QuickGrid; `.table` covers plain tables. */
.grid-card table, .table-card table, .card .table {
    width: 100%;
    margin: 0;
    font-size: var(--go-fs-sm);
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--go-tint);
    --bs-table-border-color: var(--go-rule);
    --bs-table-color: var(--go-ink);
    border-collapse: separate;
    border-spacing: 0;
}

.grid-card thead th, .table-card thead th, .card .table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--go-tint);
    color: var(--go-ink-2);
    font-size: var(--go-fs-xs);
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--go-rule-strong);
    vertical-align: middle;
}

.grid-card tbody td, .table-card tbody td, .card .table tbody td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--go-rule);
    vertical-align: middle;
}

.grid-card tbody tr:last-child td, .table-card tbody tr:last-child td, .card .table tbody tr:last-child td {
    border-bottom: 0;
}

.grid-card tbody tr:hover td, .table-card tbody tr:hover td {
    background: #f8f9f6;
}

.table-sm > :not(caption) > * > * {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.grid-card tfoot td, .grid-card tfoot th, .table-card tfoot td, .table-card tfoot th {
    padding: 0.65rem 0.9rem;
    border-top: 1px solid var(--go-rule-strong);
    background: var(--go-tint);
    font-weight: 600;
}

/* QuickGrid headers: every column looks the same; sortable ones just gain a caret. */
.grid-card .data-grid .col-header-content {
    gap: 0.25rem;
}

.grid-card .data-grid button.col-title,
.grid-card .data-grid div.col-title {
    font: inherit;
    color: inherit;
    padding: 0;
    gap: 0.3rem;
    align-items: center;
}

.grid-card .data-grid button.col-title:hover {
    color: var(--go-ink);
}

.grid-card .data-grid th .sort-indicator {
    width: 0.65rem;
    height: 0.65rem;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.55;
}

/* A faint caret on sortable-but-unsorted columns, shown on hover. */
.grid-card .data-grid th[aria-sort="none"] button.col-title:hover .sort-indicator {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M 2 3.25 L 12 20.75 L 22 3.25 L 12 10 z' fill='%236b777b'/></svg>");
    opacity: 0.35;
}

.grid-card .data-grid th.col-justify-end .col-header-content {
    justify-content: flex-end;
}

.grid-card .data-grid td.col-justify-end {
    text-align: right;
}

/* QuickGrid pads short pages with empty rows to keep a constant height; hide them. */
.grid-card .data-grid tbody tr:not(:has(> td:not(:empty))) {
    display: none;
}

/* Cell patterns */
.cell-main {
    font-weight: 600;
    color: var(--go-ink);
}

a.cell-main:hover {
    color: var(--go-primary);
}

.cell-sub {
    display: block;
    color: var(--go-muted);
    font-size: var(--go-fs-xs);
    margin-top: 0.1rem;
    white-space: nowrap;
}

.cell-id {
    color: var(--go-muted);
    font-variant-numeric: tabular-nums;
}

.cell-nowrap {
    white-space: nowrap;
}

.cell-overdue {
    color: var(--go-bad);
    font-weight: 600;
}

.cell-actions {
    white-space: nowrap;
    text-align: right;
}

/* Paginator (extra specificity: QuickGrid's own scoped CSS loads after this file). */
.grid-card .grid-footer .paginator {
    margin: 0;
    border: 0;
    padding: 0.5rem 0.9rem;
    font-size: var(--go-fs-sm);
    color: var(--go-ink-2);
}

.grid-card .grid-footer .paginator .summary strong,
.grid-card .grid-footer .paginator .pagination-text strong {
    font-weight: 600;
    color: var(--go-ink);
}

.grid-card .grid-footer .paginator nav {
    gap: 0.25rem;
}

.grid-card .grid-footer .paginator nav button {
    width: 1.9rem;
    height: 1.9rem;
    border: 1px solid var(--go-rule) !important;
    border-radius: var(--go-radius-sm);
    background-color: var(--go-surface);
    background-size: 0.7rem;
}

.grid-card .grid-footer .paginator nav button:not([disabled]):hover {
    background-color: var(--go-tint);
    border-color: var(--go-rule-strong) !important;
}

.grid-card .grid-footer .paginator nav button[disabled] {
    opacity: 0.35;
}

/* --- Pipeline, timeline, units --------------------------------------------- */

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

.timeline > li {
    position: relative;
    padding: 0 0 1.1rem 1.75rem;
    border-left: 1px solid var(--go-rule-strong);
    margin-left: 0.6rem;
}

.timeline > li:last-child {
    border-left-color: transparent;
}

.timeline > li > .dot {
    position: absolute;
    left: -0.7rem;
    top: -0.1rem;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: var(--go-surface);
    border: 1px solid var(--go-rule-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--go-oak);
}

.board {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(200px, 1fr);
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.board-column {
    background: var(--go-tint);
    border: 1px solid var(--go-rule);
    border-radius: var(--go-radius);
    padding: 0.6rem;
    min-height: 320px;
}

.board-card {
    background: var(--go-surface);
    border-radius: var(--go-radius-sm);
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--go-rule);
    font-size: var(--go-fs-sm);
}

.unit-tile {
    border-radius: var(--go-radius);
    border: 1px solid var(--go-rule);
    background: var(--go-surface);
    padding: 0.7rem 0.85rem;
    border-left-width: 4px;
}

.unit-tile.status-Available { border-left-color: var(--go-good); }
.unit-tile.status-Held { border-left-color: var(--go-info); }
.unit-tile.status-Reserved { border-left-color: #c58a12; }
.unit-tile.status-Sold { border-left-color: var(--go-idle); }
.unit-tile.status-Withdrawn { border-left-color: var(--go-ink); opacity: 0.75; }

/* --- Dialogs, toasts, nav tabs ----------------------------------------------- */

.modal {
    background: transparent;
}

.modal-backdrop.show {
    opacity: 0.4;
    background: var(--go-ink);
}

.modal-content {
    border: 1px solid var(--go-rule);
    border-radius: 10px;
    box-shadow: 0 18px 48px rgba(0, 47, 19, 0.18);
}

.modal-header, .modal-footer {
    border-color: var(--go-rule);
}

.nav-tabs {
    --bs-nav-tabs-border-color: var(--go-rule);
    --bs-nav-tabs-link-active-color: var(--go-ink);
    --bs-nav-tabs-link-active-border-color: var(--go-rule) var(--go-rule) var(--go-surface);
    --bs-nav-link-color: var(--go-ink-2);
    --bs-nav-link-hover-color: var(--go-ink);
    font-size: var(--go-fs-sm);
}

.nav-tabs .nav-link.active {
    font-weight: 600;
    box-shadow: inset 0 2px 0 var(--go-gold);
}

.toast {
    border-radius: var(--go-radius);
    font-size: var(--go-fs-sm);
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 47, 19, 0.2);
}

.toast-good { background: var(--go-primary); }
.toast-bad { background: var(--go-bad); }
.toast-info { background: var(--go-ink); }

.dropdown-menu {
    --bs-dropdown-border-color: var(--go-rule);
    --bs-dropdown-link-hover-bg: var(--go-tint);
    font-size: var(--go-fs-sm);
    box-shadow: 0 8px 24px rgba(0, 47, 19, 0.12);
}

/* --- Framework hooks kept from the template -------------------------------- */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid var(--go-bad);
}

.validation-message {
    color: var(--go-bad);
    font-size: var(--go-fs-xs);
}

.blazor-error-boundary {
    background: var(--go-bad);
    padding: 1rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

@media (max-width: 640.98px) {
    .grid-toolbar > * {
        flex: 1 1 100%;
    }

    .grid-toolbar-end {
        margin-left: 0;
    }

    .grid-scroll {
        max-height: none;
    }
}

/* QR codes (two-factor set-up) scale to their box. */
[data-qr] {
    background: #fff;
    border: 1px solid var(--go-rule);
    border-radius: var(--go-radius-sm);
    padding: 6px;
    flex: none;
}

[data-qr] svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* ---- Approval rule notes (complete sale) -------------------------------- */
.approval-note {
    display: flex; gap: .5rem; align-items: flex-start;
    margin-top: .5rem; padding: .5rem .75rem;
    border-radius: 6px; font-size: .875rem;
    border-left: 3px solid currentColor;
}
.approval-note > i { margin-top: .1rem; }
.approval-note .btn-link { font-size: inherit; }
.approval-note.tone-good { background: var(--go-good-bg); color: var(--go-good); }
.approval-note.tone-warn { background: var(--go-warn-bg); color: var(--go-warn); }
.approval-note.tone-bad  { background: var(--go-bad-bg);  color: var(--go-bad); }

/* ---- Site visits: agenda, seats, passes ---------------------------------- */
.agenda-day { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.agenda-date { text-align: center; padding-top: .35rem; line-height: 1.1; color: var(--go-ink-2); }
.agenda-date .d { display: block; font-size: 1.75rem; font-weight: 600; color: var(--go-ink); }
.agenda-date .w { font-size: var(--go-fs-xs); }
.agenda-date.today .d { color: var(--go-primary); }
.agenda-list { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }

.visit-row {
    display: grid; grid-template-columns: 4rem minmax(0, 1fr) minmax(9rem, 14rem); gap: 1rem; align-items: center;
    background: var(--go-surface); border: 1px solid var(--go-rule); border-radius: var(--go-radius);
    padding: .75rem 1rem; color: inherit; text-decoration: none;
}
a.visit-row:hover { border-color: var(--go-rule-strong); background: var(--go-tint); }
.visit-row.is-cancelled { opacity: .6; }
.visit-row .time { font-weight: 600; font-variant-numeric: tabular-nums; }
.visit-row .title { font-weight: 600; }
.visit-row .meta { font-size: var(--go-fs-sm); color: var(--go-muted); }
@media (max-width: 640px) {
    .agenda-day { grid-template-columns: 1fr; gap: .25rem; }
    .agenda-date { text-align: left; }
    .agenda-date .d { display: inline; font-size: var(--go-fs-lg); margin-right: .35rem; }
    .visit-row { grid-template-columns: 3.25rem minmax(0, 1fr); }
    .visit-row .seats { grid-column: 1 / -1; }
}

/* Seats as a coach seat map when small enough to count, else a bar. */
.seats .seat-label { font-size: var(--go-fs-xs); color: var(--go-muted); margin-bottom: .25rem; font-variant-numeric: tabular-nums; }
.seat-map { display: flex; flex-wrap: wrap; gap: 3px; }
.seat-map i { width: 9px; height: 9px; border-radius: 2px; background: var(--go-tint); border: 1px solid var(--go-rule-strong); }
.seat-map i.taken { background: var(--go-primary); border-color: var(--go-primary); }
.seat-map i.here { background: var(--go-gold); border-color: var(--go-oak); }
.seat-bar { height: 6px; border-radius: 3px; background: var(--go-tint); overflow: hidden; }
.seat-bar span { display: block; height: 100%; background: var(--go-primary); }
.seats.full .seat-label { color: var(--go-bad); font-weight: 600; }

.interest { display: inline-flex; gap: 2px; }
.interest i { width: 8px; height: 8px; border-radius: 50%; background: var(--go-rule-strong); }
.interest i.on { background: var(--go-oak); }
.interest-picker .btn { min-width: 2.5rem; }

.check-in-card { max-width: 30rem; margin: 0 auto; }
.check-in-card .who { font-size: var(--go-fs-xl); font-weight: 600; }

.passes { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; }
.pass {
    border: 1px dashed var(--go-rule-strong); border-radius: var(--go-radius); background: var(--go-surface);
    padding: .75rem; display: grid; grid-template-columns: 6.5rem 1fr; gap: .75rem; align-items: center; break-inside: avoid;
}
.pass .qr { width: 6.5rem; height: 6.5rem; }
.pass .qr svg { width: 100%; height: 100%; }
.pass .name { font-weight: 600; }
.pass .code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; font-size: var(--go-fs-sm); }
@media print {
    .sidebar, .top-row, .page-header .btn, .no-print, #blazor-error-ui { display: none !important; }
    main, .content, article { margin: 0 !important; padding: 0 !important; }
    body { background: #fff; }
    .pass-group { break-before: auto; }
}
