/* =====================================================================
   DAYTON INSURANCE AGENCY — DIOS
   Modern SaaS stylesheet (same palette: ink navy, ivory, oxblood, brass)
   --------------------------------------------------------------------
   Direction: clean product UI — flat surfaces, soft layered shadows,
   rounded cards, pill navigation, Inter-first typography.
   Original "editorial" theme preserved in Backups/ui-backup-2026-07-18.
   ===================================================================== */

:root {
    /* ---- Ink ---- */
    --ink:          #142239;
    --ink-deep:     #0B1424;
    --ink-soft:     #2C3E60;

    /* ---- Paper ---- */
    --paper:        #F6F1E6;
    --paper-deep:   #ECE4D1;
    --surface:      #FFFCF5;
    --surface-cool: #FFFFFF;

    /* ---- Accent ---- */
    --oxblood:      #7C2D2A;
    --oxblood-deep: #5E1F1D;
    --oxblood-soft: #A4413E;
    --brass:        #A78B3F;
    --brass-light:  #C9A85B;
    --brass-deep:   #7E6826;

    /* ---- Rules & Text ---- */
    --rule:         #C9BFAA;
    --rule-soft:    #E5DCC6;
    --border:       #E2DAC8;
    --text:         #1F2937;
    --muted:        #6B6052;
    --muted-soft:   #8C8273;

    /* ---- Semantic ---- */
    --danger:       #B0322F;
    --warn:         #B58025;
    --ok:           #356B4D;
    --ok-bg:        #DCE8DE;
    --warn-bg:      #F4E9CC;
    --danger-bg:    #F1D6D2;
    --info-bg:      #D9DFE8;

    /* ---- Legacy aliases (older Razor pages keep working) ---- */
    --brand:        var(--ink);
    --brand-dark:   var(--ink-deep);
    --brand-light:  var(--ink-soft);
    --gold:         var(--brass);
    --gold-light:   var(--brass-light);
    --gold-dark:    var(--brass-deep);
    --cream:        var(--paper);
    --bg:           var(--paper);
    --accent:       var(--oxblood);

    /* ---- SaaS geometry & elevation ---- */
    --radius:       12px;
    --radius-sm:    8px;
    --radius-xs:    6px;
    --shadow-sm:    0 1px 2px rgba(20, 34, 57, 0.05);
    --shadow-md:    0 1px 2px rgba(20, 34, 57, 0.05), 0 6px 20px rgba(20, 34, 57, 0.06);
    --shadow-lg:    0 4px 10px rgba(20, 34, 57, 0.07), 0 16px 40px rgba(20, 34, 57, 0.10);
    --ring:         0 0 0 3px rgba(167, 139, 63, 0.25);

    /* ---- Type ---- */
    --serif:        "Playfair Display", "Georgia", "Times New Roman", serif;
    --sans:         "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono:         "JetBrains Mono", "SF Mono", Consolas, monospace;
    --display:      "Bungee", "Impact", "Arial Black", sans-serif;
    --display-3d:   "Bungee Shade", "Bungee", "Impact", "Arial Black", sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--sans);
    background: var(--paper);
    color: var(--text);
    font-size: 15px;
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Flat, calm canvas — no texture */
body { background-image: none; }

a { color: var(--ink-soft); text-decoration: none; transition: color .15s; }
a:hover { color: var(--oxblood); text-decoration: none; }

