/* ==========================================================================
   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 {
    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;
}

/* Pager under lists: summary, rows per page, page numbers. */
.go-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.55rem 0.9rem;
    font-size: var(--go-fs-sm);
    color: var(--go-ink-2);
}
.go-pager-summary { margin-right: auto; font-weight: 500; }
.go-pager-size { display: flex; align-items: center; gap: 0.4rem; margin: 0; color: var(--go-muted); }
.go-pager-size .form-select { width: auto; padding-top: 0.2rem; padding-bottom: 0.2rem; }
.go-pager .pagination { gap: 0.25rem; flex-wrap: wrap; }
.go-pager .page-link {
    min-width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.55rem;
    border: 1px solid var(--go-rule) !important;
    border-radius: var(--go-radius-sm) !important;
    background: var(--go-surface);
    color: var(--go-ink);
    font-weight: 500;
}
.go-pager .page-link:hover { background: var(--go-tint); border-color: var(--go-rule-strong) !important; color: var(--go-ink); }
.go-pager .page-item.active .page-link { background: var(--go-primary); border-color: var(--go-primary) !important; color: #fff; }
.go-pager .page-item.disabled .page-link { opacity: 0.4; background: var(--go-surface); }
.go-pager .page-link:focus-visible { outline: 2px solid var(--go-primary); outline-offset: 1px; box-shadow: none; }
.card > .go-pager, .grid-card .grid-footer .go-pager { border-top: 1px solid var(--go-rule); }
.grid-card .grid-footer .go-pager { border-top: 0; }

/* --- 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; }
}

/* ---- Site plan: live plot map -------------------------------------------- */
.plan-frame { background: var(--go-surface); border: 1px solid var(--go-rule); border-radius: var(--go-radius); overflow: auto; max-height: 78vh; }
.site-plan { display: block; width: 100%; height: auto; }
.site-plan .plan-ground { fill: #eef2ea; }
.site-plan .plot {
    stroke: #ffffff; stroke-width: 1.5; vector-effect: non-scaling-stroke; fill-opacity: .62;
    cursor: pointer; transition: fill-opacity .15s;
}
.site-plan .plot:hover, .site-plan .plot:focus-visible { fill-opacity: .85; outline: none; }
.site-plan .plot.st-available { fill: #1f8a4c; }
.site-plan .plot.st-held      { fill: #2f6fb0; }
.site-plan .plot.st-reserved  { fill: #d99a0b; }
.site-plan .plot.st-sold      { fill: #5c6660; }
.site-plan .plot.st-withdrawn { fill: #b8bdb9; fill-opacity: .5; }
.site-plan .plot.is-dim { fill-opacity: .12; }
.site-plan .plot.is-selected { stroke: var(--go-gold); stroke-width: 4; fill-opacity: .9; }
.site-plan.is-drawing { cursor: crosshair; }
.site-plan.is-drawing .plot { pointer-events: none; fill-opacity: .35; }
.site-plan .plot-label { fill: #fff; font-weight: 600; pointer-events: none; paint-order: stroke; stroke: rgba(0, 0, 0, .45); stroke-width: 2px; }
.site-plan .draft { fill: rgba(250, 198, 21, .35); stroke: var(--go-oak); stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
.site-plan .draft-point { fill: var(--go-gold); stroke: var(--go-oak); stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }

.plan-legend { display: flex; flex-wrap: wrap; gap: .4rem; }
.plan-legend button {
    display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--go-rule-strong); background: var(--go-surface);
    border-radius: 999px; padding: .2rem .7rem; font-size: var(--go-fs-sm); color: var(--go-ink);
}
.plan-legend button[aria-pressed="false"] { opacity: .45; }
.plan-legend .swatch { width: .75rem; height: .75rem; border-radius: 3px; }
.swatch.st-available { background: #1f8a4c; } .swatch.st-held { background: #2f6fb0; } .swatch.st-reserved { background: #d99a0b; }
.swatch.st-sold { background: #5c6660; } .swatch.st-withdrawn { background: #b8bdb9; }
.live-dot { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--go-fs-xs); color: var(--go-muted); }
.live-dot::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: #1f8a4c; box-shadow: 0 0 0 3px #1f8a4c33; }
.plot-panel { position: sticky; top: 1rem; }
.plot-panel .plot-number { font-size: 1.75rem; font-weight: 600; line-height: 1.1; }
.plot-list { display: flex; flex-wrap: wrap; gap: .3rem; }
.plot-list button { border: 1px solid var(--go-rule-strong); background: var(--go-surface); border-radius: var(--go-radius-sm); padding: .15rem .5rem; font-size: var(--go-fs-sm); }
.plot-list button.done { background: var(--go-good-bg); border-color: transparent; color: var(--go-good); }
.plot-list button.active { outline: 2px solid var(--go-gold); }
@media (prefers-reduced-motion: reduce) { .site-plan .plot { transition: none; } }

/* ---- Pipeline board: dragging ------------------------------------------ */
.board-card[draggable="true"] { cursor: grab; }
.board-card.is-dragging { opacity: .45; }
.board-column.drop-ok { outline: 2px dashed var(--go-primary); outline-offset: -2px; background: var(--go-good-bg); }
.board-column.drop-no { outline: 2px dashed var(--go-rule-strong); outline-offset: -2px; }
.board-drop-lost { flex: 0 0 11rem; align-self: flex-start; border: 1px dashed var(--go-rule-strong); }
.board-drop-lost.drop-ok { background: var(--go-bad-bg); outline-color: var(--go-bad); }
.board-filters { background: var(--go-surface); border: 1px solid var(--go-rule); border-radius: var(--go-radius); }

/* ---- Printable sales documents (offer letters, reservation forms) ------ */
.print-page { background: var(--go-paper); min-height: 100vh; padding: 1.5rem 1rem; }
.doc-actions { max-width: 50rem; margin: 0 auto .75rem; display: flex; gap: .5rem; align-items: center; }
.doc-sheet {
    max-width: 50rem; margin: 0 auto; background: #fff; color: #1b1f1d; padding: 2.5rem 3rem;
    border: 1px solid var(--go-rule); border-radius: var(--go-radius); font-size: .95rem; line-height: 1.55;
}
.doc-letterhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; border-bottom: 3px solid var(--go-primary); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.doc-letterhead img { height: 64px; width: auto; }
.doc-company { text-align: right; font-size: .82rem; color: #4b5550; }
.doc-company strong { color: #1b1f1d; font-size: .95rem; }
.doc-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.doc-title h1 { font-size: 1.5rem; margin: 0; }
.doc-title dl { display: grid; grid-template-columns: auto auto; gap: .1rem .75rem; margin: 0; font-size: .85rem; }
.doc-title dt { color: #4b5550; font-weight: 500; }
.doc-title dd { margin: 0; font-weight: 600; }
.doc-to { margin-bottom: 1.25rem; }
.doc-sheet h2 { font-size: 1rem; margin: 1.5rem 0 .5rem; color: var(--go-primary); }
.doc-table { width: 100%; border-collapse: collapse; margin-bottom: .5rem; }
.doc-table th, .doc-table td { border-bottom: 1px solid #e3e7e4; padding: .35rem .5rem; text-align: left; vertical-align: top; }
.doc-table tbody th { width: 38%; font-weight: 500; color: #4b5550; }
.doc-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.doc-table tr.total th, .doc-table tr.total td { font-weight: 700; color: #1b1f1d; border-top: 2px solid #1b1f1d; }
.doc-fill td { height: 2rem; }
.doc-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 3rem; font-size: .88rem; }
.doc-signatures .line { border-bottom: 1px solid #1b1f1d; height: 2.5rem; margin-bottom: .35rem; }
.doc-signatures span { color: #4b5550; font-size: .8rem; }
.doc-sheet.is-void { position: relative; }
.doc-sheet.is-void::after {
    content: "WITHDRAWN"; position: absolute; inset: 40% 0 auto; text-align: center; font-size: 5rem; font-weight: 800;
    color: rgba(162, 51, 42, .12); transform: rotate(-18deg); pointer-events: none;
}
.doc-void-note { color: var(--go-bad); font-weight: 600; margin-top: 1.5rem; }
@media print {
    .print-page { background: #fff; padding: 0; }
    .doc-sheet { border: 0; padding: 0; max-width: none; }
    @page { margin: 18mm 16mm; }
}
@media (max-width: 640px) {
    .doc-sheet { padding: 1.25rem; }
    .doc-letterhead, .doc-title { flex-direction: column; }
    .doc-company { text-align: left; }
    .doc-signatures { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ---- Command bar (Ctrl+K) ----------------------------------------------- */
.command-trigger { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--go-rule-strong); color: var(--go-muted); background: var(--go-surface); margin-right: auto; }
.command-trigger kbd, .command-input kbd { font-size: .7rem; background: var(--go-tint); color: var(--go-muted); border: 1px solid var(--go-rule); border-radius: 4px; padding: .05rem .3rem; box-shadow: none; }
.command-backdrop { position: fixed; inset: 0; background: rgba(0, 20, 8, .35); z-index: 1080; }
.command-panel {
    position: fixed; top: 10vh; left: 50%; transform: translateX(-50%); width: min(40rem, calc(100vw - 2rem)); z-index: 1081;
    background: var(--go-surface); border-radius: var(--go-radius); box-shadow: 0 18px 48px rgba(0, 0, 0, .25); overflow: hidden;
}
.command-input { display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem; border-bottom: 1px solid var(--go-rule); }
.command-input input { flex: 1; border: 0; outline: 0; font-size: 1rem; background: transparent; }
.command-results { list-style: none; margin: 0; padding: .35rem 0; max-height: 60vh; overflow: auto; }
.command-results li[role="option"] { display: flex; align-items: center; gap: .6rem; padding: .45rem 1rem; cursor: pointer; }
.command-results li.active { background: var(--go-tint); }
.command-group { padding: .5rem 1rem .2rem; font-size: var(--go-fs-xs); color: var(--go-muted); font-weight: 600; }
.command-empty { padding: .75rem 1rem; color: var(--go-muted); font-size: var(--go-fs-sm); }

/* ---- Dashboards ----------------------------------------------------------- */
.dash-tabs { margin-bottom: 1rem; }
.bar-list { display: flex; flex-direction: column; gap: .45rem; }
.bar-row { display: grid; grid-template-columns: minmax(6rem, 9rem) 1fr minmax(4.5rem, auto); gap: .6rem; align-items: center; font-size: var(--go-fs-sm); }
.bar-label { text-align: right; color: var(--go-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 12px; background: var(--go-tint); border-radius: 0 4px 4px 0; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--go-primary); border-radius: 0 4px 4px 0; }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 600; }
.column-chart { margin: 0; }
.column-chart .columns { display: flex; align-items: flex-end; gap: 4px; height: 180px; border-bottom: 1px solid var(--go-rule-strong); }
.column-chart .col-item { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; position: relative; }
.column-chart .col-bar { display: block; background: var(--go-primary); border-radius: 4px 4px 0 0; }
.column-chart .col-item.is-different .col-bar { background: repeating-linear-gradient(45deg, var(--go-bad), var(--go-bad) 3px, #d7837b 3px, #d7837b 6px); }
.column-chart .col-label { position: absolute; bottom: -1.4rem; left: 50%; transform: translateX(-50%); font-size: .68rem; color: var(--go-muted); white-space: nowrap; }
.column-chart .col-item:nth-child(even):not(:first-child) .col-label { visibility: hidden; }
.column-chart { padding-bottom: 1.6rem; }
.dash-table td, .dash-table th { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .bar-row { grid-template-columns: 6rem 1fr auto; } }

/* ---- Live notification pop-ups ------------------------------------------- */
.notice-stack { position: fixed; top: 4rem; right: 1rem; z-index: 1070; display: flex; flex-direction: column; gap: .5rem; width: min(22rem, calc(100vw - 2rem)); }
.notice-popup {
    display: flex; gap: .6rem; align-items: flex-start; background: var(--go-surface); border: 1px solid var(--go-rule);
    border-left: 4px solid var(--go-gold); border-radius: var(--go-radius); padding: .65rem .75rem; box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
    animation: notice-in .2s ease-out;
}
.notice-popup > .bi { color: var(--go-oak); margin-top: .15rem; }
@keyframes notice-in { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
.bell-ring { display: inline-block; animation: bell-ring .6s ease-in-out 2; transform-origin: top center; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(14deg); } 75% { transform: rotate(-14deg); } }
@media (prefers-reduced-motion: reduce) { .notice-popup, .bell-ring { animation: none; } }

/* ---- Public pages: signing, client portal, partner registration --------- */
.public-shell { min-height: 100vh; background: var(--go-paper); display: flex; flex-direction: column; }
.public-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; background: var(--go-surface); border-bottom: 3px solid var(--go-primary); }
.public-head img { height: 44px; width: auto; }
.public-main { flex: 1; width: 100%; max-width: 52rem; margin: 0 auto; padding: 1.25rem 1rem 2rem; }
.public-foot { text-align: center; font-size: .8rem; color: var(--go-muted); padding: 1rem; }
.public-card { background: var(--go-surface); border: 1px solid var(--go-rule); border-radius: var(--go-radius); padding: 1.1rem 1.25rem; }
.public-nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.public-nav a { padding: .35rem .7rem; border-radius: 999px; color: var(--go-ink); text-decoration: none; font-size: .9rem; }
.public-nav a.active, .public-nav a:hover { background: var(--go-primary); color: #fff; }
.doc-esign { border: 1px solid var(--go-primary); border-radius: 6px; padding: .5rem .65rem; margin-bottom: .35rem; font-size: .78rem; color: #4b5550; }
.doc-esign-name { font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 1.35rem; color: #1b1f1d; line-height: 1.2; }
.doc-esign-hash { font-size: .7rem; margin-top: .15rem; }

/* ---- Calendar page -------------------------------------------------------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: hidden; }
.cal-head { padding: .4rem .5rem; font-size: .75rem; font-weight: 600; color: var(--go-muted); background: var(--go-paper); border-bottom: 1px solid var(--go-rule); }
.cal-day { min-height: 7.5rem; padding: .3rem .35rem .4rem; border-right: 1px solid var(--go-rule); border-bottom: 1px solid var(--go-rule); display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.cal-day:nth-child(7n + 7) { border-right: 0; }
.cal-other { background: var(--go-paper); }
.cal-other .cal-date { color: var(--go-muted); }
.cal-date { font-size: .8rem; font-weight: 600; margin-bottom: .1rem; }
.cal-weekday { display: none; }
.cal-today .cal-date { color: #fff; background: var(--go-primary); border-radius: 999px; padding: 0 .45rem; align-self: flex-start; }
.cal-item { display: block; font-size: .72rem; line-height: 1.25; padding: .1rem .3rem; border-radius: 4px; text-decoration: none; color: var(--go-ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid; background: var(--go-paper); }
.cal-item:hover { filter: brightness(.96); }
.cal-FollowUp { border-color: var(--go-primary); }
.cal-SiteVisit { border-color: var(--go-oak); }
.cal-Instalment { border-color: #3d6fb0; }
.cal-overdue { border-color: var(--go-bad); color: var(--go-bad); }
.cal-more { font-size: .72rem; align-self: flex-start; }
.cal-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 2px; vertical-align: middle; }
.cal-dot.cal-FollowUp { background: var(--go-primary); }
.cal-dot.cal-SiteVisit { background: var(--go-oak); }
.cal-dot.cal-Instalment { background: #3d6fb0; }
@media (max-width: 768px) {
    .cal-grid { grid-template-columns: 1fr; }
    .cal-head, .cal-empty { display: none; }
    .cal-day { min-height: 0; border-right: 0; }
    .cal-weekday { display: inline; font-weight: 400; color: var(--go-muted); }
    .cal-item { white-space: normal; font-size: .85rem; }
}

/* ---------- Date and time picker (flatpickr), in the app's colours ---------- */
input.go-date, input.go-time {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2366736b' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 14px;
    padding-right: 2rem;
}
input.go-time {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2366736b' viewBox='0 0 16 16'%3E%3Cpath d='M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71z'/%3E%3Cpath d='M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m7-8A7 7 0 1 1 1 8a7 7 0 0 1 14 0'/%3E%3C/svg%3E");
}
input.go-date:disabled, input.go-time:disabled { background-color: var(--bs-secondary-bg); }
.flatpickr-calendar.go-picker {
    font-family: inherit;
    border: 1px solid var(--go-rule-strong);
    border-radius: var(--go-radius);
    box-shadow: 0 10px 28px rgba(18, 41, 28, 0.16);
    background: var(--go-surface);
}
.go-picker.arrowTop::before, .go-picker.arrowBottom::before { border-bottom-color: var(--go-rule-strong); }
.go-picker .flatpickr-months { padding: 4px 2px 0; }
.go-picker .flatpickr-months .flatpickr-month,
.go-picker .flatpickr-current-month .flatpickr-monthDropdown-months,
.go-picker .flatpickr-current-month input.cur-year { color: var(--go-ink); fill: var(--go-ink); font-weight: 600; }
.go-picker .flatpickr-current-month { font-size: 1rem; }
.go-picker .flatpickr-months .flatpickr-prev-month:hover svg,
.go-picker .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--go-primary); }
.go-picker span.flatpickr-weekday { color: var(--go-muted); font-weight: 600; font-size: var(--go-fs-xs); }
.go-picker .flatpickr-day { color: var(--go-ink); border-radius: var(--go-radius-sm); }
.go-picker .flatpickr-day:hover, .go-picker .flatpickr-day:focus { background: var(--go-tint); border-color: var(--go-tint); }
.go-picker .flatpickr-day.today { border-color: var(--go-gold); }
.go-picker .flatpickr-day.today:hover { background: var(--go-oak-soft); border-color: var(--go-gold); color: var(--go-ink); }
.go-picker .flatpickr-day.selected, .go-picker .flatpickr-day.selected:hover,
.go-picker .flatpickr-day.selected:focus { background: var(--go-primary); border-color: var(--go-primary); color: #fff; }
.go-picker .flatpickr-day.prevMonthDay, .go-picker .flatpickr-day.nextMonthDay { color: var(--go-rule-strong); }
.go-picker .flatpickr-day.flatpickr-disabled, .go-picker .flatpickr-day.flatpickr-disabled:hover { color: var(--go-rule-strong); background: transparent; }
.go-picker .flatpickr-time { border-top: 1px solid var(--go-rule); }
.go-picker.noCalendar .flatpickr-time { border-top: 0; }
.go-picker .flatpickr-time input, .go-picker .flatpickr-time .flatpickr-am-pm { color: var(--go-ink); font-weight: 600; }
.go-picker .flatpickr-time input:hover, .go-picker .flatpickr-time input:focus,
.go-picker .flatpickr-time .flatpickr-am-pm:hover { background: var(--go-tint); }
input.form-control-sm.go-date, input.form-control-sm.go-time { background-position: right 0.45rem center; padding-right: 1.6rem; }

/* ---- Plot-number grid (project page) ------------------------------------ */
.plot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.25rem, 1fr)); gap: .35rem; margin-bottom: .75rem; }
.plot-grid-block { font-size: var(--go-fs-sm); font-weight: 600; color: var(--go-muted); margin: .25rem 0 .35rem; }
.plot-cell {
    border: 0; border-radius: var(--go-radius-sm); padding: .45rem .2rem; min-height: 2.5rem; color: #fff; font-weight: 600;
    font-size: var(--go-fs-sm); line-height: 1.1; overflow-wrap: anywhere; cursor: pointer; transition: transform .1s, opacity .15s;
}
.plot-cell:hover, .plot-cell:focus-visible { transform: translateY(-1px); outline: 2px solid var(--go-ink); outline-offset: 1px; }
.plot-cell.st-available { background: #1f8a4c; }
.plot-cell.st-held      { background: #2f6fb0; }
.plot-cell.st-reserved  { background: #b67f06; }
.plot-cell.st-sold      { background: #5c6660; }
.plot-cell.st-withdrawn { background: #b8bdb9; color: var(--go-ink); }
.plot-cell.is-dim { opacity: .18; }
.plot-cell.is-selected { outline: 3px solid var(--go-gold); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .plot-cell { transition: none; } }

/* ---- Forms framed on the company website -------------------------------- */
.embed-main { padding: 1rem; max-width: 44rem; margin: 0 auto; background: var(--go-surface); }

/* ---- Client portal: new projects ---------------------------------------- */
.portal-project-cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--go-radius-sm); background: var(--go-paper); }
.portal-project-thumb { width: 3.5rem; height: 2.6rem; object-fit: cover; border-radius: 4px; }
.portal-plot { border: 1px solid var(--go-rule-strong); border-radius: var(--go-radius-sm); padding: .1rem .45rem; font-size: var(--go-fs-sm); background: var(--go-good-bg); color: var(--go-good); }
