/* ═══════════════════════════════════════════════════════
   GDX Platform — Core Stylesheet
   Mobile-first, field-ready, professional
   ═══════════════════════════════════════════════════════ */

/* ── Reset & Variables ─────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Colors — light, high-contrast for outdoor use */
    --bg-primary: #f4f5f7;
    --bg-card: #ffffff;
    --bg-hover: #f0f1f3;
    --bg-active: #e8eaed;

    --text-primary: #1a1d23;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-inverse: #ffffff;

    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #dbeafe;
    --accent-bg: #eff6ff;

    --green: #16a34a;
    --green-light: #dcfce7;
    --yellow: #ca8a04;
    --yellow-light: #fef9c3;
    --red: #dc2626;
    --red-light: #fee2e2;
    --blue: #2563eb;
    --blue-light: #dbeafe;
    --gray: #6b7280;
    --gray-light: #f3f4f6;

    --border: #e5e7eb;
    --border-strong: #d1d5db;

    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);

    --topbar-height: 56px;
    --sidenav-width: 240px;

    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }

/* ── Typography ────────────────────────────────────── */
h1, h2, h3 { font-weight: 600; line-height: 1.3; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }

/* ── Top bar ───────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.3px;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar-user {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}
.topbar-role { font-size: 11px; }

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
}
.menu-toggle:hover { background: var(--bg-hover); }

/* ── Side nav ──────────────────────────────────────── */
.sidenav {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    z-index: 200;
    transition: left 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.nav-open .sidenav { left: 0; }

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 150;
    display: none;
}
.nav-open .nav-overlay { display: block; }

.sidenav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.sidenav-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.sidenav-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
}

.sidenav-links {
    list-style: none;
    padding: 12px;
    flex: 1;
}
.sidenav-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}
.sidenav-links li a:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidenav-links li.active a { background: var(--accent-light); color: var(--accent); }
.sidenav-links li a svg { flex-shrink: 0; }

.nav-section {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 20px 16px 8px;
}

.sidenav-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}
.sidenav-logout {
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
}
.sidenav-logout:hover { color: var(--text-primary); }

/* ── Main content ──────────────────────────────────── */
.main-content {
    padding: calc(var(--topbar-height) + 16px) 16px 32px;
    margin: 0 auto;
}

/* ── Page header ───────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.page-title {
    font-size: 24px;
    font-weight: 700;
}
.page-count {
    font-size: 14px;
    color: var(--text-muted);
    background: var(--gray-light);
    padding: 2px 10px;
    border-radius: 12px;
}

.back-link {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
}
.back-link:hover { color: var(--text-primary); text-decoration: none; }

/* ── Buttons ───────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
    font-family: var(--font);
}
.btn:hover { background: var(--bg-hover); text-decoration: none; }

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

.btn-green {
    background: var(--green);
    color: var(--text-inverse);
    border-color: var(--green);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-outline:hover { background: var(--bg-hover); }

.btn-danger {
    background: var(--red);
    color: var(--text-inverse);
    border-color: var(--red);
}
.btn-danger:hover { opacity: 0.9; }

.btn-full { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn:disabled, .btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Cards ─────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.card-title {
    font-size: 16px;
    font-weight: 600;
}
.card-body {
    padding: 20px;
}

/* ── Forms ─────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-group .optional {
    font-weight: 400;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;  /* 16px prevents iOS zoom */
    font-family: var(--font);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.15s;
    -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.form-group textarea { resize: vertical; min-height: 80px; }

.form-row, .form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.form-row-3 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 12px;
}

/* ── Alerts ────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 500;
}
.alert-error {
    background: var(--red-light);
    color: var(--red);
    border: 1px solid #fca5a5;
}
.alert-success {
    background: var(--green-light);
    color: var(--green);
    border: 1px solid #86efac;
}
.alert-info {
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid #93c5fd;
}

/* ── Badges ────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    line-height: 1.4;
}
.badge-gray  { background: var(--gray-light); color: var(--gray); }
.badge-blue  { background: var(--blue-light); color: var(--blue); }
.badge-yellow { background: var(--yellow-light); color: var(--yellow); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-red   { background: var(--red-light); color: var(--red); }
.badge-purple { background: #f3e8ff; color: #7c3aed; }
.badge-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }

/* ── Filter bar ────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}
.filter-chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.15s;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.filter-chip.active {
    background: var(--accent);
    color: var(--text-inverse);
    border-color: var(--accent);
}

/* ── Search bar ────────────────────────────────────── */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 14px;
    margin-bottom: 16px;
}
.search-bar svg { flex-shrink: 0; color: var(--text-muted); }
.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 15px;
    font-family: var(--font);
    color: var(--text-primary);
    outline: none;
}

