/* =====================================================================================
   TIENDA ACR — Tema visual
   Inspirado en el diseño de referencia (paneles blancos muy redondeados sobre fondo lavanda,
   índigo como color primario, panel oscuro para listas, panel índigo para el detalle, pestañas
   tipo píldora con contador). Mobile-first: barra inferior deslizable en teléfonos, menú
   "carrete" desplazable en escritorio/tablet.
   ===================================================================================== */

:root {
    --p: #5B5FEF;
    --p-dark: #4245D4;
    --p-darker: #3336B5;
    --p-light: #ECEDFE;
    --p-soft: #F4F4FF;
    --p-grad: linear-gradient(135deg, #6568F3 0%, #4B4EDD 100%);

    --bg: #F3F4FA;
    --card: #FFFFFF;
    --dark: #171A2B;
    --dark-2: #222639;
    --dark-3: #2D3249;
    --text: #1A1D2E;
    --muted: #6E7390;
    --muted-2: #9A9FB8;
    --border: #E6E8F0;
    --border-2: #EEF0F6;

    --success: #16A34A;
    --success-bg: #E7F8EE;
    --danger: #E5484D;
    --danger-bg: #FDECEC;
    --warning: #D97706;
    --warning-bg: #FEF3DF;
    --info: #0284C7;
    --info-bg: #E6F4FC;

    --r-xl: 24px;
    --r-lg: 18px;
    --r-md: 12px;
    --r-sm: 9px;
    --r-pill: 999px;

    --shadow-card: 0 1px 2px rgba(23, 26, 43, .04), 0 10px 30px rgba(23, 26, 43, .06);
    --shadow-pop: 0 12px 40px rgba(23, 26, 43, .16);

    --topbar-h: 72px;
    --bottomnav-h: 66px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Plus Jakarta Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    font-size: 14.5px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--p); text-decoration: none; }
