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

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: #f1f5f9;
    color: #1e293b;
}
.font-display { font-family: 'Oswald', sans-serif; letter-spacing: .02em; }
a { text-decoration: none; color: inherit; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px; background: #0f172a; color: #e2e8f0; flex-shrink: 0;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { padding: 20px 16px; border-bottom: 1px solid #1e293b; }
.sidebar-brand .title { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 19px; display: flex; align-items: center; gap: 8px; }
.sidebar-brand .sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.nav a {
    display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 6px;
    font-size: 14px; font-weight: 500; color: #cbd5e1; margin-bottom: 2px;
}
.nav a:hover { background: #1e293b; }
.nav a.active { background: #f59e0b; color: #0f172a; }
.sidebar-foot { padding: 12px; border-top: 1px solid #1e293b; font-size: 12px; }
.sidebar-foot .who { color: #94a3b8; margin-bottom: 6px; }
.sidebar-foot .logout { color: #f87171; }

.main { flex: 1; padding: 26px 30px; max-width: 1200px; }

/* Cards / KPIs */
.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card-pad { padding: 16px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
.kpi .label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; font-weight: 600; }
.kpi .value { font-family: 'Oswald', sans-serif; font-size: 24px; font-weight: 700; margin-top: 4px; }
.kpi .value.tone-emerald { color: #059669; }
.kpi .value.tone-red { color: #dc2626; }
.kpi .value.tone-amber { color: #d97706; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

h2.page-title { font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 700; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
h3.card-title { font-family: 'Oswald', sans-serif; font-size: 15px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; color: #0f172a; }

/* Semaforo */
.dot { display: inline-block; border-radius: 50%; box-shadow: 0 0 0 3px rgba(0,0,0,.04); }
.dot-green { background: #10b981; }
.dot-yellow { background: #fbbf24; }
.dot-red { background: #ef4444; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.badge-slate { background: #f1f5f9; color: #475569; }
.badge-emerald { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; background: #f8fafc; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: #64748b; padding: 9px 12px; border-bottom: 1px solid #e2e8f0; }
table.data td { padding: 9px 12px; border-bottom: 1px solid #f1f5f9; color: #334155; }
table.data tr:hover td { background: #f8fafc; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions a { color: #94a3b8; margin-left: 8px; }
.row-actions a:hover { color: #d97706; }
.row-actions a.del:hover { color: #dc2626; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 6px; font-size: 14px; font-weight: 600; border: none; cursor: pointer; font-family: inherit; }
.btn-primary { background: #f59e0b; color: #0f172a; }
.btn-primary:hover { background: #d97706; }
.btn-dark { background: #0f172a; color: #fff; }
.btn-outline { background: #fff; color: #334155; border: 1px solid #cbd5e1; }
.btn-outline:hover { background: #f8fafc; }
.btn-danger { background: #fef2f2; color: #b91c1c; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }

/* Forms */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; padding: 9px 11px; font-size: 14px; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid #f1f5f9; margin-top: 6px; }

/* Dialog / modal */
dialog { border: none; border-radius: 10px; padding: 0; width: 100%; max-width: 480px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(15,23,42,.5); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid #f1f5f9; }
.dialog-head h3 { margin: 0; font-family: 'Oswald', sans-serif; font-size: 17px; }
.dialog-body { padding: 18px; max-height: 70vh; overflow-y: auto; }
.dialog-close { background: none; border: none; font-size: 18px; color: #94a3b8; cursor: pointer; }

/* Alerts list */
.alert-item { display: flex; align-items: center; gap: 8px; padding: 7px 6px; border-radius: 6px; font-size: 14px; }
.alert-item:hover { background: #f8fafc; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid #e2e8f0; margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 12px; font-size: 14px; font-weight: 500; color: #64748b; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: #0f172a; border-bottom-color: #f59e0b; }

/* Driver portal (mobile) */
.portal { max-width: 380px; margin: 0 auto; }
.portal-head { text-align: center; margin-bottom: 18px; }
.portal-head .who { font-size: 12px; text-transform: uppercase; color: #94a3b8; font-weight: 600; }
.portal-head h2 { margin: 2px 0; font-family: 'Oswald', sans-serif; font-size: 24px; }
.big-input { font-size: 20px; font-weight: 700; padding: 14px; }
.mini-list .card { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 14px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0f172a; }
.login-card { background: #fff; border-radius: 12px; padding: 32px 28px; width: 100%; max-width: 360px; }
.login-card h1 { font-family: 'Oswald', sans-serif; text-align: center; margin: 0 0 4px; }
.login-card p.sub { text-align: center; color: #64748b; font-size: 13px; margin: 0 0 20px; }
.login-error { background: #fee2e2; color: #991b1b; padding: 9px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; }

.text-muted { color: #94a3b8; }
.empty { text-align: center; color: #94a3b8; padding: 30px 0; }
