/* Header Tracker - Main Styles */
/* Apple-inspired global styling */

@import url('variables.css');

/* ========================================
   RESET & BASE
   ======================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    letter-spacing: -0.01em;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-4);
    letter-spacing: var(--tracking-tight);
}

h1 {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
}

h2 {
    font-size: var(--text-2xl);
}

h3 {
    font-size: var(--text-xl);
}

h4 {
    font-size: var(--text-lg);
}

p {
    margin-bottom: var(--space-4);
}

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

a:hover {
    color: var(--color-accent-light);
}

strong, b {
    font-weight: var(--font-semibold);
}

small {
    font-size: var(--text-sm);
}

/* ========================================
   LAYOUT
   ======================================== */

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: var(--space-6);
    padding-top: calc(var(--nav-height) + var(--space-6));
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* Page header with title and actions */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.page-header-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.page-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin-bottom: 0;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin: 0;
}

.page-actions {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

/* ========================================
   GRID SYSTEM
   ======================================== */

.grid {
    display: grid;
    gap: var(--space-6);
}

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

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .main-content { padding: var(--space-4); padding-top: calc(var(--nav-height) + var(--space-4)); }
}

/* ========================================
   FLEX UTILITIES
   ======================================== */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: var(--space-1); }
.gap-sm { gap: var(--space-2); }
.gap-md { gap: var(--space-4); }
.gap-lg { gap: var(--space-6); }

/* ========================================
   SPACING UTILITIES
   ======================================== */

.mt-xs { margin-top: var(--space-1); }
.mt-sm { margin-top: var(--space-2); }
.mt-md { margin-top: var(--space-4); }
.mt-lg { margin-top: var(--space-6); }
.mb-xs { margin-bottom: var(--space-1); }
.mb-sm { margin-bottom: var(--space-2); }
.mb-md { margin-bottom: var(--space-4); }
.mb-lg { margin-bottom: var(--space-6); }
.ml-xs { margin-left: var(--space-1); }
.mr-xs { margin-right: var(--space-1); }
.my-md { margin-top: var(--space-4); margin-bottom: var(--space-4); }

.p-xs { padding: var(--space-1); }
.p-sm { padding: var(--space-2); }
.p-md { padding: var(--space-4); }
.p-lg { padding: var(--space-6); }

/* ========================================
   TEXT UTILITIES
   ======================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }

/* ========================================
   VISIBILITY
   ======================================== */

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--color-surface-light);
    border-radius: var(--radius-full);
    border: 2px solid var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-surface-hover);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-surface-light) var(--color-bg-secondary);
}

/* ========================================
   SELECTION
   ======================================== */

::selection {
    background: var(--color-primary);
    color: var(--color-text);
}

/* ========================================
   FOCUS STATES
   ======================================== */

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* ========================================
   LOADING SPINNER
   ======================================== */

.spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--color-border-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 48px;
    height: 48px;
    border-width: 3px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   LOADING OVERLAY
   ======================================== */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal-backdrop);
}

/* ========================================
   FILTER BAR - Unified filter styling
   ======================================== */

.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.filter-bar .search-box {
    flex: 1;
    min-width: 200px;
    max-width: 280px;
}

.filter-bar .form-select,
.filter-bar .form-input {
    min-width: 140px;
    background: var(--color-surface-light);
    border-color: var(--color-border);
}

/* Compact filter bar variant */
.filter-bar-compact {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    flex-wrap: nowrap;
    margin-bottom: var(--space-4);
}

.filter-bar-compact .search-box {
    flex: 0 0 auto;
    width: 180px;
    min-width: 140px;
}

.filter-bar-compact .form-select {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: 140px;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
}

/* ========================================
   ANIMATION KEYFRAMES
   ======================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .desktop-only { display: none !important; }
}

@media (min-width: 769px) {
    .hide-desktop { display: none !important; }
    .mobile-only { display: none !important; }
}

/* ========================================
   MOBILE LAYOUT SYSTEM
   Per Mobile UX Spec
   ======================================== */