a:hover { color: var(--p-dark); }
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.text-muted, .text-muted-acr { color: var(--muted) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-13 { font-size: 13px; }
.fs-12 { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- Shell ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    margin: 12px 16px 0;
    height: var(--topbar-h);
    background: var(--card);
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 14px 0 18px;
}
.topbar__brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; color: var(--text); }
.topbar__brand:hover { color: var(--text); }
.brand-logo { height: 46px; width: 46px; object-fit: contain; border-radius: var(--r-md); background: #fff; }
.brand-mark {
    width: 40px; height: 40px; border-radius: var(--r-md);
    background: var(--p-grad); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 18px; letter-spacing: -.02em;
}
.brand-text { line-height: 1.1; }
.brand-text .brand-name { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.brand-text .brand-tag { font-size: 11px; color: var(--muted); }

.topbar__acciones { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.btn-icon {
    width: 40px; height: 40px; border-radius: var(--r-md);
    border: 1px solid var(--border); background: #fff; color: var(--text);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 17px; cursor: pointer; transition: all .15s;
    position: relative;
}
.btn-icon:hover { border-color: var(--p); color: var(--p); background: var(--p-soft); }
.btn-icon .dot { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--p-light); color: var(--p-darker);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px; flex-shrink: 0;
}
.avatar.dark { background: var(--dark-3); color: #fff; }
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.topbar__user { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 2px 4px 2px 2px; border-radius: var(--r-pill); cursor: pointer; }
.topbar__user:hover { background: var(--bg); }
.topbar__user .nombre { font-weight: 700; font-size: 13px; line-height: 1.1; }
.topbar__user .rol { font-size: 11px; color: var(--muted); }

/* Menú principal (píldoras segmentadas) */
.site-nav-row {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px;
    background: var(--bg);
    border-radius: var(--r-pill);
    overflow-x: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
    max-width: 760px;
}
.site-nav-row::-webkit-scrollbar { display: none; }
.nav-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 16px; border-radius: var(--r-pill);
    color: var(--muted); font-weight: 600; font-size: 13.5px;
    white-space: nowrap; transition: all .15s;
}
.nav-pill i { font-size: 15px; }
.nav-pill:hover { color: var(--text); background: #fff; }
.nav-pill.activo { background: var(--p); color: #fff; box-shadow: 0 6px 16px rgba(91, 95, 239, .35); }
.nav-pill.activo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: .9; }
.nav-pill.deshabilitado { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* Carrete: flechas cuando el menú no cabe */
.nav-carrete { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; }
.nav-carrete__flecha {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0;
    background: var(--dark); color: #fff; display: none; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: var(--shadow-card);
}
.nav-carrete__flecha--izq { left: -6px; }
.nav-carrete__flecha--der { right: -6px; }
.nav-carrete.hay-izq .nav-carrete__flecha--izq, .nav-carrete.hay-der .nav-carrete__flecha--der { display: flex; }

/* Contenido */
.app-content { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 22px 16px 32px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; margin: 0; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.page-head__acciones { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-back { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--text); flex-shrink: 0; }
.btn-back:hover { border-color: var(--p); color: var(--p); }

/* ---------- Barra inferior (móvil) ---------- */
.bottom-nav {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
    background: var(--card);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    overflow-x: auto;
    justify-content: flex-start;
    align-items: stretch;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-shadow: 0 -8px 24px rgba(23, 26, 43, .06);
}
.bottom-nav::-webkit-scrollbar { display: none; }
.bottom-nav::after { content: ""; flex: 0 0 10px; }
.bottom-nav .nav-pill {
    flex: 0 0 auto; min-width: 82px; scroll-snap-align: start;
    flex-direction: column; gap: 3px; padding: 8px 6px;
    font-size: 10.5px; border-radius: 0; color: var(--muted); justify-content: center;
}
.bottom-nav .nav-pill i { font-size: 20px; }
.bottom-nav .nav-pill.activo { background: transparent; color: var(--p); box-shadow: none; }
.bottom-nav .nav-pill.activo::before { display: none; }
.bottom-nav .nav-pill.activo i { background: var(--p-light); border-radius: 10px; padding: 2px 10px; }

/* ---------- Tarjetas ---------- */
.card-acr {
    background: var(--card);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(230, 232, 240, .6);
}
.card-acr__head { padding: 18px 22px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-acr__head h2, .card-acr__head h3 { font-size: 16px; margin: 0; }
.card-acr__body { padding: 20px 22px; }
.card-acr__body.p-0 { padding: 0; }
.card-acr__foot { padding: 0 22px 18px; }

/* KPI */
.kpi { position: relative; overflow: hidden; padding: 20px 22px; min-height: 160px; display: flex; flex-direction: column; }
.kpi__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi__title { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi__icon { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; background: var(--p-light); color: var(--p); }
.kpi__icon.danger { background: var(--danger-bg); color: var(--danger); }
.kpi__icon.success { background: var(--success-bg); color: var(--success); }
.kpi__icon.warning { background: var(--warning-bg); color: var(--warning); }
.kpi__icon.info { background: var(--info-bg); color: var(--info); }
.kpi__value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: 15px; color: var(--muted); font-weight: 600; margin-right: 4px; }
.kpi__delta { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.kpi__delta .up { color: var(--success); font-weight: 700; }
.kpi__delta .down { color: var(--danger); font-weight: 700; }
.kpi__chart { margin-top: auto; height: 56px; }
.kpi__chart canvas { width: 100% !important; height: 56px !important; }
.kpi--accent { background: var(--p-grad); color: #fff; }
.kpi--accent .kpi__title, .kpi--accent .kpi__delta, .kpi--accent .kpi__value small { color: rgba(255, 255, 255, .8); }
.kpi--accent .kpi__icon { background: rgba(255, 255, 255, .18); color: #fff; }
.kpi--accent .kpi__value { color: #fff; }

/* Mini barras CSS */
.bars { display: flex; align-items: flex-end; gap: 5px; height: 56px; }
.bars span { flex: 1; background: var(--p-light); border-radius: 6px 6px 3px 3px; min-height: 4px; transition: background .15s; }
.bars span.hoy { background: var(--p); }
.bars span:hover { background: var(--p-dark); }

/* ---------- Pestañas tipo píldora (diseño del recuadro rojo) ---------- */
.tabs-pill-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabs-pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--card); border-radius: var(--r-pill); padding: 6px;
    box-shadow: var(--shadow-card);
    max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tabs-pill::-webkit-scrollbar { display: none; }
.tab-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px; border-radius: var(--r-pill);
    background: #fff; border: 1px solid var(--border);
    color: var(--text); font-weight: 600; font-size: 13.5px; white-space: nowrap;
    transition: all .15s; cursor: pointer;
}
.tab-pill:hover { border-color: #C9CBF5; color: var(--p-dark); }
.tab-pill .cnt { min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; background: var(--border-2); color: var(--muted); }
.tab-pill.activo { background: var(--p-grad); border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(91, 95, 239, .35); }
.tab-pill.activo .cnt { background: #fff; color: var(--p); }

/* Pestañas de grupo (Catálogos / Configuración) */
.group-tabs { margin-bottom: 18px; }

/* ---------- Panel oscuro (listas) ---------- */
.panel-dark { background: var(--dark); color: #fff; border-radius: var(--r-xl); padding: 18px; }
.panel-dark h2, .panel-dark h3 { color: #fff; font-size: 16px; margin: 0; }
.panel-dark .text-muted-acr, .panel-dark .muted { color: var(--muted-2) !important; }
.list-dark { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.row-doc {
    display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--r-lg); background: var(--dark-2); color: #fff;
    transition: background .15s, transform .15s; cursor: pointer;
}
.row-doc:hover { background: var(--dark-3); color: #fff; }
.row-doc.activo { background: var(--p); box-shadow: 0 8px 20px rgba(91, 95, 239, .4); }
.row-doc .avatar { background: var(--dark-3); color: #fff; }
.row-doc.activo .avatar { background: rgba(255, 255, 255, .2); }
.row-doc .doc { line-height: 1.15; min-width: 0; }
.row-doc .doc .num { font-weight: 700; font-size: 13.5px; }
.row-doc .doc .sub { font-size: 11.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-doc.activo .doc .sub { color: rgba(255, 255, 255, .8); }
.row-doc .monto { font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.chip-dark { background: var(--dark-3); color: #D7D9E6; }
.row-doc.activo .chip-dark { background: #fff; color: var(--p-darker); }
.chip-success { background: var(--success-bg); color: var(--success); }
.chip-danger { background: var(--danger-bg); color: var(--danger); }
.chip-warning { background: var(--warning-bg); color: var(--warning); }
.chip-info { background: var(--info-bg); color: var(--info); }
.chip-primary { background: var(--p-light); color: var(--p-darker); }
.chip-neutral { background: var(--border-2); color: var(--muted); }

/* ---------- Panel de detalle (índigo) ---------- */
.panel-detail { background: var(--p-grad); color: #fff; border-radius: var(--r-xl); padding: 22px; min-height: 100%; }
.panel-detail .lbl { font-size: 12px; color: rgba(255, 255, 255, .75); font-weight: 600; }
.panel-detail .big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.panel-detail .chip-light { background: rgba(255, 255, 255, .18); color: #fff; }
.sub-card { background: rgba(255, 255, 255, .13); border-radius: var(--r-lg); padding: 14px 16px; backdrop-filter: blur(4px); }
.sub-card .lbl { font-size: 11.5px; }
.sub-card .val { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sub-card-white { background: rgba(255, 255, 255, .96); color: var(--text); border-radius: var(--r-lg); padding: 14px 16px; }
.sub-card-white .lbl { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.sub-card-white .val { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lineas-tabla { width: 100%; font-size: 13px; }
.lineas-tabla th { font-size: 11px; color: rgba(255, 255, 255, .7); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid rgba(255, 255, 255, .18); }
.lineas-tabla td { padding: 8px; border-bottom: 1px solid rgba(255, 255, 255, .1); vertical-align: top; }
.lineas-tabla tr:last-child td { border-bottom: 0; }
.btn-white { background: #fff; color: var(--p-darker); border: 0; border-radius: var(--r-pill); padding: 10px 18px; font-weight: 700; }
.btn-white:hover { background: var(--p-light); color: var(--p-darker); }
.btn-icon-light { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon-light:hover { background: rgba(255, 255, 255, .15); color: #fff; }

/* ---------- Botones ---------- */
.btn { border-radius: var(--r-pill); font-weight: 600; padding: 9px 18px; font-size: 13.5px; }
.btn-sm { padding: 6px 13px; font-size: 12.5px; }
.btn-acr { background: var(--p); border-color: var(--p); color: #fff; box-shadow: 0 6px 16px rgba(91, 95, 239, .3); }
.btn-acr:hover, .btn-acr:focus { background: var(--p-dark); border-color: var(--p-dark); color: #fff; }
.btn-acr-dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.btn-acr-dark:hover { background: var(--dark-2); color: #fff; }
.btn-acr-outline { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-acr-outline:hover { border-color: var(--p); color: var(--p); background: var(--p-soft); }
.btn-acr-danger { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
.btn-acr-danger:hover { background: var(--danger); color: #fff; }
.btn-acr-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-acr-success:hover { filter: brightness(.95); color: #fff; }

/* ---------- Formularios ---------- */
.form-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.form-control, .form-select {
    border-radius: var(--r-md); border: 1px solid var(--border); padding: 9px 13px; font-size: 14px;
    background-color: #fff; color: var(--text);
}
.form-control:focus, .form-select:focus { border-color: var(--p); box-shadow: 0 0 0 4px rgba(91, 95, 239, .14); }
.form-control-sm, .form-select-sm { padding: 6px 10px; font-size: 13px; border-radius: var(--r-sm); }
.form-check-input:checked { background-color: var(--p); border-color: var(--p); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(91, 95, 239, .14); border-color: var(--p); }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon > .form-control, .input-icon > .form-select { padding-left: 38px; }
.filtros-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filtros-bar .form-control, .filtros-bar .form-select { background: #fff; min-width: 150px; width: auto; flex: 0 1 auto; }
.filtros-bar .lbl-filtros { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.filtros-bar .lbl-filtros .cnt { background: var(--dark); color: #fff; border-radius: 50%; width: 20px; height: 20px; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Tablas ---------- */
.table-acr { width: 100%; margin: 0; font-size: 13.5px; }
.table-acr thead th {
    font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700;
    padding: 12px 14px; border-bottom: 1px solid var(--border); background: #FAFAFE; white-space: nowrap;
}
.table-acr tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.table-acr tbody tr:last-child td { border-bottom: 0; }
.table-acr tbody tr:hover td { background: var(--p-soft); }
.table-acr .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.table-acr .codigo { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: var(--muted); }
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--r-xl) var(--r-xl); }
.table-wrap.rounded-top { border-radius: var(--r-xl); }

/* ---------- Paginación ---------- */
.paginacion { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--border-2); font-size: 13px; color: var(--muted); }
.paginacion .pages { display: flex; gap: 4px; }
.paginacion .pages a, .paginacion .pages span { min-width: 34px; height: 34px; padding: 0 8px; border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); color: var(--text); font-weight: 600; background: #fff; }
.paginacion .pages a:hover { border-color: var(--p); color: var(--p); }
.paginacion .pages span.actual { background: var(--p); border-color: var(--p); color: #fff; }

/* ---------- Alertas ---------- */
.alert { border-radius: var(--r-lg); border: 0; font-size: 13.5px; padding: 12px 16px; }
.alert-success { background: var(--success-bg); color: #166534; }
.alert-danger { background: var(--danger-bg); color: #B42318; }
.alert-warning { background: var(--warning-bg); color: #92400E; }
.alert-info { background: var(--info-bg); color: #075985; }

/* ---------- Estado vacío ---------- */
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty > i { font-size: 40px; color: var(--muted-2); display: block; margin-bottom: 10px; }
.empty .t { font-weight: 700; color: var(--text); font-size: 15px; }

/* ---------- Login ---------- */
.login-shell { min-height: 100vh; display: flex; }
.login-shell__side {
    flex: 1.1; position: relative; display: none;
    background-size: cover; background-position: center; background-color: var(--dark);
    color: #fff;
}
.login-shell__side::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, 0) 55%); }
.login-shell__brand { position: absolute; left: 48px; bottom: 48px; right: 48px; z-index: 1; }
.login-shell__brand .logo-box { width: 64px; height: 64px; border-radius: var(--r-lg); background: rgba(255, 255, 255, .92); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; overflow: hidden; }
.login-shell__brand .logo-box img { max-width: 56px; max-height: 56px; object-fit: contain; }
.login-shell__brand h1 { color: #fff; font-size: 30px; margin: 0 0 6px; }
.login-shell__brand p { margin: 0; opacity: .85; max-width: 380px; font-size: 15px; }
.login-shell__form { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px 18px; background: var(--bg); }
.login-card { width: 100%; max-width: 420px; background: var(--card); border-radius: var(--r-xl); box-shadow: var(--shadow-card); padding: 38px 34px; }
.login-card .brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-card h2 { font-size: 22px; margin: 0; }
.login-card .sub { color: var(--muted); font-size: 13.5px; margin: 2px 0 0; }
.login-mobile-head { display: block; padding: 34px 20px 28px; color: #fff; background-size: cover; background-position: center; border-radius: 0 0 var(--r-xl) var(--r-xl); }
.login-mobile-head .logo-box { width: 52px; height: 52px; border-radius: var(--r-md); background: rgba(255, 255, 255, .92); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; overflow: hidden; }
.login-mobile-head .logo-box img { max-width: 46px; max-height: 46px; object-fit: contain; }
.login-mobile-head h1 { color: #fff; font-size: 22px; margin: 0; }
.login-mobile-head p { margin: 2px 0 0; opacity: .85; font-size: 13px; }

/* ---------- Dropdown / misc ---------- */
.dropdown-menu { border-radius: var(--r-lg); border: 1px solid var(--border); box-shadow: var(--shadow-pop); padding: 8px; font-size: 13.5px; }
.dropdown-item { border-radius: var(--r-sm); padding: 8px 12px; font-weight: 600; }
.dropdown-item:hover { background: var(--p-soft); color: var(--p-dark); }
.dropdown-item.text-danger:hover { background: var(--danger-bg); color: var(--danger); }
.badge-soft { background: var(--p-light); color: var(--p-darker); border-radius: var(--r-pill); padding: 3px 9px; font-size: 11.5px; font-weight: 700; }
.divider { height: 1px; background: var(--border-2); margin: 14px 0; }
.list-kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 13.5px; }
.list-kv .k { color: var(--muted); }
.list-kv .v { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.progress-acr { height: 8px; background: var(--border-2); border-radius: var(--r-pill); overflow: hidden; }
.progress-acr span { display: block; height: 100%; background: var(--p-grad); border-radius: var(--r-pill); }
.rank { display: flex; flex-direction: column; gap: 12px; }
.rank .item { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.rank .item .n { width: 32px; height: 32px; border-radius: 10px; background: var(--p-light); color: var(--p-darker); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.rank .item .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank .item .v { font-weight: 800; font-variant-numeric: tabular-nums; }

.permiso-grupo td { background: #FAFAFE; font-weight: 700; }
.color-input { width: 54px; height: 40px; padding: 3px; border-radius: var(--r-md); border: 1px solid var(--border); background: #fff; }
.preview-login { border-radius: var(--r-lg); height: 220px; background-size: cover; background-position: center; display: flex; align-items: flex-end; padding: 18px; color: #fff; }
.logo-preview { width: 120px; height: 120px; border-radius: var(--r-lg); border: 1px dashed var(--border); background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- Responsive ---------- */
@media (min-width: 900px) {
    .login-shell__side { display: block; }
    .login-mobile-head { display: none; }
    .login-shell__form { background: var(--bg); }
}
@media (max-width: 899px) {
    .login-shell { flex-direction: column; }
    .login-shell__form { align-items: flex-start; padding-top: 0; margin-top: -28px; }
    .login-card { padding: 28px 22px; }
}
@media (max-width: 1280px) {
    .nav-pill { padding: 8px 12px; font-size: 13px; gap: 6px; }
    .topbar { gap: 12px; }
}
@media (max-width: 1100px) {
    .topbar__user .nombre, .topbar__user .rol { display: none !important; }
    .topbar__acciones .btn-icon { display: none !important; }
}
@media (max-width: 767px) {
    .topbar { margin: 10px 10px 0; height: 60px; padding: 0 8px 0 12px; }
    .site-nav-row, .nav-carrete { display: none; }
    .topbar__brand .brand-text .brand-tag { display: none; }
    .bottom-nav { display: flex; }
    .app-content { padding: 16px 10px calc(16px + var(--bottomnav-h) + 14px); }
    .page-head h1 { font-size: 21px; }
    .kpi { min-height: 136px; padding: 16px 18px; }
    .kpi__value { font-size: 23px; }
    .card-acr__head { padding: 16px 16px 0; }
    .card-acr__body { padding: 16px; }
    .panel-dark, .panel-detail { padding: 16px; }
    .row-doc { grid-template-columns: 36px 1fr auto; }
    .row-doc .chip { display: none; }
    .paginacion { padding: 12px 16px; }
    .login-card { max-width: 100%; }
}
@media (hover: none) {
    .row-doc:hover { background: var(--dark-2); }
    .row-doc.activo:hover { background: var(--p); }
}

/* ---------- Arqueo de caja: detalle del desglose ---------- */
.arq-moneda { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.arq-moneda__head { display: flex; justify-content: space-between; background: var(--dark); color: #fff; font-weight: 700; padding: 8px 12px; font-size: 13px; }
.arq-tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.arq-tabla th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--border); }
.arq-tabla td { padding: 3px 10px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.arq-tabla td.num, .arq-tabla tfoot td.num { text-align: right; font-variant-numeric: tabular-nums; }
.arq-tabla tfoot td { font-weight: 700; padding: 8px 10px; background: var(--bg); border-top: 1px solid var(--border); }
.arq-tabla tr.arq-sep td { background: var(--p-light); color: var(--p-darker); font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 3px 10px; }
.arq-tabla .arq-cant { width: 84px; margin: 0 auto; text-align: center; font-weight: 700; }
.arq-den { font-weight: 700; display: inline-block; min-width: 54px; }
.arq-den.m::before { content: "●"; font-size: 8px; margin-right: 5px; color: var(--muted); vertical-align: middle; }
.arq-den.b::before { content: "▬"; font-size: 8px; margin-right: 5px; color: var(--muted); vertical-align: middle; }
.arq-otro { border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; height: 100%; }
.arq-otro .lbl { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.table-sm-acr td, .table-sm-acr th { padding: 5px 8px !important; font-size: 13px; }
@media (max-width: 575px) { .arq-tabla .arq-cant { width: 68px; } .arq-tabla td, .arq-tabla th { padding-left: 6px; padding-right: 6px; } }

/* ---------- Consultas ---------- */
.table-consulta th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table-consulta th.sortable.asc::after { content: " ▲"; font-size: 9px; }
.table-consulta th.sortable.desc::after { content: " ▼"; font-size: 9px; }
.table-consulta td { white-space: nowrap; }
.table-consulta td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-consulta tr.grupo td { background: var(--p-light); color: var(--p-darker); font-weight: 700; }
.table-consulta tr.subtotal td { background: var(--bg); font-weight: 700; font-size: 12.5px; border-bottom: 2px solid var(--border); }
.table-consulta tfoot tr.total td { background: var(--dark); color: #fff; font-weight: 700; position: sticky; bottom: 0; }
.search-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.12); max-height: 320px; overflow: auto; display: none; }
.search-results.show { display: block; }
.search-results .item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border-2); font-size: 13px; }
.search-results .item:hover { background: var(--p-light); }

/* ---------- Dashboard: mapa de calor por hora y día de la semana ---------- */
.heat { display: grid; gap: 3px; font-size: 11px; }
.heat .h { text-align: center; color: var(--muted); font-weight: 700; font-size: 10px; }
.heat .d { font-weight: 700; color: var(--muted); padding-right: 6px; white-space: nowrap; display: flex; align-items: center; }
.heat .c { height: 26px; border-radius: 6px; background: var(--p-light); display: flex; align-items: center; justify-content: center; color: #1a1d2e; font-weight: 600; font-size: 10px; cursor: default; }
.heat .c.v { color: #fff; }
.toggle-pill { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 3px; }
.toggle-pill button { border: 0; background: transparent; border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 700; color: var(--muted); }
.toggle-pill button.activo { background: #fff; color: var(--p); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* Píldoras segmentadas dentro de un formulario (Contado / Crédito, etc.): se reparten el ancho y nunca se solapan */
.tabs-pill.segmento { display: flex; box-shadow: none; background: var(--bg); padding: 4px; overflow: hidden; }
.tabs-pill.segmento .tab-pill { flex: 1 1 0; min-width: 0; justify-content: center; padding: 8px 6px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .tabs-pill.segmento .tab-pill { font-size: 12px; padding: 8px 4px; } }

/* Ranking del dashboard: la columna del nombre no puede empujar el ancho de la página en móvil */
.rank .item > span { min-width: 0; }
.rank .item .v { white-space: nowrap; }

/* Fondo de caja en el arqueo (referencia; interruptor "quedó dentro del conteo") */
.fondo-card { border-left: 4px solid var(--p); }
.fondo-card__icono { width: 42px; height: 42px; border-radius: 12px; background: #EEF0FF; color: var(--p); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 auto; }

/* Escáner de código de barras con cámara (POS) */
.escaner-vista { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #111; border-radius: var(--r-lg); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.escaner-vista video { width: 100%; height: 100%; object-fit: cover; }
.escaner-guia { position: absolute; left: 12%; right: 12%; top: 32%; bottom: 32%; border: 2px solid rgba(255,255,255,.85); border-radius: 10px; box-shadow: 0 0 0 9999px rgba(0,0,0,.25); pointer-events: none; }
.escaner-vista #escanerLector video { object-fit: cover; }

/* ---------- Franja de la sucursal (debajo de la barra superior, en todos los módulos) ---------- */
.sucursal-banner {
    margin: 10px 16px 0;
    padding: 10px 18px;
    background: var(--card);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-card);
    border-left: 6px solid var(--p);
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 76px;
}
.sucursal-banner__logo { height: 60px; width: 60px; object-fit: contain; border-radius: var(--r-md); background: #fff; flex-shrink: 0; }
.sucursal-banner__mark { width: 60px; height: 60px; border-radius: var(--r-md); background: var(--p-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 26px; flex-shrink: 0; }
.sucursal-banner__texto { min-width: 0; }
.sucursal-banner__nombre { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sucursal-banner__detalle { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 767px) {
    .sucursal-banner { margin: 8px 10px 0; padding: 8px 12px; gap: 12px; min-height: 62px; border-left-width: 5px; }
    .sucursal-banner__logo, .sucursal-banner__mark { height: 46px; width: 46px; font-size: 20px; }
    .sucursal-banner__nombre { font-size: 20px; }
    .sucursal-banner__detalle { font-size: 12px; }
}