/* ── Job cards (list) ──────────────────────────────── */
.job-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.job-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.job-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    text-decoration: none;
}
.job-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.job-card-number {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}
.job-card-customer {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.job-card-address {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.job-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Empty state ───────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state svg { margin: 0 auto 16px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text-primary); }
.empty-state p { margin-bottom: 20px; }

/* ── Info grid ─────────────────────────────────────── */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.info-item .info-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.info-item .info-value {
    font-size: 15px;
    color: var(--text-primary);
}

/* ── Action cards (job detail) ─────────────────────── */
.action-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.action-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.action-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.action-card.done { border-color: var(--green); }
.action-card.done .action-card-icon { color: var(--green); }
.action-card.disabled {
    opacity: 0.45;
    pointer-events: none;
}
.action-card-icon {
    flex-shrink: 0;
    color: var(--text-muted);
}
.action-card-content h3 { font-size: 16px; }
.action-card-content p { font-size: 14px; color: var(--text-secondary); }
.action-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ── Wizard (inspection) ───────────────────────────── */
.wizard-progress {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
}
.wizard-step {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    transition: background 0.3s;
}
.wizard-step.complete { background: var(--green); }
.wizard-step.active { background: var(--accent); }

.wizard-section {
    display: none;
}
.wizard-section.active {
    display: block;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.wizard-section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}
.wizard-section-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.wizard-nav {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
.wizard-nav .btn { flex: 1; }

/* ── Select buttons (tap-friendly options) ─────────── */
.select-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.select-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.select-grid-1 { grid-template-columns: 1fr; }

.select-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 12px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.select-btn:hover { border-color: var(--accent); color: var(--accent); }
.select-btn input { position: absolute; opacity: 0; width: 0; height: 0; }
.select-btn.selected,
.select-btn:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 600;
}

/* ── Photo upload ──────────────────────────────────── */
.photo-upload {
    margin-bottom: 16px;
}
.photo-upload-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.photo-thumb {
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    background: var(--gray-light);
}
.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.photo-thumb .remove-photo {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-add {
    aspect-ratio: 1;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 12px;
    transition: border-color 0.15s;
}
.photo-add:hover { border-color: var(--accent); color: var(--accent); }
.photo-add svg { margin-bottom: 4px; }
.photo-add input { display: none; }

/* ── Quote options (Good/Better/Best) ──────────────── */
.quote-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}
.quote-option-card {
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
}
.quote-option-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.quote-option-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-light); }
.quote-option-card.recommended { border-color: var(--green); }

.quote-option-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.quote-option-tier {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.quote-option-tier.good { color: var(--gray); }
.quote-option-tier.better { color: var(--accent); }
.quote-option-tier.best { color: var(--green); }

.quote-option-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}
.quote-option-tagline {
    font-size: 14px;
    color: var(--text-secondary);
}
.quote-option-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
}
.quote-option-warranty {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    margin-top: 2px;
}

.quote-option-body {
    padding: 0 20px 20px;
}
.quote-option-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}
.quote-option-items {
    list-style: none;
}
.quote-option-items li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.quote-option-items li::before {
    content: '✓';
    color: var(--green);
    font-weight: 700;
    flex-shrink: 0;
}
.quote-option-items .item-name {
    font-weight: 500;
}
.quote-option-items .item-desc {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    font-weight: 400;
}

.quote-option-select {
    display: block;
    width: 100%;
    padding: 14px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
}
.quote-option-select:hover { background: var(--accent-bg); color: var(--accent); }
.quote-option-card.selected .quote-option-select {
    background: var(--accent);
    color: var(--text-inverse);
}

/* ── Signature pad ─────────────────────────────────── */
.signature-area {
    margin: 20px 0;
}
.signature-pad-container {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: white;
    position: relative;
    margin-bottom: 8px;
}
.signature-pad-container canvas {
    width: 100%;
    height: 150px;
    display: block;
}
.signature-clear {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.signature-label {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* ── Pagination ────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}
.page-info {
    font-size: 14px;
    color: var(--text-muted);
}

/* ── Photo callout (customer presentation) ─────────── */
.photo-callout {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}
.photo-callout img {
    width: 100%;
    display: block;
}
.photo-callout-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    font-size: 13px;
    font-weight: 500;
}

/* ── Utilities ─────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ── Condition selector (visual) ───────────────────── */
.condition-select {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}
.condition-option {
    flex: 1;
    padding: 10px 8px;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.condition-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.condition-option:has(input:checked).cond-good { border-color: var(--green); background: var(--green-light); color: var(--green); }
.condition-option:has(input:checked).cond-fair { border-color: var(--yellow); background: var(--yellow-light); color: var(--yellow); }
.condition-option:has(input:checked).cond-poor { border-color: #f97316; background: #fff7ed; color: #ea580c; }
.condition-option:has(input:checked).cond-bad  { border-color: var(--red); background: var(--red-light); color: var(--red); }

/* ── Desktop (sidebar always visible) ──────────────── */
@media (min-width: 768px) {
    .menu-toggle { display: none; }
    .nav-overlay { display: none !important; }

    .sidenav {
        left: 0;
        top: var(--topbar-height);
        height: calc(100% - var(--topbar-height));
        width: var(--sidenav-width);
    }
    .sidenav-header { display: none; }

    .main-content {
        margin-left: var(--sidenav-width);
        padding: calc(var(--topbar-height) + 24px) 32px 48px;
        max-width: 1200px;
    }

    .topbar {
        padding-left: calc(var(--sidenav-width) + 16px);
    }

    .info-grid { grid-template-columns: 1fr 1fr 1fr; }
    .form-row-3 { grid-template-columns: 2fr 1fr 1fr; }

    .quote-options {
        flex-direction: row;
        align-items: stretch;
    }
    .quote-option-card { flex: 1; }

    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .stats-grid-6 { grid-template-columns: repeat(3, 1fr); }
}

/* ── Photo callouts ────────────────────────────────── */
.photo-callout {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}
.photo-callout img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}
.photo-callout-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.55);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
}

