/* Component styles for every marketplace-facing screen (login, onboarding,
   pending, dashboard). Reads every color/font/radius through the tokens
   defined in theme/tokens.css (loaded first, from base.html) - this file
   should never hardcode a color or declare its own :root block. To retheme
   the project, edit tokens.css; this file just consumes it. */

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Centered single-card screens: login, onboarding, pending */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.card .brand {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 20px;
}

.card h1 {
    font-size: 19px;
    font-weight: 600;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.card p.muted {
    color: var(--text-muted);
    font-size: 13.5px;
    margin: 0 0 24px;
}

/* Form fields */
.field { margin-bottom: 16px; }

.field label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}

.field input:focus {
    outline: none;
    border-color: var(--accent);
}

.field .help {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 5px;
}

.field .errorlist {
    list-style: none;
    padding: 0;
    margin: 5px 0 0;
    color: var(--danger);
    font-size: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-google {
    background: #fff;
    color: #1f1f1f;
    border: 1px solid #dcdcdc;
}
.btn-google:hover { background: #f4f4f4; }

.btn-text {
    background: none;
    color: var(--text-muted);
    width: auto;
    padding: 0;
    font-weight: 500;
}
.btn-text:hover { color: var(--text); }

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}
.badge.pending { color: var(--warning); background: var(--warning-bg); }
.badge.verified { color: var(--success); background: var(--success-bg); }
.badge.rejected { color: var(--danger); background: var(--danger-bg); }

/* Simple app shell: header + centered column (quote history, history) */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    border-bottom: 1px solid var(--border);
}

.app-header .org-name { font-weight: 600; font-size: 15px; }
.app-header .role-tag { color: var(--text-muted); font-size: 12px; margin-left: 8px; }
.app-header .actions { display: flex; align-items: center; gap: 16px; }

.app-header select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    font-family: inherit;
}

.app-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.panel h2 { font-size: 14px; font-weight: 600; margin: 0 0 16px; color: var(--text); }
.panel .empty { color: var(--text-muted); font-size: 13px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th {
    text-align: left;
    padding: 0 10px 10px 0;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
}

td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }

.panel-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.panel-header-row h2 { margin: 0; }
.unit-note { color: var(--text-muted); font-size: 12px; font-weight: 400; }

/* Back link (icon + text, baseline-aligned) */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}
.back-link:hover { color: var(--text); }
.back-link svg { flex-shrink: 0; }

/* Collapsible company details (quote history page) */
.details-panel {
    margin-top: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 16px;
}
.details-panel summary {
    cursor: pointer;
    padding: 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    list-style: none;
}
.details-panel summary::-webkit-details-marker { display: none; }
.details-panel summary::after { content: '+'; float: right; color: var(--text-muted); font-weight: 400; }
.details-panel[open] summary::after { content: '\2212'; }

.detail-list { margin: 0 0 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.detail-list dt { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 12px; }
.detail-list dt:first-child { margin-top: 0; }
.detail-list dd { margin: 2px 0 0; font-size: 13.5px; color: var(--text); }

.qc-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 2px;
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 10px;
    color: var(--text-muted);
    cursor: help;
}

.qc-inline { margin-bottom: 8px; }
.qc-inline .detail-list { border-top: none; padding-top: 0; margin-bottom: 12px; }

/* Price history chart */
.price-chart { margin: 4px 0 8px; }
.price-chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis-label { fill: var(--text-muted); font-size: 10px; font-family: var(--font); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-fill-stop-start { stop-color: var(--accent); stop-opacity: 0.22; }
.chart-fill-stop-end { stop-color: var(--accent); stop-opacity: 0; }
.chart-end-ring { fill: var(--surface); stroke: none; }
.chart-end-dot { fill: var(--accent); }
.chart-hover-dot { fill: var(--accent); }
.chart-crosshair { stroke: var(--border); stroke-width: 1; }

.chart-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1;
}
.chart-tooltip-value { font-weight: 700; color: var(--text); }
.chart-tooltip-label { color: var(--text-muted); font-size: 11px; margin-top: 2px; }


