/* ── Variables ─────────────────────────────────────────────────── */
:root {
    --red:          #ED1E24;
    --red-dark:     #c5191e;
    --red-pale:     #fef2f2;
    --green:        #28a745;
    --text:         #1c1c1e;
    --text-sub:     #6b7280;
    --text-muted:   #aeaeb2;
    --border:       #e4e4e7;
    --bg-page:      #f2f2f7;
    --bg-card:      #ffffff;
    --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md:    0 4px 12px rgba(0,0,0,.08);
    --radius-card:  12px;
    --radius-btn:   8px;
    --header-h:     62px;
    --footer-h:     72px;
    --transition:   280ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-page);
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

/* ── Header ────────────────────────────────────────────────────── */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
    max-width: 680px;
    margin: 0 auto;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.header-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
    object-fit: cover;
}

.header-titles {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.brand-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.1px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-blinq { color: var(--red); }

.brand-sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-sub);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: background var(--transition);
}

.hamburger-btn:hover { background: var(--bg-page); }

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--transition);
}

/* ── Sidebar ───────────────────────────────────────────────────── */
.app-sidebar {
    width: 280px;
    border-left: 1px solid var(--border);
}

.app-sidebar .offcanvas-body { padding: 0; display: flex; flex-direction: column; }

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--red-pale);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
    object-fit: cover;
}

.sidebar-user-info { flex: 1; min-width: 0; }

.sidebar-user-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 1px;
}

.sidebar-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-sub);
    padding: 4px;
    border-radius: 6px;
    display: flex;
    transition: color var(--transition), background var(--transition);
}

.sidebar-close:hover { background: rgba(0,0,0,.06); color: var(--text); }

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}

.sidebar-link:hover { background: var(--bg-page); color: var(--red); }

.sidebar-link svg { color: var(--text-sub); flex-shrink: 0; transition: color var(--transition); }

.sidebar-link:hover svg { color: var(--red); }

.sidebar-footer {
    padding: 12px 0 20px;
    border-top: 1px solid var(--border);
}

.sidebar-signout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    color: var(--red);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background var(--transition);
}

.sidebar-signout:hover { background: var(--red-pale); color: var(--red-dark); }

.sidebar-signout svg { flex-shrink: 0; }

/* ── Main layout ───────────────────────────────────────────────── */
.app-main {
    padding-top: calc(var(--header-h) + 12px);
    padding-bottom: calc(var(--footer-h) + 16px);
    max-width: 680px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

/* ── Progress ──────────────────────────────────────────────────── */
.progress-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px 16px;
    margin-bottom: 12px;
}

.progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.progress-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-sub);
    text-transform: uppercase;
}

.progress-pct {
    font-size: 13px;
    font-weight: 700;
    color: var(--red);
}

.progress-track {
    height: 6px;
    background: var(--bg-page);
    border-radius: 99px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--red);
    border-radius: 99px;
    width: 0%;
    transition: width 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Sections hub ──────────────────────────────────────────────── */
.sections-hub {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* ── Section item ──────────────────────────────────────────────── */
.section-item {
    border-bottom: 1px solid var(--border);
}

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

.section-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.section-trigger:hover { background: var(--bg-page); }

.section-trigger:active { background: var(--red-pale); }

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--red);
    transition: background var(--transition);
}

.status-dot.complete { background: var(--green); }

.section-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

.section-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity var(--transition), transform var(--transition);
}

.section-check.visible {
    opacity: 1;
    transform: scale(1);
}

.section-check svg { width: 12px; height: 12px; stroke-width: 2.5; }

.section-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform var(--transition), color var(--transition);
}

.section-chevron svg { display: block; }

.section-trigger.open .section-chevron {
    transform: rotate(90deg);
    color: var(--red);
}

/* ── Collapsible panel ─────────────────────────────────────────── */
.section-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 320ms cubic-bezier(0.4, 0, 0.2, 1),
                opacity 220ms ease;
}

.section-panel.open {
    opacity: 1;
}

.section-content {
    padding: 4px 16px 20px;
    border-top: 1px solid var(--border);
}

/* ── Form fields ───────────────────────────────────────────────── */
.field-group { margin-top: 16px; }

.field-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: var(--text-sub);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.field-input {
    display: block;
    width: 100%;
    padding: 9px 12px;
    font-size: 15px;
    color: var(--text);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-btn);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.field-input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(237, 30, 36, 0.12);
}

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

.field-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* ── Toggle buttons (Yes/No/N/A) ───────────────────────────────── */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.toggle-row:last-of-type { border-bottom: none; }

