@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

/* ============================================================
   Design tokens — shared with public site
   ============================================================ */
:root {
    --bg: #eef2ff;
    --paper: #f8fbff;
    --paper-strong: #ffffff;
    --ink: #0f172a;
    --muted: #475569;
    --line: #d9e2f2;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --accent-soft: #dbeafe;
    --signal: #1e40af;
    --signal-soft: #e0e7ff;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
    --shadow-lg: 0 12px 40px rgba(37, 99, 235, 0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-body: "Inter", "Noto Sans", "Helvetica Neue", sans-serif;
    --sidebar-w: 240px;
    --topbar-h: 56px;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #0b1527;
        --paper: #0f1a2f;
        --paper-strong: #f8fafc;
        --ink: #e2e8f0;
        --muted: #94a3b8;
        --line: #334155;
        --accent: #60a5fa;
        --accent-strong: #3b82f6;
        --accent-soft: #1e3a5f;
        --signal: #93c5fd;
        --signal-soft: #1f3657;
        --danger: #f87171;
        --danger-soft: #1c1317;
        --success: #4ade80;
        --success-soft: #0f1d15;
        --warning: #fbbf24;
        --warning-soft: #1a1708;
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
        --shadow: 0 4px 16px rgba(2, 6, 23, 0.3);
        --shadow-lg: 0 12px 40px rgba(2, 6, 23, 0.5);
    }
}

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   App shell layout
   ============================================================ */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-areas:
        "sidebar topbar"
        "sidebar main";
    min-height: 100vh;
}

/* ---- Top bar ---- */
.app-topbar {
    grid-area: topbar;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.app-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-topbar-left h1 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.app-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.app-breadcrumb a { color: var(--muted); }
.app-breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.app-breadcrumb .sep { opacity: 0.4; }

.app-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
}

.app-user-name {
    color: var(--muted);
}

.app-topbar-right a {
    color: var(--muted);
    font-size: 13px;
}

/* ---- Sidebar ---- */
.app-sidebar {
    grid-area: sidebar;
    background: var(--paper);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 30;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--topbar-h);
    padding: 0 20px;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
    font-size: 16px;
    color: var(--accent);
    text-decoration: none;
}
.app-sidebar-brand:hover { text-decoration: none; }

.app-sidebar-brand__mark {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    background: var(--accent);
    flex-shrink: 0;
}

.app-sidebar-tenant {
    padding: 12px 20px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.app-sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 4px 8px;
    flex: 1;
}

.app-sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    transition: background 0.15s;
}

.app-sidebar-nav li a:hover {
    background: var(--accent-soft);
    text-decoration: none;
}

.app-sidebar-nav li a.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.app-sidebar-nav .nav-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
    font-variation-settings: 'FILL' 0, 'wght' 400;
}

.app-sidebar-section {
    padding: 16px 20px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.app-sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

/* ---- Main content ---- */
.app-main {
    grid-area: main;
    padding: 24px 32px;
    overflow-y: auto;
}

.app-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.app-page-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

/* ============================================================
   Cards & panels
   ============================================================ */
.app-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.app-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.app-card-header h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.app-card + .app-card {
    margin-top: 16px;
}

/* ============================================================
   Action dashboard — operational cockpit
   ============================================================ */
.app-action-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.app-action-card {
    display: block;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s;
}

.app-action-card:hover {
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.10));
    border-color: var(--accent);
}

.app-action-card--warn {
    border-color: var(--warning, #d97706);
}

.app-action-card--bill {
    border-color: var(--success, #2a7a2a);
}

.app-action-card-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 4px;
}

.app-action-card-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Worker job cards */
.app-job-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-job-card {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: background 0.1s, border-color 0.1s;
}

@media (hover: hover) {
    .app-job-card:hover {
        background: var(--accent-soft);
        border-color: var(--accent);
    }
}

.app-job-card-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
}

.app-job-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
}

/* ============================================================
   Shift week coverage grid (records-shift-week.php)
   ============================================================ */