/* ---------------------------------------------------------------------
   Homepage (marketplace/home.html): flush, minimal single-column layout.
   Two visual registers on purpose - the price list is a quiet, flat
   reference you scan; "Ongoing deals" is the one thing that gets a
   contained surface, because it's where something might need you to act.
   --------------------------------------------------------------------- */

.shell {
    max-width: 420px;
    margin-inline: auto;
    padding-inline: 16px;
    padding-block: 18px 48px;
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.topbar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    padding-block: 2px 4px;
}
.topbar .who { display: flex; flex-direction: column; gap: 2px; }
.topbar .org { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.topbar .role { font-size: 12px; color: var(--text-muted); }
.topbar .controls { display: flex; align-items: center; gap: 2px; }

.icon-btn {
    position: relative;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: none;
    border-radius: 100px;
    color: var(--text-muted);
}
.icon-btn:hover { color: var(--text); background: var(--accent-soft); }
.icon-btn .dot {
    position: absolute;
    top: 8px; right: 9px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--warning);
    border: 2px solid var(--bg);
}

/* Account menu (org switcher + sign out), tucked behind one icon */
.menu-drop { position: relative; }
.menu-drop > summary { list-style: none; }
.menu-drop > summary::-webkit-details-marker { display: none; }

.menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

.menu-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 5px;
}

.menu-panel select {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
}

.menu-panel .btn-text { font-size: 13px; width: 100%; text-align: left; }

.home-section { display: flex; flex-direction: column; }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}
.section-head h2 { font-size: 15px; font-weight: 600; margin: 0; }

.sort-row { display: flex; align-items: baseline; gap: 6px; font-size: 12px; flex-shrink: 0; margin-left: auto; }
.sort-row a { color: var(--text-muted); }
.sort-row a:hover { color: var(--text); }
.sort-row a.active { color: var(--accent); font-weight: 600; }
.sort-row .sep { color: var(--text-faint); }

/* Commodity chips */
.chip-row { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 8px; }
.chip-row::-webkit-scrollbar { display: none; }

.chip {
    flex: 0 0 auto;
    padding: 9px 15px;
    border-radius: 100px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    min-height: 40px;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Buyer rows */
.row-list { display: flex; flex-direction: column; }

.buyer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 2px;
    border-bottom: 1px solid var(--border);
    min-height: 44px;
    color: var(--text);
}
.row-list .buyer-row:last-child { border-bottom: none; }

.buyer-name { font-size: 14.5px; font-weight: 500; }
.buyer-city { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.buyer-price {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 15px;
    flex-shrink: 0;
    text-align: right;
    color: var(--text);
}
.buyer-price .unit { display: block; font-family: var(--font); font-weight: 400; font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }

.empty-note { font-size: 13px; color: var(--text-muted); padding: 14px 2px; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 36px 16px;
    color: var(--text-muted);
}
.empty-state svg { color: var(--text-faint); }
.empty-state p { font-size: 13px; margin: 0; }

/* Ongoing deals - the one contained surface on the page */
.deal-list {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px 16px;
}
.deal { border-bottom: 1px solid var(--border); }
.deal:last-child { border-bottom: none; }

.deal-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 0;
    background: transparent;
    border: none;
    color: inherit;
    text-align: left;
    min-height: 44px;
    font-family: inherit;
    cursor: pointer;
}

.deal-head .id-col { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }

.flag-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--warning);
    flex-shrink: 0;
    margin-top: 6px;
}

.deal-head .name-block { min-width: 0; }
.deal-head .name { font-size: 14.5px; font-weight: 500; color: var(--text); }
.deal-head .sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.deal-head .sub.flagged { color: var(--warning); font-weight: 500; }

.deal-head .chev { color: var(--text-faint); flex-shrink: 0; transition: transform 0.15s; }
.deal.open .chev { transform: rotate(180deg); }

.deal-body { padding: 0 0 20px 0; }