.toggle-question {
    font-size: 14px;
    color: var(--text);
    flex: 1;
    padding-right: 12px;
}

.toggle-group {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.toggle-btn {
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-sub);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition), transform 100ms ease;
    -webkit-tap-highlight-color: transparent;
}

.toggle-btn:active { transform: scale(0.95); }

.toggle-btn.active-yes {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.toggle-btn.active-no {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.toggle-btn.active-na {
    background: var(--text-sub);
    border-color: var(--text-sub);
    color: #fff;
}

.section-sub-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: var(--text-sub);
    text-transform: uppercase;
    margin: 20px 0 4px;
}

/* ── Photo upload rows ─────────────────────────────────────────── */
.photo-group-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: var(--text-sub);
    text-transform: uppercase;
    margin: 16px 0 8px;
}

.photo-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-btn);
    cursor: pointer;
    margin-bottom: 8px;
    transition: border-color var(--transition), background var(--transition);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.photo-row:hover { border-color: var(--red); background: var(--red-pale); }

.photo-row:active { transform: scale(0.98); }

.photo-row-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--red-pale);
    color: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    transition: background var(--transition);
}

.photo-row:hover .photo-row-icon { background: rgba(190,30,45,.15); }

.photo-row-label {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.photo-count-badge {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 20px;
    text-align: right;
}

.photo-count-badge.has-photos { color: var(--red); }

.photos-total {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0 2px;
    color: var(--text-sub);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.photos-total-count {
    margin-left: auto;
    font-weight: 600;
    color: var(--text);
}

/* ── PDF upload zone ───────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-card);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.upload-zone:hover { border-color: var(--red); background: var(--red-pale); }

.upload-zone.has-file { border-style: solid; border-color: var(--green); background: #f0faf3; }

.upload-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 10px;
    color: var(--text-muted);
    transition: color var(--transition);
}

.upload-zone:hover .upload-icon { color: var(--red); }

.upload-zone.has-file .upload-icon { color: var(--green); }

.upload-text {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 6px;
}

.upload-btn-label {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: var(--red);
    padding: 6px 18px;
    border: 1.5px solid var(--red);
    border-radius: var(--radius-btn);
    transition: background var(--transition), color var(--transition);
}

.upload-zone:hover .upload-btn-label { background: var(--red); color: white; }

.upload-filename {
    font-size: 13px;
    color: var(--green);
    font-weight: 500;
    margin-top: 8px;
    word-break: break-all;
}

/* ── Signature ─────────────────────────────────────────────────── */
.sig-block { margin-top: 20px; }

.sig-block + .sig-block { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--border); }

.sig-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-sub);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.sig-canvas-wrap {
    position: relative;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-btn);
    overflow: hidden;
    background: var(--bg-card);
    margin-top: 10px;
    transition: border-color var(--transition);
}

.sig-canvas-wrap.has-sig { border-color: var(--text-muted); }

.sig-canvas {
    display: block;
    width: 100%;
    height: 130px;
    touch-action: none;
    cursor: crosshair;
}

.sig-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
    transition: opacity var(--transition);
}

.sig-placeholder.hidden { opacity: 0; }

.sig-placeholder-icon { color: var(--text-muted); }

.sig-placeholder-text {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.sig-actions {
    display: flex;
    justify-content: flex-end;
    padding: 6px 10px 6px;
    border-top: 1px solid var(--border);
    background: var(--bg-page);
}

.sig-clear-btn {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color var(--transition);
}

.sig-clear-btn:hover { color: var(--red); }

/* ── Footer ────────────────────────────────────────────────────── */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-h);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 900;
}

.complete-btn {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    display: block;
    padding: 13px 20px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--red);
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: background var(--transition), opacity var(--transition), transform 100ms ease;
    -webkit-tap-highlight-color: transparent;
}

.complete-btn:hover:not(:disabled) { background: var(--red-dark); }

.complete-btn:active:not(:disabled) { transform: scale(0.98); }

.complete-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

/* ── Header actions (PDF button) ───────────────────────────────── */
.header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.header-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-sub);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.header-action-btn:hover { background: var(--bg-page); color: var(--red); }

/* ── Job detail card ────────────────────────────────────────────── */
.job-detail-card {
    background: var(--bg-page);
    border-radius: 10px;
    padding: 14px;
    margin-top: 8px;
}

.job-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 12px;
}

.job-detail-full { grid-column: 1 / -1; }

.job-detail-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 3px;
}

.job-detail-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.job-detail-notes {
    font-size: 14px;
    color: var(--text-sub);
    font-weight: 400;
    line-height: 1.5;
}

