:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-hover: #22222e;
    --border: #2a2a3a;
    --text-primary: #ffffff;
    --text-muted: #888;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; }
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; }
.login-box { background: var(--bg-card); border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; text-align: center; border: 1px solid var(--border); }
.login-logo { font-size: 48px; margin-bottom: 16px; }
.login-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.login-subtitle { color: var(--text-muted); margin-bottom: 32px; }
.pin-container { display: flex; justify-content: center; gap: 12px; margin-bottom: 24px; }
.pin-digit { width: 48px; height: 56px; text-align: center; font-size: 24px; font-weight: 700; background: var(--bg-secondary); border: 2px solid var(--border); border-radius: var(--radius); color: var(--text-primary); outline: none; transition: all 0.2s; }
.pin-digit:focus { border-color: var(--accent); background: var(--bg-hover); }
.login-error { color: var(--danger); margin-top: 16px; display: none; }
.btn { padding: 10px 20px; border-radius: var(--radius); font-weight: 600; cursor: pointer; transition: all 0.2s; border: none; font-size: 14px; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: black; }
.btn-danger { background: var(--danger); color: white; }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.header { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.header-left { display: flex; align-items: center; gap: 12px; }
.header-logo { font-size: 28px; }
.header-title { font-size: 20px; font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 16px; }
.user-info { display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 36px; height: 36px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.nav-main { display: flex; background: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: 0 16px; overflow-x: auto; }
.nav-main-item { padding: 16px 24px; background: none; border: none; color: var(--text-muted); font-weight: 600; cursor: pointer; border-bottom: 3px solid transparent; transition: all 0.2s; white-space: nowrap; }
.nav-main-item:hover { color: var(--text-primary); }
.nav-main-item.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-tabs { display: flex; gap: 8px; padding: 16px 24px; background: var(--bg-primary); flex-wrap: wrap; align-items: center; }
.nav-tab { padding: 10px 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-muted); font-weight: 500; cursor: pointer; transition: all 0.2s; }
.nav-tab:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-tab.active { background: var(--accent); border-color: var(--accent); color: white; }
.nav-tab.action { background: var(--success); border-color: var(--success); color: white; }
.nav-tab.action:hover { background: #0ea572; }
.nav-tab.action-secondary { background: var(--warning); border-color: var(--warning); color: black; }
.nav-separator { width: 1px; height: 30px; background: var(--border); margin: 0 8px; }
.content { padding: 24px; }
.module-panel { display: none; }
.module-panel.active { display: block; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-label { color: var(--text-muted); font-size: 14px; margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 700; }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }
.stat-value.danger { color: var(--danger); }
.table-container { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.table-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.table-title { font-size: 18px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg-secondary); color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
tr:hover { background: var(--bg-hover); }
.badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-info { background: rgba(59,130,246,0.15); color: var(--accent); }
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); display: none; justify-content: center; align-items: center; z-index: 1000; padding: 20px; overflow-y: auto; }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-card); border-radius: 12px; width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto; margin: auto; }
.modal-lg { max-width: 900px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-card); z-index: 10; }
.modal-title { font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; gap: 12px; justify-content: flex-end; padding: 20px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--bg-card); }
.form-group { margin-bottom: 16px; }
.form-label { display: block; color: var(--text-muted); font-size: 14px; margin-bottom: 6px; font-weight: 500; }
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-control { width: 100%; padding: 12px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); font-size: 14px; }
.form-control:focus { outline: none; border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.search-box { display: flex; gap: 12px; margin-bottom: 16px; }
.search-input { flex: 1; padding: 12px 16px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-text { font-size: 16px; }
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; }
.toast { background: var(--bg-card); border: 1px solid var(--border); padding: 16px 20px; border-radius: var(--radius); margin-bottom: 8px; display: flex; align-items: center; gap: 12px; animation: slideIn 0.3s; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--accent); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.filters-bar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.item-list { display: flex; flex-direction: column; gap: 8px; }
.item-row { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg-secondary); border-radius: var(--radius); cursor: pointer; }
.item-row:hover { background: var(--bg-hover); }
.item-info { flex: 1; }
.item-title { font-weight: 600; }
.item-subtitle { color: var(--text-muted); font-size: 13px; }
.map-container { height: 350px; background: var(--bg-secondary); border-radius: var(--radius); overflow: hidden; }
#rutaMapa { height: 100%; width: 100%; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Estilos para modal de detalle */
.detail-grid {
    display: grid;
    gap: 0.75rem;
}
.detail-row {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.detail-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 150px;
}
.detail-value {
    color: var(--text);
}
.text-center {
    text-align: center;
}
