/* GravityBooks Executive List View Styles (Luxury CRM Aesthetic) */

:root {
    --crm-bg: #ffffff;
    --crm-card-bg: #ffffff;
    --crm-border: #eaedf0;
    --crm-text-primary: #1a1a1a;
    --crm-text-muted: #8e959c;
    --crm-gold: #d4b068;
    --crm-gold-dark: #c09d56;
    --color-deep-canvas: #2C3539;
    /* Recessed surface: row hover and lineage-note background (PRJ-035 §4.6.4) */
    --crm-recessed: #fafbfd;
}

/* 1. Global Container & Sticky Logic */
.v-crm-container {
    max-width: 1600px;
    margin: 2rem auto 4rem auto;
    padding: 0;
    /* Full bleed on small screens, margin handles large */
    display: flex;
    flex-direction: column;
    background: var(--crm-card-bg);
    border-radius: 12px;
    box-shadow: 0 15px 35px -5px rgba(44, 53, 57, 0.15);
}

.v-crm-sticky-top {
    position: sticky;
    top: 0;
    margin: 0 auto;
    max-width: 1600px;
    width: 100%;
    background-color: var(--crm-card-bg);
    z-index: 1020;
    border-top: 4px solid var(--crm-gold);
    /* Letterhead sticks now */
    border-bottom: 1px solid var(--crm-border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    /* Subtle separation when sticking */
}

.v-crm-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 2.5rem 2rem 2.5rem;
    margin-bottom: 0;
}

.v-crm-title {
    font-family: 'Playfair Display', 'Merriweather', serif;
    font-size: 2.25rem;
    font-weight: 500;
    color: var(--crm-text-primary);
    margin: 0;
}

.v-crm-search-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 0 2.5rem 1.5rem 2.5rem;
    border-bottom: 1px solid var(--crm-border);
}

.v-crm-search-composite {
    display: flex;
    background: var(--crm-card-bg);
    border-radius: 10px;
    flex: 1;
    max-width: 900px;
    padding: 0.4rem 1.25rem;
    box-shadow: 0 4px 12px rgba(44, 53, 57, 0.08);
    /* Sophisticated shadow */
    align-items: center;
    border: 1px solid var(--crm-border);
}

.v-crm-search-input {
    border: none;
    outline: none;
    padding: 0.85rem 0.5rem;
    font-size: 0.95rem;
    color: var(--crm-text-primary);
    background: transparent;
    flex: 1;
}

.v-search-refine-integrated {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    border-left: 1px solid var(--crm-border);
    color: var(--crm-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s;
}

.v-search-refine-integrated:hover {
    color: var(--crm-gold);
}

.v-crm-search-divider {
    width: 1px;
    height: 28px;
    background-color: var(--crm-border);
    margin: 0 1rem;
}

/* 3. High-Density Executive Split Rows */
.v-crm-list {
    margin-top: 1rem;
    padding-bottom: 4rem;
}

.v-crm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--crm-card-bg);
    padding: 1.25rem 2.5rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--crm-border);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none !important;
    position: relative;
    min-height: 80px;
    /* Increased for stacked layout */
}

.v-crm-row:first-child {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.v-crm-row:last-child {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    border-bottom: none;
}

.v-crm-area-leading {
    display: flex;
    align-items: center;
    padding-right: 1.5rem;
    padding-left: 0.5rem;
    z-index: 10;
    position: relative;
}

.v-crm-row:hover {
    background-color: #fcfdfe;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    z-index: 5;
}

/* Area Splits (Executive Split Architecture) */
.v-crm-area-primary {
    display: flex;
    flex-direction: column;
    /* Stacked layout */
    align-items: flex-start;
    width: 45%;
    gap: 0.5rem;
    /* Increased for breathing room */
    text-align: left;
}

.v-crm-smart-row-bottom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 1.2rem;
}

.v-crm-area-secondary {
    display: flex;
    flex-direction: column;
    /* Stacked layout */
    align-items: flex-end;
    width: 55%;
    gap: 0.5rem;
    /* Increased for breathing room */
}

/* Text Stylings */
.v-crm-text-name {
    font-family: 'Merriweather', serif;
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--crm-text-primary);
    margin: 0;
    line-height: 1.2;
}

.v-crm-text-balance {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--color-deep-canvas);
    text-align: right;
    font-variant-numeric: tabular-nums;
    margin: 0;
}

.v-crm-text-muted {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--crm-text-muted);
}

.v-crm-status-exception {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--crm-text-muted);
}