/* Mobile-specific CSS variables */
@media (max-width: 768px) {
    :root {
        --mobile-header-height: 56px;
        --mobile-bottom-nav-height: 64px;
        --mobile-footer-height: 72px;
        --mobile-touch-target: 44px;
        --mobile-btn-height: 48px;
        --mobile-card-padding: 12px;
        --mobile-card-radius: 10px;
        --mobile-card-gap: 10px;
    }

    /* Adjust main content for mobile bottom nav */
    .main-content {
        padding-bottom: calc(var(--mobile-bottom-nav-height) + var(--space-4));
    }

    /* Pages with sticky footer need extra padding */
    .main-content.has-mobile-footer {
        padding-bottom: calc(var(--mobile-footer-height) + var(--mobile-bottom-nav-height) + var(--space-4));
    }

    /* Page header adjustments for mobile */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
    }

    .page-actions {
        justify-content: stretch;
    }

    .page-actions .btn {
        flex: 1;
    }
}

/* ========================================
   MOBILE BOTTOM NAVIGATION
   Per Spec: Home, Scan, Pick Lists, More
   ======================================== */

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-bottom-nav-height, 64px);
    background: var(--color-primary-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: var(--z-sticky);
    padding: var(--space-2) 0;
    padding-bottom: env(safe-area-inset-bottom, var(--space-2));
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: var(--space-1) var(--space-3);
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 10px;
    font-weight: var(--font-medium);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    min-width: var(--mobile-touch-target, 44px);
    min-height: var(--mobile-touch-target, 44px);
}

.mobile-nav-item:hover,
.mobile-nav-item:active {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

.mobile-nav-item.active {
    color: var(--color-accent);
}

.mobile-nav-icon {
    font-size: 22px;
    line-height: 1;
}

.mobile-nav-label {
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* ========================================
   MOBILE STICKY FOOTER
   Per Spec: 2 buttons max, 48px height
   ======================================== */

.mobile-sticky-footer {
    display: none;
    position: fixed;
    bottom: var(--mobile-bottom-nav-height, 64px);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: var(--space-3) var(--space-4);
    z-index: calc(var(--z-sticky) - 1);
    gap: var(--space-3);
}

@media (max-width: 768px) {
    .mobile-sticky-footer {
        display: flex;
    }

    .mobile-sticky-footer .btn {
        flex: 1;
        min-height: var(--mobile-btn-height, 48px);
        font-size: var(--text-base);
        font-weight: var(--font-semibold);
    }

    .mobile-sticky-footer .btn:disabled {
        opacity: 0.5;
    }
}

/* ========================================
   MOBILE CARDS (Replace Tables)
   Per Spec: 10-14px padding, 10px radius
   ======================================== */

.mobile-card-list {
    display: none;
    flex-direction: column;
    gap: var(--mobile-card-gap, 10px);
}

@media (max-width: 768px) {
    .mobile-card-list {
        display: flex;
    }
}

.mobile-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--mobile-card-radius, 10px);
    padding: var(--mobile-card-padding, 12px);
    transition: all var(--transition-fast);
}

.mobile-card:active {
    transform: scale(0.98);
    background: var(--color-surface-light);
}

/* Card state colors per spec */
.mobile-card.state-pending {
    background: var(--color-surface);
    border-left: 4px solid #37474f;
}

.mobile-card.state-complete,
.mobile-card.state-completed {
    background: rgba(46, 125, 50, 0.1);
    border-left: 4px solid #2e7d32;
}

.mobile-card.state-warning,
.mobile-card.state-flagged {
    background: rgba(255, 152, 0, 0.1);
    border-left: 4px solid #ff9800;
}

.mobile-card.state-active {
    background: rgba(10, 132, 255, 0.1);
    border-left: 4px solid var(--color-info);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-2);
}

.mobile-card-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-text);
    margin: 0;
}

.mobile-card-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: 2px;
}