h1, h2, h3, h4 {
    font-family: var(--sans);
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
h1 { font-size: 1.55rem; margin: 0 0 0.6rem; }
h2 { font-size: 1.2rem;  margin: 1.6rem 0 0.8rem; font-weight: 650; }
h3 { font-size: 1.02rem; margin: 1.2rem 0 0.5rem; font-weight: 650; }

table, .metric-value, .kpi-value, .segment-count, .badge, td, th,
input[type="text"], input[type="number"], input[type="email"] {
    font-variant-numeric: tabular-nums;
}

/* =====================================================================
   LAYOUT
   ===================================================================== */

.page {
    display: flex;
    min-height: 100vh;
}

/* -------- Sidebar — flat navy rail -------- */
.sidebar {
    width: 248px;
    background: var(--ink-deep);
    color: var(--paper);
    padding: 1rem 0.7rem 1.25rem;
    position: relative;
    border-right: none;
    box-shadow: none;
}
.sidebar::after { content: none; }

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* -------- Masthead (kept for pages that render it) — simplified -------- */
.masthead {
    padding: 1.2rem 2rem 0.4rem;
    background: transparent;
    position: relative;
}
.masthead-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--sans);
    font-style: normal;
    font-size: 0.76rem;
    color: var(--muted);
    letter-spacing: 0.03em;
    margin-bottom: 0.3rem;
}
.masthead-issue { font-variant: normal; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.masthead-dateline { font-style: normal; }
.masthead-rule, .masthead-rule-thin { border: none; height: 0; margin: 0; }
.masthead-title-row { text-align: left; padding: 0; }
.masthead-title {
    margin: 0;
    font-family: var(--sans);
    font-size: 1.7rem;
    font-weight: 750;
    letter-spacing: -0.025em;
    color: var(--ink);
    line-height: 1.15;
}
.masthead-subtitle {
    text-align: left;
    font-family: var(--sans);
    font-style: normal;
    color: var(--muted);
    font-size: 0.88rem;
    margin: 0.25rem 0 0.4rem;
    letter-spacing: 0;
}

/* -------- Top bar -------- */
.top-row {
    height: 56px;
    background: rgba(255, 252, 245, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}
.brand-title {
    font-family: var(--display);
    font-weight: 400;
    color: var(--brass-deep);
    letter-spacing: 0.06em;
    font-size: 1.3rem;
    line-height: 1;
}
.brand-title-tagline {
    margin-left: 0.65rem;
    font-family: var(--sans);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    vertical-align: middle;
}

.content {
    padding: 1.6rem 2rem 3.5rem;
    max-width: 1600px;
    width: 100%;
}
.content-wide { max-width: 100%; }
.px-4 { padding-left: 2rem; padding-right: 2rem; }

/* =====================================================================
   NAVIGATION (sidebar)
   ===================================================================== */

.nav-brand {
    padding: 0.6rem 0.55rem 1rem;
    border-bottom: 1px solid rgba(255, 252, 245, 0.08);
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}
.nav-brand-wordmark {
    font-family: var(--display-3d);
    font-weight: 400;
    font-size: 2.1rem;
    line-height: 1;
    color: var(--brass-light);
    letter-spacing: 0.05em;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.nav-brand-subtitle {
    font-family: var(--sans);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(245, 240, 220, 0.55);
    font-weight: 600;
    margin-top: 0.15rem;
}

.nav-brand-icon {
    background: linear-gradient(135deg, var(--brass-light) 0%, var(--brass) 55%, var(--brass-deep) 100%);
    color: var(--ink-deep);
    width: 38px; height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-family: var(--sans);
    font-size: 1.1rem;
    box-shadow: var(--shadow-sm);
}

.nav-brand-text {
    font-family: var(--sans);
    font-weight: 700;
    color: var(--paper);
    letter-spacing: 0.01em;
    font-size: 1.05rem;
    line-height: 1.1;
}

.nav-list { display: flex; flex-direction: column; gap: 1px; }

.nav-link {
    color: rgba(246, 241, 230, 0.72);
    padding: 0.48rem 0.7rem;
    margin: 0 0.15rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-left: none;
    border-radius: var(--radius-sm);
    transition: background .12s, color .12s;
    font-size: 0.9rem;
    font-weight: 500;
}
.nav-link:hover {
    background: rgba(255, 252, 245, 0.07);
    color: var(--paper);
    padding-left: 0.7rem;
}
.nav-link.active {
    background: rgba(167, 139, 63, 0.16);
    color: var(--brass-light);
    border-left: none;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(167, 139, 63, 0.25);
}
.nav-icon { width: 20px; text-align: center; opacity: 0.9; flex: 0 0 20px; }

.nav-section-label {
    color: rgba(246, 241, 230, 0.42);
    font-family: var(--sans);
    font-style: normal;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
    padding: 1.1rem 0.85rem 0.35rem;
    position: relative;
}
.nav-section-label::after { content: none; }

/* =====================================================================
   CARDS, PANELS, SECTIONS
   ===================================================================== */

.card {
    background: var(--surface-cool);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    margin-bottom: 1rem;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.card-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.card-row .card { flex: 1 1 200px; }

.metric-label {
    color: var(--muted);
    font-family: var(--sans);
    font-style: normal;
    font-size: 0.74rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-weight: 600;
}
.metric-value {
    font-size: 1.9rem;
    font-weight: 750;
    margin-top: 0.35rem;
    font-family: var(--sans);
    color: var(--ink);
    letter-spacing: -0.03em;
    line-height: 1;
}

.section-card {
    background: var(--surface-cool);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.section-card-header {
    background: var(--surface-cool);
    padding: 0.8rem 1.25rem;
    font-family: var(--sans);
    font-weight: 650;
    color: var(--ink);
    border-bottom: 1px solid var(--rule-soft);
    border-left: none;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.section-card-header::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--brass);
    flex: 0 0 8px;
}
.section-card-body { padding: 1.25rem; }

/* =====================================================================
   TABLES — clean SaaS grid
   ===================================================================== */

table.data {
    width: 100%;
    background: var(--surface-cool);
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
table.data th, table.data td {
    text-align: left;
    padding: 0.68rem 0.95rem;
    border-bottom: 1px solid var(--rule-soft);
    vertical-align: middle;
}
table.data th {
    background: #FBF8F0;
    font-family: var(--sans);
    font-weight: 650;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border);
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover { background: rgba(167, 139, 63, 0.05); }
table.data td.num,
table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

.actions a, .actions button { margin-right: 0.4rem; }

/* =====================================================================
   BUTTONS
   ===================================================================== */

.btn {
    display: inline-block;
    background: var(--oxblood);
    color: #FFFDF8;
    border: 1px solid var(--oxblood);
    padding: 0.5rem 1.05rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.88rem;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: var(--shadow-sm);
    transition: background .12s, box-shadow .12s, transform .06s;
}
.btn:hover {
    background: var(--oxblood-deep);
    border-color: var(--oxblood-deep);
    color: #FFFDF8;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    filter: none;
}
.btn:active { transform: translateY(1px); box-shadow: var(--shadow-sm); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

.btn-secondary {
    background: var(--surface-cool);
    color: var(--ink);
    border: 1px solid var(--rule);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
    background: #FBF8F0;
    color: var(--ink);
    border-color: var(--muted-soft);
    filter: none;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}
.btn-danger:hover { background: #8A2724; border-color: #8A2724; filter: none; }

.btn-sm { padding: 0.32rem 0.7rem; font-size: 0.79rem; border-radius: var(--radius-xs); }

/* =====================================================================
   FORMS
   ===================================================================== */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
    max-width: 720px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-field { display: flex; flex-direction: column; position: relative; }

.copy-field-btn {
    position: absolute;
    right: 5px;
    bottom: 6px;
    width: 22px;
    height: 22px;
    background: #F7F3E8;
    border: 1px solid var(--rule-soft);
    border-radius: 6px;
    cursor: pointer;
    color: var(--ink-soft);
    font-size: 0.75rem;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
    z-index: 2;
}
.copy-field-btn:hover {
    background: var(--brass);
    color: #fff;
    border-color: var(--brass-deep);
}
.copy-field-btn.copied {
    background: var(--ok);
    color: #fff;
    border-color: var(--ok);
}
.copy-field-btn.empty {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger);
    animation: copy-empty-shake .35s ease;
}
@keyframes copy-empty-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-2px); }
    75%      { transform: translateX(2px); }
}
.form-field:has(> .copy-field-btn) > input,
.form-field:has(> .copy-field-btn) > textarea,
.form-field:has(> .copy-field-btn) > select {
    padding-right: 32px;
}

.copy-text-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 6px;
    padding: 0;
    background: #F7F3E8;
    border: 1px solid var(--rule-soft);
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--ink-soft);
    line-height: 1;
    vertical-align: middle;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.copy-text-btn:hover {
    background: var(--brass);
    color: #fff;
    border-color: var(--brass-deep);
}
.copy-text-btn.copied {
    background: var(--ok);
    color: #fff;
    border-color: var(--ok);
}
.copy-text-btn.empty {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger);
    animation: copy-empty-shake .35s ease;
}
.form-field label {
    font-family: var(--sans);
    font-style: normal;
    font-size: 0.78rem;
    margin-bottom: 0.32rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.02em;
}
.form-field input,
.form-field select,
.form-field textarea {
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    font: inherit;
    background: var(--surface-cool);
    color: var(--text);
    transition: border-color .12s, box-shadow .12s, background .12s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--brass);
    background: var(--surface-cool);
    box-shadow: var(--ring);
}

