/**
 * Caminhão OK - Stylesheet Principal
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=Oswald:wght@500;700&display=swap');

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Industrial Safety Palette */
    --primary-color: #FFD700; /* Safety Yellow */
    --secondary-color: #1E1E1E; /* Concrete Gray */
    --accent-color: #00E676; /* Over-approved Green */
    --surface-color: #1A1A1A; /* Dark Surface */
    --text-color: #FFFFFF; /* High Visibility White */
    
    /* Cores derivadas */
    --primary-hover: #E5C100;
    --bg-color: #121212; /* Asphalt Black */
    --text-muted: #94A3B8; /* Slate-400 */
    --border-color: #333333; /* Dark divider */
    
    --success-color: #00DD80; /* Neon Green */
    --warning-color: #FFD700; /* Safety Yellow */
    --danger-color: #FF3F34; /* Neon Danger Orange/Red */
    
    /* Design System */
    --border-radius: 8px; /* Mais industrial e quadrado */
    --spacing-unit: 8px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); /* transição rápida "snap" */
    --shadow-sm: 0 4px 0 rgba(0,0,0,1); /* Brutalist hard shadow */
    --shadow-md: 0 8px 0 rgba(0,0,0,1);
    --shadow-lg: 0 12px 20px rgba(0,0,0,0.5);
    
    /* Typography */
    --font-family-body: 'Inter', sans-serif;
    --font-family-display: 'Oswald', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
}

html {
    font-size: clamp(14px, 2.5vw, 18px);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family-body);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    padding-top: 60px;
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-display);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 991px) {
    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
}

/* Header Fixo */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 700;
}

.header-logo i {
    display: none; /* Hide fontawesome icon */
}

.header-logo::before {
    content: '';
    display: inline-block;
    width: 32px;
    height: 32px;
    background-image: url('../assets/logo.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px; /* Slight rounded edges */
}

.header-logo h1 {
    font-size: var(--font-size-lg);
    margin: 0;
}

.desktop-nav {
    display: none;
    gap: 8px;
}

.desktop-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

.desktop-nav .nav-link:hover,
.desktop-nav .nav-link.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

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

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--surface-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px; /* Increased for better touch accessibility */
    background: var(--surface-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 3px solid var(--border-color);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-family-display);
    transition: var(--transition);
    min-width: 65px;
    height: 100%;
}

.nav-item i {
    font-size: 24px;
    transition: transform 0.2s ease;
    margin-bottom: 2px;
}

.nav-item.active {
    color: var(--primary-color);
    background: transparent;
    border-top: 4px solid var(--primary-color);
    margin-top: -3px; /* Offset the 3px border */
}

.nav-item.active i {
    transform: scale(1.15);
}

.nav-item:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}

/* Responsive Navigation */
@media (min-width: 992px) {
    .desktop-nav {
        display: flex;
    }
    
    .bottom-nav {
        display: none !important;
    }
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 60px);
    padding-bottom: 80px;
}

.container {
    padding: 16px;
    max-width: 100%;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .container {
        padding: 24px;
        max-width: 720px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 960px;
    }
}

/* Views */
.view {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.view.active {
    display: block;
}

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

/* Welcome Card */
.welcome-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 32px 24px;
    box-shadow: 0 8px 0 var(--border-color);
    margin-bottom: 24px;
    border: 3px solid var(--border-color);
}

.welcome-header {
    text-align: center;
    margin-bottom: 24px;
}

.welcome-icon {
    margin-bottom: 24px;
}

.welcome-icon i {
    display: none;
}

.welcome-icon::before {
    content: '';
    display: block;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background-image: url('../assets/logo.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 2px solid var(--border-color);
}

.welcome-header h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: 8px;
    color: var(--text-color);
}

.welcome-header p {
    color: var(--text-muted);
    font-size: var(--font-size-lg);
}

.current-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(255, 215, 0, 0.05); /* Yellow tint */
    border-radius: var(--border-radius);
    border-left: 6px solid var(--primary-color);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.info-item i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 0 var(--border-color);
    border: 3px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--border-color);
    border-color: #555555;
}

.stat-card i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

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

.stat-number {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    font-family: var(--font-family-display);
    color: var(--text-color);
}

.stat-label {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-lg);
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-family-display);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    min-height: 56px; /* Massive touch target */
}

.btn-primary {
    background: var(--primary-color);
    color: #000000; /* Black text on yellow for high contrast */
    box-shadow: 0 4px 0 #A88E00;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(2px);
    box-shadow: 0 2px 0 #A88E00;
}

.btn-primary:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #A88E00;
}

