/* ============================================================
   Sistema de Encomiendas — Tema claro "Dashboard"
   Sidebar oscuro + área clara con tarjetas blancas suaves.
   Soporta modo oscuro con  <body class="dark">
   ============================================================ */
:root {
    /* Superficies */
    --bg:           #eceef7;
    --bg-soft:      #f5f6fc;
    --panel:        #ffffff;
    --panel-2:      #f7f8fd;
    --panel-soft:   #f1f2fa;

    /* Texto */
    --text:         #2b3043;
    --text-dim:     #878da4;
    --text-faint:   #aab0c4;

    /* Acentos */
    --primary:      #6c5ce7;   /* violeta/índigo */
    --primary-2:    #8b7ff1;
    --violet:       #6c5ce7;
    --orange:       #f6a623;
    --orange-2:     #f7b94d;
    --magenta:      #ff5d8f;
    --magenta-2:    #ff85a8;
    --cyan:         #2ec6db;   /* turquesa */
    --cyan-2:       #4dd2e4;
    --green:        #22c79b;
    --yellow:       #f6b73c;
    --red:          #ff5d6c;

    /* Líneas y sombras */
    --border:       #ebedf5;
    --shadow:       0 10px 30px rgba(45,50,90,.08);
    --shadow-sm:    0 4px 14px rgba(45,50,90,.07);
    --shadow-hover: 0 16px 38px rgba(45,50,90,.14);

    /* Sidebar (siempre oscuro) */
    --sb-bg:        #2b2d3b;
    --sb-bg-2:      #252734;
    --sb-text:      #b8bcce;
    --sb-faint:     #717689;
    --sb-active:    rgba(255,255,255,.08);

    --radius:       20px;
    --radius-sm:    13px;
    --sidebar-w:    248px;
}