.app-shift-week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.app-shift-week-nav-label {
    font-weight: 600;
    font-size: 14px;
    text-align: center;
}

.app-shift-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.app-shift-week-day {
    min-width: 110px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
    overflow: hidden;
}

.app-shift-week-day--today {
    border-color: var(--accent);
}

.app-shift-week-day--empty {
    opacity: 0.55;
}

.app-shift-week-day-header {
    padding: 8px 10px 6px;
    border-bottom: 1px solid var(--line);
    background: var(--canvas, var(--bg));
}

.app-shift-week-day-abbr {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.app-shift-week-day-num {
    display: block;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.app-shift-week-day--today .app-shift-week-day-num {
    color: var(--accent);
}

.app-shift-week-day-coverage {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.app-shift-week-cov {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 9999px;
}

.app-shift-week-cov--ok {
    background: var(--success-soft);
    color: var(--success);
}

.app-shift-week-cov--warn {
    background: var(--warning-soft);
    color: var(--warning);
}

.app-shift-week-cov--danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.app-shift-week-day-shifts {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 36px;
}

.app-shift-week-shift {
    display: block;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    border-left-width: 3px;
    text-decoration: none;
    color: inherit;
    font-size: 12px;
    background: var(--paper);
    transition: background 0.1s;
}

@media (hover: hover) {
    .app-shift-week-shift:hover {
        background: var(--accent-soft);
    }
}

.app-shift-week-shift--confirmed {
    border-left-color: var(--success);
}

.app-shift-week-shift--unconfirmed {
    border-left-color: var(--warning);
}

.app-shift-week-shift--unassigned {
    border-left-color: var(--danger);
    background: var(--danger-soft);
}

.app-shift-week-shift--unassigned .app-shift-week-shift-person {
    color: var(--danger);
    font-style: italic;
}

.app-shift-week-shift--cancelled {
    border-left-color: var(--muted);
    opacity: .45;
}

.app-shift-week-shift--cancelled .app-shift-week-shift-person {
    text-decoration: line-through;
}

.app-shift-week-shift-person {
    font-weight: 600;
    margin-bottom: 2px;
}

.app-shift-week-shift-time,
.app-shift-week-shift-role {
    color: var(--muted);
    font-size: 11px;
}

.app-shift-week-confirm-btn {
    display: block;
    width: 100%;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
}

@media (hover: hover) {
    .app-shift-week-confirm-btn:hover {
        background: var(--accent);
        color: #fff;
    }
}

.app-shift-week-gap {
    font-size: 12px;
    color: var(--muted);
    padding: 6px 4px;
    font-style: italic;
}

.app-shift-week-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    margin-top: 4px;
}

.app-shift-week-sum-ok   { color: var(--success); font-weight: 500; }
.app-shift-week-sum-warn { color: var(--warning);  font-weight: 500; }
.app-shift-week-sum-gap  { color: var(--danger);   font-weight: 500; }

/* On mobile: hide week grid, keep card list */
@media (max-width: 640px) {
    .app-shift-week-grid { display: none; }
    .app-shift-week-nav  { display: none; }
    .app-shift-week-summary { display: none; }
}

.app-shift-week-flash {
    font-weight: 500;
    font-size: 14px;
    padding: 14px 18px;
    margin-bottom: 14px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* Shift brief (shift-detail.php header card) */
.app-shift-brief-card {
    margin-bottom: 16px;
}

.app-shift-brief {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
}

.app-shift-brief-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.app-shift-brief-item .material-symbols-outlined {
    font-size: 18px;
    color: var(--muted);
}

.app-shift-brief-tpl {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

/* Lead activity timeline */
.app-lead-timeline {
    display: flex;
    flex-direction: column;
}

.app-lead-timeline-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.app-lead-timeline-item:last-child {
    border-bottom: none;
}

.app-lead-timeline-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--canvas);
    color: var(--muted);
}

.app-lead-timeline-item--transition .app-lead-timeline-icon {
    background: var(--accent-soft);
    color: var(--accent);
}

.app-lead-timeline-body {
    flex: 1;
    min-width: 0;
}

.app-lead-timeline-item--auto {
    opacity: .55;
}

.app-lead-timeline-item--auto .app-lead-timeline-icon {
    width: 22px;
    height: 22px;
}

/* ============================================================
   Stats grid (dashboard)
   ============================================================ */
.app-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.app-stat {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
}

.app-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.app-stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

/* ============================================================
   Tables
   ============================================================ */
.app-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.app-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    border-bottom: 2px solid var(--line);
}

.app-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.app-table tbody tr:hover {
    background: var(--accent-soft);
}

.app-table-link {
    color: var(--ink);
    font-weight: 500;
}

.app-table-link:hover {
    color: var(--accent);
}

/* ============================================================
   Badges / status pills
   ============================================================ */
.app-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.app-badge--draft     { background: var(--line); color: var(--muted); }
.app-badge--active    { background: var(--accent-soft); color: var(--accent); }
.app-badge--progress  { background: var(--signal-soft); color: var(--signal); }
.app-badge--done      { background: var(--success-soft); color: var(--success); }
.app-badge--danger    { background: var(--danger-soft); color: var(--danger); }
.app-badge--warning   { background: var(--warning-soft); color: var(--warning); }

/* Invoice state pills on billing card */
.app-badge--success {
    background: var(--success-soft);
    color: var(--success);
    border-color: var(--success);
}
.app-badge--signal {
    background: var(--signal-soft);
    color: var(--signal);
    border-color: var(--signal);
}
.app-badge--muted {
    background: transparent;
    color: var(--muted);
    border-color: var(--line);
}

/* Job status summary row — manager at-a-glance on work order detail */
.app-job-status-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
    overflow: hidden;
}
.app-job-status-item {
    padding: 10px 14px;
    border-right: 1px solid var(--line);
}
.app-job-status-item:last-child { border-right: none; }
.app-job-status-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 3px;
}
.app-job-status-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
}
.app-job-status-missing { color: var(--warning); }