.btn-secondary {
    background: var(--surface-color);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 0 var(--border-color);
}

.btn-secondary:hover {
    background: #252525;
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--border-color);
}

.btn-secondary:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--border-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 4px 0 #B22C24;
}

.btn-danger:hover {
    background: #E5392F;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #B22C24;
}

.btn-large {
    padding: 18px 36px;
    font-size: var(--font-size-xl);
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-input,
.form-select {
    width: 100%;
    padding: 16px;
    border: 3px solid var(--border-color);
    border-bottom-width: 6px;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: inherit;
    background: var(--surface-color);
    color: var(--text-color);
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.15);
}

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

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

@media (max-width: 767px) {
    .form-actions {
        flex-direction: column;
    }
}

/* Checklist */
.checklist-header {
    margin-bottom: 24px;
}

.checklist-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--text-color);
}

.progress-bar {
    position: relative;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: 12px;
    right: 0;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-weight: 500;
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.checklist-item {
    background: var(--surface-color);
    border: 3px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 32px 24px;
    transition: var(--transition);
    display: none;
    box-shadow: 0 8px 0 var(--border-color);
}

.checklist-item.active {
    display: block;
    animation: slideSnapIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideSnapIn {
    0% { opacity: 0; transform: translateX(20px) scale(0.95); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

.checklist-item:hover {
    border-color: #555555;
    box-shadow: 0 8px 0 #555555;
}

.item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.item-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    width: 24px;
    text-align: center;
}

.item-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-color);
}

.status-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.status-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    border: 3px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-color);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 700;
    font-size: var(--font-size-xl);
    font-family: var(--font-family-display);
    text-transform: uppercase;
    box-shadow: 0 4px 0 var(--border-color);
}

.status-option i {
    font-size: 28px;
}

.status-option:hover {
    border-color: #555555;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #555555;
}

.status-option:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #555555;
}

.status-option.selected {
    border-color: var(--primary-color);
    background: rgba(255, 215, 0, 0.1);
    color: var(--primary-color);
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--primary-color);
}

.status-option.ok.selected {
    border-color: var(--success-color);
    background: rgba(0, 221, 128, 0.1);
    color: var(--success-color);
    box-shadow: 0 0 0 var(--success-color);
}

.status-option.attention.selected {
    border-color: var(--warning-color);
    background: rgba(255, 215, 0, 0.1);
    color: var(--warning-color);
    box-shadow: 0 0 0 var(--warning-color);
}

.status-option.problem.selected {
    border-color: var(--danger-color);
    background: rgba(255, 63, 52, 0.1);
    color: var(--danger-color);
    box-shadow: 0 0 0 var(--danger-color);
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 63, 52, 0.05),
        rgba(255, 63, 52, 0.05) 10px,
        transparent 10px,
        transparent 20px
    );
}

.observation-field {
    margin-top: 12px;
    display: none;
}

.observation-field.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

.observation-field textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: var(--font-size-base);
    resize: vertical;
    background: var(--bg-color);
    color: var(--text-color);
}

.observation-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

/* FAQ */
.faq-section {
    margin-top: 32px;
    padding: 24px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.faq-section h2 {
    margin-bottom: 20px;
    color: var(--text-color);
    text-align: center;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 16px;
    background: var(--bg-color);
    border: none;
    text-align: left;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background: rgba(255, 0, 0, 0.05);
}

.faq-icon {
    font-size: var(--font-size-lg);
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 16px;
    background: rgba(255, 0, 0, 0.02);
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-answer:not([hidden]) {
    padding: 16px;
    max-height: 200px;
}

.faq-answer p {
    color: var(--text-muted);
    line-height: 1.6;
}

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

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text-color);
}

.empty-state p {
    margin-bottom: 24px;
    font-size: var(--font-size-lg);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 96px; /* High enough to clear the new 72px bottom-nav */
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-color);
    color: var(--bg-color);
    padding: 16px 24px;
    border-radius: var(--border-radius);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Snappy transition */
    z-index: 2000;
    font-weight: 700;
    font-family: var(--font-family-display);
    text-transform: uppercase;
    box-shadow: 0 4px 0 rgba(0,0,0,0.5);
    max-width: 90vw;
    text-align: center;
    pointer-events: none; /* KEY FIX: Do not block clicks underneath */
}

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

.toast.success {
    background: var(--success-color);
    color: var(--bg-color);
}

.toast.error {
    background: var(--danger-color);
    color: var(--text-color);
}

.toast.warning {
    background: var(--warning-color);
    color: var(--bg-color);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(4px);
}

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

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 16px;
}