/* ---------- Modo oscuro (toggle) ---------- */
body.dark {
    --bg:           #171a27;
    --bg-soft:      #1e2230;
    --panel:        #242838;
    --panel-2:      #2a2f42;
    --panel-soft:   #2c3146;
    --text:         #e8eaf3;
    --text-dim:     #9aa0bb;
    --text-faint:   #6d7391;
    --border:       rgba(255,255,255,.07);
    --shadow:       0 12px 30px rgba(0,0,0,.40);
    --shadow-sm:    0 4px 14px rgba(0,0,0,.35);
    --shadow-hover: 0 16px 38px rgba(0,0,0,.55);
    --sb-bg:        #1f2230;
    --sb-bg-2:      #1a1d29;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfd3e4; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #b9bed4; }
body.dark ::-webkit-scrollbar-thumb { background: #3a3f57; }

/* ============================================================
   LAYOUT
   ============================================================ */
.layout { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(185deg, var(--sb-bg) 0%, var(--sb-bg-2) 100%);
    padding: 22px 16px;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    z-index: 30;
    transition: transform .25s ease;
}

.brand {
    display: flex; align-items: center; gap: 12px;
    padding: 4px 8px 20px;
}
.brand .logo {
    width: 42px; height: 42px; border-radius: 13px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    display: grid; place-items: center;
    color: #fff;
    box-shadow: 0 6px 16px rgba(108,92,231,.4);
}
.brand .logo svg { width: 22px; height: 22px; }
.brand .title { font-weight: 700; font-size: 1.02rem; line-height: 1.1; color: #fff; }
.brand .title span { display: block; font-size: .68rem; color: var(--sb-faint); font-weight: 500; letter-spacing: .4px; }

/* Botón destacado "Crear" */
.sb-create {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    margin: 6px 4px 14px; padding: 13px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: #fff; font-weight: 600; font-size: .9rem;
    box-shadow: 0 10px 22px rgba(246,166,35,.40);
    transition: transform .12s, box-shadow .12s;
}
.sb-create:hover { transform: translateY(-1px); box-shadow: 0 13px 26px rgba(246,166,35,.5); }
.sb-create svg { width: 18px; height: 18px; }

.nav-label {
    font-size: .68rem; text-transform: uppercase; letter-spacing: 1.4px;
    color: var(--sb-faint); padding: 16px 14px 8px; font-weight: 600;
}

.nav-item {
    display: flex; align-items: center; gap: 13px;
    padding: 11px 14px; margin: 2px 0;
    border-radius: var(--radius-sm);
    color: var(--sb-text);
    font-size: .9rem; font-weight: 500;
    transition: all .16s ease;
    position: relative;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: var(--sb-active); color: #fff; }
.nav-item.active {
    color: #fff;
    background: var(--sb-active);
}
.nav-item.active::before {
    content: ''; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
    width: 4px; height: 22px; border-radius: 0 4px 4px 0;
    background: linear-gradient(var(--primary), var(--primary-2));
}
.nav-item.active svg { opacity: 1; color: var(--primary-2); }

/* Sidebar Dropdown */
.sb-dropdown {
    display: flex; flex-direction: column;
}
.sb-dropdown > button.nav-item {
    background: transparent; border: none; width: 100%; text-align: left;
    cursor: pointer; font-family: inherit; margin: 2px 0;
}
.sb-dropdown > button.nav-item:hover {
    background: var(--sb-active);
}
.sb-dropdown-arrow {
    margin-left: auto; width: 15px !important; height: 15px !important; transition: transform 0.2s ease;
}
.sb-dropdown.open .sb-dropdown-arrow {
    transform: rotate(180deg);
}
.sb-submenu {
    display: flex; flex-direction: column; overflow: hidden;
    max-height: 0; transition: max-height 0.3s ease;
    padding-left: 28px;
}
.sb-dropdown.open .sb-submenu {
    max-height: 300px;
}
.sb-submenu .nav-item {
    padding: 9px 14px; font-size: 0.85rem; color: var(--sb-faint); margin: 0;
}
.sb-submenu .nav-item svg { width: 16px; height: 16px; }
.sb-submenu .nav-item:hover { color: #fff; background: transparent; }
.sb-submenu .nav-item.active { color: #fff; background: transparent; }
.sb-submenu .nav-item.active::before { display: none; }
.sb-submenu .nav-item.active svg { color: var(--primary-2); }

/* Toggle de modo claro/oscuro en el sidebar */
.sb-toggle {
    display: flex; align-items: center; gap: 10px;
    margin: 8px 6px 4px; padding: 11px 14px;
    color: var(--sb-text); font-size: .9rem; font-weight: 500;
}
.sb-toggle svg { width: 18px; height: 18px; opacity: .85; }
.switch { margin-left: auto; position: relative; width: 42px; height: 23px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; inset: 0; border-radius: 30px;
    background: #494d63; transition: .2s;
}
.switch .slider::before {
    content: ''; position: absolute; height: 17px; width: 17px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: linear-gradient(135deg, var(--orange), var(--orange-2)); }
.switch input:checked + .slider::before { transform: translateX(19px); }

/* ---------- Main ---------- */
.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex; flex-direction: column;
    min-width: 0;
}

/* ---------- Topbar ---------- */
.topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 28px;
    position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(12px);
    overflow: visible;
}
.topbar .page-title { font-size: 1.25rem; font-weight: 700; }
.topbar .spacer { flex: 1; }

.searchbox {
    display: flex; align-items: center; gap: 9px;
    background: var(--panel);
    border-radius: 30px; padding: 10px 18px;
    box-shadow: var(--shadow-sm);
    min-width: 230px;
}
.searchbox svg { width: 17px; height: 17px; color: var(--text-faint); }
.searchbox input {
    background: transparent; border: none; outline: none;
    color: var(--text); font-size: .9rem; width: 100%;
}
.searchbox input::placeholder { color: var(--text-faint); }

.icon-btn {
    width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer;
    background: var(--panel); color: var(--text-dim);
    box-shadow: var(--shadow-sm);
    position: relative; transition: color .15s, transform .12s;
}
.icon-btn:hover { color: var(--primary); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot {
    position: absolute; top: 9px; right: 11px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--magenta); border: 2px solid var(--panel);
}
.icon-btn .notif-count {
    position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
    padding: 0 5px; border-radius: 10px; background: var(--magenta); color: #fff;
    font-size: .66rem; font-weight: 700; display: grid; place-items: center;
    border: 2px solid var(--panel);
}

.user-chip {
    display: flex; align-items: center; gap: 11px;
    padding: 5px 6px 5px 16px; border-radius: 30px;
    background: var(--panel);
    box-shadow: var(--shadow-sm);
}
.user-chip .meta { text-align: right; line-height: 1.15; }
.user-chip .meta b { font-size: .85rem; font-weight: 600; }
.user-chip .meta small { font-size: .7rem; color: var(--text-dim); }
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .85rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

/* ---------- User dropdown ---------- */
.user-chip-wrapper {
    position: relative;
}
.user-chip { cursor: pointer; transition: box-shadow .2s; }
.user-chip:hover { box-shadow: var(--shadow-hover); }

.user-dropdown {
    position: fixed;
    top: 72px;
    right: 24px;
    width: 260px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility .2s;
    z-index: 9999;
}
.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ud-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px 10px;
}
.ud-header b { display: block; font-size: .88rem; font-weight: 600; color: var(--text); }
.ud-header small { font-size: .72rem; color: var(--text-dim); }

.ud-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 12px;
}

.ud-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px;
    font-size: .84rem;
    color: var(--text);
    cursor: pointer;
    transition: background .15s, color .15s;
    border: none; background: none; width: 100%;
    text-align: left; font-family: inherit;
}
.ud-item:hover {
    background: var(--panel-soft);
    color: var(--primary);
}
.ud-item i { color: var(--text-dim); flex-shrink: 0; }
.ud-item:hover i { color: var(--primary); }

.ud-arrow {
    transition: transform .2s;
}

.ud-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
    display: flex;
    flex-direction: column;
}
.ud-submenu.open {
    max-height: 400px;
}
.ud-sub-item {
    padding-left: 44px;
    font-size: .8rem;
}
.ud-sub-item:hover {
    background: var(--panel-soft);
}