/* Worker job card next-action hint */
.app-job-card-secondary {
    font-size: 11px;
    color: var(--muted);
    margin-top: 5px;
}

.app-job-card-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
}

/* Worker action bar on work order detail (mobile-first field actions) */
.app-worker-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--accent-soft);
    border-radius: var(--radius-md);
}
.app-btn--worker-action {
    font-size: 15px;
    padding: 10px 20px;
    min-width: 140px;
    text-align: center;
}
.app-worker-location {
    font-size: 13px;
    color: var(--ink);
}

/* Invoice lifecycle step track */
.app-inv-track {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin: 12px 0 4px;
}
.app-inv-track-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    font-size: 11px;
    color: var(--muted);
}
.app-inv-track-step::before {
    content: '';
    position: absolute;
    top: 9px;
    left: calc(50% + 9px);
    right: calc(-50% + 9px);
    height: 2px;
    background: var(--line);
}
.app-inv-track-step:last-child::before { display: none; }
.app-inv-track-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--line);
    background: var(--paper);
    margin-bottom: 5px;
    position: relative;
    z-index: 1;
}
.app-inv-track-step--done .app-inv-track-dot {
    border-color: var(--accent);
    background: var(--accent);
}
.app-inv-track-step--done::before { background: var(--accent); }
.app-inv-track-step--done { color: var(--accent); }
.app-inv-track-step--current .app-inv-track-dot {
    border-color: var(--accent);
    background: var(--paper);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.app-inv-track-step--current { color: var(--ink); font-weight: 600; }
.app-inv-track-label { text-align: center; line-height: 1.3; }

/* Worker job brief description */
.app-worker-desc {
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px;
    color: var(--ink);
}

/* ============================================================
   Buttons
   ============================================================ */
.app-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
    color: var(--ink);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
}

.app-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    text-decoration: none;
}

.app-btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.app-btn--primary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.app-btn--danger {
    color: var(--danger);
    border-color: var(--danger);
}

.app-btn--danger:hover {
    background: var(--danger-soft);
}

.app-btn--sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* ============================================================
   Forms
   ============================================================ */
