/* ══════════════════════════════════════════════════════════
   CellShop ERP — Dark Design System
   ══════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --primary:        #818cf8;
    --primary-dark:   #6366f1;
    --primary-light:  rgba(99,102,241,.12);
    --primary-glow:   rgba(129,140,248,.25);

    --sidebar-bg:     #0a0d18;
    --sidebar-hover:  rgba(255,255,255,.06);
    --sidebar-active: rgba(129,140,248,.18);
    --sidebar-border: rgba(255,255,255,.05);

    --surface:        #13172a;
    --surface-2:      #0d1020;
    --surface-3:      #1c2038;

    --border:         rgba(255,255,255,.07);
    --border-strong:  rgba(255,255,255,.14);

    --text:           #e2e8f0;
    --text-2:         #b0bbc8;
    --text-muted:     #64748b;
    --text-faint:     #3d4760;

    --radius:         14px;
    --radius-sm:      9px;
    --radius-xs:      6px;

    --shadow-sm:   0 1px 4px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.2);
    --shadow-md:   0 4px 18px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.25);
    --shadow-lg:   0 10px 36px rgba(0,0,0,.55), 0 4px 12px rgba(0,0,0,.3);
    --shadow-xl:   0 20px 56px rgba(0,0,0,.65), 0 8px 20px rgba(0,0,0,.35);

    --transition:  .17s cubic-bezier(.4,0,.2,1);
}

/* ── Reset / Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--surface-2);
    font-size: 0.9rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════ */
.sidebar {
    background: var(--sidebar-bg);
    min-height: 100vh;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--sidebar-border);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.08) transparent;
}

/* Brand */
.sidebar-brand-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem; color: #fff; flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(99,102,241,.45);
}

/* Nav links */
.sidebar .nav-link {
    border-radius: var(--radius-xs);
    padding: 8px 12px;
    transition: background var(--transition), color var(--transition);
    font-size: 0.855rem;
    font-weight: 500;
    color: rgba(255,255,255,.48);
    display: flex; align-items: center; gap: 9px;
    position: relative;
}

.sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: rgba(255,255,255,.85);
}

.sidebar .nav-link.active {
    background: var(--sidebar-active);
    color: #c7d2fe !important;
    font-weight: 600;
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 6px; bottom: 6px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: var(--primary);
}

.sidebar .nav-link i {
    width: 15px; text-align: center;
    font-size: 0.82rem; opacity: .7;
    flex-shrink: 0;
}

.sidebar .nav-link.active i { opacity: 1; }

.sidebar .nav-label {
    font-size: 0.63rem; font-weight: 800;
    letter-spacing: 0.12em; color: rgba(255,255,255,.18);
    text-transform: uppercase;
    padding: 8px 12px 3px;
    display: block;
}

.sidebar hr {
    border-color: var(--sidebar-border);
    opacity: 1;
    margin: 8px 0;
}

/* User area */
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-xs);
    transition: background var(--transition);
    text-decoration: none;
    color: rgba(255,255,255,.65);
}

.sidebar-user:hover { background: var(--sidebar-hover); color: rgba(255,255,255,.9); }

.sidebar-user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 800; flex-shrink: 0;
    border: 1.5px solid rgba(255,255,255,.12);
}

.sidebar-user-name { font-size: 0.82rem; font-weight: 600; line-height: 1.1; color: #c4cdd6; }
.sidebar-user-role { font-size: 0.65rem; color: rgba(255,255,255,.28); }

/* ══════════════════════════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════════════════════════ */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    min-height: 54px;
    box-shadow: 0 1px 0 var(--border), 0 2px 12px rgba(0,0,0,.25);
}

.topbar-btn {
    width: 34px; height: 34px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-size: 0.82rem;
    position: relative;
}

.topbar-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: rgba(129,140,248,.3);
}

.topbar-badge {
    position: absolute; top: -5px; right: -5px;
    min-width: 16px; height: 16px; border-radius: 8px;
    background: #ef4444; color: #fff;
    font-size: 0.57rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px; border: 1.5px solid var(--surface);
}

.topbar-divider { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }

.user-avatar-sm {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 0.68rem; font-weight: 800; flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   PAGE HEADER
   ══════════════════════════════════════════════════════════ */
.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}

.page-header h4 {
    font-weight: 700; color: var(--text); margin: 0;
    font-size: 1.15rem; letter-spacing: -0.02em;
}

/* ══════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════ */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--surface);
    transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: 0.875rem;
    padding: 13px 18px;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    color: var(--text);
    display: flex; align-items: center; justify-content: space-between;
}

.card-body { padding: 18px; }

