/* =========================================
   Spot On TMS — Freight Rate Calculator
   Dark Glass-Morphism Theme
   ========================================= */

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

:root {
    --bg: #0a0e17;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-input: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.14);
    --text: #e2e8f0;
    --text-dim: #94a3b8;
    --text-muted: #64748b;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.25);
    --green: #10b981;
    --green-dim: rgba(16, 185, 129, 0.15);
    --yellow: #f59e0b;
    --yellow-dim: rgba(245, 158, 11, 0.15);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --transition: 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

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

/* ---------- Header ---------- */
.app-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(16, 185, 129, 0.05));
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.brand-icon .material-icons-round {
    font-size: 24px;
    color: #fff;
}

.brand-text h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

.brand-subtitle {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 400;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-dim);
    font-weight: 500;
}

.meta-chip .material-icons-round {
    font-size: 16px;
}

.meta-chip.accent {
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--accent);
}

/* ---------- Stats Bar ---------- */
.stats-bar {
    border-bottom: 1px solid var(--border);
}

.stats-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 32px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    transition: border-color var(--transition), background var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon .material-icons-round {
    font-size: 22px;
    color: var(--accent);
}

.stat-icon.green {
    background: var(--green-dim);
}

.stat-icon.green .material-icons-round {
    color: var(--green);
}

.stat-body {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---------- Main Content ---------- */
.main-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px 32px 60px;
}

/* ---------- Sections ---------- */
.section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    margin-bottom: 24px;
    overflow: hidden;
}

.section-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .material-icons-round {
    font-size: 22px;
    color: var(--accent);
}

.section-title h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 10px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 600;
}

.section-desc {
    padding: 12px 24px 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ---------- Filters ---------- */
.filters-row {
    padding: 16px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    flex: 1;
    min-width: 260px;
    max-width: 400px;
    transition: border-color var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-box .material-icons-round {
    font-size: 20px;
    color: var(--text-muted);
}

.search-box input {
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.88rem;
    padding: 10px 0;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color var(--transition);
    visibility: hidden;
}

.clear-btn.visible {
    visibility: visible;
}

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

.clear-btn .material-icons-round {
    font-size: 18px;
}

.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.82rem;
    padding: 9px 32px 9px 12px;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color var(--transition);
    min-width: 140px;
}

.filter-select:focus {
    border-color: var(--accent);
}

.filter-select option {
    background: #1a1f2e;
    color: var(--text);
}

/* ---------- Table ---------- */
.table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 680px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    background: rgba(15, 20, 35, 0.95);
    backdrop-filter: blur(8px);
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: color var(--transition);
}

.data-table th:hover {
    color: var(--accent);
}

.data-table th.num {
    text-align: right;
}

.data-table th.action-col {
    text-align: center;
    cursor: default;
}

.data-table th.action-col:hover {
    color: var(--text-muted);
}

.sort-icon {
    font-size: 16px !important;
    vertical-align: middle;
    margin-left: 2px;
    opacity: 0.4;
    transition: opacity var(--transition);
}

.data-table th:hover .sort-icon {
    opacity: 0.8;
}

.data-table th.sorted-asc .sort-icon,
.data-table th.sorted-desc .sort-icon {
    opacity: 1;
    color: var(--accent);
}

.data-table td {
    padding: 11px 16px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background var(--transition);
}

.data-table td.num {
    text-align: right;
    font-family: var(--mono);
    font-size: 0.82rem;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.data-table tbody tr:hover td {
    border-bottom-color: transparent;
}

/* Rate color classes */
.rate-high {
    color: var(--green) !important;
    font-weight: 600;
}

.rate-mid {
    color: var(--yellow) !important;
    font-weight: 600;
}

.rate-low {
    color: var(--text-dim);
}

.rpm-invalid {
    color: var(--text-muted) !important;
}

/* Customer cell */
.customer-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.lane-cell {
    color: var(--text-dim);
    font-size: 0.82rem;
}

/* Quote Button */
.quote-btn {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--accent);
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.quote-btn .material-icons-round {
    font-size: 15px;
}

.quote-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: var(--accent);
    box-shadow: 0 2px 12px var(--accent-glow);
}

td.action-col {
    text-align: center;
}

/* ---------- Calc Grid ---------- */
.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.calc-card {
    margin-bottom: 0;
}

.calc-body {
    padding: 20px 24px 24px;
}

/* ---------- Inputs ---------- */
.input-group {
    margin-bottom: 14px;
}

.input-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.optional {
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-muted);
    font-weight: 400;
}

.input-icon-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    transition: border-color var(--transition);
}

.input-icon-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-icon-wrap .material-icons-round {
    font-size: 18px;
    color: var(--text-muted);
}

.input-icon-wrap input {
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.9rem;
    padding: 10px 0;
    width: 100%;
    outline: none;
}