.app-form-group {
    margin-bottom: 16px;
}

.app-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.app-input,
.app-select,
.app-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
    color: var(--ink);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}

.app-input:focus,
.app-select:focus,
.app-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.app-textarea { resize: vertical; min-height: 80px; }

/* ============================================================
   Alerts
   ============================================================ */
.app-alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.app-alert--success { background: var(--success-soft); color: var(--success); }
.app-alert--danger  { background: var(--danger-soft); color: var(--danger); }
.app-alert--warning { background: var(--warning-soft); color: var(--warning); }
.app-alert--info    { background: var(--accent-soft); color: var(--accent); }

/* ============================================================
   Review strip (time entry / expense report manager summary)
   ============================================================ */
.app-review-strip {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.app-review-strip-item {
    display: flex;
    flex-direction: column;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--paper);
    text-decoration: none;
    color: var(--ink);
    min-width: 100px;
}

@media (hover: hover) {
    .app-review-strip-item:hover { border-color: var(--accent); }
}

.app-review-strip-val {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.app-review-strip-label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.app-review-strip-item--warn {
    border-left: 3px solid var(--warning);
}

.app-review-strip-item--warn .app-review-strip-val {
    color: var(--warning);
}

.app-review-strip-item--ok {
    border-left: 3px solid var(--success);
}

.app-review-strip-item--ok .app-review-strip-val {
    color: var(--success);
}

.app-review-strip-item--accent {
    border-left: 3px solid var(--accent);
}

.app-review-strip-item--accent .app-review-strip-val {
    color: var(--accent);
}

/* ============================================================
   Self-queue: worker's own records grouped by what to do next.
   Card list is visible on ALL viewports (this is the primary
   worker surface, not a mobile-only fallback).
   ============================================================ */
.app-queue-summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 20px;
}
.app-queue-summary__val {
    font-size: 28px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
}
.app-queue-summary__label {
    font-size: 13px;
    color: var(--muted);
}

.app-queue-group { margin-bottom: 24px; }

.app-queue-group__head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 10px;
    padding-left: 10px;
    border-left: 3px solid var(--line);
}
.app-queue-group__head--danger { border-left-color: var(--danger); color: var(--danger); }
.app-queue-group__head--warn   { border-left-color: var(--warning); }
.app-queue-group__head--ok      { border-left-color: var(--success); }

.app-queue-group__count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 1px 9px;
}

.app-queue-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Manager approval queue */
.app-approve-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}
.app-approve-bar__sel {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
}
.app-approve-owner td { background: var(--paper); }

.app-flag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    padding: 1px 8px;
    border-radius: 999px;
    margin: 1px 2px 1px 0;
    white-space: nowrap;
}
.app-flag--warn {
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid var(--danger);
}
.app-flag--info {
    color: var(--muted);
    background: var(--paper);
    border: 1px solid var(--line);
}

/* ============================================================
   Public demo — banner + one-time splash. Mobile-first: ~80% of
   demo visitors are on phones. Full-width splash card, >=44px taps.
   ============================================================ */
.app-demo-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 13px;
    font-weight: 600;
}
.app-demo-banner__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.app-demo-banner .app-btn { min-height: 40px; }

.app-demo-splash {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(15, 23, 42, 0.55);
}
.app-demo-splash__card {
    background: var(--paper-strong, #fff);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.app-demo-splash__card h2 { margin: 0 0 10px; font-size: 20px; }
.app-demo-splash__card p { margin: 0 0 18px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.app-demo-splash__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.app-demo-splash__actions .app-btn { min-height: 44px; flex: 1 1 140px; justify-content: center; }

@media (max-width: 640px) {
    .app-demo-splash__card { padding: 18px; }
    .app-demo-banner { font-size: 12px; }
}

/* ============================================================
   Empty state
   ============================================================ */
.app-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--muted);
}

.app-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.app-empty h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--ink);
}

.app-empty p {
    font-size: 13px;
    margin: 0;
}

/* ============================================================
   Detail page
   ============================================================ */
.app-detail-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}

.app-detail-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}