.job-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
}

.type-install { background: #dcfce7; color: #16a34a; }
.type-repair  { background: #fff7ed; color: #ea580c; }
.type-measure { background: #eff6ff; color: #2563eb; }
.type-other   { background: var(--bg-page); color: var(--text-sub); border: 1px solid var(--border); }

/* ── Wizard navigation ──────────────────────────────────────────── */
.wizard-nav {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.wizard-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 14px;
    border-radius: var(--radius-btn);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background var(--transition), color var(--transition), opacity var(--transition), transform 100ms ease;
    -webkit-tap-highlight-color: transparent;
}

.wizard-btn svg { flex-shrink: 0; }

.wizard-btn.prev {
    background: var(--bg-page);
    color: var(--text-sub);
    border: 1.5px solid var(--border);
}

.wizard-btn.prev:hover { background: var(--border); }

.wizard-btn.next {
    background: var(--red);
    color: #fff;
}

.wizard-btn.next:hover:not(:disabled) { background: var(--red-dark); }

.wizard-btn:disabled {
    background: var(--bg-page);
    color: var(--text-muted);
    border-color: var(--border);
    cursor: not-allowed;
}

.wizard-btn:active:not(:disabled) { transform: scale(0.97); }

/* ── Photo thumbnails ───────────────────────────────────────────── */
.photo-thumbs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 6px 0 10px;
}

.photo-thumb {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-page);
    position: relative;
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 220ms ease;
}

.photo-thumb:hover img { transform: scale(1.06); }

.photo-thumb:active { opacity: 0.85; }

/* ── Lightbox ───────────────────────────────────────────────────── */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}

.lightbox.open {
    opacity: 1;
    pointer-events: all;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.93);
}

.lightbox-stage {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox-img {
    max-width: 92vw;
    max-height: 78vh;
    object-fit: contain;
    transform-origin: center;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 150ms ease;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background 200ms;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }

.lightbox-counter {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    pointer-events: none;
}

.lightbox-caption {
    position: absolute;
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background 200ms;
    -webkit-tap-highlight-color: transparent;
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-nav:disabled { opacity: 0.25; cursor: default; }
.lightbox-nav.prev { left: 12px; }
.lightbox-nav.next { right: 12px; }

.lightbox-toolbar {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 99px;
    padding: 5px 10px;
}

.lightbox-zoom-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    font-size: 18px;
    transition: background 200ms;
    line-height: 1;
}

.lightbox-zoom-btn:hover { background: rgba(255, 255, 255, 0.15); }

.lightbox-zoom-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    min-width: 38px;
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ── Signature person card ──────────────────────────────────────── */
.sig-person-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-page);
    border-radius: 10px;
    margin-bottom: 10px;
}

.sig-person-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.04em;
}

