/* ==========================================================================
   NegPlanilla — Estilos globales
   Paleta: naranja #FF7800 (primario) + ámbar #f59e0b (acento), sobre gris claro.
   ========================================================================== */

:root {
    --azul: #ff7800;
    --azul-600: #e06300;
    --azul-050: #fff1e6;
    --ambar: #f59e0b;
    --verde: #22c55e;
    --rojo: #ef4444;
    --purpura: #a855f7;

    --texto: #0f172a;
    --texto-2: #475569;
    --texto-3: #94a3b8;
    --linea: #e2e8f0;
    --fondo: #f4f6fb;
    --panel: #ffffff;

    --sidebar-w: 258px;
    --radio: 14px;
    --sombra: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .05);
    --sombra-sm: 0 1px 2px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--fondo);
    color: var(--texto);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
a { text-decoration: none; color: inherit; }

/* ---------------- Layout base ---------------- */
.app-shell { display: flex; min-height: 100vh; }

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

.content-area { padding: 26px 32px 40px; }

/* ---------------- Sidebar ---------------- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: #ffffff;
    color: var(--texto-2);
    border-right: 1px solid var(--linea);
    display: flex;
    flex-direction: column;
    z-index: 30;
    transition: transform .25s ease;
}

/* Drawer toggle (móvil/tablet) — oculto en escritorio */
.nav-toggle-cb { display: none; }
.nav-overlay { display: none; }
.hamburger {
    display: none;
    width: 40px; height: 40px;
    border: 1px solid var(--linea);
    background: #fff;
    border-radius: 11px;
    color: var(--texto-2);
    align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
}
.hamburger:hover { background: var(--azul-050); color: var(--azul); }

.sidebar-brand {
    padding: 18px 22px;
    border-bottom: 1px solid var(--linea);
}

.brand-logo {
    display: block;
    width: 100%;
    max-width: 168px;
    height: auto;
}

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 6px 14px 18px; }
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, .18); border-radius: 3px; }

.nav-section { margin-top: 16px; }
.nav-caption {
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--texto-3);
    padding: 0 12px 8px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--texto-2);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--azul-050); color: var(--azul-600); }
.nav-item.active {
    background: var(--azul);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 14px rgba(255, 120, 0, .30);
}
.nav-ico { display: inline-flex; opacity: .95; }
.nav-item.active .nav-ico { color: #fff; }

.sidebar-footer {
    padding: 14px 22px;
    font-size: 11px;
    color: var(--texto-3);
    border-top: 1px solid var(--linea);
}

/* ---------------- Topbar ---------------- */
.topbar {
    position: sticky; top: 0; z-index: 20;
    height: 66px;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--linea);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    gap: 20px;
}

.topbar-search {
    display: flex; align-items: center; gap: 10px;
    background: var(--fondo);
    border: 1px solid var(--linea);
    border-radius: 12px;
    padding: 9px 14px;
    width: min(420px, 42vw);
    color: var(--texto-3);
}
.topbar-search input {
    border: 0; background: transparent; outline: none;
    font-size: 14px; width: 100%; color: var(--texto);
    font-family: inherit;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    position: relative;
    width: 40px; height: 40px;
    border: 1px solid var(--linea);
    background: #fff;
    border-radius: 11px;
    color: var(--texto-2);
    display: grid; place-items: center;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--azul-050); color: var(--azul); border-color: #ffd9b3; }
.badge-dot {
    position: absolute; top: 8px; right: 9px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--ambar); border: 2px solid #fff;
}

.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 6px 5px 8px;
    border: 1px solid var(--linea);
    border-radius: 12px;
    background: #fff;
}
.user-avatar {
    width: 36px; height: 36px; border-radius: 9px;
    background: linear-gradient(135deg, var(--azul), var(--azul-600));
    color: #fff; font-weight: 700; font-size: 13px;
    display: grid; place-items: center;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-name { font-size: 13px; font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--texto-3); }
.logout-form { margin: 0; }
.logout-form .icon-btn { width: 34px; height: 34px; }

/* ---------------- Encabezado de página ---------------- */
.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 22px;
}
.page-head h1 { font-size: 24px; }
.page-sub { margin: 4px 0 0; color: var(--texto-2); font-size: 14px; }
.page-head-actions { display: flex; gap: 10px; align-items: center; }

.chip-soft {
    background: var(--azul-050); color: var(--azul-600);
border: 1px solid #ffd9b3;
    padding: 7px 14px; border-radius: 999px;
    font-size: 13px; font-weight: 600; text-transform: capitalize;
}

/* ---------------- KPIs ---------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px; margin-bottom: 20px;
}
.kpi-card {
    background: var(--panel);
    border: 1px solid var(--linea);
    border-radius: var(--radio);
    padding: 18px;
    display: flex; align-items: center; gap: 15px;
    box-shadow: var(--sombra-sm);
    transition: transform .15s, box-shadow .15s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--sombra); }
.kpi-ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.kpi-blue { background: var(--azul-050); color: var(--azul); }
.kpi-amber { background: #fef4e2; color: var(--ambar); }
.kpi-green { background: #e7f8ee; color: var(--verde); }
.kpi-purple { background: #f5ecfe; color: var(--purpura); }
.kpi-label { display: block; font-size: 12.5px; color: var(--texto-2); font-weight: 500; }
.kpi-value { display: block; font-size: 23px; font-weight: 700; margin: 2px 0; }
.kpi-trend { font-size: 11.5px; color: var(--texto-3); }
.kpi-trend.up { color: var(--verde); }

/* ---- Tarjetas KPI con degradado (estilo colorido) ---- */
.stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 20px 22px;
    min-height: 116px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(15, 23, 42, .18); }
.stat-body { position: relative; z-index: 2; display: flex; flex-direction: column; }
.stat-label { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; opacity: .92; }
.stat-value { font-size: 30px; font-weight: 800; line-height: 1.1; margin: 8px 0 5px; }
.stat-foot { font-size: 12.5px; font-weight: 500; opacity: .88; }
.stat-icon {
    position: absolute;
    right: 12px; bottom: -12px;
    z-index: 1;
    opacity: .22;
    color: #fff;
    pointer-events: none;
}
.stat-icon svg { width: 96px; height: 96px; stroke-width: 1.6; }