.validation-message {
    color: var(--danger);
    font-size: 0.83rem;
    margin-top: 0.25rem;
    font-style: normal;
}

.toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.toolbar input[type="text"], .toolbar select {
    padding: 0.48rem 0.7rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    background: var(--surface-cool);
}
.toolbar input[type="text"]:focus, .toolbar select:focus {
    outline: none;
    border-color: var(--brass);
    box-shadow: var(--ring);
}

/* =====================================================================
   BADGES — pill style
   ===================================================================== */

.badge {
    display: inline-block;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.69rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
}
.badge-ok      { background: var(--ok-bg);     color: var(--ok);     border-color: transparent; }
.badge-warn    { background: var(--warn-bg);   color: var(--warn);   border-color: transparent; }
.badge-danger  { background: var(--danger-bg); color: var(--danger); border-color: transparent; }

.badge-freedom     { background: #DDE2EC; color: var(--ink);       border-color: transparent; }
.badge-progressive { background: #E5DDEC; color: #5C2E78;          border-color: transparent; }
.badge-geico       { background: #F2D9DD; color: #9A1F47;          border-color: transparent; }
.badge-bonus       { background: var(--warn-bg); color: var(--brass-deep); border-color: transparent; }
.badge-other       { background: #EFEAE0; color: var(--muted);     border-color: transparent; }

.row-muted { opacity: 0.55; }
.row-muted td { background: #F4F0E6; }

/* =====================================================================
   ALERTS
   ===================================================================== */

.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-left: 4px solid;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
}
.alert-success { background: var(--ok-bg);     color: var(--ok);     border-color: var(--ok); }
.alert-error   { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.alert-info    { background: var(--info-bg);   color: var(--ink);    border-color: var(--ink-soft); }

/* =====================================================================
   FILTER TABS — segmented pills
   ===================================================================== */

.filter-tabs {
    display: inline-flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.28rem;
    border-bottom: none;
    background: #EFE9DB;
    border-radius: 999px;
}
.filter-tab {
    background: transparent;
    border: none;
    padding: 0.42rem 0.95rem;
    cursor: pointer;
    font-size: 0.86rem;
    color: var(--muted);
    border-bottom: none;
    margin-bottom: 0;
    border-radius: 999px;
    font-family: var(--sans);
    font-style: normal;
    letter-spacing: 0;
    font-weight: 550;
    transition: color .12s, background .12s, box-shadow .12s;
}
.filter-tab:hover { color: var(--ink); }
.filter-tab.active {
    color: var(--ink);
    font-weight: 650;
    border-bottom: none;
    background: var(--surface-cool);
    font-style: normal;
    box-shadow: var(--shadow-sm);
}
.filter-tab .count {
    color: var(--muted);
    font-size: 0.72rem;
    margin-left: 0.35rem;
    background: rgba(20, 34, 57, 0.07);
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-family: var(--sans);
    font-style: normal;
    font-weight: 600;
}
.filter-tab.active .count {
    background: var(--oxblood);
    color: #FFFDF8;
    font-weight: 650;
}

.quick-actions a {
    display: inline-block;
    padding: 0.3rem 0.45rem;
    margin-right: 0.15rem;
    font-size: 1rem;
    text-decoration: none;
    border-radius: var(--radius-xs);
    transition: background .1s;
}
.quick-actions a:hover { background: #F1ECDF; }

/* =====================================================================
   SALES SEGMENT CARDS
   ===================================================================== */

.segment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}
.segment-card {
    display: block;
    background: var(--surface-cool);
    border: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: transform .14s, box-shadow .14s, border-color .14s;
}
.segment-card:hover {
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brass);
    border-left-color: var(--brass);
}
.segment-count {
    font-family: var(--sans);
    font-size: 2.1rem;
    font-weight: 750;
    color: var(--ink);
    line-height: 1;
    margin-bottom: 0.35rem;
    letter-spacing: -0.03em;
}
.segment-title {
    font-family: var(--sans);
    font-weight: 650;
    color: var(--ink);
    margin-bottom: 0.3rem;
    font-size: 1rem;
}
.segment-desc {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

/* =====================================================================
   READ-ONLY VIEW GRID
   ===================================================================== */

.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.95rem 1.5rem;
}
.view-field { min-width: 0; }
.view-label {
    color: var(--muted);
    font-family: var(--sans);
    font-style: normal;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 650;
    margin-bottom: 0.22rem;
}
.view-value {
    font-weight: 500;
    word-wrap: break-word;
    color: var(--ink);
}

/* =====================================================================
   AUTOCOMPLETE
   ===================================================================== */

.autocomplete-wrapper { position: relative; }
.autocomplete-dropdown {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--surface-cool);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 280px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
}
.autocomplete-item {
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid var(--rule-soft);
    font-size: 0.9rem;
}
.autocomplete-item:hover { background: #F7F3E8; }
.autocomplete-item:last-child { border-bottom: none; }

/* =====================================================================
   NOTES PANEL
   ===================================================================== */

.notes-log {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 0.25rem;
}
.note-item {
    position: relative;
    background: #FBF8F0;
    border: 1px solid var(--rule-soft);
    border-left: 3px solid var(--brass);
    border-radius: var(--radius-sm);
    padding: 0.7rem 2.2rem 0.7rem 0.9rem;
}
.note-meta {
    font-family: var(--sans);
    font-style: normal;
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    font-weight: 650;
}
.note-body { white-space: pre-wrap; }
.note-del {
    position: absolute;
    top: 0.4rem; right: 0.4rem;
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
}

/* =====================================================================
   VEHICLE / SUB-CARD
   ===================================================================== */

.vehicle-card {
    background: var(--surface-cool);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 0.8rem;
    box-shadow: var(--shadow-sm);
}
.vehicle-card .form-grid-wide { gap: 0.5rem 0.85rem; }
.vehicle-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

/* =====================================================================
   BAR CHART
   ===================================================================== */

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 220px;
    padding: 0.5rem 0.25rem 0;
    border-bottom: 1px solid var(--rule);
    overflow-x: auto;
}
.bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    min-width: 38px;
    height: 100%;
    justify-content: flex-end;
    position: relative;
}
.bar-col .bar-value {
    font-size: 0.65rem;
    color: var(--muted);
    position: absolute;
    top: -1.2rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.bar-col .bar {
    background: var(--ink-soft);
    width: 100%;
    border-radius: 6px 6px 0 0;
    min-height: 2px;
    transition: opacity .15s;
    cursor: default;
}
.bar-col:hover .bar { opacity: 0.85; }
.bar-col.highlight .bar { background: var(--oxblood); }
.bar-col.muted .bar { background: #C4BBA6; }
.bar-labels {
    display: flex;
    gap: 5px;
    padding: 0.4rem 0.25rem 0;
    overflow-x: auto;
}
.bar-label {
    flex: 0 0 auto;
    min-width: 38px;
    text-align: center;
    font-size: 0.7rem;
    color: var(--muted);
    line-height: 1.2;
    font-family: var(--sans);
    font-style: normal;
}

/* Seasonality grid */
.season-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 6px;
    margin-top: 0.5rem;
}
.season-cell {
    padding: 0.55rem 0.25rem;
    background: var(--surface-cool);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    text-align: center;
    font-size: 0.78rem;
}
.season-cell .season-label {
    color: var(--muted);
    font-family: var(--sans);
    font-style: normal;
    font-size: 0.7rem;
    font-weight: 600;
}
.season-cell .season-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.season-cell.strong { border-color: var(--ok);   background: var(--ok-bg); }
.season-cell.weak   { border-color: var(--warn); background: var(--warn-bg); }

/* =====================================================================
   KPI TILES (analytics)
   ===================================================================== */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.kpi-tile {
    background: var(--surface-cool);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    position: relative;
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.kpi-tile::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--ink);
    border-radius: 3px 3px 0 0;
}
.kpi-tile .kpi-label {
    color: var(--muted);
    font-family: var(--sans);
    font-style: normal;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 650;
}
.kpi-tile .kpi-value {
    font-family: var(--sans);
    font-size: 1.7rem;
    font-weight: 750;
    margin-top: 0.35rem;
    color: var(--ink);
    letter-spacing: -0.03em;
    line-height: 1;
}
.kpi-tile .kpi-sub {
    color: var(--muted);
    font-size: 0.74rem;
    margin-top: 0.4rem;
    font-style: normal;
}
.kpi-tile.gold::before     { background: var(--brass); }
.kpi-tile.gold .kpi-value  { color: var(--brass-deep); }
.kpi-tile.positive::before { background: var(--ok); }
.kpi-tile.positive .kpi-value { color: var(--ok); }
.kpi-tile.negative::before { background: var(--danger); }
.kpi-tile.negative .kpi-value { color: var(--danger); }
/* keep legacy border-top-color rules harmless */
.kpi-tile.gold, .kpi-tile.positive, .kpi-tile.negative { border-top-color: var(--border); }

/* =====================================================================
   FORM GRID — wide
   ===================================================================== */

.form-grid-wide {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem 1rem;
}
.form-grid-wide .full   { grid-column: 1 / -1; }
.form-grid-wide .full-2 { grid-column: span 2; }
.form-grid-wide .full-3 { grid-column: span 3; }
@media (max-width: 900px) {
    .form-grid-wide { grid-template-columns: repeat(2, 1fr); }
    .form-grid-wide .full-3 { grid-column: span 2; }
}

.form-field .req { color: var(--danger); margin-left: 0.15rem; }
.form-field .hint { color: var(--muted); font-size: 0.74rem; margin-top: 0.22rem; font-style: normal; }

/* =====================================================================
   ADDRESS COMPONENT
   ===================================================================== */

.address-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-cool);
    padding: 0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.address-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.1rem;
    background: var(--surface-cool);
    border-bottom: 1px solid var(--rule-soft);
}
.address-card-title {
    font-family: var(--sans);
    font-weight: 650;
    color: var(--ink);
}
.address-card .form-grid { padding: 1rem; }
.address-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0 1rem 1rem;
}
.address-map {
    height: 220px;
    width: 100%;
    border-top: 1px solid var(--border);
    background: #EEE9DC;
}
.verify-ok  { color: var(--ok);     font-size: 0.85rem; font-style: normal; font-weight: 600; }
.verify-err { color: var(--danger); font-size: 0.85rem; font-style: normal; font-weight: 600; }