.input-group input:not(.input-icon-wrap input) {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.9rem;
    padding: 10px 12px;
    outline: none;
    transition: border-color var(--transition);
}

.input-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-group.compact {
    margin-bottom: 10px;
}

.input-group.compact label {
    font-size: 0.72rem;
    margin-bottom: 4px;
}

.input-group.compact input {
    padding: 8px 10px;
    font-size: 0.85rem;
}

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

/* ---------- Buttons ---------- */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition);
    margin-top: 6px;
}

.btn-primary:hover {
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition);
}

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

.btn-ghost {
    background: none;
    border: 1px solid var(--border);
    color: var(--accent);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition);
}

.btn-ghost .material-icons-round {
    font-size: 18px;
}

.btn-ghost:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
}

/* ---------- Calc Results ---------- */
.calc-results {
    margin-top: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.calc-results.hidden {
    display: none;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.result-row:last-child {
    border-bottom: none;
}

.result-row.total {
    background: rgba(16, 185, 129, 0.06);
    border-bottom: none;
}

.result-row.total span:last-child {
    color: var(--green);
    font-weight: 700;
    font-size: 1rem;
}

.mono {
    font-family: var(--mono);
    font-weight: 600;
    color: #fff;
}

.mono.warn {
    color: var(--yellow);
}

/* ---------- Benchmarks ---------- */
.benchmark-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.benchmark-section h4 {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-dim);
    font-weight: 500;
}

.chip .chip-value {
    font-family: var(--mono);
    color: var(--green);
    font-weight: 600;
}

/* ---------- Facility Grid ---------- */
.facility-grid {
    padding: 20px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.facility-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: border-color var(--transition), background var(--transition);
}

.facility-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

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

.facility-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

.facility-actions {
    display: flex;
    gap: 4px;
}

.facility-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    transition: color var(--transition);
}

.facility-actions button:hover {
    color: var(--text);
}

.facility-actions button.delete:hover {
    color: var(--red);
}

.facility-actions .material-icons-round {
    font-size: 18px;
}

.facility-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.facility-detail .material-icons-round {
    font-size: 16px;
    color: var(--text-muted);
}

.facility-detail span {
    font-size: 0.82rem;
    color: var(--text-dim);
}

.facility-detail .value {
    font-family: var(--mono);
    color: var(--yellow);
    font-weight: 600;
}

.facility-notes {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 6px;
}

.facility-dwell-input {
    width: 60px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--yellow);
    font-family: var(--mono);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 3px 6px;
    text-align: center;
    outline: none;
    transition: border-color var(--transition);
}

.facility-dwell-input:focus {
    border-color: var(--accent);
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(180deg, #141925, #0f1320);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-content.small {
    max-width: 440px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
}

.modal-header .material-icons-round {
    color: var(--accent);
    font-size: 22px;
}

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

.modal-close:hover {
    color: var(--text);
    background: var(--bg-card);
}

.modal-body {
    padding: 20px 24px 24px;
}

.modal-lane-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.modal-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 500;
}

.modal-detail-value {
    font-family: var(--mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.modal-detail-value.green { color: var(--green); }
.modal-detail-value.yellow { color: var(--yellow); }

.modal-section {
    margin-bottom: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.modal-section h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 14px;
}

.modal-section h4 .material-icons-round {
    font-size: 18px;
    color: var(--accent);
}

.modal-results {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    flex: 1;
    margin-top: 0;
}

/* ---------- Toast ---------- */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1e293b, #1a2332);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
    min-width: 260px;
}

.toast .material-icons-round {
    font-size: 20px;
    color: var(--green);
}

.toast span {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}

/* ---------- Footer ---------- */
.app-footer {
    text-align: center;
    padding: 24px 32px;
    border-top: 1px solid var(--border);
}

.app-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

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

/* ---------- Utility ---------- */
.hidden {
    display: none !important;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* ---------- Input number spinners ---------- */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 0.3;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .calc-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
    }

    .header-meta {
        width: 100%;
        justify-content: flex-start;
    }

    .stats-inner {
        grid-template-columns: 1fr 1fr;
        padding: 14px 16px;
        gap: 10px;
    }

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

    .stat-value {
        font-size: 1.15rem;
    }

    .main-content {
        padding: 16px;
    }

    .filters-row {
        padding: 12px 16px;
        flex-direction: column;
        gap: 10px;
    }

    .search-box {
        max-width: 100%;
        min-width: 100%;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select {
        flex: 1;
        min-width: 0;
    }

    .section-header {
        padding: 14px 16px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .calc-body {
        padding: 16px;
    }

    .facility-grid {
        padding: 16px;
        grid-template-columns: 1fr;
    }

    .modal-lane-details {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column;
    }

    .input-row-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

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

    html {
        font-size: 13px;
    }

    .brand-text h1 {
        font-size: 1.15rem;
    }
}