/* ── Alert ─────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: var(--green-light); color: #166534; border: 1px solid #86efac; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }

/* ── Helpers ───────────────────────────────────────── */
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-muted); }
.mb-12 { margin-bottom: 12px; }
.mb-24 { margin-bottom: 24px; }
.card-inactive { opacity: 0.6; }

/* ── Pricebook list ─────────────────────────────────── */
.pricebook-cat-header {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 16px 0 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.pricebook-item {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
}
.pricebook-item.inactive { opacity: 0.5; }
.pricebook-item-main { flex: 1; min-width: 200px; }
.pricebook-item-sku {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    font-family: monospace;
}
.pricebook-item-name { font-weight: 600; font-size: 15px; margin: 2px 0; }
.pricebook-item-meta { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-muted); }
.pricebook-item-prices { text-align: right; min-width: 120px; }
.pricebook-cost { font-size: 13px; color: var(--text-muted); }
.pricebook-price { font-size: 16px; font-weight: 700; }
.pricebook-margin { font-size: 12px; color: var(--green); }
.pricebook-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Stats grid ────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.stats-grid-6 {
    grid-template-columns: repeat(2, 1fr);
}
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}
.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Status bars (reports) ─────────────────────────── */
.status-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.status-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.status-bar-label {
    width: 90px;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
}
.status-bar-track {
    flex: 1;
    height: 20px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}
.status-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    min-width: 2px;
}
.status-bar-created   { background: var(--text-muted); }
.status-bar-inspected { background: var(--blue); }
.status-bar-quoted    { background: var(--yellow); }
.status-bar-approved  { background: var(--green); }
.status-bar-completed { background: #059669; }
.status-bar-declined  { background: var(--red); }
.status-bar-cancelled { background: #9ca3af; }
.status-bar-count {
    width: 80px;
    text-align: right;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
}

/* ── Template Management ─────────────────────────── */
.template-tiers {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}
.template-card-meta {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}
.template-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.toggle-group {
    display: flex;
    gap: 1.5rem;
    padding: 0.5rem 0;
}
.toggle-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    cursor: pointer;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    cursor: pointer;
}
@media (min-width: 768px) {
    .form-grid-2 { grid-template-columns: 1fr 1fr; }
    .form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* ── Empty state ───────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
    font-size: 15px;
}

/* ── Editable cells (quote inline edit) ──────────── */
.editable-cell {
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.editable-cell:hover {
    background: var(--accent-light);
}

/* ── Job Tags ──────────────────────────────────────── */
.job-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.job-tag-sm {
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 10px;
}
.job-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.job-tag-remove:hover {
    opacity: 1;
    background: rgba(0,0,0,0.15);
}

/* ── Global Alerts ────────────────────────────────── */
.alerts-container {
    padding: 0 16px;
    max-width: 900px;
    margin: 0 auto;
}
@media (min-width: 769px) {
    .alerts-container {
        margin-left: 260px;
        padding: 0 32px;
    }
}
.global-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 12px;
    border: 1px solid;
    font-size: 14px;
    line-height: 1.5;
    transition: opacity 0.3s, max-height 0.3s;
    max-height: 200px;
}
.global-alert.alert-danger {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}
.global-alert.alert-warning {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}
.global-alert.alert-info {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e40af;
}
.global-alert.alert-success {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}
.alert-icon {
    flex-shrink: 0;
    margin-top: 2px;
}
.alert-body {
    flex: 1;
    min-width: 0;
}
.alert-title {
    margin-right: 6px;
}
.alert-message {
    opacity: 0.9;
}
.alert-action {
    display: inline-block;
    margin-left: 8px;
    font-weight: 600;
    text-decoration: underline;
    color: inherit;
}
.alert-dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    opacity: 0.5;
    color: inherit;
    border-radius: 4px;
    transition: opacity 0.15s;
}
.alert-dismiss:hover {
    opacity: 1;
    background: rgba(0,0,0,0.06);
}

/* ── Print ─────────────────────────────────────────── */
@media print {
    .topbar, .sidenav, .nav-overlay, .wizard-nav, .btn, .alerts-container { display: none !important; }
    .main-content { margin: 0; padding: 0; max-width: none; }
    body { background: white; }
    .card { border: 1px solid #ddd; break-inside: avoid; }
}