.app-detail-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 2px;
}

.app-detail-field .value {
    font-size: 14px;
}

/* Workflow actions sidebar */
.app-workflow-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* On mobile: workflow transition buttons become large primary CTAs */
@media (max-width: 640px) {
    .app-workflow-actions .app-btn {
        background: var(--accent);
        color: white;
        border-color: var(--accent);
        font-size: 16px;
        padding: 13px 16px;
        font-weight: 600;
        justify-content: center;
    }
    .app-workflow-actions .app-btn:hover {
        opacity: 0.88;
        background: var(--accent);
    }
}

/* ============================================================
   Mobile menu toggle
   ============================================================ */
.app-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-size: 22px;
    padding: 0;
}

.app-menu-toggle:hover {
    background: var(--accent-soft);
}

.app-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 29;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    /* Action strip: 3 columns on tablet */
    .app-action-strip {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .app-shell {
        grid-template-columns: 1fr;
        grid-template-areas:
            "topbar"
            "main";
    }

    .app-menu-toggle {
        display: flex;
    }

    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 30;
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-sidebar-overlay.is-open {
        display: block;
    }

    .app-topbar {
        padding: 0 16px;
    }

    .app-topbar-right .app-user-name {
        display: none;
    }

    .app-main {
        padding: 16px;
    }

    .app-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .app-page-header h1 {
        font-size: 18px;
    }

    /* Stats grid */
    .app-stats {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .app-stat {
        padding: 12px 14px;
    }

    .app-stat-value {
        font-size: 22px;
    }

    /* Tables */
    .app-table th,
    .app-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    /* Detail page */
    .app-detail-grid {
        grid-template-columns: 1fr;
    }

    /* Surface workflow sidebar above detail cards on mobile */
    .app-detail-grid > div:last-child {
        order: -1;
    }

    .app-detail-fields {
        grid-template-columns: 1fr;
    }

    /* Cards */
    .app-card {
        padding: 16px;
    }

    /* Breadcrumb */
    .app-breadcrumb {
        font-size: 12px;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .app-stats {
        grid-template-columns: 1fr 1fr;
    }

    /* Action strip: single column on mobile */
    .app-action-strip {
        grid-template-columns: 1fr 1fr;
    }

    .app-action-card-value {
        font-size: 24px;
    }

    /* Records table: horizontal scroll instead of compression */
    .app-card {
        overflow-x: auto;
    }

    .app-topbar-left h1 {
        font-size: 14px;
    }
}

/* ============================================================
   Line item edit tables — mobile card layout
   ============================================================ */
@media (max-width: 640px) {
    .line-items-edit-table thead {
        display: none;
    }

    .line-items-edit-table,
    .line-items-edit-table tbody,
    .line-items-edit-table tr,
    .line-items-edit-table td {
        display: block;
        width: 100%;
    }

    .line-items-edit-table tr {
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        padding: 10px;
        margin-bottom: 10px;
        position: relative;
    }

    .line-items-edit-table td {
        padding: 4px 0 !important;
        text-align: left !important;
        width: 100% !important;
    }

    /* Field labels via data-label */
    .line-items-edit-table td[data-label]:not([data-label=""])::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        font-weight: 600;
        color: var(--muted);
        margin-bottom: 2px;
    }

    /* Full-width inputs */
    .line-items-edit-table td input,
    .line-items-edit-table td select {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Thumbnail: inline at top */
    .line-items-edit-table td[data-label=""]:first-child {
        display: inline-block;
        width: auto !important;
    }

    /* Delete button: top-right corner */
    .line-items-edit-table td:last-child {
        position: absolute;
        top: 8px;
        right: 8px;
        width: auto !important;
    }

    /* Amount row: visual separator (second-to-last cell) */
    .line-items-edit-table td:nth-last-child(2) {
        font-weight: 600;
        border-top: 1px solid var(--line);
        margin-top: 4px;
        padding-top: 6px !important;
    }

    /* Distance calculator: stack vertically */
    #distance-panel > div {
        flex-direction: column;
    }
    #distance-panel > div > div {
        min-width: 0 !important;
    }

    /* Quick time entry: two-column grid on mobile */
    .app-card form > div[style*="flex-wrap"] > div {
        min-width: 0 !important;
        flex: 1 1 45%;
    }
}