.sig-person-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.sig-person-role {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* ── Locked sections ───────────────────────────────────────────── */
.section-item.locked .section-trigger {
    cursor: default;
    pointer-events: none;
}

.section-item.locked .section-trigger:hover { background: none; }

.section-item.locked .section-name { color: var(--text-muted); }

.section-item.locked .status-dot { background: var(--border); }

.section-item.locked .section-chevron { display: none; }

.section-lock {
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.section-item.locked .section-lock { display: flex; }

/* Highlight the next-up locked section so user knows where they're headed */
.section-item.locked:not(.section-item.locked ~ .section-item.locked) .section-name {
    color: var(--text-sub);
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (min-width: 480px) {
    .app-main { padding-left: 20px; padding-right: 20px; }
    .header-inner { padding: 0 20px; }
}

@media (min-width: 680px) {
    .app-main { padding-left: 0; padding-right: 0; }
    .header-inner { padding: 0; }
}

/* ══════════════════════════════════════════════════════════════════
   OVERRIDES & NEW COMPONENTS
   ══════════════════════════════════════════════════════════════════ */

/* No fixed footer — remove bottom space reservation */
.app-main { padding-bottom: 32px; }

/* ── Hamburger (now FA icon) ────────────────────────────────────── */
.hamburger-btn {
    width: 38px;
    height: 38px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 0;
    transition: background var(--transition), color var(--transition);
}
.hamburger-btn:hover { background: var(--bg-page); color: var(--red); }

/* ── Sidebar icon links ─────────────────────────────────────────── */
.sidebar-link { gap: 14px; }
.sidebar-link i, .sidebar-signout i { font-size: 15px; }
.sidebar-close { font-size: 16px; background: none; border: none; cursor: pointer; color: var(--text-sub); padding: 6px; border-radius: 6px; display: flex; transition: color var(--transition); }
.sidebar-close:hover { color: var(--text); }

/* ── Section check — FA icon ────────────────────────────────────── */
.section-check { font-size: 11px; }
.section-chevron { font-size: 13px; flex-shrink: 0; color: var(--text-muted); transition: transform var(--transition), color var(--transition); }
.section-trigger.open .section-chevron { transform: rotate(90deg); color: var(--red); }
.section-lock { font-size: 12px; }
.section-item.locked .section-chevron { display: none; }

/* ── Job top card ───────────────────────────────────────────────── */
.job-top-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 10px;
}

.job-top-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    gap: 12px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.job-top-summary:hover { background: var(--bg-page); }

.job-top-left { flex: 1; min-width: 0; }

.job-top-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.job-top-num {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.job-top-customer {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.job-top-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}

.job-top-date {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.job-top-chevron {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 300ms ease;
}

.job-top-card.expanded .job-top-chevron { transform: rotate(180deg); }

.job-top-expand {
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.job-top-expand-inner {
    padding: 0 16px 16px;
    border-top: 1px solid var(--border);
}

.job-top-expand-inner .job-detail-grid { padding-top: 12px; }

/* ── Installer Sheet button ─────────────────────────────────────── */
.installer-sheet-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(135deg, #ED1E24 0%, #c5191e 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(237, 30, 36, 0.28);
    transition: opacity 200ms, transform 100ms, box-shadow 200ms;
    -webkit-tap-highlight-color: transparent;
    text-align: left;
}

.installer-sheet-btn-label { flex: 1; }

.installer-sheet-btn:hover { opacity: 0.92; box-shadow: 0 6px 18px rgba(237, 30, 36, 0.36); }
.installer-sheet-btn:active { transform: scale(0.99); }

/* ── Wizard nav — modern redesign ──────────────────────────────── */
.wizard-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.wizard-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border: none;
    transition: background 200ms, box-shadow 200ms, transform 100ms, color 200ms;
    -webkit-tap-highlight-color: transparent;
}

.wizard-btn.prev {
    width: 46px;
    height: 46px;
    min-width: 46px;
    flex: 0 0 46px;
    border-radius: 50%;
    background: none;
    border: 1.5px solid var(--border);
    color: var(--text-sub);
    padding: 0;
}
.wizard-btn.prev:hover { background: var(--bg-page); border-color: var(--text-muted); color: var(--text); }

.wizard-btn.next {
    flex: 1;
    padding: 13px 22px;
    border-radius: 99px;
    background: var(--red);
    color: #fff;
    box-shadow: 0 4px 14px rgba(237, 30, 36, 0.28);
    letter-spacing: 0.01em;
}
.wizard-btn.next:not(:disabled):hover { background: var(--red-dark); box-shadow: 0 6px 18px rgba(237, 30, 36, 0.38); transform: translateY(-1px); }
.wizard-btn.next:not(:disabled):active { transform: translateY(0); }
.wizard-btn.next:disabled { background: var(--border); color: var(--text-muted); box-shadow: none; cursor: not-allowed; }

/* ── Photo thumb delete button ──────────────────────────────────── */
.photo-thumb-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 0;
    line-height: 1;
    transition: background 180ms;
}
.photo-thumb-del:hover { background: var(--red); }

/* ── Complete Job button (inside Signatures) ────────────────────── */
.complete-job-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 14px;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
    transition: background 200ms, box-shadow 200ms, transform 100ms;
    -webkit-tap-highlight-color: transparent;
}
.complete-job-btn:not(:disabled):hover { background: #15803d; box-shadow: 0 6px 16px rgba(22, 163, 74, 0.35); }
.complete-job-btn:not(:disabled):active { transform: scale(0.99); }
.complete-job-btn:disabled { background: var(--border); color: var(--text-muted); box-shadow: none; cursor: not-allowed; }

/* ── PDF Modal ──────────────────────────────────────────────────── */
.pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    background: #fff;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}
.pdf-modal.open { opacity: 1; pointer-events: all; }

.pdf-modal-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    height: 52px;
    background: var(--red);
    flex-shrink: 0;
    color: #fff;
}

.pdf-modal-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
}

.pdf-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    transition: background 200ms;
    flex-shrink: 0;
}
.pdf-modal-close:hover { background: rgba(255, 255, 255, 0.28); }

.pdf-modal-frame {
    flex: 1;
    border: none;
    background: #f5f5f5;
    display: block;
    width: 100%;
}
