/* Self-hosted Outfit Font definition */
@font-face {
    font-family: 'Outfit';
    src: url('fonts/Outfit/Outfit-Variable.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Color Palette System & Tokens */
:root {
    --primary-color: #132537;
    --accent-red: #ed292b;
    --success-green: #2e7d32;
    --warning-orange: #f57c00;
    --danger-red: #ed292b;
    --bg-gray: #f8f9fa;
    --card-border: #cbd5e1;
    --text-dark: #132537;
    --text-muted: #64748b;
    --light-bg: #fafafa;
}

/* Global Reset */
body {
    background-color: var(--bg-gray);
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden !important;
    height: 100vh !important;
}

/* Printable Canvas Layout Constraints (DSC-033) */
.canvas-sheet {
    width: 8.5in;
    height: 10.5in;
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
    margin: 0 auto;
}

/* Unified Layout Container Wrapper */
.report-page {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border: none;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 0;
    overflow: visible;
    min-height: 100vh;
    box-sizing: border-box;
}

/* Branded Header (OOFuelPrice Style) */
.main-header {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 12px 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-bottom: 3px solid var(--accent-red);
    flex-shrink: 0;
}

.header-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.header-logo-container {
    display: flex;
    align-items: center;
}

.header-logo {
    max-height: 44px;
    width: auto;
}

.header-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    flex-grow: 1;
}

.main-header h1 {
    font-weight: 800;
    font-size: 18px;
    line-height: 1.1;
    letter-spacing: 1px;
    margin: 0;
    color: #ffffff;
    text-transform: uppercase;
}

.main-header .subtitle {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin: 2px 0 0 0;
}

/* Navigation Bar */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    background: #fafafa;
    border-bottom: 2px solid #f0f0f0;
    height: 48px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--primary-color);
    background: #f1f5f9;
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 800;
    border-bottom: 2px solid var(--accent-red);
    border-radius: 0;
    padding-bottom: 2px;
}

.help-btn {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.help-btn:hover {
    transform: scale(1.1);
    background-color: white;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Content Layout Containers */
.content-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 25px 40px 30px 40px;
    flex: 1;
    box-sizing: border-box;
}

.card {
    background: white;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px;
    box-sizing: border-box;
}

.card-header {
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

.card-header svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

/* SSO Login Block */
.portal-intro {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.portal-intro h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portal-intro p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    max-width: 680px;
    margin: 10px auto 0 auto;
}

.feature-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.feature-icon {
    background: var(--primary-color);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
}

.feature-info h4 {
    margin: 0 0 5px 0;
    font-weight: 800;
    font-size: 14px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feature-info p {
    margin: 0;
    font-size: 12.5px;
    color: #556677;
    line-height: 1.4;
}

.login-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 350px;
    margin: 15px auto 0 auto;
    padding: 25px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fafafa;
}

.btn-sso {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 24px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-color);
    color: white;
    width: 100%;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(19, 37, 55, 0.25);
}

.btn-sso:hover {
    background: #243b53;
    transform: translateY(-1px);
}

.sso-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Home / Selector Filters */
.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    outline: none;
    background: white;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(19, 37, 55, 0.1);
}

.date-range-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

/* Driver Selector Registry Table */
.table-scroll {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow-y: auto;
    max-height: 350px;
}

.driver-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.driver-table th {
    background: var(--primary-color);
    color: white;
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    padding: 10px 15px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.driver-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    background: white;
    vertical-align: middle;
}

.driver-table tr {
    cursor: pointer;
    transition: background 0.15s;
}

.driver-table tr:hover td {
    background-color: #f8fafc;
}

.driver-table tr.selected td {
    background-color: #eff6ff;
    border-bottom: 1px solid #bfdbfe;
}

.driver-radio {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Action Panels & Buttons */
.btn-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.selection-hint {
    font-size: 12px;
    color: #ef4444;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-generate {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(19, 37, 55, 0.25);
}

.btn-generate:hover:not(:disabled) {
    background: #243b53;
    transform: translateY(-1px);
}

.btn-generate:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

/* Branded Footer */
.main-footer {
    background-color: #ffffff;
    color: var(--text-muted);
    padding: 15px 40px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.02);
}

.main-footer p {
    margin: 0;
    line-height: 1.4;
}