.loading-spinner p {
    font-size: var(--font-size-lg);
    font-weight: 500;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 32px 16px;
    background: var(--surface-color);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    margin-top: 48px;
    border-top: 3px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-transform: uppercase;
    font-family: var(--font-family-display);
    letter-spacing: 0.5px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-links .separator {
    color: var(--border-color);
}

.app-footer p {
    margin: 0;
}

.b20-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.b20-link:hover {
    text-decoration: underline;
    transform: scale(1.05);
}

/* Reports & Telemetry UI */
.report-card {
    background: var(--surface-color);
    border: 3px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 32px 24px;
    box-shadow: 0 8px 0 var(--border-color);
    margin-bottom: 24px;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px dashed var(--border-color);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.report-header h3 {
    font-size: var(--font-size-2xl);
    color: var(--text-color);
}

.report-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-family: var(--font-family-display);
    font-size: var(--font-size-xl);
    text-transform: uppercase;
    border-radius: var(--border-radius);
    font-weight: 700;
}

.status-success, .status-approved {
    color: var(--bg-color) !important;
    background: var(--success-color);
    box-shadow: 0 4px 0 #008f51;
}

.status-warning, .status-attention {
    color: var(--bg-color) !important;
    background: var(--warning-color);
    box-shadow: 0 4px 0 #A88E00;
}

.status-danger, .status-rejected {
    color: var(--text-color) !important;
    background: var(--danger-color);
    box-shadow: 0 4px 0 #B22C24;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    background: var(--bg-color);
    padding: 24px;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    margin-bottom: 24px;
}

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

.info-item label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.info-item span {
    font-family: var(--font-family-display);
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-color);
}

.report-stats {
    display: flex;
    justify-content: space-around;
    padding: 32px 0;
    border-top: 2px dashed var(--border-color);
    border-bottom: 2px dashed var(--border-color);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--font-family-display);
}

.stat-item .stat-number {
    font-size: 3.5rem;
    line-height: 1;
    margin: 8px 0;
}

.stat-item .stat-label {
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 2px;
}

.stat-ok { color: var(--success-color); }
.stat-attention { color: var(--warning-color); }
.stat-problem { color: var(--danger-color); }

/* History List UI */
.history-item {
    display: flex;
    flex-direction: column;
    background: var(--surface-color);
    padding: 24px;
    border: 3px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    transition: var(--transition);
    box-shadow: 0 4px 0 var(--border-color);
}

.history-item:hover {
    border-color: #555555;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #555555;
    cursor: pointer;
}

.history-item .history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Page Header for History/General */
section .history-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--border-color);
}

@media (min-width: 768px) {
    section .history-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.history-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.history-filters .form-select {
    width: auto;
    flex: 1;
    min-width: 150px;
    padding: 12px 16px; /* slightly smaller padding for inline header */
    border-bottom-width: 3px; /* standard thickness */
}



.history-date {
    font-family: var(--font-family-display);
    font-size: var(--font-size-xl);
    color: var(--text-color);
}

.history-status {
    padding: 8px 16px;
    border-radius: var(--border-radius);
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-family-display);
}

.history-actions, .report-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.report-observations {
    background: rgba(255, 63, 52, 0.05);
    padding: 24px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--danger-color);
}

.report-observations h4 {
    margin-bottom: 16px;
    color: var(--danger-color);
    font-size: var(--font-size-xl);
}

.observation-item {
    margin-bottom: 12px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.observation-item strong {
    color: var(--text-color);
    display: block;
    margin-bottom: 4px;
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

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

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: calc(var(--spacing-unit) * 1); }
.mb-2 { margin-bottom: calc(var(--spacing-unit) * 2); }
.mb-3 { margin-bottom: calc(var(--spacing-unit) * 3); }
.mb-4 { margin-bottom: calc(var(--spacing-unit) * 4); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: calc(var(--spacing-unit) * 1); }
.mt-2 { margin-top: calc(var(--spacing-unit) * 2); }
.mt-3 { margin-top: calc(var(--spacing-unit) * 3); }
.mt-4 { margin-top: calc(var(--spacing-unit) * 4); }

/* Responsive Adjustments */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .welcome-card {
        padding: 16px;
    }
    
    .status-options {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .current-info {
        flex-direction: row;
        justify-content: space-around;
    }
    
    .form-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
    
    .form-actions .btn {
        width: auto;
    }
}

/* Print Styles */
@media print {
    .app-header,
    .bottom-nav,
    .btn,
    .toast,
    .loading-overlay {
        display: none !important;
    }
    
    body {
        padding-top: 0;
        padding-bottom: 0;
    }
    
    .main-content {
        padding-bottom: 0;
    }
}