/* ============================================================
   Auth pages (login, reset-password)
   ============================================================ */
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.auth-header {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 0 24px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: var(--accent);
    text-decoration: none;
}

.auth-brand:hover { text-decoration: none; }

.auth-brand__mark {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    background: var(--accent);
    flex-shrink: 0;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-body {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    flex-shrink: 0;
}

/* Alert styles shared by auth pages */
.alerts {
    display: grid;
    gap: 8px;
}

.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert.error {
    background: var(--danger-soft);
    color: var(--danger);
}

.alert.success {
    background: var(--success-soft);
    color: var(--success);
}

/* Full-width button for auth forms */
.app-btn--block {
    width: 100%;
    justify-content: center;
}

/* ============================================================
   Records toolbar (view tabs + search)
   ============================================================ */
.records-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.records-toolbar__views {
    display: flex;
    gap: 4px;
}

.records-toolbar__search {
    margin-left: auto;
}

.records-toolbar__search .app-input {
    width: 200px;
    padding: 4px 10px;
    font-size: 13px;
}

@media (max-width: 640px) {
    .records-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .records-toolbar__views {
        justify-content: stretch;
    }
    .records-toolbar__views .app-btn {
        flex: 1;
        justify-content: center;
    }
    .records-toolbar__label {
        display: none;
    }
    .records-toolbar__search {
        margin-left: 0;
    }
    .records-toolbar__search .app-input {
        width: 100%;
    }
}

/* ============================================================
   Kanban board
   ============================================================ */
.kanban-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 16px;
    min-height: 300px;
}

.kanban-col {
    min-width: 220px;
    max-width: 300px;
    flex: 1 0 220px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 10px;
    transition: outline 0.15s;
}

.kanban-col.is-drag-over {
    outline: 2px dashed var(--accent);
    outline-offset: -2px;
}

.kanban-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.kanban-col-count {
    font-size: 12px;
    color: var(--muted);
}

.kanban-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: grab;
    transition: opacity 0.15s, box-shadow 0.15s;
}

.kanban-card:hover {
    box-shadow: var(--shadow);
}

.kanban-card.is-dragging {
    opacity: 0.4;
}

.kanban-card-title {
    display: block;
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 4px;
    text-decoration: none;
    color: var(--ink);
}

.kanban-card-title:hover {
    color: var(--accent);
}

.kanban-card-meta {
    font-size: 11px;
    color: var(--muted);
}

@media (max-width: 640px) {
    .kanban-col {
        min-width: 200px;
        flex: 1 0 200px;
    }
}

/* ============================================================
   Calendar view
   ============================================================ */
.cal-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.cal-nav-title {
    font-weight: 600;
    font-size: 16px;
    min-width: 140px;
    text-align: center;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.cal-header {
    background: var(--bg);
    padding: 6px 2px;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    color: var(--muted);
}

.cal-day {
    background: var(--paper);
    min-height: 90px;
    padding: 4px;
    vertical-align: top;
    cursor: pointer;
}

.cal-day--other {
    opacity: 0.35;
}

.cal-day--today .cal-day-num {
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cal-day.is-selected {
    background: var(--accent-soft);
}

.cal-day-num {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-align: center;
    margin-bottom: 2px;
}

/* Dots: shown on mobile, hidden on desktop */
.cal-day-dots {
    display: none;
    justify-content: center;
    gap: 3px;
    padding: 2px 0;
}

.cal-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

/* Pills: shown on desktop, hidden on mobile */
.cal-pill {
    display: block;
    font-size: 11px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-bottom: 1px;
    text-decoration: none;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--bg);
    border: 1px solid var(--line);
}

.cal-pill:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.cal-overflow {
    font-size: 10px;
    color: var(--muted);
    text-align: center;
}

/* Agenda list below the calendar */
.cal-agenda {
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
}

.cal-agenda[hidden] {
    display: none;
}

.cal-agenda-header {
    padding: 10px 14px;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}

.cal-agenda-empty {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--muted);
}