.deal-figures {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.timeline { display: flex; flex-direction: column; }

.tl-item { position: relative; padding-left: 20px; padding-bottom: 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
    content: '';
    position: absolute;
    left: 3px; top: 4px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-faint);
}
.tl-item::after {
    content: '';
    position: absolute;
    left: 5.5px; top: 13px;
    width: 1px;
    bottom: -3px;
    background: var(--border);
}
.tl-item:last-child::after { display: none; }
.tl-item.needs::before { background: var(--warning); }

.tl-title { font-size: 13px; font-weight: 500; color: var(--text); }
.tl-time { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.tl-note { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.tl-note.warn { color: var(--warning); }

.empty-tl { font-size: 12.5px; color: var(--text-muted); }

.footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    min-height: 44px;
}
.footer-link:hover { color: var(--accent); }

/* ---------------------------------------------------------------------
   Buyer detail page (marketplace/quote_history.html): same mobile-app
   width as .shell, but plain block flow instead of .shell's flex gap -
   this page carries more differently-sized element groups (identity,
   price card, chip row, chart, details, CTA) than that gap, tuned for
   home.html's handful of big sections, fits well.
   --------------------------------------------------------------------- */
.detail-shell {
    max-width: 420px;
    margin-inline: auto;
    padding-inline: 16px;
    padding-block: 18px 48px;
}

.back-context { margin-bottom: 22px; }

.buyer-identity { margin-bottom: 20px; }
.buyer-identity .name { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.buyer-identity .meta { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

.price-card { padding: 18px 20px; }
.price-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-value {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 32px;
    font-weight: 600;
    color: var(--text);
}
.price-delta { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.price-delta.up { color: var(--success); }
.price-delta.down { color: var(--danger); }
.price-meta { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.switch-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 8px; }

.chart-section { margin-bottom: 6px; }

.stat-row { display: flex; gap: 22px; margin: 2px 4px 12px; }
.stat-row .stat-label { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.stat-row .stat-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 600; color: var(--text); margin-top: 3px; }
.stat-row .stat-value.up { color: var(--success); }
.stat-row .stat-value.down { color: var(--danger); }

.range-tabs { display: flex; gap: 4px; justify-content: center; margin: 10px 0 26px; }
.range-tabs button {
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 100px;
    cursor: pointer;
    min-height: 32px;
}
.range-tabs button:hover { color: var(--text); }
.range-tabs button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-raised); }

.field textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 64px;
    line-height: 1.5;
    transition: border-color 0.15s;
}
.field textarea:focus { outline: none; border-color: var(--accent); }

/* Show-interest bottom sheet */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 50;
    padding: 0 16px;
}
.sheet-backdrop[hidden] { display: none; }

.sheet {
    width: 100%;
    max-width: 420px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    padding: 14px 20px calc(20px + env(safe-area-inset-bottom, 0px));
}
.sheet-handle { width: 36px; height: 4px; border-radius: 100px; background: var(--border); margin: 0 auto 18px; }
.sheet h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px; color: var(--text); }
.sheet .sheet-note { font-size: 13px; color: var(--text-muted); margin: 0 0 20px; line-height: 1.5; }
.sheet .sheet-actions { display: flex; gap: 10px; margin-top: 6px; }
.sheet .sheet-actions .btn { width: auto; flex: 1; }

.sheet-success { text-align: center; padding: 14px 0 4px; }
.sheet-success svg { color: var(--success); margin-bottom: 10px; }
.sheet-success p { font-size: 14px; color: var(--text); margin: 0; line-height: 1.5; }

/* ---------------------------------------------------------------------
   Deal page: claim report per truck (marketplace/deal_detail.html)
   --------------------------------------------------------------------- */
.claim-card { padding: 18px 20px; }
.claim-card.needs { border-color: var(--warning); }

