/* Driver App - Mobile First */
.driver-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 600px;
    margin: 0 auto;
}

/* Header */
.driver-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.driver-header-left { display: flex; flex-direction: column; gap: 2px; }
.driver-name { font-weight: 600; font-size: 14px; }
.driver-vehicle { font-size: 11px; color: var(--main); cursor: pointer; }
.driver-vehicle:hover { text-decoration: underline; }
.driver-logout {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
}

/* Main Content */
.driver-content {
    flex: 1;
    padding: 16px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); /* space for bottom nav + safe area */
    overflow-y: auto;
}

/* Bottom Navigation */
.driver-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: #161b22;
    border-top: 1px solid var(--border);
    z-index: 10;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.driver-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    transition: color 0.2s;
}
.driver-nav-item.active { color: var(--main); }
.driver-nav-item:hover { color: var(--text); }
.nav-icon { font-size: 20px; line-height: 1; margin-bottom: 4px; display: block; }
.nav-label { font-weight: 500; line-height: 1; text-align: center; }

/* Cards */
.driver-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}
.driver-card h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Compliance Bars */
.compliance-bar {
    margin-bottom: 12px;
}
.compliance-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 4px;
}
.compliance-bar-track {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.compliance-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}
.compliance-bar-fill.green { background: var(--status-online); }
.compliance-bar-fill.yellow { background: var(--status-warning); }
.compliance-bar-fill.red { background: var(--status-error); }

/* Activity Buttons (Virtual Tacho) */
.tacho-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.tacho-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 80px;
}
.tacho-btn:active { transform: scale(0.95); }
.tacho-btn.active { border-width: 3px; }
.tacho-btn.driving { border-color: #22c55e; }
.tacho-btn.driving.active { background: rgba(34,197,94,0.15); box-shadow: 0 0 20px rgba(34,197,94,0.2); }
.tacho-btn.work { border-color: #3b82f6; }
.tacho-btn.work.active { background: rgba(59,130,246,0.15); box-shadow: 0 0 20px rgba(59,130,246,0.2); }
.tacho-btn.available { border-color: #eab308; }
.tacho-btn.available.active { background: rgba(234,179,8,0.15); box-shadow: 0 0 20px rgba(234,179,8,0.2); }
.tacho-btn.rest { border-color: #6b7280; }
.tacho-btn.rest.active { background: rgba(107,114,128,0.15); box-shadow: 0 0 20px rgba(107,114,128,0.2); }
.tacho-btn-icon { font-size: 28px; margin-bottom: 6px; }
.tacho-btn-timer { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Current Status */
.current-status {
    text-align: center;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
}
.current-status-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.current-status-value { font-size: 24px; font-weight: 700; }
.current-status-timer { font-size: 14px; color: var(--text-muted); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* Forms */
.driver-form-group {
    margin-bottom: 16px;
}
.driver-form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.driver-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #21262d;
    color: var(--text);
    font-size: 16px; /* prevents iOS zoom */
}
.driver-input:focus { outline: none; border-color: var(--main); }
.driver-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: var(--main);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}
.driver-btn:disabled { opacity: 0.5; }
.driver-btn-secondary {
    background: var(--border);
    color: var(--text);
}

/* Vehicle List */
.vehicle-list { display: flex; flex-direction: column; gap: 8px; }
.vehicle-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.vehicle-item:hover, .vehicle-item.selected { border-color: var(--main); }
.vehicle-item .vehicle-reg { font-weight: 600; font-size: 16px; }
.vehicle-item .vehicle-type { font-size: 12px; color: var(--text-muted); }

/* Check Form */
.check-question {
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
}
.check-question-text { font-size: 14px; font-weight: 500; margin-bottom: 12px; }
.check-yesno { display: flex; gap: 8px; }
.check-yesno button {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.check-yesno button.selected-yes { border-color: #22c55e; background: rgba(34,197,94,0.1); color: #22c55e; }
.check-yesno button.selected-no { border-color: #ef4444; background: rgba(239,68,68,0.1); color: #ef4444; }

/* Infraction Badges */
.infraction-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; }
.infraction-minor { background: rgba(234,179,8,0.15); color: #eab308; }
.infraction-serious { background: rgba(249,115,22,0.15); color: #f97316; }
.infraction-veryserious { background: rgba(239,68,68,0.15); color: #ef4444; }

/* Offline Banner */
.offline-banner {
    padding: 8px 16px;
    background: rgba(249,115,22,0.15);
    color: #f97316;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
}

/* Activity Timeline */
.activity-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.activity-dot.driving { background: #22c55e; }
.activity-dot.work { background: #3b82f6; }
.activity-dot.available { background: #eab308; }
.activity-dot.rest { background: #6b7280; }

/* Responsive */
@media (min-width: 601px) {
    .driver-nav { left: 50%; transform: translateX(-50%); }
}
