/* ============================================================
   VehiCheck — Estilos principales
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --sidebar-bg: linear-gradient(180deg, #0d1b2a 0%, #1b2838 40%, #162032 100%);
    --sidebar-item-hover: rgba(255,255,255,0.08);
    --sidebar-item-active: rgba(66, 153, 225, 0.2);
    --sidebar-item-active-border: #4299e1;
    --sidebar-text: rgba(255,255,255,0.8);
    --sidebar-text-muted: rgba(255,255,255,0.45);
    --topbar-bg: #ffffff;
    --topbar-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --accent: #4299e1;
    --accent2: #f6ad55;
    --success-soft: #d1fae5;
    --danger-soft: #fee2e2;
    --warning-soft: #fef3c7;
    --card-radius: 12px;
    --transition: all 0.25s ease;
}

/* ── RESET / BASE ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: #f0f4f8; font-family: 'Helvetica Neue', Arial, sans-serif; }

/* ── LOGIN ────────────────────────────────────────────── */
.login-body { background: #f0f4f8; display: flex; align-items: stretch; min-height: 100vh; }
.login-wrapper { display: flex; width: 100%; min-height: 100vh; }

.login-left {
    flex: 0 0 420px;
    background: var(--sidebar-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.login-brand { color: #fff; text-align: center; }
.login-icon { font-size: 72px; margin-bottom: 20px; opacity: 0.9; color: #4299e1; }
.login-brand h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 6px; }
.login-brand p  { opacity: 0.7; font-size: 14px; margin-bottom: 32px; }
.login-features { text-align: left; display: inline-block; }
.login-features div { padding: 6px 0; opacity: 0.8; font-size: 14px; }
.login-features i  { color: #68d391; }

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.login-form-container { width: 100%; max-width: 420px; }

/* ── TOPBAR ───────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    box-shadow: var(--topbar-shadow);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    gap: 12px;
}
.sidebar-toggle {
    background: none; border: none; cursor: pointer;
    font-size: 18px; color: #555; padding: 6px 10px;
    border-radius: 8px; transition: var(--transition);
}
.sidebar-toggle:hover { background: #f0f4f8; color: #333; }
.topbar-brand { font-weight: 800; font-size: 18px; color: #1a202c; letter-spacing: -0.5px; }

.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, #4299e1, #667eea);
    color: #fff; font-weight: 700; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center;
}
.topbar-user { color: #333; text-decoration: none; padding: 4px 8px; border-radius: 8px; }
.topbar-user:hover { background: #f0f4f8; }

.cuenta-badge {
    background: linear-gradient(135deg, #4299e1, #667eea);
    font-size: 12px; padding: 5px 12px; border-radius: 99px;
}

/* ── SIDEBAR ──────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
}
.sidebar-collapsed .sidebar { width: 0; }

.sidebar-header {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    min-height: var(--topbar-height);
}
.sidebar-logo {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, #4299e1, #667eea);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px; flex-shrink: 0;
}
.sidebar-brand-text .fw-bold { color: #fff; font-size: 16px; line-height: 1.2; }
.sidebar-tagline { color: var(--sidebar-text-muted); font-size: 10px; line-height: 1.3; }

.sidebar-cuenta {
    margin: 8px 12px;
    background: rgba(66,153,225,0.15);
    border: 1px solid rgba(66,153,225,0.3);
    border-radius: 8px;
    padding: 8px 12px;
    color: #90cdf4;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0;
    border-left: 3px solid transparent;
    transition: var(--transition);
    font-size: 14px; font-weight: 500;
    white-space: nowrap;
}
.sidebar-item:hover {
    background: var(--sidebar-item-hover);
    color: #fff;
}
.sidebar-item.active {
    background: var(--sidebar-item-active);
    border-left-color: var(--sidebar-item-active-border);
    color: #fff;
}
.sidebar-item.text-warning { color: #f6ad55 !important; }
.sidebar-item.text-danger-soft { color: rgba(252, 165, 165, 0.8); }
.sidebar-item.text-danger-soft:hover { color: #fca5a5; }
.sidebar-icon { width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-divider {
    padding: 16px 20px 6px;
    color: var(--sidebar-text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 8px 0;
}

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

/* ── MAIN CONTENT ─────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 24px;
    min-height: calc(100vh - var(--topbar-height));
    transition: var(--transition);
}

/* ── CARDS ────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: var(--card-radius);
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition);
    height: 100%;
}
.stat-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.10); transform: translateY(-2px); }

.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 14px;
}
.stat-icon.blue   { background: #ebf8ff; color: #3182ce; }
.stat-icon.green  { background: #f0fff4; color: #38a169; }
.stat-icon.orange { background: #fffaf0; color: #dd6b20; }
.stat-icon.purple { background: #faf5ff; color: #805ad5; }
.stat-icon.red    { background: #fff5f5; color: #e53e3e; }
.stat-icon.teal   { background: #e6fffa; color: #319795; }

.stat-value { font-size: 2rem; font-weight: 800; color: #1a202c; line-height: 1; }
.stat-label { font-size: 13px; color: #718096; margin-top: 4px; }

.content-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
}
.content-card .card-header-vc {
    padding: 16px 22px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex; align-items: center; justify-content: space-between;
    background: #fff;
}
.content-card .card-header-vc h5 { margin: 0; font-weight: 700; font-size: 15px; }
.content-card .card-body-vc { padding: 22px; }

/* ── TABLA ────────────────────────────────────────────── */
.vc-table { width: 100%; border-collapse: collapse; }
.vc-table th {
    background: #f7fafc; padding: 12px 16px; font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.6px; color: #4a5568;
    font-weight: 700; border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.vc-table td {
    padding: 13px 16px; border-bottom: 1px solid #edf2f7;
    font-size: 14px; color: #2d3748; vertical-align: middle;
}
.vc-table tr:last-child td { border-bottom: none; }
.vc-table tr:hover td { background: #f7fafc; }

/* ── BADGES ───────────────────────────────────────────── */
.badge-rol { font-size: 11px; padding: 3px 8px; border-radius: 4px; }
.badge-rol.badge-root       { background:#7c3aed;color:#fff; }
.badge-rol.badge-admin      { background:#2563eb;color:#fff; }
.badge-rol.badge-supervisor { background:#d97706;color:#fff; }
.badge-rol.badge-operator   { background:#059669;color:#fff; }

.status-badge { display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border-radius:99px;font-size:12px;font-weight:600; }
.status-borrador  { background:#e2e8f0;color:#4a5568; }
.status-enviado   { background:#fef3c7;color:#92400e; }
.status-aprobado  { background:#d1fae5;color:#065f46; }
.status-observado { background:#ffedd5;color:#9a3412; }
.status-rechazado { background:#fee2e2;color:#991b1b; }

/* ── CHECKLIST ITEMS ──────────────────────────────────── */
.checklist-category {
    background: #f7fafc; border-radius: 10px; margin-bottom: 12px;
    border: 1px solid #e2e8f0; overflow: hidden;
}
.checklist-category-header {
    padding: 12px 16px; font-weight: 700; font-size: 14px;
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    background: linear-gradient(135deg, #667eea11, #764ba211);
    border-bottom: 1px solid #e2e8f0;
}
.checklist-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-bottom: 1px solid #edf2f7;
    font-size: 14px; transition: background 0.15s;
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item:hover { background: #f7fafc; }

.item-status-btn {
    width: 36px; height: 36px; border-radius: 50%; border: 2px solid #e2e8f0;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition); flex-shrink: 0;
    background: #fff; font-size: 14px;
}
.item-status-btn.ok       { border-color: #38a169; background: #f0fff4; color: #38a169; }
.item-status-btn.atencion { border-color: #d97706; background: #fffaf0; color: #d97706; }
.item-status-btn.falla    { border-color: #e53e3e; background: #fff5f5; color: #e53e3e; }
.item-status-btn.no_aplica{ border-color: #a0aec0; background: #f7fafc; color: #a0aec0; }

.prog-bar-vc { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.prog-fill-vc { height: 100%; background: linear-gradient(90deg, #4299e1, #667eea); border-radius: 99px; transition: width 0.4s; }

/* ── RANKING ──────────────────────────────────────────── */
.rank-row {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 20px; border-bottom: 1px solid #edf2f7;
}
.rank-row:last-child { border-bottom: none; }
.rank-pos { font-size: 24px; width: 36px; text-align: center; flex-shrink: 0; }
.rank-pct { font-size: 22px; font-weight: 800; min-width: 60px; text-align: right; }
.rank-bar-wrap { flex: 1; }

/* ── PAGE TITLE ───────────────────────────────────────── */
.page-title { font-size: 1.5rem; font-weight: 800; color: #1a202c; margin-bottom: 4px; }
.page-subtitle { color: #718096; font-size: 14px; margin-bottom: 24px; }

/* ── BTNS GRANDES (mobile) ────────────────────────────── */
.action-btn-lg {
    display: flex; align-items: center; gap: 16px;
    padding: 18px 20px; background: #fff; border-radius: 12px;
    border: 1px solid #e2e8f0; text-decoration: none; color: #1a202c;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06); transition: var(--transition);
    margin-bottom: 10px; cursor: pointer; width: 100%;
}
.action-btn-lg:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.10); transform: translateY(-1px); color: #1a202c; }
.action-btn-lg .abl-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.action-btn-lg .abl-title { font-weight: 700; font-size: 16px; }
.action-btn-lg .abl-sub   { font-size: 13px; color: #718096; }

/* ── MODAL ────────────────────────────────────────────── */
.modal-header-vc { background: linear-gradient(135deg, #1b2838, #2d3748); color: #fff; }

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0; padding: 16px; }
    .topbar { padding: 0 14px; }
    .stat-value { font-size: 1.6rem; }
    .page-title { font-size: 1.25rem; }
}
@media (max-width: 480px) {
    .main-content { padding: 12px; }
    .checklist-item { padding: 10px 12px; font-size: 13px; }
    .vc-table th, .vc-table td { padding: 10px 12px; font-size: 13px; }
}

/* ── SIDEBAR COLLAPSED (desktop) ─────────────────────── */
.sidebar-collapsed .sidebar {
    width: 64px;
}
.sidebar-collapsed .main-content { margin-left: 64px; }
.sidebar-collapsed .sidebar-label { display: none; }
.sidebar-collapsed .sidebar-brand-text { display: none; }
.sidebar-collapsed .sidebar-tagline { display: none; }
.sidebar-collapsed .sidebar-cuenta { display: none; }
.sidebar-collapsed .sidebar-divider { display: none; }
.sidebar-collapsed .sidebar-item { padding: 12px; justify-content: center; }
.sidebar-collapsed .sidebar-icon { width: auto; }
.sidebar-collapsed .sidebar-header { justify-content: center; padding: 18px 14px; }

/* ── MISC ─────────────────────────────────────────────── */
.foto-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid #e2e8f0; cursor: pointer; }
.config-switch-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #edf2f7; font-size: 14px; }
.config-switch-row:last-child { border-bottom: none; }

/* scrollbar global */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0f4f8; }
::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0aec0; }