/* ---- KPI cards estilo pastel (rediseño dashboard) ---- */
.kpi-stat {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fff1e6 0%, #ffdfc2 100%);
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 132px;
    justify-content: center;
    transition: transform .15s, box-shadow .15s;
}
.kpi-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, .18);
}
.kpi-stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.kpi-stat-pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}
.kpi-stat-pill.up { background: #d9f2e2; color: #16a34a; }
.kpi-stat-pill.down { background: #fde3e3; color: #dc2626; }
.kpi-stat-value { font-size: 30px; font-weight: 800; line-height: 1.1; position: relative; z-index: 2; }
.kpi-stat-label { font-size: 13px; color: #64748b; font-weight: 500; position: relative; z-index: 2; }

/* Icono grande al fondo derecha, color sólido, semitransparente como el original */
.kpi-stat-ico {
    position: absolute;
    right: 14px; bottom: 6px;
    z-index: 1;
    pointer-events: none;
    opacity: .22;
}
.kpi-stat-ico svg {
    width: 88px; height: 88px;
    stroke-width: 1.6;
}

/* Brillo de barrido al pasar el cursor (mismo efecto que el CRM Ventas) */
.kpi-stat::after,
.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .15));
    transform: skewX(-20deg) translateX(250px);
    transition: transform .6s ease;
    pointer-events: none;
}
.kpi-stat:hover::after,
.stat-card:hover::after {
    transform: skewX(-20deg) translateX(-250px);
}