.mobile-card-meta {
    font-size: 12px;
    color: var(--color-text-muted);
    opacity: 0.7;
}

.mobile-card-body {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.mobile-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
}

.mobile-card-actions {
    display: flex;
    gap: var(--space-2);
}

/* ========================================
   JOB SUMMARY STRIP
   Per Spec: For screens tied to a job
   ======================================== */

.mobile-job-strip {
    display: none;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-3) var(--space-4);
}

@media (max-width: 768px) {
    .mobile-job-strip {
        display: block;
    }
}

.mobile-job-strip-customer {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-text);
    margin: 0;
}

.mobile-job-strip-job {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: 2px;
}

.mobile-job-strip-address {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* ========================================
   MOBILE PROGRESS BAR
   Per Spec: Light grey track, brand fill
   ======================================== */

.mobile-progress {
    display: none;
    padding: var(--space-2) var(--space-4);
    background: var(--color-bg-secondary);
}

@media (max-width: 768px) {
    .mobile-progress {
        display: block;
    }
}

.mobile-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.mobile-progress-bar {
    height: 6px;
    background: var(--color-surface-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.mobile-progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

/* ========================================
   MOBILE FILTER BOTTOM SHEET
   Per Spec: Opens from bottom, swipe dismiss
   ======================================== */

.mobile-filter-sheet {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.mobile-filter-sheet.open {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .mobile-filter-sheet {
        display: block;
    }
}

.mobile-filter-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.mobile-filter-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-4);
    padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform var(--transition-normal);
    max-height: 80vh;
    overflow-y: auto;
}

.mobile-filter-sheet.open .mobile-filter-content {
    transform: translateY(0);
}

.mobile-filter-handle {
    width: 36px;
    height: 4px;
    background: var(--color-surface-hover);
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-4);
}

.mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.mobile-filter-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin: 0;
}

.mobile-filter-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: var(--text-xl);
    padding: var(--space-2);
    cursor: pointer;
    border-radius: var(--radius-md);
    min-width: var(--mobile-touch-target, 44px);
    min-height: var(--mobile-touch-target, 44px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-filter-close:hover {
    background: var(--color-surface-light);
}

.mobile-filter-group {
    margin-bottom: var(--space-4);
}

.mobile-filter-group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}

.mobile-filter-group .form-select,
.mobile-filter-group .form-input {
    min-height: var(--mobile-touch-target, 44px);
    font-size: var(--text-base);
}

.mobile-filter-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.mobile-filter-actions .btn {
    flex: 1;
    min-height: var(--mobile-btn-height, 48px);
}

/* Mobile filter trigger button */
.mobile-filter-btn {
    display: none;
}

@media (max-width: 768px) {
    .mobile-filter-btn {
        display: inline-flex;
    }
}

/* ========================================
   MOBILE PHOTOS SECTION
   Per Spec: Collapsible
   ======================================== */

.mobile-photos-section {
    border: 1px solid var(--color-border);
    border-radius: var(--mobile-card-radius, 10px);
    overflow: hidden;
    margin-top: var(--space-4);
}

.mobile-photos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--mobile-card-padding, 12px);
    background: var(--color-surface);
    cursor: pointer;
    min-height: var(--mobile-touch-target, 44px);
}

.mobile-photos-header h4 {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.mobile-photos-toggle {
    font-size: var(--text-lg);
    color: var(--color-text-muted);
    transition: transform var(--transition-fast);
}

.mobile-photos-section.open .mobile-photos-toggle {
    transform: rotate(180deg);
}

.mobile-photos-body {
    display: none;
    padding: var(--mobile-card-padding, 12px);
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
}

.mobile-photos-section.open .mobile-photos-body {
    display: block;
}

.mobile-photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.mobile-photo-thumb {
    aspect-ratio: 1;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.mobile-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-add-photo-btn {
    min-height: var(--mobile-touch-target, 44px);
    width: 100%;
}

/* ========================================
   MOBILE HEADER BAR
   Per Spec: 48-56px, Back + Title + Menu
   ======================================== */

.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mobile-header-height, 56px);
    background: var(--color-primary-dark);
    z-index: var(--z-sticky);
    padding: 0 var(--space-2);
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Hide desktop navbar on mobile when mobile-header is present */
    .has-mobile-header .navbar {
        display: none;
    }
}