.v-crm-meta-group {
    display: flex;
    gap: 2rem;
    /* Increased for distinct fields */
    align-items: center;
    color: var(--crm-text-muted);
}

/* 4. Transaction Tables (High Density) */
.v-table-high-density td {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

.v-table-high-density tr {
    transition: background-color 0.15s ease;
}

/* 5. Action Buttons */
.v-actions-group {
    display: flex;
    gap: 0.75rem;
}

.v-btn-crm {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    text-decoration: none !important;
}

.v-btn-export,
.v-btn-import {
    background: transparent;
    border: none;
    color: var(--crm-text-muted);
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.v-btn-export:hover,
.v-btn-import:hover {
    color: var(--crm-text-primary);
    background: rgba(0, 0, 0, 0.03);
}

.v-btn-new {
    background-color: var(--crm-gold) !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(212, 176, 104, 0.2);
}

.v-btn-crm:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.v-btn-new:hover {
    background-color: var(--crm-gold-dark);
    color: white;
}

/* Override standard button groups in sticky header */
.v-crm-sticky-top .btn-group .btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.v-btn-export:hover {
    border-color: var(--crm-text-muted);
    color: var(--crm-text-primary);
    background-color: white;
}

.v-btn-import:hover,
.v-btn-new:hover {
    filter: brightness(1.1);
    color: white !important;
}

/* Search Bar Refine Toggle Button */
.v-crm-btn-refine {
    background: transparent;
    border: 1px solid var(--crm-border);
    color: var(--crm-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.v-crm-btn-refine i {
    color: var(--crm-gold);
}

.v-crm-btn-refine:hover {
    border-color: var(--crm-gold);
    color: var(--crm-text-primary);
    background: rgba(212, 176, 104, 0.06);
}

/* Refine Tray Action Buttons */
.v-crm-btn-apply {
    background: var(--crm-text-primary);
    color: #fff;
    border: none;
    padding: 0.55rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
}

.v-crm-btn-apply:hover {
    background: var(--crm-gold);
    transform: translateY(-1px);
}

.v-crm-btn-clear {
    background: transparent;
    border: none;
    color: var(--crm-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.v-crm-btn-clear:hover {
    color: var(--crm-text-primary);
    text-decoration: underline;
}

/* ============================================================
   Universal Row Delete Action
   Hidden by default. Revealed at 50% op on row hover.
   Full Crimson at 100% op when directly hovered.
   Usage: add class 'v-btn-delete' to any delete button inside
   a .v-crm-row element.
   ============================================================ */
.v-btn-delete {
    opacity: 0 !important;
    transition: opacity 0.2s ease, color 0.2s ease;
    z-index: 10;
    position: relative;
    color: var(--crm-text-muted) !important;
}

.v-crm-row:hover .v-btn-delete {
    opacity: 0.4 !important;
}

.v-crm-row:hover .v-btn-delete:hover {
    opacity: 1 !important;
    color: #A62C2B !important;
    /* Muted Crimson per Style Guide */
}

/* Legacy alias — customers.html used a specific class. Keep for safety. */
.btn-delete-customer.v-crm-text-muted {
    opacity: 0 !important;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.v-crm-row:hover .btn-delete-customer.v-crm-text-muted {
    opacity: 0.4 !important;
}

.v-crm-row:hover .btn-delete-customer.v-crm-text-muted:hover {
    opacity: 1 !important;
    color: #A62C2B !important;
}

.v-crm-text-code {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--crm-text-muted);
    letter-spacing: 0.05em;
    min-width: 60px;
}

/* ============================================================
   TRANSACTION LIST ROWS (Invoices, Bills, Quotes etc.)
   ============================================================ */

/* Refine tray inner card */
.v-crm-refine-tray {
    background: var(--crm-card-bg);
    border: 1px solid var(--crm-border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.5rem;
}

/* Label inside refine tray */
.v-crm-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--crm-text-muted);
    display: block;
}

/* Unboxed list container for tx rows */
.v-crm-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Select-all bar */
.v-tx-select-bar {
    padding: 0.5rem 1.25rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--crm-border);
    color: var(--crm-text-muted);
}

/* Transaction card row — two-panel horizontal layout */
.v-tx-row {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--crm-border);
    background: var(--crm-card-bg);
    transition: background 0.15s ease, box-shadow 0.15s ease;
    min-height: 64px;
}

.v-tx-row:first-child {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-top: 1px solid var(--crm-border);
}

.v-tx-row:last-child {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.v-tx-row:hover {
    background: #fafbfc;
    box-shadow: inset 3px 0 0 var(--crm-gold);
}

/* Left panel: checkbox + doc no + entity name */
.v-crm-area-primary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 240px;
    flex-shrink: 0;
}

/* Right panel: metadata + financials + badge + actions */
.v-crm-area-secondary {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    overflow: hidden;
}

.v-crm-meta-group {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Transaction status left-border tokens */
.v-tx-draft {
    border-left: 3px solid var(--crm-border);
}

.v-tx-posted {
    border-left: 3px solid var(--crm-gold);
}

.v-tx-paid {
    border-left: 3px solid #2e7d32;
}

/* Crimson text for overdue amounts */
.text-crimson {
    color: #A62C2B !important;
}

/* Linear Row Architecture (Single Line / High Density) */
.v-linear-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 2.5rem;
    background: var(--crm-card-bg);
    border-bottom: 1px solid var(--crm-border);
    transition: all 0.2s ease;
    text-decoration: none !important;
    position: relative;
    min-height: 60px;
}

.v-linear-row:hover {
    background-color: #fafbfd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    z-index: 5;
}

/* Linear Column Definitions - Shared between row and header */
.v-col-check {
    width: 40px;
    flex-shrink: 0;
    z-index: 10;
    position: relative;
}

.v-col-doc {
    width: 120px;
    flex-shrink: 0;
}

.v-col-entity {
    flex: 2;
    min-width: 200px;
    padding-right: 1rem;
}

.v-col-date {
    width: 120px;
    flex-shrink: 0;
}

.v-col-amount {
    width: 140px;
    flex-shrink: 0;
    text-align: right;
    padding-right: 1.5rem;
}

.v-col-meta {
    flex: 1;
    min-width: 150px;
}

.v-col-status {
    width: 100px;
    flex-shrink: 0;
    text-align: center;
    position: relative;
    z-index: 10;
}

.v-col-actions {
    width: 80px;
    flex-shrink: 0;
    text-align: right;
    position: relative;
    z-index: 10;
}

/* 6. Linear Header Styling */
.v-linear-header {
    display: flex;
    align-items: center;
    padding: 1rem 2.5rem;
    background: var(--color-deep-canvas);
    color: var(--crm-gold);
    font-family: var(--font-ui);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    position: sticky;
    /* This will stick relative to the nearest scrolling parent or top */
    top: 0;
    z-index: 1010;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.v-linear-header .sortable {
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
    display: flex;
    align-items: center;
}

.v-linear-header .sortable:hover {
    color: #fff;
}

.v-linear-header i {
    font-size: 0.7rem;
    opacity: 0.6;
}

.v-linear-header .sort-active {
    color: #fff;
    opacity: 1;
}

.v-linear-header .sort-active i {
    opacity: 1;
    color: var(--crm-gold);
}

/* Header Extra Styling */
.v-header-extra {
    display: flex;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--crm-text-muted);
}

.v-header-extra .form-check-input {
    margin-right: 0.75rem;
}

@media (max-width: 1200px) {
    .v-col-meta {
        display: none;
    }
}

@media (max-width: 992px) {
    .v-col-date {
        display: none;
    }
}

/* =====================================================================
   DOCUMENT NOTES — PRJ-035 §4.6
   Gold belongs to RESOLUTION, never to the open state (§4.6.2).
   Colour never carries meaning alone — the icon does (Style Guide §10D).
   ===================================================================== */

/* Fixed 32px slot, immediately left of Status. Reserved for every row in an
   opted-in list, present or absent, so the grid never reflows (§4.6.3). */
.v-col-notes {
    width: 32px;
    flex-shrink: 0;
    text-align: center;
    /* Above the row's stretched-link so hovering the badge does not fire
       row navigation (§4.6.3, Style Guide §8D Control Exclusions). */
    position: relative;
    z-index: 10;
}

.v-note-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1;
    transition: opacity 0.2s ease;
}

.v-note-indicator:hover {
    opacity: 0.7;
}

/* Standing information: present, but not demanding attention. */
.v-note-indicator-memo {
    color: var(--crm-text-muted);
}

/* Style Guide §3 "Notice" — crimson informs without panic. An open query is
   a to-do, not a failure. Never pure red. */
.v-note-indicator-open {
    color: var(--v-crimson);
}

/* Reassurance, not celebration — low emphasis. */
.v-note-indicator-resolved {
    color: var(--crm-text-muted);
    opacity: 0.55;
}

.v-note-indicator-count {
    font-family: var(--font-mono, 'Roboto Mono', monospace);
    font-size: 0.7rem;
    font-weight: 600;
}

/* Ledger (table) variant of the slot. 46px, not 32px: the cell holds the
   indicator AND the hover quick-add (§4.6.3a) side by side. Fixed width, so
   the grid still never reflows between rows. */
.col-ledger-notes {
    width: 46px;
    white-space: nowrap;
}

/* ------------------------------------------------- quick add (§4.6.3a) */

/* Hidden at rest so an un-noted row stays clean (§4.6.2), revealed on row
   hover using the SAME 0 -> .5 -> 1 ramp the Actions column already uses in
   this grid — a familiar affordance, not a new one. */
.v-note-quick-add {
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    background: none;
    border: 0;
    padding: 0 0 0 3px;
    line-height: 1;
    font-size: 0.8rem;
    color: var(--crm-text-muted);
    cursor: pointer;
    vertical-align: middle;
}

tr:hover > .col-ledger-notes > .v-note-quick-add {
    opacity: 0.5;
}

.v-note-quick-add:hover,
.v-note-quick-add[aria-expanded="true"] {
    opacity: 1;
    color: var(--v-crimson);
}

/* Keyboard parity: hover-only controls are unreachable by tab without this. */
.v-note-quick-add:focus-visible {
    opacity: 1;
    color: var(--v-crimson);
    outline: 2px solid var(--v-crimson);
    outline-offset: 2px;
}

/* Touch has no hover. The quick-add is a desktop accelerator only; the
   document panel remains the universal path (P1 — no functionality is lost,
   it is reached differently). */
@media (max-width: 767.98px) {
    .v-note-quick-add {
        display: none;
    }
}

/* ---------------------------------------------- quick-add popover (JS-built) */

.v-quick-note {
    position: absolute;
    z-index: 1080;          /* action-sheet slot (P16) — no new z-index tier */
    width: 300px;
    max-width: calc(100vw - 24px);
    background: #FFFFFF;
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: 4px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    padding: 0.75rem;
}

.v-quick-note-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-charcoal, #2C3539);
    margin: 0 0 0.4rem;
}

.v-quick-note-doc {
    font-family: var(--font-mono, 'Roboto Mono', monospace);
    color: var(--crm-text-muted);
    font-weight: 600;
}

.v-quick-note textarea {
    width: 100%;
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: 3px;
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    resize: vertical;
}

.v-quick-note textarea:focus {
    outline: none;
    border-color: var(--v-crimson);
}

.v-quick-note-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.v-quick-note-submit {
    background: var(--color-charcoal, #2C3539);
    color: #FFFFFF;
    border: 0;
    border-radius: 3px;
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.v-quick-note-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

.v-quick-note-cancel {
    background: none;
    border: 0;
    color: var(--crm-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
}

/* Retains the typed text and explains why (§4.6.8, R4). */
.v-quick-note-error {
    color: var(--v-crimson);
    font-size: 0.75rem;
    margin: 0.4rem 0 0;
}

/* ---------------------------------------------------------------- panel */

.v-notes-panel {
    border: 1px solid var(--crm-border);
    border-radius: 6px;
    background: var(--crm-card-bg);
    margin: 1.5rem 0;
}

.v-notes-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    color: var(--crm-text-primary);
    font-weight: 600;
}

.v-notes-title {
    flex-grow: 1;
}

.v-notes-chip {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: var(--crm-border);
    color: var(--crm-text-muted);
}

/* Crimson only when open queries actually exist (§4.6.4). */
.v-notes-chip-open {
    background: var(--v-crimson);
    color: var(--color-pure-white);
}

.v-notes-chevron {
    transition: transform 0.25s ease;
    color: var(--crm-text-muted);
}

.v-notes-header[aria-expanded="true"] .v-notes-chevron {
    transform: rotate(180deg);
}

.v-notes-body {
    padding: 0 1.25rem 1.25rem;
}

.v-notes-empty {
    color: var(--crm-text-muted);
    font-size: 0.9rem;
    margin: 0 0 1rem;
}

/* ----------------------------------------------------------- note card */

.v-note-card {
    padding: 0.85rem 1rem;
    border: 1px solid var(--crm-border);
    border-radius: 4px;
    margin-bottom: 0.75rem;
    background: var(--crm-card-bg);
}

/* Open queries carry a left side-accent; memos and resolved notes carry none. */
.v-note-card-open {
    border-left: 3px solid var(--v-crimson);
}

/* Lineage notes render slightly recessed, and are read-only here (§4.6.4). */
.v-note-card-lineage {
    background: var(--crm-recessed);
    opacity: 0.92;
}

.v-note-origin {
    font-size: 0.75rem;
    color: var(--crm-text-muted);
    margin-bottom: 0.35rem;
}

.v-note-content {
    margin: 0 0 0.5rem;
    color: var(--crm-text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.v-note-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--crm-text-muted);
}

.v-note-author {
    font-weight: 600;
}

.v-note-stamp,
.v-note-edited {
    font-family: var(--font-mono, 'Roboto Mono', monospace);
}

.v-note-actions {
    margin-top: 0.6rem;
}

.v-note-readonly-hint {
    font-size: 0.75rem;
    color: var(--crm-text-muted);
    font-style: italic;
}

.v-note-resolve {
    background: transparent;
    border: 1px solid var(--v-charcoal);
    color: var(--v-charcoal);
    border-radius: 4px;
    padding: 0.3rem 0.85rem;
    font-size: 0.8rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.v-note-resolve:hover {
    background: var(--v-charcoal);
    color: var(--color-pure-white);
}

/* THE PEAK (§4.6.6, Style Guide §10C): resolving is the emotional high point
   of this feature — the moment the document becomes clean. This is the ONLY
   place gold appears in the notes UI. */
@keyframes v-note-resolved-pulse {
    0%   { background-color: var(--v-gold-light); }
    100% { background-color: transparent; }
}

.v-note-card-resolving {
    animation: v-note-resolved-pulse 400ms ease-out;
}

.v-notes-resolved-toggle {
    background: none;
    border: none;
    padding: 0.25rem 0;
    color: var(--crm-text-muted);
    font-size: 0.8rem;
    text-decoration: underline;
}

/* ----------------------------------------------------------- composer */

.v-note-composer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--crm-border);
}

/* Segmented control, not a dropdown — both options visible without a click
   (§4.6.5, Style Guide §4B). */
.v-note-type-control {
    display: inline-flex;
    border: 1px solid var(--crm-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.v-note-type-option {
    margin: 0;
    cursor: pointer;
}

.v-note-type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.v-note-type-option span {
    display: block;
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    color: var(--crm-text-muted);
    background: var(--crm-card-bg);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.v-note-type-option input:checked + span {
    background: var(--v-charcoal);
    color: var(--color-pure-white);
}

.v-note-type-hint {
    font-size: 0.75rem;
    color: var(--crm-text-muted);
    margin: 0 0 0.5rem;
}

.v-note-textarea {
    width: 100%;
    border: 1px solid var(--crm-border);
    border-radius: 4px;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    resize: vertical;
}

.v-note-textarea:focus {
    outline: none;
    border-color: var(--v-charcoal);
}

/* Save failure keeps the typed text and shows the reason inline (§4.6.8, R4). */
.v-note-error {
    color: var(--v-crimson);
    font-size: 0.8rem;
    margin: 0.5rem 0 0;
}

.v-note-submit {
    margin-top: 0.6rem;
    background: var(--v-charcoal);
    color: var(--color-pure-white);
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
    transition: background-color 0.2s ease;
}

.v-note-submit:hover {
    background: var(--color-charcoal-hover);
}

.v-note-submit:disabled {
    opacity: 0.6;
}

/* ------------------------------------------------- mobile (Task 5b, P1-P18)
   CSS-first: the collapsed/expanded layout works from this media query alone;
   JS only drives the AJAX save (P17). */
@media (max-width: 767.98px) {
    /* P15 — always collapsed on mobile; the count in the header tells the
       user something is there without expanding. */
    .v-notes-body.show {
        display: none;
    }

    .v-notes-body.show.v-notes-mobile-open {
        display: block;
    }

    /* P5 — 48px minimum touch targets. */
    .v-notes-header {
        min-height: 48px;
    }

    .v-note-resolve,
    .v-note-submit {
        min-height: 48px;
        width: 100%;
    }

    .v-note-type-control {
        display: flex;
        width: 100%;
    }

    .v-note-type-option {
        flex: 1;
    }

    .v-note-type-option span {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    /* P12/P14 — on a mobile card the indicator joins the existing status
       line; it never gets its own row, and note content never appears. */
    .mobile-card-status .v-note-indicator {
        margin-right: 0.35rem;
    }
}