.ud-logout:hover {
    color: var(--red);
}
.ud-logout:hover i { color: var(--red); }

.content { padding: 12px 28px 40px; }


/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    border: 1px solid var(--border);
}
.card.flat { box-shadow: var(--shadow-sm); }

.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.card-head h3 { font-size: 1rem; font-weight: 700; }
.card-head .sub { font-size: .78rem; color: var(--text-dim); }

/* Grids */
.grid { display: grid; gap: 20px; }
.kpi-grid { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: 2fr 1fr; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.charts-3 { grid-template-columns: 1fr 1fr 1fr; }
.mt { margin-top: 20px; }

.chart-box { position: relative; width: 100%; }
.chart-box canvas { width: 100% !important; }

/* ---------- KPI cards ---------- */
.kpi { display: flex; align-items: center; gap: 16px; }
.kpi .ic {
    width: 52px; height: 52px; border-radius: 15px;
    display: grid; place-items: center; flex-shrink: 0;
}
.kpi .ic svg { width: 24px; height: 24px; color: #fff; }
.kpi .ic.magenta { background: linear-gradient(135deg, var(--magenta), var(--magenta-2)); box-shadow: 0 8px 18px rgba(255,93,143,.32); }
.kpi .ic.cyan    { background: linear-gradient(135deg, var(--cyan), var(--cyan-2)); box-shadow: 0 8px 18px rgba(46,198,219,.30); }
.kpi .ic.violet  { background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 8px 18px rgba(108,92,231,.30); }
.kpi .ic.green   { background: linear-gradient(135deg, var(--green), #4fd9b6); box-shadow: 0 8px 18px rgba(34,199,155,.28); }
.kpi .ic.orange  { background: linear-gradient(135deg, var(--orange), var(--orange-2)); box-shadow: 0 8px 18px rgba(246,166,35,.30); }
.kpi .ic.red     { background: linear-gradient(135deg, var(--red), #ff8a94); box-shadow: 0 8px 18px rgba(255,93,108,.30); }
.kpi .val { font-size: 1.65rem; font-weight: 700; line-height: 1; }
.kpi .lbl { font-size: .8rem; color: var(--text-dim); margin-top: 6px; }
.kpi .trend { font-size: .72rem; margin-top: 4px; }
.trend.up { color: var(--green); }
.trend.down { color: var(--red); }

/* ---------- Badges ---------- */
.badge {
    display: inline-block; padding: 4px 11px; border-radius: 20px;
    font-size: .72rem; font-weight: 600; letter-spacing: .2px;
}
.badge.info { background: rgba(46,198,219,.15); color: #1aa7bd; }
.badge.primary { background: rgba(108,92,231,.15); color: var(--primary); }
.badge.secondary { background: rgba(135,141,164,.16); color: var(--text-dim); }
.badge.warning { background: rgba(246,183,60,.18); color: #d9930f; }
.badge.success { background: rgba(34,199,155,.16); color: #14a07a; }
.badge.danger { background: rgba(255,93,108,.15); color: #e23b4b; }
body.dark .badge.info { color: #4dd2e4; }
body.dark .badge.warning { color: var(--yellow); }
body.dark .badge.success { color: #34d399; }
body.dark .badge.danger { color: #ff8a95; }

/* ---------- Timeline (historial de seguimiento) ---------- */
.timeline-dot {
    position: relative;
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.timeline-dot i { width: 15px; height: 15px; color: #fff; stroke-width: 2.4; }
.timeline-dot.info { background: #1aa7bd; }
.timeline-dot.primary { background: var(--primary); }
.timeline-dot.secondary { background: #878da4; }
.timeline-dot.warning { background: #d9930f; }
.timeline-dot.success { background: #14a07a; }
.timeline-dot.danger { background: #e23b4b; }
.timeline-dot .paso-num {
    position: absolute; top: -4px; left: -4px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--ink, #2b2f42); color: #fff;
    font-size: .62rem; font-weight: 700; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--panel);
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.data thead th {
    text-align: center; padding: 12px 14px;
    color: var(--text-faint); font-weight: 600; font-size: .73rem;
    text-transform: uppercase; letter-spacing: .6px;
    border-bottom: 1px solid var(--border);
}
table.data tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); text-align: center; }
table.data.compact tbody td { padding: 5px 14px; }
table.data tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.02); }
body.dark table.data tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
table.data tbody tr:hover { background: var(--panel-soft) !important; }
table.data tbody tr:last-child td { border-bottom: none; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .82rem; color: var(--primary); font-weight: 500; }

/* ---------- Buttons / forms ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 12px; border: none; cursor: pointer;
    font-size: .88rem; font-weight: 600; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 8px 18px rgba(108,92,231,.28);
    transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 11px 22px rgba(108,92,231,.4); }
.btn svg { width: 17px; height: 17px; }
.btn.ghost {
    background: var(--panel); color: var(--text-dim);
    box-shadow: none; border: 1px solid var(--border);
}
.btn.ghost:hover { color: var(--primary); border-color: var(--primary); box-shadow: none; }
.btn.cyan { background: linear-gradient(135deg, var(--cyan), var(--cyan-2)); box-shadow: 0 8px 18px rgba(46,198,219,.3); }
.btn.orange { background: linear-gradient(135deg, var(--orange), var(--orange-2)); box-shadow: 0 8px 18px rgba(246,166,35,.32); }
.btn.danger { background: linear-gradient(135deg, var(--red), #ff8a94); box-shadow: 0 8px 18px rgba(255,93,108,.32); }
.btn[disabled] { cursor: not-allowed; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

.form-input, .form-select {
    background: var(--panel); border: 1px solid var(--border); outline: none;
    color: var(--text); padding: 11px 15px; border-radius: 12px;
    font-size: .9rem; width: 100%;
}
.form-input::placeholder { color: var(--text-faint); }
.form-input:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,92,231,.14); }
.form-select {
    min-width: 180px; width: auto; appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23878da4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}

/* ---------- Progress / gauge ---------- */
.gauge { position: relative; width: 130px; height: 130px; margin: 0 auto; }
.gauge .pct { position: absolute; inset: 0; display: grid; place-items: center; }
.gauge .pct b { font-size: 1.5rem; font-weight: 700; }

.legend { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.legend .row { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--text-dim); }
.legend .swatch { width: 11px; height: 11px; border-radius: 4px; }

.empty { text-align: center; padding: 50px 20px; color: var(--text-dim); }
.empty svg { width: 44px; height: 44px; color: var(--text-faint); margin-bottom: 14px; }

/* ---------- Messages ---------- */
.messages { margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 12px 16px; border-radius: 12px; font-size: .87rem; border-left: 3px solid; }
.msg.success { background: rgba(34,199,155,.12); border-color: var(--green); color: #138063; }
.msg.info { background: rgba(46,198,219,.12); border-color: var(--cyan); color: #167d8e; }
.msg.warning { background: rgba(246,183,60,.14); border-color: var(--yellow); color: #b3790a; }
.msg.danger { background: rgba(255,93,108,.12); border-color: var(--red); color: #cf2c3c; }
body.dark .msg.success { color: #a7f3d0; }
body.dark .msg.info { color: #bae6fd; }
body.dark .msg.warning { color: #fde68a; }
body.dark .msg.danger { color: #fecdd3; }

/* ---------- Hamburger / overlay (móvil-tablet) ---------- */
.hamburger { display: none; }
.sb-close { display: none; margin-left: auto; color: var(--sb-text); }
.sb-overlay {
    display: none; position: fixed; inset: 0; z-index: 25;
    background: rgba(20,22,40,.5); backdrop-filter: blur(2px);
}
.sb-overlay.show { display: block; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background: radial-gradient(900px 520px at 18% 8%, #e7e3ff 0%, var(--bg) 60%);
}
.login-card {
    width: 100%; max-width: 410px;
    background: var(--panel);
    border-radius: 24px; padding: 40px 36px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.login-card .logo {
    width: 62px; height: 62px; border-radius: 19px; margin: 0 auto 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    display: grid; place-items: center; color: #fff;
    box-shadow: 0 10px 26px rgba(108,92,231,.4);
}
.login-card .logo svg { width: 32px; height: 32px; }
.login-card h1 { text-align: center; font-size: 1.4rem; margin-bottom: 4px; }
.login-card .muted { text-align: center; color: var(--text-dim); font-size: .85rem; margin-bottom: 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .78rem; color: var(--text-dim); margin-bottom: 7px; padding-left: 4px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 8px; padding: 13px; }
.login-foot { text-align: center; margin-top: 22px; font-size: .76rem; color: var(--text-faint); }

/* ============================================================
   ACENTOS KPI (tarjetas blancas con toque de color)
   ============================================================ */
.kpi-card {
    position: relative; overflow: hidden;
    transition: transform .16s ease, box-shadow .16s ease;
}
.kpi-card::after {
    content: ''; position: absolute; right: -30px; top: -30px;
    width: 110px; height: 110px; border-radius: 50%; opacity: .10;
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.kpi-card .val { font-size: 1.75rem; }

.accent-magenta::after { background: var(--magenta); }
.accent-cyan::after    { background: var(--cyan); }
.accent-green::after   { background: var(--green); }
.accent-violet::after  { background: var(--primary); }
.accent-orange::after  { background: var(--orange); }
.accent-red::after     { background: var(--red); }

/* ============================================================
   FORMULARIOS CRUD
   ============================================================ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-grid .field { margin-bottom: 0; }
.form-grid .field label { display:block; font-size:.78rem; color:var(--text-dim); margin-bottom:7px; padding-left:2px; }
.form-grid textarea.form-input { resize: vertical; min-height: 76px; }
.field .hint { display:block; color:var(--text-faint); font-size:.72rem; margin-top:5px; }
.field .err  { display:block; color:var(--red); font-size:.74rem; margin-top:5px; }
.field-check { display:flex; align-items:center; gap:10px; }
.field-check label { margin-bottom:0 !important; order:2; }
.field-check input { width:18px; height:18px; accent-color: var(--primary); }
.form-actions { display:flex; gap:12px; justify-content:flex-end; margin-top:24px; }

/* Botones de acción dentro de tablas */
td.acciones { white-space: nowrap; }
td.acciones a {
    display:inline-grid; place-items:center; width:32px; height:32px;
    border-radius:9px; color:var(--text-dim); margin:0 1px;
    background: var(--panel-soft);
    transition: color .15s, transform .12s, background .15s;
}
td.acciones a:hover { color: var(--primary); background: rgba(108,92,231,.12); transform: translateY(-2px); }
td.acciones a.del:hover { color: var(--red); background: rgba(255,93,108,.12); }
td.acciones a svg { width:16px; height:16px; }
td.acciones a.activa { color: var(--primary); border: 1px solid var(--primary); background: rgba(108,92,231,.16); }
td.acciones a.activa:hover { color: var(--primary); background: rgba(108,92,231,.26); }

/* ============================================================
   FILTROS DE REPORTES
   ============================================================ */
.filtros { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 14px; align-items: end; }
.filtros .field { margin-bottom: 0; }
.filtros .field label { display:block; font-size:.78rem; color:var(--text-dim); margin-bottom:7px; }
.filtros .field-btn .btn { width: 100%; justify-content: center; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-3 { grid-template-columns: 1fr; }
    .cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .hamburger { display: grid; }
    .sb-close { display: grid; }
    .cols-2 { grid-template-columns: 1fr; }
    .topbar .searchbox { display: none; }
}
@media (max-width: 680px) {
    .form-grid { grid-template-columns: 1fr; }
    .filtros { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: 1fr; }
    .content { padding: 12px 16px 32px; }
    .user-chip .meta { display: none; }
}
@media (max-width: 900px) { .filtros { grid-template-columns: 1fr 1fr; } }