.cal-agenda-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink);
    font-size: 13px;
}

.cal-agenda-item:last-child {
    border-bottom: none;
}

.cal-agenda-item:hover {
    background: var(--accent-soft);
}

.cal-agenda-item .app-badge {
    flex-shrink: 0;
}

/* Mobile: dots + compact cells */
@media (max-width: 640px) {
    .cal-day {
        min-height: 44px;
        padding: 2px;
    }
    .cal-day-num {
        font-size: 11px;
    }
    .cal-day--today .cal-day-num {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
    .cal-day-dots {
        display: flex;
    }
    .cal-pill,
    .cal-overflow {
        display: none;
    }
    .cal-nav-title {
        font-size: 14px;
        min-width: 120px;
    }
}

/* ============================================================
   Lookup typeahead
   ============================================================ */
.lookup-wrapper {
    position: relative;
}

.lookup-results {
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    max-height: 240px;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.lookup-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
}

.lookup-item:hover {
    background: var(--accent-soft);
}

.lookup-empty {
    padding: 8px 12px;
    color: var(--muted);
    font-size: 13px;
}

/* ============================================================
   Toast notifications
   ============================================================ */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.app-toast {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    box-shadow: var(--shadow);
    pointer-events: auto;
    max-width: 320px;
    animation: toast-in 0.2s ease;
}

.app-toast--out {
    animation: toast-out 0.3s ease forwards;
}

.app-toast--danger  { background: var(--danger-soft);  color: var(--danger);  border: 1px solid var(--danger); }
.app-toast--success { background: var(--success-soft); color: var(--success); border: 1px solid var(--success); }
.app-toast--warning { background: var(--warning-soft); color: var(--warning); border: 1px solid var(--warning); }

@keyframes toast-in  { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-8px); } }

/* ============================================================
   Kanban transition modal
   ============================================================ */
.kanban-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 8000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kanban-modal-box {
    background: var(--paper);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    width: 100%;
    max-width: 360px;
}

.kanban-modal-box h3 {
    margin: 0 0 16px;
    font-size: 15px;
}

.kanban-modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ============================================================
   Kanban warning badge
   ============================================================ */
.kanban-card-warn {
    font-size: 12px;
    color: var(--warning);
    margin-left: 4px;
    cursor: default;
}

/* ============================================================
   Records list table — mobile: show title+status only
   ============================================================ */
@media (max-width: 640px) {
    /* Hide ID column, non-first field columns, owner, and updated columns.
       Keep: first table_field (title/name — column 2) and status (second-to-last). */
    .records-table th:first-child,
    .records-table td:first-child,
    .records-table th:nth-child(n+3):not(:nth-last-child(2)):not(:nth-last-child(1)),
    .records-table td:nth-child(n+3):not(:nth-last-child(2)):not(:nth-last-child(1)),
    .records-table th:last-child,
    .records-table td:last-child {
        display: none;
    }
}

/* Work-order list: card layout on mobile, table on desktop */
.app-wo-card-list { display: none; }
.records-status-select { display: none; }

.records-status-filters {
    display: flex;
    margin-bottom: 16px;
}
.records-status-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Focus ring: remove browser default on job cards (tap artifact on mobile) */
.app-job-card:focus { outline: none; }
.app-job-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app-job-card { -webkit-tap-highlight-color: transparent; }

@media (max-width: 640px) {
    /* Work order list: swap table for cards */
    .app-wo-card-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .records-table-wrap--wo { display: none; }

    /* View toggle: hide for work order (cards replace table; kanban/calendar not useful on mobile) */
    .records-toolbar--wo .records-toolbar__views { display: none; }

    /* Status filter: hide chips, show select */
    .records-status-filters--wo .records-status-chips { display: none; }
    .records-status-filters--wo .records-status-select {
        display: block;
        width: 100%;
        font-size: 14px;
        padding: 6px 10px;
    }

    /* Tighten top chrome on records pages */
    .app-page-header { margin-bottom: 12px; }
    .records-status-filters--wo { margin-bottom: 10px; }
    .records-toolbar--wo { margin-bottom: 8px; }
}