/* Color del icono por tema */
.kp-orange .kpi-stat-ico { color: #ff7800; }
.kp-blue   .kpi-stat-ico { color: #2563eb; }
.kp-green  .kpi-stat-ico { color: #16a34a; }
.kp-red    .kpi-stat-ico { color: #dc2626; }
.kp-cyan   .kpi-stat-ico { color: #0891b2; }
.kp-violet .kpi-stat-ico { color: #a855f7; }
.kp-amber  .kpi-stat-ico { color: #f59e0b; }

/* Fondos pastel por tema */
.kp-orange { background: linear-gradient(135deg, #fff1e6 0%, #ffdfc2 100%); }
.kp-blue   { background: linear-gradient(135deg, #eff4ff 0%, #dbe8ff 100%); }
.kp-green  { background: linear-gradient(135deg, #e9f8ef 0%, #d2f0df 100%); }
.kp-red    { background: linear-gradient(135deg, #fdeaea 0%, #fbd0d0 100%); }
.kp-cyan   { background: linear-gradient(135deg, #ecfeff 0%, #d4f5f8 100%); }
.kp-violet { background: linear-gradient(135deg, #f5ecfe 0%, #e7d6fb 100%); }
.kp-amber  { background: linear-gradient(135deg, #fef6e7 0%, #fceac4 100%); }

.grad-emerald { background: linear-gradient(135deg, #0d9488 0%, #10b981 100%); }
.grad-violet  { background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%); }
.grad-cyan    { background: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%); }
.grad-amber   { background: linear-gradient(135deg, #ea580c 0%, #f59e0b 100%); }
.grad-blue    { background: linear-gradient(135deg, #e06300 0%, #ff8a1f 100%); }
.grad-rose    { background: linear-gradient(135deg, #e11d48 0%, #fb7185 100%); }
.grad-pink    { background: linear-gradient(135deg, #be185d 0%, #ec4899 100%); }
.grad-slate   { background: linear-gradient(135deg, #475569 0%, #64748b 100%); }

/* ---------------- Paneles / grids ---------------- */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-bottom: 20px; }

.panel {
    background: var(--panel);
    border: 1px solid var(--linea);
    border-radius: var(--radio);
    padding: 20px;
    box-shadow: var(--sombra-sm);
}
.panel-head { display: flex; flex-direction: column; margin-bottom: 14px; }
.panel-head h3 { font-size: 16px; }
.panel-sub { font-size: 12.5px; color: var(--texto-3); margin-top: 2px; }
.chart-box { position: relative; height: 260px; }

/* ---------------- Mini list ---------------- */
.mini-list { display: flex; flex-direction: column; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--linea); }
.mini-row:last-child { border-bottom: 0; }
.mini-avatar {
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--azul-050); color: var(--azul-600);
    display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.mini-info { flex: 1; display: flex; flex-direction: column; }
.mini-name { font-size: 13.5px; font-weight: 600; }
.mini-sub { font-size: 12px; color: var(--texto-3); }
.mini-date { font-size: 12px; color: var(--texto-2); }

/* ---------------- Tablas / data ---------------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.search-inline {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid var(--linea);
    border-radius: 11px; padding: 9px 13px; min-width: 260px; color: var(--texto-3);
}
.search-inline input { border: 0; outline: none; font-size: 14px; width: 100%; font-family: inherit; color: var(--texto); }

.table-wrap { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data thead th {
    text-align: left; padding: 13px 18px;
    background: #f8fafc; color: var(--texto-2);
    font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--linea);
}
table.data tbody td { padding: 13px 18px; border-bottom: 1px solid var(--linea); color: var(--texto); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #f9fbff; }
.cell-strong { font-weight: 600; }
.cell-muted { color: var(--texto-3); }

.avatar-cell { display: flex; align-items: center; gap: 10px; }
.avatar-cell .mini-avatar { width: 34px; height: 34px; }
.avatar-cell .mini-avatar.foto { background: #fff; overflow: hidden; padding: 0; border: 2px solid #ff7800; box-shadow: 0 2px 6px rgba(255, 120, 0, .35); }
.avatar-cell .mini-avatar.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------------- Badges ---------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok { background: #e7f8ee; color: #15803d; }
.badge.off { background: #fdeaea; color: #b91c1c; }
.badge.warn { background: #fef4e2; color: #b45309; }
.badge.info { background: var(--azul-050); color: var(--azul-600); }
.badge.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------- Botones ---------------- */
.btn-primary {
    background: var(--azul); color: #fff; border: 0;
    padding: 10px 18px; border-radius: 11px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: background .15s, transform .1s;
    font-family: inherit;
}
.btn-primary:hover { background: var(--azul-600); }
.btn-primary:active { transform: translateY(1px); }
.btn-block { width: 100%; justify-content: center; margin-top: 8px; }
.btn-ghost {
    background: #fff; color: var(--texto-2); border: 1px solid var(--linea);
    padding: 9px 15px; border-radius: 11px; font-size: 14px; font-weight: 500; cursor: pointer;
    font-family: inherit;
}
.btn-ghost:hover { background: var(--fondo); }

/* ---------------- Estados vacíos / placeholder ---------------- */
.module-empty {
    background: var(--panel); border: 1px dashed #cdd7e6; border-radius: var(--radio);
    padding: 54px 30px; text-align: center; color: var(--texto-2);
}
.module-empty .emoji { font-size: 34px; }
.module-empty h3 { margin: 14px 0 6px; color: var(--texto); }
.module-empty p { margin: 0 auto; max-width: 460px; font-size: 14px; }

/* ---------------- Banner de alerta ---------------- */
.alert-banner {
    display: flex; align-items: center; gap: 12px;
    background: #fef4e2; border: 1px solid #f6d69a;
    color: #92400e; border-radius: 12px;
    padding: 13px 18px; margin-bottom: 20px; font-size: 14px;
    transition: background .15s;
}
.alert-banner:hover { background: #fdeccd; }
.alert-ico { font-size: 18px; }

/* ---------------- Notificaciones ---------------- */
.notif { position: relative; }
.badge-count {
    position: absolute; top: 2px; right: 2px;
    min-width: 17px; height: 17px; padding: 0 4px;
    background: var(--rojo); color: #fff;
    font-size: 10px; font-weight: 700;
    border-radius: 9px; border: 2px solid #fff;
    display: grid; place-items: center; line-height: 1;
}
.notif-backdrop { position: fixed; inset: 0; z-index: 40; }
.notif-panel {
    position: absolute; right: 0; top: 48px; z-index: 50;
    width: 320px; max-width: 90vw;
    background: #fff; border: 1px solid var(--linea);
    border-radius: 14px; box-shadow: 0 16px 40px rgba(15, 23, 42, .22);
    overflow: hidden; animation: modalIn .16s ease;
}
.notif-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 16px; border-bottom: 1px solid var(--linea); font-weight: 600; font-size: 14px;
}
.notif-tag { font-size: 11px; color: var(--azul-600); background: var(--azul-050); padding: 3px 8px; border-radius: 999px; }
.notif-empty { padding: 26px 16px; text-align: center; color: var(--texto-3); font-size: 13.5px; }
.notif-item { display: flex; gap: 11px; padding: 11px 16px; cursor: pointer; border-bottom: 1px solid var(--linea); transition: background .12s; }
.notif-item:hover { background: var(--azul-050); }
.notif-ico { font-size: 18px; }
.notif-body { display: flex; flex-direction: column; }
.notif-title { font-size: 13px; font-weight: 600; }
.notif-sub { font-size: 12px; color: var(--texto-3); }
.notif-foot { padding: 11px 16px; text-align: center; font-size: 13px; color: var(--azul-600); font-weight: 600; cursor: pointer; }
.notif-foot:hover { background: var(--azul-050); }

/* ---------------- Modales ---------------- */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    padding: 24px; overflow-y: auto;
    animation: backdropIn .16s ease;
}
.modal-card {
    background: #fff; border-radius: 16px;
    width: 100%; box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
    animation: modalIn .22s cubic-bezier(.16, 1, .3, 1);
    max-height: calc(100vh - 48px);
    display: flex; flex-direction: column;
}
.modal-card .modal-body { overflow-y: auto; }
.modal-sm { max-width: 420px; }
.modal-md { max-width: 620px; }
.modal-mdlg { max-width: 680px; }
.modal-lg { max-width: 860px; }
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: scale(1); } }
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; border-bottom: 1px solid var(--linea);
}
.modal-head h3 { font-size: 17px; }
.modal-close {
    border: 0; background: transparent; font-size: 26px; line-height: 1;
    color: var(--texto-3); cursor: pointer; padding: 0 4px; border-radius: 8px;
}
.modal-close:hover { color: var(--rojo); }
.modal-body { padding: 22px; }
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; border-bottom: 1px solid var(--linea);
}
.modal-head h3 { font-size: 17px; }
.modal-close {
    border: 0; background: transparent; font-size: 26px; line-height: 1;
    color: var(--texto-3); cursor: pointer; padding: 0 4px; border-radius: 8px;
}
.modal-close:hover { color: var(--rojo); }
.modal-body { padding: 22px; }
.modal-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 22px; border-top: 1px solid var(--linea); background: #f8fafc;
    border-radius: 0 0 16px 16px;
}
.confirm-text { margin: 0; color: var(--texto-2); font-size: 14.5px; }

/* ---------------- Formularios (grid) ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .col-span-2 { grid-column: 1 / -1; }
.form-grid label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--texto-2); }
.form-control {
    width: 100%; padding: 10px 13px;
    border: 1px solid #94a3b8; border-radius: 10px;
    font-size: 14px; font-family: inherit; color: var(--texto);
    background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { border-color: var(--crm-primary); box-shadow: 0 0 0 3px rgba(255, 120, 0, .14); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

/* Contorno visible en los campos de los formularios de Departamento y Cargo */
.dpt-edit-panel .form-control { border-color: #94a3b8; }
.dpt-edit-panel .form-control:focus { border-color: var(--crm-primary); }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------------- Botones adicionales ---------------- */
.btn-danger {
    background: var(--rojo); color: #fff; border: 0;
    padding: 10px 18px; border-radius: 11px; font-size: 14px; font-weight: 600;
    cursor: pointer; font-family: inherit;
}
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }

/* Acciones en filas de tabla */
.row-actions { display: flex; gap: 6px; }
.act-btn {
    width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid var(--linea); background: #fff;
    display: grid; place-items: center; cursor: pointer;
    color: var(--texto-2); transition: all .15s;
}
.act-btn:hover { background: var(--azul-050); color: var(--azul); border-color: #ffd9b3; }
.act-btn.danger:hover { background: #fdeaea; color: var(--rojo); border-color: #f6c9c9; }

/* ---------------- Toast ---------------- */
.toast {
    position: fixed; right: 22px; bottom: 22px; z-index: 80;
    background: #0f172a; color: #fff;
    padding: 13px 18px; border-radius: 12px; font-size: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
    display: flex; align-items: center; gap: 10px;
    animation: modalIn .2s ease;
}
.toast.ok { background: #15803d; }
.toast.err { background: #b91c1c; }

/* Filtros / selects en toolbar */
.filter-select {
    padding: 9px 34px 9px 13px; border: 1px solid var(--linea); border-radius: 11px;
    font-size: 14px; font-family: inherit; background: #fff; color: var(--texto); cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}

/* ---------------- Boleta de pago ---------------- */
.boleta-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.boleta-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 2px; border-bottom: 1px solid var(--linea); font-size: 14px;
}
.boleta-row.header { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--texto-3); font-weight: 600; border-bottom: 2px solid var(--linea); }
.boleta-row.ingreso span:last-child { color: #15803d; font-weight: 600; }
.boleta-row.deduccion span:last-child { color: #b91c1c; font-weight: 600; }
.boleta-row.total {
    margin-top: 6px; border: 0; border-top: 2px solid var(--texto);
    font-size: 16px; font-weight: 700;
}
.boleta-row.total span:last-child { color: var(--azul); }
.boleta-note {
    margin-top: 14px; padding: 10px 12px; background: var(--azul-050);
    border-radius: 10px; font-size: 12.5px; color: var(--texto-2);
    display: flex; flex-wrap: wrap; gap: 4px 12px;
}
.boleta-note span { font-weight: 600; }

/* ---------------- Login ---------------- */
.auth-shell {
    min-height: 100vh;
    display: grid; place-items: center;
    background: radial-gradient(1200px 600px at 15% -10%, #dbe7ff 0, transparent 55%),
                radial-gradient(900px 500px at 100% 100%, #fde9c8 0, transparent 45%),
                #eef2fb;
    padding: 24px;
}

/* ---- Login split (tarjeta dividida) ---- */
.auth-split {
    display: flex;
    width: 100%; max-width: 960px;
    min-height: 580px;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(224, 99, 0, .20);
}

.auth-aside {
    position: relative;
    flex: 1 1 46%;
    padding: 40px 42px;
    color: #fff5ec;
    background: linear-gradient(155deg, #cc5f00 0%, #e06300 45%, #ff7800 100%);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.auth-aside-brand { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 700; color: #fff; z-index: 2; }
.auth-aside-content { margin-top: auto; margin-bottom: auto; z-index: 2; }
.auth-aside-content h2 { font-size: 30px; line-height: 1.2; color: #fff; letter-spacing: -.02em; }
.auth-aside-content p { margin: 14px 0 26px; font-size: 14.5px; color: #ffe4cc; max-width: 340px; }
.auth-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.auth-features li { display: flex; align-items: center; gap: 11px; font-size: 14px; color: #ffedd6; }
.af-ico {
    flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
    background: rgba(255, 255, 255, .22); color: #fff;
    display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.auth-aside-foot { z-index: 2; font-size: 12px; color: #ffdcc2; }
.auth-blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5; }
.auth-blob-1 { width: 260px; height: 260px; right: -90px; top: -70px; background: radial-gradient(circle, rgba(255,170,120,.55), transparent 70%); }
.auth-blob-2 { width: 220px; height: 220px; left: -80px; bottom: -60px; background: radial-gradient(circle, rgba(245,158,11,.4), transparent 70%); }

.auth-form-side {
    flex: 1 1 54%;
    display: flex; align-items: center; justify-content: center;
    padding: 40px 44px;
}
.auth-form-box { width: 100%; max-width: 360px; }
.auth-brand-mobile { display: none; align-items: center; gap: 12px; margin-bottom: 24px; }

.input-wrap { position: relative; }
.input-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--texto-3); pointer-events: none; }
.form-input.has-ico { padding-left: 40px; }

.btn-lg { padding: 13px 18px; font-size: 15px; border-radius: 12px; }

.auth-demo {
    margin-top: 22px; text-align: center;
    display: flex; flex-direction: column; gap: 4px;
}
.auth-demo span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-3); font-weight: 600; }
.auth-demo code {
    font-size: 12.5px; color: var(--azul-600);
    background: var(--azul-050); border: 1px solid #ffd9b3;
    padding: 6px 12px; border-radius: 8px; font-family: 'Consolas', monospace;
}

@media (max-width: 760px) {
    .auth-split { flex-direction: column; max-width: 440px; min-height: 0; }
    .auth-aside { display: none; }
    .auth-form-side { padding: 34px 28px; }
    .auth-brand-mobile { display: flex; }
}
.auth-card {
    width: 100%; max-width: 410px;
    background: #fff; border: 1px solid var(--linea);
    border-radius: 20px; padding: 34px 32px;
    box-shadow: 0 24px 60px rgba(224, 99, 0, .15);
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.auth-logo {
    width: 52px; height: 52px; border-radius: 14px;
    background: linear-gradient(135deg, var(--azul), var(--azul-600));
    color: #fff; font-weight: 800; font-size: 18px;
    display: grid; place-items: center;
    box-shadow: 0 10px 22px rgba(255, 120, 0, .35);
}
.auth-title { font-size: 20px; }
.auth-subtitle { margin: 2px 0 0; font-size: 12.5px; color: var(--texto-3); }
.auth-heading { font-size: 20px; margin-bottom: 4px; }
.auth-hint { color: var(--texto-2); font-size: 14px; margin: 0 0 22px; }

.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--texto-2); }
.form-input {
    width: 100%; padding: 11px 14px;
    border: 1px solid var(--linea); border-radius: 11px;
    font-size: 14px; font-family: inherit; color: var(--texto);
    transition: border-color .15s, box-shadow .15s; outline: none;
}
.form-input:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(255, 120, 0, .14); }
.field-error { display: block; color: var(--rojo); font-size: 12px; margin-top: 5px; }

.form-row-between { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 18px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--texto-2); cursor: pointer; }

.auth-alert {
    background: #fdeaea; color: #b91c1c; border: 1px solid #f6c9c9;
    padding: 11px 14px; border-radius: 11px; font-size: 13.5px; margin-bottom: 18px;
}
.auth-footer { text-align: center; font-size: 12.5px; color: var(--texto-3); margin: 20px 0 0; }

/* ---------------- Misc ---------------- */
.loading-screen, .access-denied { padding: 60px; text-align: center; color: var(--texto-2); }
.access-denied h3 { color: var(--texto); }

.validation-message { color: var(--rojo); font-size: 12px; }

/* ==========================================================================
   Responsive: escritorio (>1100) · tablet (900-1100) · móvil (<900 / <560)
   ========================================================================== */

/* Las tablas siempre pueden desplazarse horizontalmente si no caben */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { min-width: 620px; }

/* Tablet grande / laptops pequeñas */
@media (max-width: 1100px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .content-area { padding: 22px 24px 36px; }
}

/* Tablet / móvil: el sidebar se convierte en drawer deslizable */
@media (max-width: 900px) {
    .app-main { margin-left: 0; }
    .hamburger { display: inline-flex; }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: 0 0 40px rgba(0, 0, 0, .3);
    }
    .nav-toggle-cb:checked ~ .sidebar { transform: translateX(0); }
    .nav-toggle-cb:checked ~ .nav-overlay {
        display: block;
        position: fixed; inset: 0;
        background: rgba(15, 23, 42, .5);
        z-index: 25;
        backdrop-filter: blur(1px);
    }

    .topbar { padding: 0 18px; gap: 12px; }
    .topbar-search { width: 100%; }
    .content-area { padding: 20px 18px 34px; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .chart-box { height: 240px; }
}

/* Móvil */
@media (max-width: 620px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .topbar-search { display: none; }
    .topbar { height: 60px; }
    .user-meta { display: none; }
    .user-chip { padding: 4px; gap: 6px; }
    .page-head h1 { font-size: 21px; }
    .panel { padding: 16px; }
    .chart-box { height: 220px; }
    .stat-value { font-size: 26px; }
    .content-area { padding: 16px 14px 30px; }
}

/* Móvil pequeño */
@media (max-width: 380px) {
    .stat-icon svg { width: 78px; height: 78px; }
    .kpi-card { padding: 15px; }
}

/* ========================================================================
   NEGPLANILLA — Utilitarios de tema fusión (Asistencia)
   Misma paleta naranja #FF7800 + ámbar #f59e0b. Reutilizables en nuevas páginas.
   ======================================================================== */

/* Botones */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px;
       border-radius: 10px; border: 1px solid transparent; font-size: 14px;
       font-weight: 600; cursor: pointer; transition: .15s; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--azul); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--azul-600); }
.btn-amber { background: var(--ambar); color: #fff; }
.btn-amber:hover:not(:disabled) { background: #d97706; }
.btn-outline { background: #fff; color: var(--azul); border-color: var(--azul-600); }
.btn-outline:hover:not(:disabled) { background: var(--azul-050); }
.btn-ghost { background: transparent; color: var(--texto-2); border-color: var(--linea); }
.btn-ghost:hover:not(:disabled) { background: var(--fondo); }
.btn-danger { background: #fff; color: var(--rojo); border-color: var(--rojo); }
.btn-danger:hover:not(:disabled) { background: var(--rojo); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }

/* Badges de estado */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
         border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; }
.badge-green { background: #dcfce7; color: #15803d; }   .badge-green .badge-dot { background: var(--verde); }
.badge-amber { background: #fef3c7; color: #b45309; }   .badge-amber .badge-dot { background: var(--ambar); }
.badge-red   { background: #fee2e2; color: #b91c1c; }   .badge-red .badge-dot   { background: var(--rojo); }
.badge-gray  { background: #f1f5f9; color: #475569; }   .badge-gray .badge-dot  { background: var(--texto-3); }
.badge-blue  { background: var(--azul-050); color: var(--azul-600); } .badge-blue .badge-dot { background: var(--azul); }

/* Tarjetas */
.card { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio);
        box-shadow: var(--sombra-sm); padding: 18px; }
.card-title { font-size: 15px; font-weight: 700; color: var(--texto); margin-bottom: 12px;
              display: flex; align-items: center; justify-content: space-between; }

/* Tabla de datos */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; padding: 9px 10px; color: var(--texto-3); font-size: 12px;
          font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
          border-bottom: 1px solid var(--linea); white-space: nowrap; }
.tbl td { padding: 11px 10px; color: var(--texto); border-bottom: 1px solid var(--fondo); }
.tbl tr:hover td { background: var(--azul-050); }
.tbl-empty { text-align: center; color: var(--texto-3); padding: 26px 10px; }

/* Formularios reutilizables */
.fld { margin-bottom: 14px; }
.fld label { display: block; font-size: 13px; font-weight: 600; color: var(--texto-2); margin-bottom: 6px; }
.fld input, .fld select, .fld textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--linea);
        border-radius: 10px; font-size: 14px; background: #fff; color: var(--texto); outline: none; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-050); }

/* Barra de filtros / toolbar de página */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }

/* Estado vacío */
.empty-state { text-align: center; padding: 40px 16px; color: var(--texto-3); }
.empty-state svg { width: 44px; height: 44px; margin-bottom: 10px; color: var(--texto-3); }

/* KPI de asistencia (fusión) */
.asist-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.asist-kpi .box { background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); padding: 16px; }
.asist-kpi .val { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.asist-kpi .lbl { font-size: 12px; font-weight: 600; color: var(--texto-3); text-transform: uppercase; letter-spacing: .04em; }

.asist-kpi .var-warn { color: #b45309; }
.asist-kpi .var-red { color: #b91c1c; }

.panel-asist .panel-head { align-items: center; gap: 10px; }
.asist-refresh { margin-left: auto; display: inline-flex; color: var(--texto-3); cursor: default; }
.asist-refresh svg { width: 18px; height: 18px; }

.asist-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.asist-tabs .tab { flex: 1; padding: 7px 8px; border: 1px solid var(--linea); border-radius: 9px;
                   background: transparent; color: var(--texto-2); font-size: 12px; font-weight: 600; cursor: pointer; }
.asist-tabs .tab.active { background: var(--azul); border-color: var(--azul); color: #fff; }

.asist-req-list { display: flex; flex-direction: column; gap: 8px; }
.asist-req { display: flex; justify-content: space-between; align-items: center; gap: 10px;
             padding: 10px 12px; border: 1px solid var(--linea); border-radius: 10px; background: #fff; }
.asist-req-name { display: block; font-size: 14px; font-weight: 600; }
.asist-req-sub { display: block; font-size: 12px; color: var(--texto-3); }
.asist-req-reason { font-size: 12px; color: var(--texto-3); padding: 0 4px 8px 4px; margin-top: -4px;
                    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asist-ver-todas { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%;
                   margin-top: 10px; padding: 7px; border: 1px solid var(--linea); border-radius: 9px;
                   color: var(--azul); font-size: 13px; font-weight: 600; text-decoration: none; }
.asist-ver-todas:hover { background: var(--azul-050); }

/* Secciones de formulario de fusión (asistencia) */
.asist-form-sec { font-size: 13px; font-weight: 700; letter-spacing: .03em; color: var(--azul);
                  text-transform: uppercase; margin: 6px 0 12px; padding-bottom: 6px;
                  border-bottom: 1px solid var(--linea); }
.asist-form-sec:not(:first-child) { margin-top: 20px; }
.asist-hint { display: block; font-size: 11px; color: var(--texto-3); margin-top: 4px; }

/* Pills de días laborables (horarios) */
.dias-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.dias-pills .pill { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--linea);
                    background: var(--fondo); color: var(--texto-2); font-size: 13px; font-weight: 600;
                    cursor: pointer; transition: all .15s ease; }
.dias-pills .pill:hover { border-color: var(--azul); color: var(--azul); }
.dias-pills .pill.on { background: var(--azul); border-color: var(--azul); color: #fff; }
td.dias { white-space: nowrap; letter-spacing: .04em; }

/* Tarjeta de fusión para listas de asistencia */
.asist-card { background: #fff; border: 1px solid var(--linea); border-radius: var(--radio);
              padding: 16px 18px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }

/* Pills de selección de vista (tabs de solicitudes/asistencia) */
.pillTab { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--linea);
           background: var(--fondo); color: var(--texto-2); font-size: 13px; font-weight: 600;
           cursor: pointer; transition: all .15s ease; }
.pillTab:hover { border-color: var(--azul); color: var(--azul); }
.pillTab.on { background: var(--azul); border-color: var(--azul); color: #fff; }
.btn.danger { color: var(--rojo); }

/* ========================================================================
   TEMA CRM — Módulos de fusión asistencia
   (Sedes, Revisión Facial, Descargar App, Feriados)
   Inspirado en crm-ventas-front: naranja #FF8A1F + gris-teal #60878D.
   El contenedor .crm aísla la paleta para no afectar al resto de NegPlanilla.
   ======================================================================== */

.crm {
    --crm-primary: #FF7800;
    --crm-primary-dark: #E06300;
    --crm-primary-light: #FFF1E6;
    --crm-teal: #60878D;
    --crm-teal-dark: #3A6268;
    --crm-teal-bg: #E8F0F1;
    --crm-teal-border: #BDD0D3;
    --crm-danger: #ef4444;
    --crm-text: #1e293b;
    --crm-muted: #64748b;
    --crm-border: #e2e8f0;
    --crm-radius: 12px;
    --crm-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

/* Acción primaria naranja */
.crm .btn-primary { background: var(--crm-primary); box-shadow: 0 4px 14px rgba(255, 120, 0, .22); }
.crm .btn-primary:hover { background: var(--crm-primary-dark); }

/* Focus naranja en formularios */
.crm .form-control:focus,
.crm .fld input:focus, .crm .fld select:focus, .crm .fld textarea:focus {
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 3px rgba(255, 120, 0, .16);
}

/* Encabezado */
.crm .page-head h1 { font-size: 24px; }
.crm .page-sub { color: var(--crm-muted); }

/* Alertas */
.crm .auth-alert { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }

/* Tarjetas con elevación sutil */
.crm .asist-card {
    border-radius: var(--crm-radius);
    border-color: var(--crm-border);
    box-shadow: var(--crm-shadow);
    transition: transform .18s ease, box-shadow .18s ease;
}
.crm .asist-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(0, 0, 0, .10); }

/* Tabla de datos */
.crm table.data thead th { background: #f8fafc; color: var(--crm-muted); }
.crm table.data tbody tr:hover td { background: var(--crm-primary-light); }

/* Botones de acción en filas */
.crm .act-btn:hover { background: var(--crm-primary-light); color: var(--crm-primary); border-color: #fed7aa; }
.crm .act-btn.danger:hover { background: #fee2e2; color: var(--crm-danger); border-color: #fecaca; }

/* Etiquetas (estilo tag del CRM) */
.crm .badge { background: var(--crm-teal-bg); color: var(--crm-teal-dark); border: 1px solid var(--crm-teal-border); }
.crm .badge.info { background: var(--crm-teal-bg); color: var(--crm-teal-dark); }
.crm .badge.ok { background: #e7f8ee; color: #15803d; border-color: transparent; }
.crm .badge.off { background: #fdeaea; color: #b91c1c; border-color: transparent; }

/* Título de sección (información → teal) */
.crm .asist-form-sec { color: var(--crm-teal-dark); border-bottom-color: var(--crm-border); }

/* Lista de geocercas (tags teal) */
.crm-geo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.crm-geo {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    background: var(--crm-teal-bg); border: 1px solid var(--crm-teal-border);
    padding: 6px 8px 6px 12px; border-radius: 999px; font-size: 13px; color: var(--crm-teal-dark);
}
.crm-geo-nombre { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.crm-geo-nombre svg { color: var(--crm-teal); }
.crm-geo .cell-muted { color: var(--crm-muted); opacity: .9; }
.crm-geo-del {
    background: none; border: none; padding: 0; cursor: pointer;
    width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center; color: var(--crm-teal-dark); flex-shrink: 0;
    transition: background .12s, color .12s;
}
.crm-geo-del:hover { background: #fee2e2; color: var(--crm-danger); }

/* Tarjeta de sucursal con borde superior teal */
.crm-sucursal { position: relative; border-top: 3px solid var(--crm-teal); }
.crm-sucursal.sin-geo { border-top-color: #cbd5e1; }

/* Aviso sin geocercas */
.crm-warn {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 0;
    background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
    border-radius: 10px; font-size: 13px;
}

/* Toolbar superior (Revisión Facial) */
.crm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.crm-total { font-size: 15px; font-weight: 700; color: var(--crm-text); }
.crm-total small { color: var(--crm-muted); font-weight: 600; }
.crm-search { display: flex; align-items: center; gap: 8px; }
.crm-search-box { position: relative; display: flex; align-items: center; }
.crm-search-box svg { position: absolute; left: 11px; color: var(--crm-muted); width: 15px; height: 15px; pointer-events: none; }
.crm-search-box input {
    width: 240px; max-width: 100%; padding: 9px 12px 9px 34px;
    border: 1px solid var(--crm-border); border-radius: 10px;
    font-size: 14px; font-family: inherit; color: var(--crm-text); background: #fff;
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.crm-search-box input:focus { border-color: var(--crm-primary); box-shadow: 0 0 0 3px rgba(255, 120, 0, .16); }

/* Icono de la app APK */
.crm-apk-icon {
    width: 56px; height: 56px; border-radius: 14px;
    background: linear-gradient(135deg, var(--crm-primary), var(--crm-primary-dark));
    color: #fff; display: flex; align-items: center; justify-content: center;
margin: 0 auto 14px; box-shadow: 0 8px 18px rgba(255, 120, 0, .3);
}
.crm-apk-icon svg { width: 26px; height: 26px; }

/* Marca de encabezado (identifica visualmente el módulo CRM) */
.crm-head-title { display: flex; align-items: center; gap: 12px; }
.crm-head-mark {
    width: 40px; height: 40px; border-radius: 11px;
    background: linear-gradient(135deg, var(--crm-primary), var(--crm-primary-dark));
    color: #fff; display: flex; align-items: center; justify-content: center;
box-shadow: 0 6px 14px rgba(255, 120, 0, .3); flex-shrink: 0;
}
.crm-head-mark svg { width: 20px; height: 20px; }

/* ============================================================
   Departamentos y Cargos (dos tarjetas)
   ============================================================ */
.dpt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; width: 100%; }
.dpt-card {
    background: #fff; border: 1px solid var(--crm-border);
    border-radius: 14px; padding: 20px; box-shadow: var(--crm-shadow, 0 2px 12px rgba(0,0,0,.08));
}
.dpt-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dpt-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: var(--crm-text); margin: 0; }
.dpt-title svg { color: var(--crm-primary); }

.dpt-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.dpt-item {
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px;
    padding: 11px 14px; background: #fff; border-radius: 10px; border: 1px solid var(--crm-border); transition: background .15s, border-color .15s;
}
.dpt-item:hover { border-color: var(--crm-primary); background: var(--crm-primary-light); }
.dpt-item.expanding { border-color: var(--crm-primary); box-shadow: 0 6px 18px rgba(0,0,0,.08); background: #fff; }
.dpt-item-body { grid-column: 1; min-width: 0; }
.dpt-item > .row-actions { grid-column: 2; grid-row: 1; }
.dpt-edit-panel {
    grid-column: 1 / -1; grid-row: 2;
    display: grid; grid-template-rows: 0fr; overflow: hidden;
    transition: grid-template-rows .3s cubic-bezier(.16, 1, .3, 1);
}
.dpt-item.expanding .dpt-edit-panel { grid-template-rows: 1fr; }
.dpt-edit-panel-inner { min-height: 0; overflow: hidden; }
.dpt-item.expanding .dpt-edit-panel-inner { padding-top: 14px; border-top: 1px dashed var(--crm-border); }
.dpt-item-name { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--crm-text); font-size: 14px; }
.dpt-item-code { font-weight: 400; color: var(--crm-muted); font-size: 12px; }
.dpt-item-salary { font-weight: 700; color: var(--crm-primary-dark); font-size: 13px; }
.dpt-item-sub { font-size: 12px; color: var(--crm-muted); }
.dpt-vacio { text-align: center; color: var(--crm-muted); padding: 16px; font-size: 14px; }

/* Panel de edición expandido dentro del ítem de cargo (desliza hacia abajo) */
.dpt-edit-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* Control segmentado para Estado (Activo/Inactivo), reemplaza el select booleano */
.seg {
    display: inline-flex; width: 100%; background: #eef1f6; border: 1px solid var(--crm-border);
    border-radius: 10px; padding: 3px; gap: 3px;
}
.seg-btn {
    flex: 1; border: 0; background: transparent; padding: 7px 0;
    border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--texto-2);
    cursor: pointer; font-family: inherit; transition: background .15s, color .15s, box-shadow .15s;
}
.seg-btn.on { background: #fff; color: var(--texto); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.seg-btn.on:first-child { color: var(--crm-primary-dark); }

.dpt-alert {
    display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
    padding: 12px 14px; border-radius: 10px; font-size: 14px;
    background: rgba(255, 120, 0, .1); border: 1px solid var(--crm-primary); color: var(--crm-primary-dark);
}
.dpt-alert svg { flex-shrink: 0; }

/* Detalle de cargo en ventana desplegable (módulo departamentos) */
.dpt-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dpt-detail-item { display: flex; flex-direction: column; gap: 4px; }
.dpt-detail-lbl { font-size: 12px; font-weight: 600; color: var(--crm-muted); text-transform: uppercase; letter-spacing: .03em; }
.dpt-detail-val { font-size: 15px; color: var(--crm-text); line-height: 1.5; }
.dpt-detail-val.strong { font-weight: 700; color: var(--crm-primary-dark); }
@media (max-width: 600px) { .dpt-detail-grid { grid-template-columns: 1fr; } }

@media (max-width: 900px) { .dpt-grid { grid-template-columns: 1fr; } }

/* Autocompletado de ubicación (ubigeo) */
.ubigeo-dropdown { position: absolute; z-index: 1080; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 12px 32px rgba(15,23,42,.14); max-height: 240px; overflow-y: auto; width: 100%; }
.ubigeo-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.ubigeo-item:last-child { border-bottom: 0; }
.ubigeo-item:hover { background: #f8fafc; }
.ubigeo-item-dist { display: block; font-size: 14px; font-weight: 600; color: var(--crm-text); }
.ubigeo-item-dep { display: block; font-size: 12px; color: var(--crm-muted); }
.ubigeo-ok { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding: 7px 10px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; font-size: 13px; color: #065f46; }
.ubigeo-limpiar { border: 0; background: none; color: #059669; font-weight: 700; cursor: pointer; padding: 2px 6px; }
.ubigeo-limpiar:hover { color: #dc2626; }
.form-grid .ubigeo-field { position: relative; }

/* ---------------- DatePicker estilizado ---------------- */

.dp-wrap { position: relative; display: block; }
.dp-input {
    width: 100%; padding: 10px 13px 10px 40px;
    border: 1px solid #94a3b8; border-radius: 10px;
    font-size: 14px; font-family: inherit; color: var(--texto);
    background: #fff; outline: none; cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.dp-input:focus, .dp-wrap.open .dp-input { border-color: var(--crm-primary); box-shadow: 0 0 0 3px rgba(255,120,0,.14); }
.dp-ico {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--crm-primary); pointer-events: none;
    display: flex; align-items: center; justify-content: center;
}
.dp-input.placeholder { color: var(--crm-muted); }

.dp-pop {
    position: absolute; z-index: 60; top: calc(100% + 6px); left: 0;
    width: 288px; background: #fff; border: 1px solid var(--linea);
    border-radius: 12px; box-shadow: var(--sombra);
    padding: 12px; animation: dp-in .16s ease;
}
@keyframes dp-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { font-size: 14px; font-weight: 600; color: var(--crm-text); }
.dp-nav {
    width: 28px; height: 28px; border: 1px solid var(--linea); background: #fff;
    border-radius: 8px; color: var(--crm-text); cursor: pointer; font-size: 15px; line-height: 1;
    display: flex; align-items: center; justify-content: center; transition: .12s;
}
.dp-nav:hover { background: var(--crm-primary-light); border-color: var(--crm-primary); color: var(--crm-primary); }

.dp-week { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; margin-bottom: 4px; }
.dp-week span { text-align: center; font-size: 11px; font-weight: 700; color: var(--crm-muted); text-transform: uppercase; padding: 4px 0; }

.dp-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.dp-day {
    height: 32px; border: 0; background: transparent; border-radius: 8px;
    font-size: 13px; color: var(--crm-text); cursor: pointer; transition: .12s;
}
.dp-day:hover { background: var(--crm-primary-light); color: var(--crm-primary); }
.dp-day.other { color: #cbd5e1; }
.dp-day:disabled { cursor: default; }
.dp-day.today { font-weight: 700; color: var(--crm-primary); }
.dp-day.sel { background: var(--crm-primary); color: #fff; font-weight: 600; }
.dp-day.sel:hover { background: var(--crm-primary-dark); color: #fff; }

.dp-titlebar { display: flex; gap: 4px; }
.dp-titlebtn {
    border: 0; background: transparent; padding: 4px 8px; border-radius: 7px;
    font-size: 14px; font-weight: 600; color: var(--crm-text); cursor: pointer; transition: .12s;
}
.dp-titlebtn:hover { background: var(--crm-primary-light); color: var(--crm-primary); }

.dp-grid-mes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; animation: dp-in .15s ease; }
.dp-mes {
    border: 0; background: transparent; border-radius: 8px; padding: 8px 0;
    font-size: 13px; color: var(--crm-text); cursor: pointer; transition: .12s;
}
.dp-mes:hover { background: var(--crm-primary-light); color: var(--crm-primary); }
.dp-mes.sel { background: var(--crm-primary); color: #fff; font-weight: 600; }

.dp-grid-anio { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; animation: dp-in .15s ease; }
.dp-anio {
    border: 0; background: transparent; border-radius: 8px; padding: 8px 0;
    font-size: 13px; color: var(--crm-text); cursor: pointer; transition: .12s;
}
.dp-anio:hover { background: var(--crm-primary-light); color: var(--crm-primary); }
.dp-anio.sel { background: var(--crm-primary); color: #fff; font-weight: 600; }
.dp-anio-rapido { grid-column: 1 / -1; display: flex; gap: 4px; }
.dp-anio-btn {
    flex: 1; border: 1px solid var(--linea); background: #fff; border-radius: 8px;
    padding: 5px 0; font-size: 12px; font-weight: 600; color: var(--crm-muted); cursor: pointer; transition: .12s;
}
.dp-anio-btn:hover { border-color: var(--crm-primary); color: var(--crm-primary); background: var(--crm-primary-light); }

.dp-backdrop {
    position: fixed; inset: 0; z-index: 55; background: transparent; border: 0; padding: 0; margin: 0;
}