.reading-list { margin: 0 0 14px; }
.reading-list .reading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid var(--border);
}
.reading-list .reading:first-child { border-top: none; }
.reading-list dt { font-size: 13.5px; color: var(--text); }
.reading-list dd { margin: 0; text-align: right; }
.reading-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 600; color: var(--text); }
.reading-limit { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.claim-ask { font-size: 13px; color: var(--text-muted); margin: 0 0 12px; line-height: 1.5; }

/* Seller's ordered/delivered/remaining totals above the trucks */
.weight-summary { padding: 18px 20px; }
.weight-summary .stat-row { margin: 0; justify-content: space-between; }
.weight-note { font-size: 11.5px; color: var(--text-muted); margin: 10px 0 0; line-height: 1.5; }

/* Each truck is a <details> dropdown - the header row is its summary */
.truck-card > summary { cursor: pointer; list-style: none; margin-bottom: 0; flex-wrap: nowrap; }
.truck-card > summary::-webkit-details-marker { display: none; }
.truck-card > summary .unit-note { margin-left: auto; }
.truck-card > summary::after {
    content: '';
    width: 7px; height: 7px;
    border-right: 2px solid var(--text-faint);
    border-bottom: 2px solid var(--text-faint);
    transform: rotate(45deg);
    margin: -4px 2px 0 0;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.truck-card[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.truck-card[open] > summary { margin-bottom: 14px; }
.truck-weights { padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.claim-actions { display: flex; flex-direction: column; gap: 8px; }

.notice {
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    color: var(--success);
    background: var(--success-bg);
}
.notice.error { color: var(--danger); background: var(--danger-bg); }

.deal-link { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 600; }

/* ---------------------------------------------------------------------
   Broker console (templates/console/) - staff, desktop-first but usable
   on a phone: wide tables scroll inside their panel, not the page.
   --------------------------------------------------------------------- */
.console .mono { font-family: var(--font-mono); font-size: 12.5px; }
.console .cell-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.console .row-actions { white-space: nowrap; text-align: right; }
.console .row-actions a, .console .row-actions form { display: inline-block; margin-left: 12px; }
.console .row-actions a:first-child, .console .row-actions form:first-child { margin-left: 0; }
.table-wrap { overflow-x: auto; }

.console-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.console-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.console-stat .stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.console-stat .stat-value { font-family: var(--font-mono); font-size: 24px; font-weight: 600; color: var(--text); margin-top: 4px; }
.console-stat .stat-note { font-size: 12px; margin-top: 2px; color: var(--warning); }
.console-stat.warn { border-color: var(--warning); }
.console-stat.danger { border-color: var(--danger); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 100px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); background: var(--surface-raised); white-space: nowrap; }
.pill.ok { color: var(--success); background: var(--success-bg); }
.pill.warn { color: var(--warning); background: var(--warning-bg); }
.pill.danger { color: var(--danger); background: var(--danger-bg); }

/* Console: notifications feed - side by side on desktop, stacked on a phone */
.notes { list-style: none; margin: 0; padding: 0; }
.note { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.note:first-child { border-top: none; }
.note-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.note-title { font-size: 14px; font-weight: 600; color: var(--text); }
.note-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; flex-shrink: 0; font-size: 13px; }
@media (max-width: 640px) {
    .note { flex-direction: column; align-items: flex-start; gap: 8px; }
}

.chat { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.bubble { max-width: 560px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.bubble.in { align-self: flex-start; }
.bubble.out { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.bubble.failed { border-color: var(--danger); background: var(--danger-bg); }
.bubble-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.bubble-text { font-size: 13.5px; color: var(--text); line-height: 1.5; }
.bubble-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.bubble form { margin-top: 6px; }
.console .btn-text { border: none; font: inherit; font-size: 13px; color: var(--accent); cursor: pointer; }
.console .btn-text:hover { color: var(--accent-hover); }

/* Console: WhatsApp chat list (templates/console/conversations.html) */
.inbox-search { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.inbox-search input {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    font: inherit;
    font-size: 13.5px;
}
.inbox-search .btn { width: auto; }
.console .dir { color: var(--text-muted); font-weight: 600; margin-right: 4px; }