/* ==================== REPORT SECTION STYLES ==================== */
.utility-header {
    width: 100%;
    max-width: 8.5in;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    box-sizing: border-box;
    position: sticky;
    top: 10px;
    z-index: 4500;
    margin: 0 auto 15px auto;
}

.canvas-scroll-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 15px;
}

.utility-back {
    color: var(--primary-color);
    font-weight: 800;
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.utility-back:hover {
    color: var(--accent-red);
    transform: translateX(-2px);
}

.utility-actions {
    display: flex;
    gap: 10px;
}

.btn-util {
    padding: 7px 14px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: white;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    font-family: 'Outfit', sans-serif;
}

.btn-util:hover {
    background: #f1f5f9;
    color: var(--primary-color);
    border-color: #94a3b8;
}

.btn-util-print {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(19, 37, 55, 0.25);
}

.btn-util-print:hover {
    background: #243b53;
    color: white;
}

/* Info Bar Report */
.info-bar-report {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1.5fr;
    padding: 0 40px;
    background: #fafafa;
    border-bottom: 2px solid #f0f0f0;
    font-family: 'Outfit', sans-serif;
    height: 48px;
    box-sizing: border-box;
    align-items: center;
    flex-shrink: 0;
}

.info-item-report {
    display: flex;
    flex-direction: column;
}

.info-item-report span.lbl {
    font-size: 9px;
    text-transform: uppercase;
    color: #888;
    font-weight: 600;
    letter-spacing: 1px;
    line-height: 1.2;
}

.info-item-report span.val {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.2;
}

.info-item-report span.val-period {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.2;
}

.info-item-report span.val-compare {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.1;
    margin-top: 1px;
}

/* Hero Score Card */
.hero-card {
    background: linear-gradient(135deg, #F1F8E9 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px 20px;
    border-radius: 12px;
    height: 100%;
    flex: 1.1;
    box-sizing: border-box;
    border: 1px solid #eee;
    font-family: 'Outfit', sans-serif;
    position: relative;
}

.score-main-value {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1;
}

.score-sub-value {
    font-size: 8px;
    color: var(--text-muted);
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

.trend-badge-gauge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success-green);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.tier-label {
    font-size: 22px;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tier-subtitle {
    font-size: 9px;
    color: var(--primary-color);
    font-weight: 800;
    opacity: 0.6;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-scale-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
    margin-top: 6px;
    font-size: 8.5px;
    color: #444;
    font-weight: 700;
    box-sizing: border-box;
    flex-shrink: 0;
}

.legend-title {
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.color-dot {
    width: 7px;
    height: 7px;
    border-radius: 2px;
}
.color-dot.elite { background: var(--primary-color); }
.color-dot.strong { background: var(--success-green); }
.color-dot.average { background: var(--warning-orange); }
.color-dot.improve { background: var(--danger-red); }

/* Distance Milestone Tracker (calibrated to 250,000 km max) */
.distance-card-container {
    background: white;
    border-radius: 12px;
    border: 1px solid #eee;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: 'Outfit', sans-serif;
    height: 100%;
    flex: 1.4;
    box-sizing: border-box;
}

.distance-card-header {
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 14px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.distance-stats-row {
    display: grid;
    grid-template-columns: 1fr 1px 1fr 1px 1fr;
    align-items: center;
    gap: 0;
    padding: 10px 14px 6px 14px;
    flex-shrink: 0;
}

.stat-column {
    text-align: center;
}

.stat-column span.lbl {
    font-size: 8px;
    color: #888;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 1px;
    display: block;
}

.stat-column span.val {
    font-size: 22px;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1;
}

.stat-column span.val span {
    font-size: 10px;
    font-weight: 700;
    margin-left: 2px;
}

.compare-val-style {
    color: var(--text-muted) !important;
}

.divider-line {
    width: 1px;
    background: #e2e8f0;
    height: 32px;
}

.milestone-track-container {
    padding: 4px 16px 6px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

.progress-bar-track {
    height: 7px;
    background: #eee;
    border-radius: 4px;
    position: relative;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--success-green) 100%);
    width: 0%;
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.node {
    position: absolute;
    top: -3px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #ccc;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 1;
    transform: translateX(-50%);
    transition: background 0.3s;
}

.label-pct {
    position: absolute;
    transform: translateX(-50%);
    font-size: 7.5px;
    color: #666;
    font-weight: 700;
}

.milestone-banner {
    text-align: center;
    font-size: 8.5px;
    color: #1e3a8a;
    font-weight: 700;
    background: #eff6ff;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1.2;
}

/* Report Sections Grid */
.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1.5fr 1fr;
    gap: 10px;
    padding: 10px 40px 10px 40px;
    flex: 1;
    min-height: 0;
}

.full-width {
    grid-column: 1 / -1;
}

/* Performance Breakdown Table Card */
.breakdown-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #eee;
    padding: 10px 20px;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    margin: 0;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.breakdown-header {
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.breakdown-header svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.metrics-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.metrics-table th {
    background: var(--primary-color);
    padding: 5px 12px;
    font-size: 10px;
    text-transform: uppercase;
    color: white;
    letter-spacing: 1px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.metrics-table td {
    padding: 4px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.metrics-table tr:last-child td {
    border-bottom: none;
}

.metric-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-icon {
    width: 22px;
    height: 22px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.metric-name {
    font-weight: 800;
    font-size: 13px;
    color: var(--primary-color);
}

.value-cell {
    display: flex;
    align-items: baseline;
    gap: 2px;
    justify-content: flex-end;
}

.value-main {
    font-size: 22px;
    font-weight: 900;
    color: var(--primary-color);
}

.value-unit {
    font-size: 10px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
}

.prev-period-val {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 1px;
}

.benchmark-cell {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.benchmark-label {
    font-size: 8px;
    text-transform: uppercase;
    color: #999;
    font-weight: 700;
    line-height: 1;
}

.bold-target {
    font-size: 13px;
    font-weight: 800;
    color: #555;
}

.benchmark-direction {
    font-size: 7px;
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.benchmark-direction.green { color: var(--success-green); }
.benchmark-direction.red { color: var(--accent-red); }

.status-svg {
    width: 24px;
    height: 24px;
    display: block;
    margin: 0 auto;
}

.trend-icon-svg {
    width: 20px;
    height: 20px;
    display: block;
    margin: 0 auto;
}

.visual-bar-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    font-weight: 800;
    color: #666;
    text-transform: uppercase;
}

.bar-track {
    height: 10px;
    background: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.4s ease;
}

.fill-success { background: var(--success-green); }
.fill-warning { background: var(--warning-orange); }
.fill-needs-improvement { background: var(--danger-red); }

.row-success { background-color: rgba(46, 125, 50, 0.02); }
.row-warning { background-color: rgba(245, 124, 0, 0.02); }
.row-needs-improvement { background-color: rgba(237, 41, 43, 0.02); }
.row-inactive { background-color: rgba(100, 116, 139, 0.02); }
.fill-inactive { background: #94a3b8; }

/* Insights Card styles */
.insights-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #eee;
    padding: 20px;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    font-family: 'Outfit', sans-serif;
}

.insights-header {
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--primary-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

.insights-header svg {
    width: 18px;
    height: 18px;
}

.insights-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 20px;
    margin-top: 10px;
}

.insights-summary {
    color: #444;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 400;
}

.rec-banner {
    padding: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
}

.rec-header {
    font-weight: 800;
    font-size: 11px;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rec-header svg {
    width: 10px;
    height: 10px;
}

.rec-text {
    color: #444;
    font-size: 13px;
    line-height: 1.5;
}

/* Fleet Recognition Card styles */
.recognition-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #eee;
    padding: 15px 20px;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    font-family: 'Outfit', sans-serif;
}

.recognition-header {
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.recognition-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex-grow: 1;
}

.rank-notes-block {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 700;
    text-align: center;
    margin-top: 8px;
    border-top: 1px dashed #f0f0f0;
    padding-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Printable Canvas Footer */
.canvas-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    background: #ffffff;
    color: var(--primary-color);
    border-top: 1px solid #e2e8f0;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    font-family: 'Outfit', sans-serif;
    height: 40px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.canvas-footer .footer-left {
    font-size: 9px;
    opacity: 0.65;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.canvas-footer .footer-right {
    font-weight: 800;
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--primary-color);
    text-transform: uppercase;
}

/* ==================== CONFIG/SETTINGS SECTION STYLES ==================== */
.weights-flex {
    display: flex;
    gap: 25px;
    align-items: center;
}

.sliders-container {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.slider-row {
    display: grid;
    grid-template-columns: 1.5fr 3fr;
    align-items: center;
    gap: 15px;
}

.slider-label {
    font-weight: 800;
    font-size: 13px;
    color: var(--primary-color);
}

.slider-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-input-group input[type="range"] {
    flex: 1;
    accent-color: var(--primary-color);
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
}

.weight-num-input {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-color);
    background: #f1f5f9;
    padding: 4px 5px;
    border-radius: 6px;
    text-align: center;
    width: 45px;
    border: 1px solid #cbd5e1;
    font-family: 'Outfit', sans-serif;
    outline: none;
    box-sizing: border-box;
    -moz-appearance: textfield;
}

.weight-num-input::-webkit-outer-spin-button,
.weight-num-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.weight-num-input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 2px rgba(19, 37, 55, 0.1);
}

/* Validation Gauge */
.validation-gauge {
    flex: 1;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 180px;
    box-sizing: border-box;
    position: relative;
}

.gauge-circle {
    position: relative;
    width: 100px;
    height: 100px;
}

.gauge-circle svg {
    width: 100%;
    height: 100%;
}

.gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-val {
    font-size: 26px;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1;
}

.gauge-lbl {
    font-size: 8px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 2px;
}

.validation-status {
    font-size: 11px;
    font-weight: 800;
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-valid { color: var(--success-green); }
.status-invalid { color: var(--danger-red); }

/* Targets Matrix Table */
.targets-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.targets-table th {
    background: var(--primary-color);
    color: white;
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    padding: 8px 10px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.targets-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    background: white;
    vertical-align: middle;
}

.targets-table tr:hover td {
    background-color: #f8fafc;
}

.targets-table input[type="text"],
.targets-table input[type="number"] {
    width: 70px;
    padding: 5px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    text-align: right;
    outline: none;
    transition: border-color 0.2s;
}

.targets-table input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(19, 37, 55, 0.1);
}

.targets-table input:disabled {
    opacity: 0.6;
    background-color: #f8fafc !important;
    cursor: not-allowed;
    border: 1px dashed #cbd5e1 !important;
    color: #94a3b8 !important;
}

.cell-toggle {
    cursor: pointer;
    accent-color: var(--primary-color);
    width: 13px;
    height: 13px;
    margin: 0;
}

.default-badge {
    font-size: 8.5px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 2px;
    display: block;
}

.division-name-input {
    width: 100px !important;
    text-align: left !important;
    font-weight: 800 !important;
}

.global-default-row td {
    background: #f8fafc;
    font-weight: 600;
}

.global-default-row td:first-child {
    color: var(--text-muted);
    font-weight: 800;
}

.actions-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    gap: 12px;
}

.actions-flex .btn {
    flex: 1;
    justify-content: center;
    height: 48px;
    box-sizing: border-box;
    white-space: normal;
    text-align: center;
    padding: 6px 12px;
}

/* General Buttons */
.btn {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #243b53;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-green);
    color: white;
}

.btn-success:hover {
    background: #1b5e20;
    transform: translateY(-1px);
}

.btn-outline {
    background: white;
    color: var(--text-muted);
    border: 1px solid #cbd5e1;
}

.btn-outline:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.btn-danger-icon {
    color: var(--accent-red);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.btn-danger-icon:hover {
    transform: scale(1.15);
}

/* ==================== OVERLAYS & MODALS ==================== */
/* Glassmorphic Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 6000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.3s ease;
}

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

.modal-header {
    background-color: var(--primary-color);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.modal-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    line-height: 1;
    transition: all 0.2s;
}

.close-modal:hover {
    opacity: 1;
    transform: scale(1.1);
}

.modal-body {
    padding: 24px;
    font-size: 13.5px;
    color: #1e293b;
    line-height: 1.5;
    text-align: center;
    box-sizing: border-box;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid var(--accent-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.success-icon-wrap {
    background: #e0f2fe;
    color: #0288d1;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

.pdf-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    margin-top: 15px;
}

/* Notification Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 7000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast svg {
    width: 18px;
    height: 18px;
    color: #4ade80;
}

/* Shimmer Loading Page */
.shimmer-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 5000;
    padding: 40px;
    box-sizing: border-box;
    flex-direction: column;
    gap: 20px;
    transition: opacity 0.4s ease;
}

.shimmer-overlay.show {
    display: flex;
}

.shimmer-header {
    height: 80px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer-anim 1.5s infinite;
    border-radius: 8px;
}

.shimmer-title {
    height: 48px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer-anim 1.5s infinite;
    border-radius: 6px;
    width: 100%;
}

.shimmer-large-box {
    flex-grow: 1;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer-anim 1.5s infinite;
    border-radius: 12px;
}

.loading-text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    height: 100%;
    color: var(--primary-color);
}

.loading-spinner {
    width: 45px;
    height: 45px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid var(--accent-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-status-text {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
}

@keyframes shimmer-anim {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== PRINT MEDIA DIRECTIVES ==================== */
@media print {
    body {
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
    }

    .non-printable {
        display: none !important;
    }

    .report-page {
        box-shadow: none !important;
        border-radius: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .canvas-sheet {
        width: 100% !important;
        height: 100% !important;
        box-shadow: none !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
        padding: 0 !important;
    }

    @page {
        size: letter portrait;
        margin: 0.4in;
    }
}

/* Mobile responsive adjustments */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
        min-width: 100%;
    }
    .content-container {
        padding: 15px;
        gap: 15px;
    }
    .filter-grid, .date-range-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .driver-table {
        min-width: 600px;
    }
    .btn-container {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    .btn-generate {
        width: 100%;
        justify-content: center;
    }
    .nav-bar {
        height: auto;
        flex-direction: column;
        padding: 10px 20px;
        gap: 10px;
    }
    .nav-links {
        width: 100%;
        justify-content: space-around;
    }
    .main-header {
        padding: 10px 15px;
    }
    .main-header h1 {
        font-size: 14px;
    }
    .main-header .subtitle {
        display: none;
    }
    .header-logo {
        max-height: 32px;
    }
    .main-footer {
        padding: 12px 15px;
        font-size: 10px;
    }
    .weights-flex {
        flex-direction: column;
        align-items: stretch;
    }
    .validation-gauge {
        height: 140px;
    }
    .targets-table {
        min-width: 600px;
    }
    .actions-flex {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    .actions-flex button {
        width: 100%;
        justify-content: center;
    }
}

/* ==================== MICROSOFT ENTRA ID SSO CARD MOCKUP STYLES ==================== */
.sso-card {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    padding: 44px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border: 1px solid #dcdcdc;
    font-family: 'Segoe UI', -apple-system, system-ui, Roboto, sans-serif;
    color: #1b1b1b;
    box-sizing: border-box;
    border-radius: 4px;
}

.sso-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.ms-logo {
    width: 22px;
    height: 22px;
}

.ms-text {
    font-size: 17px;
    font-weight: 600;
    color: #737373;
}

.sso-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1b1b1b;
}

.sso-subtitle {
    font-size: 15px;
    color: #1b1b1b;
    margin: 0 0 16px 0;
}

.sso-form-group {
    margin-bottom: 20px;
}

.sso-input {
    width: 100%;
    padding: 6px 10px;
    font-size: 15px;
    border: none;
    border-bottom: 1px solid #666666;
    outline: none;
    background: transparent;
    color: #1b1b1b;
    box-sizing: border-box;
}

.sso-input:focus {
    border-bottom: 2px solid #0067b8;
    padding-bottom: 5px;
}

.sso-links {
    margin-bottom: 24px;
}

.sso-links a {
    font-size: 13px;
    color: #0067b8;
    text-decoration: none;
}

.sso-links a:hover {
    text-decoration: underline;
}

.sso-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-sso-next {
    background: #0067b8;
    color: #ffffff;
    border: none;
    padding: 8px 32px;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    min-width: 100px;
    text-align: center;
}

.btn-sso-next:hover {
    background: #005da6;
}

.sso-back-arrow {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 14px;
    color: #475569;
}

.sso-checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.sso-checkbox-group label {
    font-size: 15px;
    color: #1b1b1b;
    cursor: pointer;
}

.sso-actions-split {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-sso-cancel {
    background: #cccccc;
    color: #1b1b1b;
    border: none;
    padding: 8px 32px;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    min-width: 100px;
    text-align: center;
}

.btn-sso-cancel:hover {
    background: #c0c0c0;
}

/* Sortable Table Headers */
th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    background-color: var(--primary-color) !important;
    color: white !important;
}

th.sortable:hover {
    background-color: #1e3a8a !important; /* Premium hover highlight */
}

th.sortable i {
    margin-left: 5px;
    font-size: 0.85em;
    opacity: 0.4;
    transition: opacity 0.2s;
}

th.sortable:hover i {
    opacity: 0.8;
}

#btn-force-refresh {
    transition: color 0.2s, transform 0.2s;
}

#btn-force-refresh:hover {
    color: var(--accent-red) !important;
    transform: scale(1.15);
}

/* Card level loader overlay for decoupled refresh progress */
.card-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(241, 245, 249, 0.92) 25%, rgba(226, 232, 240, 0.92) 50%, rgba(241, 245, 249, 0.92) 75%);
    background-size: 200% 100%;
    animation: shimmer-anim 1.5s infinite;
    z-index: 100;
    display: none; /* Controlled by JS via class .show */
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    backdrop-filter: blur(1px);
}

.card-loader-overlay.show {
    display: flex;
}

.card-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Page break between scorecard and cheat sheet in combined report export */
#printable-area #target-cheat-canvas {
    page-break-before: always !important;
    break-before: page !important;
}

/* Override screen-only gaps during PDF generation */
.generating-pdf .canvas-sheet + .canvas-sheet {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.generating-pdf .html2pdf__page-break {
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
}

/* Screen-only separator for preview */
.canvas-sheet + .canvas-sheet {
    margin-top: 40px;
}
@media print {
    .canvas-sheet + .canvas-sheet {
        margin-top: 0 !important;
    }
}

/* Compact styling for Target Cheat Sheet to prevent height overflow/cropping */
#target-cheat-canvas th, #target-cheat-canvas td {
    padding: 7px 12px !important;
}

/* Card Header Action Button Styling */
.card-header-flex {
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 4px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.utility-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-utility {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 4px;
    box-shadow: none;
    white-space: nowrap;
    line-height: 1;
}

.btn-utility:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

#btn-cheat-sheet {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

#btn-cheat-sheet:hover {
    background-color: var(--accent-red);
    color: #ffffff;
}

.btn-refresh-action {
    width: 32px;
    padding: 0;
    justify-content: center;
}

/* Intermediate screen responsive table styles */
@media (min-width: 769px) and (max-width: 1200px) {
    .driver-table {
        font-size: 11.5px !important;
    }
    .driver-table th, .driver-table td {
        padding: 8px 10px !important;
    }
}

/* Responsive adjustments for mobile and narrow viewports */
@media (max-width: 768px) {
    body {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .report-page {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 0 !important;
        border: none !important;
    }

    .card-header.card-header-flex {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        height: auto !important;
    }
    
    .card-header-title {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
    }
    
    .card-header-actions {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        width: 100% !important;
    }
    
    .utility-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr 40px !important;
        gap: 8px !important;
        width: 100% !important;
    }
    
    .utility-actions .btn-utility {
        width: 100% !important;
        justify-content: center !important;
        height: 38px !important;
    }
    
    .utility-actions .btn-refresh-action {
        width: 100% !important;
        height: 38px !important;
    }
    
    .card-header-actions .btn-generate {
        width: 100% !important;
        justify-content: center !important;
        height: 38px !important;
        margin: 0 !important;
    }
    
    .nav-bar {
        padding: 10px 15px !important;
        flex-direction: column !important;
        height: auto !important;
        gap: 10px !important;
    }
    
    .nav-links {
        width: 100% !important;
        justify-content: space-around !important;
    }
    
    .content-container {
        padding: 15px 12px 20px 12px !important;
    }
    
    .filter-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .date-range-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .weights-flex {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 20px !important;
    }
    
    .slider-row {
        grid-template-columns: 1fr !important;
        gap: 5px !important;
    }
    
    .validation-gauge {
        width: 100% !important;
        height: 150px !important;
    }
    
    .actions-flex {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    
    .actions-flex .btn {
        width: 100% !important;
        flex: none !important;
    }
    
    /* Allow tables to scroll horizontally on small screens to avoid squishing */
    .table-scroll {
        overflow-x: auto !important;
        width: 100% !important;
    }

    /* Prevent iOS auto-zoom on input focus */
    .form-group input,
    .form-group select,
    .targets-table input[type="text"],
    .targets-table input[type="number"],
    .weight-num-input,
    input[type="number"],
    select {
        font-size: 16px !important;
    }

    /* Responsive driver table font size for narrow screens */
    .driver-table {
        font-size: 10.5px !important;
    }
    .driver-table th, .driver-table td {
        padding: 6px 8px !important;
    }
    .driver-table th {
        font-size: 9px !important;
    }
}

/* Help Drawer Variation (OOFuelPrice Style) */
.modal.help-drawer {
    justify-content: flex-end;
    padding: 0;
}

.modal.help-drawer .modal-content {
    height: 100%;
    max-height: 100vh;
    width: 85%;
    max-width: 400px;
    border-radius: 0;
    transform: translateX(100%);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.help-drawer.show .modal-content {
    transform: translateX(0);
}

.modal.help-drawer .modal-body {
    overflow-y: auto;
    flex: 1;
    text-align: left;
}

/* Sort Bar for Card Grid */
.driver-sort-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 6px;
    flex-wrap: wrap;
}

.sort-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sort-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sort-option {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.sort-option:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.sort-option.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.sort-direction-indicator {
    font-weight: 800;
    margin-left: 2px;
}

/* Drivers Card Grid (Stacked vertically) */
.driver-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.driver-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 18px;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.driver-card:hover {
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.driver-card.selected {
    background-color: #eff6ff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6, 0 4px 12px rgba(59, 130, 246, 0.1);
}

.driver-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1.5;
    min-width: 180px;
}

.driver-card-selection {
    display: flex;
    align-items: center;
    justify-content: center;
}

.driver-card-identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.driver-card-name {
    font-weight: 800;
    color: var(--primary-color);
    font-size: 13.5px;
    line-height: 1.2;
}

.driver-card-id {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    font-family: monospace;
    letter-spacing: 0.5px;
}

.driver-card-details {
    display: flex;
    gap: 6px;
    flex: 1.2;
    align-items: center;
    justify-content: flex-start;
}

.badge-division {
    padding: 3px 8px;
    font-size: 9px;
    font-weight: 800;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #e2e8f0;
    color: #475569;
}

.driver-card-stats {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: #f8fafc;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
    min-width: 70px;
    box-sizing: border-box;
}

.driver-card.selected .stat-box {
    background: #f0f7ff;
    border-color: #e0f0ff;
}

.stat-label {
    font-size: 8.5px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: center;
}

.stat-value {
    font-size: 12px;
    font-weight: 800;
    color: var(--primary-color);
    text-align: center;
}

.stat-value.score {
    color: var(--primary-color);
}

.stat-value.div-rank {
    color: var(--success-green);
}

/* Mobile responsive layout for horizontal cards stack */
@media (max-width: 768px) {
    .driver-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding: 12px !important;
    }
    
    .driver-card-header {
        width: 100% !important;
        min-width: auto !important;
        flex: none !important;
    }
    
    .driver-card-details {
        width: 100% !important;
        justify-content: flex-start !important;
        flex: none !important;
    }
    
    .driver-card-stats {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 8px !important;
        border-top: 1px dashed #e2e8f0 !important;
        padding-top: 8px !important;
        width: 100% !important;
    }
    
    .stat-box {
        width: 100% !important;
        min-width: auto !important;
        padding: 6px 4px !important;
    }
}

/* Collapsible Header Cards visual hover states */
.collapsible-header-card {
    transition: background-color 0.2s ease, border-color 0.2s ease;
    border-radius: 6px;
    padding: 12px 16px !important;
    margin: -20px -20px 15px -20px !important;
}

.collapsible-header-card:hover {
    background-color: #f8fafc;
}

.collapsible-header-card.collapsed {
    margin-bottom: -20px !important;
    border-bottom: none !important;
}

/* PDF Cheat Sheet Only rules to hide division/driver info and align date to the right */
.generating-pdf-cheat .info-bar-report > .info-item-report:first-child,
.generating-pdf-cheat .info-bar-report > .info-item-report:nth-child(2) {
    display: none !important;
}

.generating-pdf-cheat .info-bar-report {
    display: flex !important;
    justify-content: flex-end !important;
}