/* Job status row: 2-column grid on mobile */
@media (max-width: 640px) {
    .app-job-status-row {
        grid-template-columns: 1fr 1fr;
    }
    .app-job-status-item {
        border-right: none;
        border-bottom: 1px solid var(--line);
    }
    .app-job-status-item:nth-child(odd)  { border-right: 1px solid var(--line); }
    .app-job-status-item:nth-child(3),
    .app-job-status-item:nth-child(4)    { border-bottom: none; }
}

/* ============================================================
   Call Queue — mobile-first dialer styles
   ============================================================ */

/* Stats bar */
.cq-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--paper);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
}
.cq-stat { display: flex; flex-direction: column; align-items: center; min-width: 50px; }
.cq-stat-value { font-size: 20px; font-weight: 700; color: var(--ink); }
.cq-stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.cq-stat--danger .cq-stat-value { color: var(--danger); }
.cq-stat--accent .cq-stat-value { color: var(--accent); }
.cq-stat--success .cq-stat-value { color: var(--success); }

/* Current lead card */
.cq-current-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: var(--shadow);
}
.cq-current-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.cq-current-company {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}
.cq-current-contact {
    font-size: 14px;
    color: var(--muted);
    margin-top: 2px;
}
.cq-deal-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
    white-space: nowrap;
}

/* Last note */
.cq-last-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    margin-bottom: 16px;
    line-height: 1.4;
}

/* Call button */
.cq-call-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: var(--success);
    border-radius: var(--radius-md);
    text-decoration: none;
    margin-bottom: 12px;
    transition: background 0.15s;
}
.cq-call-btn:hover { background: #15803d; }
.cq-call-btn .material-symbols-rounded { font-size: 22px; }

/* Contact secondary row (SMS, copy, email) */
.cq-contact-actions { margin-bottom: 16px; }
.cq-contact-secondary {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* Fast dispositions (one-click, top row) */
.cq-fast-dispositions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

/* Disposition buttons */
.cq-dispositions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}
@media (min-width: 480px) {
    .cq-dispositions { grid-template-columns: repeat(4, 1fr); }
}

.cq-disp-btn--accent .material-symbols-rounded { color: var(--accent); }
.cq-disp-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    color: var(--ink);
    transition: all 0.15s;
}
.cq-disp-btn:hover { border-color: var(--accent); }
.cq-disp-btn .material-symbols-rounded { font-size: 20px; }
.cq-disp-btn--selected { border-color: var(--accent); background: var(--accent-soft); }
.cq-disp-btn--success .material-symbols-rounded { color: var(--success); }
.cq-disp-btn--warning .material-symbols-rounded { color: var(--warning); }
.cq-disp-btn--muted .material-symbols-rounded { color: var(--muted); }
.cq-disp-btn--info .material-symbols-rounded { color: var(--accent); }
.cq-disp-btn--danger .material-symbols-rounded { color: var(--danger); }

/* (disposition grid responsive handled above) */

/* Upcoming queue list */
.cq-upcoming { display: flex; flex-direction: column; }
.cq-upcoming-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink);
    font-size: 13px;
    transition: background 0.1s;
}
.cq-upcoming-item:last-child { border-bottom: none; }
.cq-upcoming-item:hover { background: var(--bg); }
.cq-upcoming-main { display: flex; flex-direction: column; gap: 1px; }
.cq-upcoming-company { font-weight: 600; }
.cq-upcoming-contact { font-size: 12px; color: var(--muted); }
.cq-upcoming-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Mobile: tighter spacing */
@media (max-width: 480px) {
    .cq-current-card { padding: 16px; }
    .cq-current-company { font-size: 18px; }
    .cq-call-btn { font-size: 16px; padding: 12px 16px; }
    .cq-disp-btn { padding: 8px 2px; font-size: 10px; }
}