/* =====================================================================
   PAGE HEADER
   ===================================================================== */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
    flex-wrap: wrap;
    padding-bottom: 0;
    border-bottom: none;
}
.page-header h1 {
    margin: 0;
    font-family: var(--sans);
    font-weight: 750;
    letter-spacing: -0.025em;
}

/* =====================================================================
   PDF SIGNATURE DESIGNER + SIGNER
   ===================================================================== */

.pdfsign-toolbar {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0.55rem 0.75rem;
    background: var(--surface-cool);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border-bottom: none;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}
.pdfsign-tool {
    background: var(--surface-cool);
    border: 1px solid var(--rule);
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background .12s, border-color .12s;
}
.pdfsign-tool:hover { background: #F7F3E8; }
.pdfsign-tool.active {
    background: var(--oxblood);
    color: #FFFDF8;
    font-weight: 600;
    border-color: var(--oxblood-deep);
}
.pdfsign-container {
    background: #EFEAE0;
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 1rem;
    max-height: 80vh;
    overflow-y: auto;
}
.pdfsign-page {
    position: relative;
    background: white;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow-lg);
    border-radius: 4px;
}
.pdfsign-page canvas { display: block; }
.pdfsign-field {
    position: absolute;
    border: 2px solid var(--brass);
    background: rgba(167, 139, 63, 0.15);
    cursor: move;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--ink);
    user-select: none;
}
.pdfsign-field-signature { border-color: var(--ink);     background: rgba(20, 34, 57, 0.12); }
.pdfsign-field-date      { border-color: var(--ok);      background: rgba(53, 107, 77, 0.10); }
.pdfsign-field-text      { border-color: var(--oxblood); background: rgba(124, 45, 42, 0.10); }
.pdfsign-field-prefilled { border-color: var(--muted);   background: rgba(107, 96, 82, 0.10); border-style: dashed; }
.pdfsign-field-label {
    pointer-events: none;
    padding: 0 0.4rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.pdfsign-field-delete {
    position: absolute;
    top: -10px; right: -10px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
}
.pdfsign-field input[type="text"],
.pdfsign-field input[type="date"] {
    width: 100%; height: 100%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    padding: 0 0.4rem;
    font: inherit;
}
.pdfsign-field.pdfsign-sig-slot {
    cursor: pointer;
    background: rgba(20, 34, 57, 0.06);
    border-style: dashed;
}
.pdfsign-field.pdfsign-sig-slot:hover { background: rgba(167, 139, 63, 0.2); }
.pdfsign-field img { width: 100%; height: 100%; object-fit: contain; }
.pdfsign-prefilled {
    width: 100%;
    padding: 0 0.4rem;
    color: var(--text);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pdfsign-modal-bg {
    position: fixed; inset: 0;
    background: rgba(11, 20, 36, 0.55);
    backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
}
.pdfsign-modal {
    background: var(--surface-cool);
    border-radius: var(--radius);
    padding: 1.5rem;
    width: min(540px, 92vw);
    box-shadow: var(--shadow-lg);
}

/* =====================================================================
   POPOUT MODE EXTRAS
   ===================================================================== */

.popout-restore-link {
    color: var(--muted);
    font-size: 0.78rem;
    text-decoration: none;
    background: var(--surface-cool);
    border: 1px solid var(--border);
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-family: var(--sans);
    font-style: normal;
    box-shadow: var(--shadow-sm);
}
.popout-restore-link:hover {
    background: #F7F3E8;
    color: var(--ink);
}

/* =====================================================================
   BLAZOR ERROR UI
   ===================================================================== */

#blazor-error-ui {
    background: var(--warn-bg);
    border-top: 2px solid var(--warn);
    bottom: 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
    display: none;
    left: 0;
    padding: 0.7rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-family: var(--sans);
    font-style: normal;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.55rem;
}

/* =====================================================================
   SELECTION COLOR
   ===================================================================== */

::selection {
    background: var(--brass);
    color: var(--ink-deep);
}

/* =====================================================================
   SCROLLBAR (WebKit)
   ===================================================================== */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #CFC6B0;
    border: 3px solid var(--paper);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted-soft); }

/* =====================================================================
   BRAND LOCKUP — shield mark + gradient wordmark
   ===================================================================== */

.nav-brand-lockup { display: flex; align-items: center; gap: 0.7rem; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 42px; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4)); }
.brand-mark-sm { width: 26px; height: 26px; flex: 0 0 26px; margin-right: 0.55rem; }
.nav-brand-textcol { display: flex; flex-direction: column; gap: 3px; }

.nav-brand-wordmark {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 1.55rem;
    line-height: 1;
    letter-spacing: 0.14em;
    background: linear-gradient(115deg, #E8D194 0%, var(--brass-light) 30%, var(--brass) 65%, var(--brass-deep) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.top-row .brand-title {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.14em;
    background: linear-gradient(115deg, var(--brass-deep) 0%, var(--brass) 60%, var(--brass-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    display: inline-flex;
    align-items: center;
}