/* ── Stat cards ────────────────────────────────────────────── */
.stat-card {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    transition: transform var(--transition), box-shadow var(--transition);
    background: var(--surface);
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg) !important;
}

.stat-accent { border-top-width: 3px !important; border-top-style: solid !important; }
.stat-accent.a-blue   { border-top-color: #818cf8 !important; }
.stat-accent.a-green  { border-top-color: #34d399 !important; }
.stat-accent.a-orange { border-top-color: #fbbf24 !important; }
.stat-accent.a-red    { border-top-color: #f87171 !important; }

/* Stat icons — vibrant on dark */
.stat-icon {
    width: 50px; height: 50px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; flex-shrink: 0;
}

.stat-icon.blue   { background: rgba(99,102,241,.2);  color: #818cf8; }
.stat-icon.green  { background: rgba(16,185,129,.18); color: #34d399; }
.stat-icon.orange { background: rgba(245,158,11,.18); color: #fbbf24; }
.stat-icon.red    { background: rgba(239,68,68,.18);  color: #f87171; }
.stat-icon.purple { background: rgba(139,92,246,.18); color: #c084fc; }

/* ══════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════ */
.table {
    font-size: 0.865rem;
    --bs-table-striped-bg: rgba(255,255,255,.02);
    margin: 0;
    color: var(--text);
}

.table-hover tbody tr {
    transition: background var(--transition);
    cursor: default;
}

.table-hover tbody tr:hover { background: var(--surface-3) !important; }

.table th {
    font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--text-muted); border-top: none;
    padding: 10px 14px; background: rgba(255,255,255,.025);
    white-space: nowrap; border-bottom: 1px solid var(--border) !important;
}

.table td { padding: 10px 14px; vertical-align: middle; border-color: var(--border); }
.table td:first-child { border-left: none; }
.table td:last-child  { border-right: none; }

.table-light { --bs-table-bg: rgba(255,255,255,.03); }

/* ══════════════════════════════════════════════════════════
   BADGE — ESTADOS
   ══════════════════════════════════════════════════════════ */
.badge-estado {
    display: inline-flex; align-items: center;
    font-size: 0.7rem; font-weight: 700;
    padding: 3px 10px; border-radius: 20px;
    letter-spacing: 0.03em; white-space: nowrap;
}

.estado-pendiente     { background: rgba(251,191,36,.12); color: #fbbf24; border: 1px solid rgba(251,191,36,.25); }
.estado-cobrada,
.estado-recibida,
.estado-entregado     { background: rgba(52,211,153,.12); color: #34d399; border: 1px solid rgba(52,211,153,.25); }
.estado-anulada,
.estado-no_reparable  { background: rgba(248,113,113,.12); color: #f87171; border: 1px solid rgba(248,113,113,.25); }
.estado-en_reparacion { background: rgba(96,165,250,.12); color: #60a5fa; border: 1px solid rgba(96,165,250,.25); }
.estado-reparado      { background: rgba(52,211,153,.12); color: #34d399; border: 1px solid rgba(52,211,153,.25); }
.estado-diagnosticado { background: rgba(192,132,252,.12); color: #c084fc; border: 1px solid rgba(192,132,252,.25); }
.estado-recibido      { background: rgba(148,163,184,.1); color: #94a3b8; border: 1px solid rgba(148,163,184,.2); }

/* ══════════════════════════════════════════════════════════
   PRIORIDAD
   ══════════════════════════════════════════════════════════ */
.prio-urgente { border-left: 3px solid #f87171 !important; }
.prio-alta    { border-left: 3px solid #fbbf24 !important; }
.prio-normal  { border-left: 3px solid var(--primary) !important; }
.prio-baja    { border-left: 3px solid #475569 !important; }

/* ══════════════════════════════════════════════════════════
   FORM CONTROLS
   ══════════════════════════════════════════════════════════ */
.form-control,
.form-select {
    border-color: var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--surface-2);
    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(129,140,248,.18);
    background: var(--surface-2);
    color: var(--text);
}

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

.form-control:disabled,
.form-control[readonly] {
    background: rgba(255,255,255,.04);
    color: var(--text-muted);
    border-color: var(--border);
}

.form-select option {
    background: #1c2038;
    color: var(--text);
}

.form-label {
    font-size: 0.82rem; font-weight: 600;
    color: var(--text-2); margin-bottom: 5px;
}

.form-text { font-size: 0.78rem; color: var(--text-muted); }

.form-check-input {
    background-color: var(--surface-3);
    border-color: var(--border-strong);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.input-group-text {
    background: var(--surface-3); border-color: var(--border);
    color: var(--text-muted); font-size: 0.875rem;
}

/* ══════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════ */
.btn {
    border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500;
    padding: 7px 15px;
    transition: all var(--transition);
    letter-spacing: 0.01em;
}

.btn:active { transform: scale(0.97); }
.btn-sm { font-size: 0.8rem; padding: 5px 11px; }

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,.35);
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    box-shadow: 0 4px 18px rgba(99,102,241,.5);
    transform: translateY(-1px);
    border-color: transparent; color: #fff;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: rgba(129,140,248,.35);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-light);
    color: #a5b4fc;
    border-color: rgba(129,140,248,.6);
}

.btn-outline-secondary {
    color: var(--text-muted); border-color: var(--border);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--surface-3); color: var(--text); border-color: var(--border-strong);
}

.btn-outline-warning { color: #fbbf24; border-color: rgba(251,191,36,.35); background: transparent; }
.btn-outline-warning:hover { background: rgba(251,191,36,.1); color: #fde68a; border-color: rgba(251,191,36,.6); }

.btn-outline-danger { color: #f87171; border-color: rgba(248,113,113,.35); background: transparent; }
.btn-outline-danger:hover { background: rgba(248,113,113,.1); color: #fca5a5; border-color: rgba(248,113,113,.6); }

.btn-outline-success { color: #34d399; border-color: rgba(52,211,153,.35); background: transparent; }
.btn-outline-success:hover { background: rgba(52,211,153,.1); color: #6ee7b7; border-color: rgba(52,211,153,.6); }

.btn-secondary {
    background: var(--surface-3); border-color: var(--border);
    color: var(--text-2);
}
.btn-secondary:hover { background: rgba(255,255,255,.08); color: var(--text); border-color: var(--border-strong); }

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: transparent; color: #fff;
    box-shadow: 0 2px 8px rgba(16,185,129,.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    border-color: transparent; color: #fff;
    box-shadow: 0 4px 16px rgba(16,185,129,.45);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: transparent; color: #fff;
    box-shadow: 0 2px 8px rgba(239,68,68,.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    border-color: transparent; color: #fff;
    box-shadow: 0 4px 16px rgba(239,68,68,.45);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: transparent; color: #fff;
    box-shadow: 0 2px 8px rgba(245,158,11,.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-color: transparent; color: #fff;
    box-shadow: 0 4px 16px rgba(245,158,11,.45);
    transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════
   KANBAN
   ══════════════════════════════════════════════════════════ */
.kanban-col {
    min-height: 300px;
    background: rgba(255,255,255,.025);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.kanban-card {
    border-radius: var(--radius-sm);
    transition: box-shadow var(--transition), transform var(--transition);
    border: 1px solid var(--border) !important;
    background: var(--surface);
}

.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ══════════════════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════════════════ */
.alert {
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    border-width: 1px; border-style: solid;
    display: flex; align-items: flex-start; gap: 10px;
}

.alert-success { background: rgba(52,211,153,.1); color: #6ee7b7; border-color: rgba(52,211,153,.25); }
.alert-danger  { background: rgba(248,113,113,.1); color: #fca5a5; border-color: rgba(248,113,113,.25); }
.alert-warning { background: rgba(251,191,36,.1);  color: #fde68a; border-color: rgba(251,191,36,.25); }
.alert-info    { background: rgba(96,165,250,.1);  color: #93c5fd; border-color: rgba(96,165,250,.25); }

/* ══════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════ */
.badge {
    border-radius: var(--radius-xs);
    font-weight: 700; font-size: 0.7rem;
    letter-spacing: 0.03em;
    padding: 3px 8px;
}

.bg-primary   { background: #6366f1 !important; }
.bg-success   { background: #059669 !important; }
.bg-danger    { background: #dc2626 !important; }
.bg-warning   { background: #d97706 !important; color: #fff !important; }
.bg-info      { background: #0891b2 !important; }
.bg-secondary { background: #334155 !important; }
.bg-light     { background: rgba(255,255,255,.07) !important; color: var(--text-2) !important; }

/* ══════════════════════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

/* ══════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════ */
.notif-toast {
    position: fixed; bottom: 24px; right: 24px;
    z-index: 9999; min-width: 280px; max-width: 380px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    animation: slideUp .22s cubic-bezier(.34,1.56,.64,1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ══════════════════════════════════════════════════════════
   SPINNER
   ══════════════════════════════════════════════════════════ */
.spinner-overlay {
    display: flex; align-items: center; justify-content: center;
    padding: 56px;
}

/* ══════════════════════════════════════════════════════════
   STOCK / PRIORITY
   ══════════════════════════════════════════════════════════ */
.stock-bajo td { background: rgba(245,158,11,.06) !important; }

/* ══════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════ */
.modal-content {
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    background: var(--surface);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 16px 20px; background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
}

.modal-body { padding: 20px; background: var(--surface); }

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 14px 20px; background: var(--surface);
    border-radius: 0 0 var(--radius) var(--radius);
}

.btn-close {
    filter: invert(1) grayscale(1) brightness(0.7);
}

/* ══════════════════════════════════════════════════════════
   QUICK ACTIONS — Solid buttons
   ══════════════════════════════════════════════════════════ */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.qa-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.875rem;
    color: #fff !important;
    cursor: pointer;
    transition: all .18s cubic-bezier(.4,0,.2,1);
    position: relative;
    overflow: hidden;
    letter-spacing: .01em;
    flex: 1 1 160px;
    border: 2px solid rgba(255,255,255,.18) !important;
}

.qa-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background .18s ease;
    pointer-events: none;
}
.qa-btn:hover::after  { background: rgba(255,255,255,.1); }
.qa-btn:active::after { background: rgba(0,0,0,.1); }

.qa-btn:hover { transform: translateY(-3px); color: #fff !important; }
.qa-btn:active { transform: translateY(-1px); }

.qa-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    background: rgba(255,255,255,.18);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background .18s ease;
}
.qa-btn:hover .qa-icon { background: rgba(255,255,255,.28); }

.qa-arrow {
    margin-left: auto;
    font-size: .68rem;
    opacity: .65;
    flex-shrink: 0;
    transition: transform .18s ease;
}
.qa-btn:hover .qa-arrow { transform: translateX(3px); opacity: 1; }

.qa-blue   { background: linear-gradient(135deg,#6366f1,#4f46e5); border-color: #4338ca !important; box-shadow: 0 4px 14px rgba(99,102,241,.4); }
.qa-blue:hover   { box-shadow: 0 8px 24px rgba(99,102,241,.55); }
.qa-orange { background: linear-gradient(135deg,#f59e0b,#d97706); border-color: #b45309 !important; box-shadow: 0 4px 14px rgba(245,158,11,.4); }
.qa-orange:hover { box-shadow: 0 8px 24px rgba(245,158,11,.55); }
.qa-green  { background: linear-gradient(135deg,#10b981,#059669); border-color: #047857 !important; box-shadow: 0 4px 14px rgba(16,185,129,.4); }
.qa-green:hover  { box-shadow: 0 8px 24px rgba(16,185,129,.55); }
.qa-purple { background: linear-gradient(135deg,#8b5cf6,#7c3aed); border-color: #6d28d9 !important; box-shadow: 0 4px 14px rgba(139,92,246,.4); }
.qa-purple:hover { box-shadow: 0 8px 24px rgba(139,92,246,.55); }
.qa-teal   { background: linear-gradient(135deg,#06b6d4,#0891b2); border-color: #0e7490 !important; box-shadow: 0 4px 14px rgba(6,182,212,.4); }
.qa-teal:hover   { box-shadow: 0 8px 24px rgba(6,182,212,.55); }
.qa-wa     { background: linear-gradient(135deg,#25d366,#128c7e); border-color: #075e54 !important; box-shadow: 0 4px 14px rgba(37,211,102,.4); }
.qa-wa:hover     { box-shadow: 0 8px 24px rgba(37,211,102,.55); }

/* ══════════════════════════════════════════════════════════
   KPI CARDS — Dashboard metric cards
   ══════════════════════════════════════════════════════════ */
.kpi-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    padding: 22px 20px 18px;
    color: #fff;
    transition: transform .18s cubic-bezier(.4,0,.2,1), box-shadow .18s cubic-bezier(.4,0,.2,1);
    min-height: 118px;
    display: flex; flex-direction: column; justify-content: flex-end;
}

.kpi-card:hover { transform: translateY(-4px); }

.kc-bg-icon {
    position: absolute;
    top: 50%; right: -8px;
    transform: translateY(-50%);
    font-size: 5.5rem;
    opacity: .12;
    pointer-events: none;
    line-height: 1;
    color: #fff;
}

.kc-label {
    font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .09em;
    opacity: .82; margin-bottom: 4px;
}

.kc-value {
    font-size: 1.7rem; font-weight: 800;
    line-height: 1.1; letter-spacing: -.03em;
    margin-bottom: 4px;
}

.kc-sub { font-size: .72rem; opacity: .78; }

.kc-skeleton { animation: kc-pulse 1.4s ease-in-out infinite; }

@keyframes kc-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .65; }
}

.kc-blue  { background: linear-gradient(135deg,#6366f1,#4f46e5); box-shadow: 0 6px 24px rgba(99,102,241,.45); }
.kc-blue:hover  { box-shadow: 0 10px 32px rgba(99,102,241,.6); }
.kc-green { background: linear-gradient(135deg,#10b981,#059669); box-shadow: 0 6px 24px rgba(16,185,129,.45); }
.kc-green:hover { box-shadow: 0 10px 32px rgba(16,185,129,.6); }
.kc-orange{ background: linear-gradient(135deg,#f59e0b,#d97706); box-shadow: 0 6px 24px rgba(245,158,11,.45); }
.kc-orange:hover{ box-shadow: 0 10px 32px rgba(245,158,11,.6); }
.kc-red   { background: linear-gradient(135deg,#ef4444,#dc2626); box-shadow: 0 6px 24px rgba(239,68,68,.45); }
.kc-red:hover   { box-shadow: 0 10px 32px rgba(239,68,68,.6); }
.kc-teal  { background: linear-gradient(135deg,#06b6d4,#0891b2); box-shadow: 0 6px 24px rgba(6,182,212,.45); }
.kc-teal:hover  { box-shadow: 0 10px 32px rgba(6,182,212,.6); }

/* ══════════════════════════════════════════════════════════
   DASHBOARD HERO — Centred greeting banner
   ══════════════════════════════════════════════════════════ */
.dash-hero {
    position: relative;
    text-align: center;
    padding: 28px 24px 22px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #1a1d3a 0%, #141829 50%, #1a1535 100%);
    border: 1px solid rgba(129,140,248,.15);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.dash-hero::before,
.dash-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.dash-hero::before {
    width: 160px; height: 160px;
    top: -60px; left: -50px;
    background: radial-gradient(circle, rgba(99,102,241,.2) 0%, transparent 70%);
}
.dash-hero::after {
    width: 120px; height: 120px;
    bottom: -40px; right: -30px;
    background: radial-gradient(circle, rgba(139,92,246,.18) 0%, transparent 70%);
}

.dash-hero-text { position: relative; z-index: 1; }
.dash-hero-text h4 { font-size: 1.35rem; color: var(--text); margin: 0; }

.dash-hero-refresh {
    position: absolute;
    top: 14px; right: 16px;
    z-index: 1;
}

/* ══════════════════════════════════════════════════════════
   SECTION LABEL
   ══════════════════════════════════════════════════════════ */
.section-label {
    font-size: 0.7rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-faint);
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px;
}

.section-label::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ══════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════ */
.empty-state {
    text-align: center; padding: 28px 16px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 1.8rem; opacity: .25;
    margin-bottom: 8px; display: block;
}

.empty-state p { margin: 0; font-size: 0.855rem; }

/* ══════════════════════════════════════════════════════════
   URGENTES HIGHLIGHT
   ══════════════════════════════════════════════════════════ */
.urgente-highlight { background: rgba(239,68,68,.06) !important; }
.alta-highlight    { background: rgba(245,158,11,.06) !important; }

/* ══════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════ */
.text-primary   { color: var(--primary) !important; }
.bg-primary     { background: #6366f1 !important; }
.border-primary { border-color: var(--primary) !important; }

.text-muted { color: var(--text-muted) !important; }
.text-dark  { color: var(--text-2) !important; }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.ch-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

.font-monospace {
    font-family: 'Cascadia Code', 'Courier New', monospace;
    font-size: 0.82rem;
}

hr { border-color: var(--border); opacity: 1; }

/* ══════════════════════════════════════════════════════════
   PAGINATION — dark
   ══════════════════════════════════════════════════════════ */
.page-link {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-2);
    transition: all var(--transition);
}
.page-link:hover {
    background: var(--surface-3);
    border-color: var(--border-strong);
    color: var(--text);
}
.page-item.active .page-link {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    box-shadow: 0 2px 8px var(--primary-glow);
}
.page-item.disabled .page-link {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-faint);
    pointer-events: none;
}

/* Table tfoot dark */
.table tfoot td {
    background: rgba(255,255,255,.025);
    border-top: 1px solid var(--border);
}

/* code element — dark variant */
code {
    color: #a5b4fc;
    background: rgba(129,140,248,.1);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Bootstrap overrides for dark */
.border { border-color: var(--border) !important; }
.border-bottom { border-bottom-color: var(--border) !important; }
.border-top    { border-top-color: var(--border) !important; }
.text-secondary { color: var(--text-muted) !important; }
.dropdown-menu {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}
.dropdown-item { color: var(--text-2); }
.dropdown-item:hover { background: var(--surface-3); color: var(--text); }
.list-group-item {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}