.mobile-header-back {
    background: none;
    border: none;
    color: var(--color-text);
    font-size: var(--text-xl);
    padding: var(--space-2);
    cursor: pointer;
    border-radius: var(--radius-md);
    min-width: var(--mobile-touch-target, 44px);
    min-height: var(--mobile-touch-target, 44px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-header-back:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-header-title {
    font-size: 18px;
    font-weight: var(--font-semibold);
    color: var(--color-text);
    flex: 1;
    text-align: center;
    margin: 0;
}

.mobile-header-menu {
    background: none;
    border: none;
    color: var(--color-text);
    font-size: var(--text-xl);
    padding: var(--space-2);
    cursor: pointer;
    border-radius: var(--radius-md);
    min-width: var(--mobile-touch-target, 44px);
    min-height: var(--mobile-touch-target, 44px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-header-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ========================================
   MOBILE TYPOGRAPHY
   Per Spec: Readable with gloves
   ======================================== */

@media (max-width: 768px) {
    .mobile-title {
        font-size: 18px;
        font-weight: var(--font-semibold);
    }

    .mobile-section-header {
        font-size: 16px;
        font-weight: var(--font-bold);
    }

    .mobile-label {
        font-size: 14px;
    }

    .mobile-meta {
        font-size: 12px;
        opacity: 0.7;
    }
}

/* ========================================
   MOBILE TOUCH TARGETS
   Per Spec: Min 44x44px
   ======================================== */

@media (max-width: 768px) {
    /* Ensure all interactive elements meet touch target size */
    .btn {
        min-height: var(--mobile-touch-target, 44px);
        min-width: var(--mobile-touch-target, 44px);
    }

    .btn-sm {
        min-height: 36px;
        padding: var(--space-2) var(--space-3);
    }

    .form-input,
    .form-select,
    .form-textarea {
        min-height: var(--mobile-touch-target, 44px);
        font-size: 16px; /* Prevents iOS zoom */
    }

    .form-check-input {
        width: 24px;
        height: 24px;
    }

    /* Increment/decrement buttons */
    .mobile-stepper {
        display: flex;
        align-items: center;
        gap: var(--space-2);
    }

    .mobile-stepper-btn {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--color-surface-light);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        font-size: var(--text-lg);
        font-weight: var(--font-bold);
        color: var(--color-text);
        cursor: pointer;
    }

    .mobile-stepper-btn:active {
        background: var(--color-surface-hover);
    }

    .mobile-stepper-value {
        min-width: 40px;
        text-align: center;
        font-size: var(--text-base);
        font-weight: var(--font-semibold);
    }
}

/* ========================================
   MOBILE SCAN BUTTON
   Per Spec: Big "SCAN" button in center
   ======================================== */

.mobile-scan-container {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: var(--space-6);
}

@media (max-width: 768px) {
    .mobile-scan-container {
        display: flex;
    }
}

.mobile-scan-btn {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 4px solid var(--color-primary-light);
    color: var(--color-text);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    letter-spacing: 0.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(114, 47, 55, 0.4);
    transition: all var(--transition-fast);
}

.mobile-scan-btn:active {
    transform: scale(0.95);
    box-shadow: 0 4px 16px rgba(114, 47, 55, 0.4);
}

/* ========================================
   MOBILE CONDITION DROPDOWN
   Per Spec: Touch-friendly selector
   ======================================== */

.mobile-condition-select {
    width: 100%;
    min-height: var(--mobile-touch-target, 44px);
    padding: var(--space-2) var(--space-3);
    background: var(--color-surface-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    color: var(--color-text);
    cursor: pointer;
}
