/* ═══════════════════════════════════════════════════════════════════
   BSCR Admin — Global styles
   Tema oscuro global + fuentes aumentadas para legibilidad
   ═══════════════════════════════════════════════════════════════════ */

/* ── Legibilidad: colores y tamaños de texto ─────────────────────────
   Todas las etiquetas y textos secundarios usan estas variables.
   Para hacerlos más claros/oscuros o grandes, cambiar solo aquí.
   Contraste medido contra el fondo de tarjeta (#161b27):
     --txt-section  #cbd5e1  11.6:1   títulos de sección (SELECCIÓN…)
     --txt-label    #b4c0d0   9.3:1   etiquetas de campos (SUCURSAL…)
     --txt-secondary #94a3b8  6.7:1   subtítulos, fechas, notas
     --txt-placeholder #64748b 3.6:1  texto de ejemplo en campos vacíos
   Mínimo recomendado para texto pequeño: 4.5:1                        */
:root {
    --txt-section: #cbd5e1;
    --txt-label: #b4c0d0;
    --txt-secondary: #94a3b8;
    --txt-placeholder: #64748b;
    --fs-section: 14px;
    --fs-label: 13px;
    --fs-small: 13px;
}

/* ── Base ─────────────────────────────────────────────────────────── */
body {
    background: #0f1117;
    color: #e2e8f0;
    font-family: Arial, sans-serif;
    font-size: 16px;
}

/* ── Login ────────────────────────────────────────────────────────── */
.login-page {
    background: linear-gradient(135deg, #111827, #1f2937);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 20px;
}

/* ── App shell ────────────────────────────────────────────────────── */
.app-shell {
    max-width: 700px;
    margin: 0 auto;
    padding: 16px 16px 110px;
}

/* ── Topbar ───────────────────────────────────────────────────────── */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: #161b27;
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    border: 1px solid #2d3f55;
}

.app-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f1f5f9;
}

/* ── Card box ─────────────────────────────────────────────────────── */
.card-box {
    background: #161b27;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    margin-bottom: 16px;
    border: 1px solid #2d3f55;
    color: #e2e8f0;
    font-size: 16px;
}

.card-box h3,
.card-box h2 {
    color: #f1f5f9;
}

.card-box .small,
.card-box small {
    color: #94a3b8;
}

/* ── Form elements globales ──────────────────────────────────────── */
.form-label {
    font-size: 15px;
    color: #94a3b8;
    font-weight: 600;
}

.form-control,
.form-select {
    font-size: 16px;
    background: #0f1117;
    border: 1px solid #2d3f55;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    min-height: 48px;
}

.form-control:focus,
.form-select:focus {
    background: #0f1117;
    border-color: #3b82f6;
    color: #e2e8f0;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .25);
}

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

/* ── Tablas ──────────────────────────────────────────────────────── */
.table {
    color: #cbd5e1;
    --bs-table-bg: #161b27;
    --bs-table-striped-bg: #1a2133;
    --bs-table-hover-bg: #1e2840;
    --bs-table-border-color: #2d3f55;
    --bs-table-color: #cbd5e1;
    background: #161b27;
}

.table td,
.table th {
    vertical-align: middle;
    font-size: 15px;
    border-color: #2d3f55;
    background-color: transparent;
    color: #cbd5e1;
}

.table thead th {
    color: var(--txt-label);
    border-color: #2d3f55;
    font-size: 13px;
    background-color: #1a2133;
}

.table tbody tr {
    background: #161b27;
}

.table-responsive {
    border-radius: 14px;
    background: #161b27;
    border: 1px solid #2d3f55;
    /* Antes "overflow: hidden": recortaba las esquinas pero impedía deslizar
       la tabla a los lados en el celular (no se veían las últimas columnas). */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

/* Encabezados en una sola línea ("% Servicio", "Acciones"…) */
.table thead th {
    white-space: nowrap;
}

/* ── Botones Bootstrap overrides ─────────────────────────────────── */
.btn-dark {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
    font-size: 15px;
}

.btn-dark:hover {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

.btn-outline-dark {
    border-color: #475569;
    color: #94a3b8;
    font-size: 15px;
}

.btn-outline-dark:hover {
    background: #1e293b;
    border-color: #64748b;
    color: #e2e8f0;
}

.btn-outline-secondary {
    border-color: #2d3f55;
    color: #94a3b8;
}

/* ── Text helpers ────────────────────────────────────────────────── */
.text-muted {
    color: var(--txt-secondary) !important;
}

.display-6 {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    color: #f1f5f9;
}

/* ── Alert / Flash ───────────────────────────────────────────────── */
.alert {
    border-radius: 12px;
    font-size: 14px;
}

/* ── Canvas charts ───────────────────────────────────────────────── */
canvas {
    width: 100% !important;
    max-width: 100%;
}

/* ── POS search ──────────────────────────────────────────────────── */
.pos-sticky-summary {
    position: sticky;
    bottom: 76px;
    z-index: 20;
    background: #161b27;
    border: 1px solid #2d3f55;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}

.pos-search-results {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #2d3f55;
    border-radius: 12px;
    background: #161b27;
    margin-top: 6px;
}

.pos-search-item {
    padding: 10px 12px;
    border-bottom: 1px solid #2d3f55;
    cursor: pointer;
    color: #e2e8f0;
    font-size: 14px;
}

.pos-search-item:last-child {
    border-bottom: none;
}

.pos-search-item:hover {
    background: #243447;
}

.pos-mini-label {
    font-size: 13px;
    color: var(--txt-secondary);
}

.pos-difference-ok {
    color: #22c55e;
    font-weight: 700;
}

.pos-difference-bad {
    color: #f87171;
    font-weight: 700;
}

/* Cambio a entregar (efectivo de más) */
.pos-difference-change {
    color: #60a5fa;
    font-weight: 800;
    font-size: 20px;
}

/* ── Responsive base ─────────────────────────────────────────────── */
@media (max-width: 576px) {
    body {
        font-size: 16px;
    }

    .app-shell {
        padding: 12px 12px 110px;
    }

    .topbar {
        padding: 12px 14px;
    }

    .form-control,
    .form-select {
        font-size: 16px; /* evita zoom automático en iOS */
    }
}

/* ── Botón Bolsa de trabajo ─────────────────────────────────────── */
.btn-bolsa-trabajo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 9px;
    background: #243447;
    color: #cbd5e1;
    font-size: var(--fs-small);
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid #2d3f55;
    transition: background .18s ease, transform .18s ease;
}

.btn-bolsa-trabajo:hover {
    background: #1e3a5f;
    color: #e2e8f0;
    transform: translateY(-1px);
}

.btn-bolsa-trabajo:active {
    transform: translateY(0);
}

/* ── Navegación inferior ─────────────────────────────────────────── */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 700px;
    margin: auto;
    background: #0f172a;
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .35);
    scrollbar-width: thin;
}

.bottom-nav::-webkit-scrollbar {
    height: 6px;
}

.bottom-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .20);
    border-radius: 999px;
}

.bottom-nav a {
    color: #fff;
    text-decoration: none;
    font-size: .92rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    flex: 0 0 auto;
    min-height: 42px;
    transition: background .2s ease, transform .2s ease;
}

.bottom-nav a:hover {
    background: rgba(255, 255, 255, .16);
    transform: translateY(-1px);
}

.bottom-nav a:active {
    transform: translateY(0);
}

@media (max-width: 576px) {
    .bottom-nav {
        padding: 10px 12px;
        gap: 8px;
    }

    .bottom-nav a {
        font-size: .88rem;
        padding: 9px 12px;
        min-height: 40px;
    }
}

/* ── Bottom sheet nav ────────────────────────────────────────────── */
.mobile-menu {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(100%, 700px);
    background: #0f172a;
    padding: 10px 8px 12px;
    display: flex;
    justify-content: space-around;
    z-index: 100;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    transition: background .15s;
    min-width: 54px;
}

.nav-tab svg {
    opacity: .55;
    transition: opacity .15s;
}

.nav-tab span {
    font-size: 12px;   /* era 9px */
    font-weight: 600;
    opacity: .8;
    transition: opacity .15s;
    white-space: nowrap;
}

.nav-tab.active,
.nav-tab:hover {
    background: rgba(255,255,255,.10);
}

.nav-tab.active svg,
.nav-tab.active span,
.nav-tab:hover svg,
.nav-tab:hover span {
    opacity: 1;
}

@media (max-width: 400px) {
    .nav-tab {
        min-width: 44px;
        padding: 6px 6px;
    }
    .nav-tab span {
        font-size: 11px;
    }
}

/* ── Sheet overlay ───────────────────────────────────────────────── */
.sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 101;
}

.sheet-overlay.open {
    display: block;
}

/* ── Bottom sheet ────────────────────────────────────────────────── */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: min(100%, 700px);
    background: #161b27;
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    border: 1px solid #2d3f55;
    border-bottom: none;
    padding: 8px 0 100px;
    z-index: 102;
    transition: transform .25s cubic-bezier(.32,.72,0,1);
    max-height: 80vh;
    overflow-y: auto;
}

.bottom-sheet.open {
    transform: translateX(-50%) translateY(0);
}

.sheet-handle {
    width: 36px;
    height: 4px;
    background: #2d3f55;
    border-radius: 2px;
    margin: 0 auto 12px;
}

.sheet-title {
    font-size: var(--fs-label);   /* era 11px */
    font-weight: 700;
    color: var(--txt-label);
    padding: 0 16px 8px;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0;
}

.sheet-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    font-size: 15px;   /* era 14px */
    font-weight: 600;
    color: #e2e8f0;
    text-decoration: none;
    border-bottom: 0.5px solid #1e293b;
    transition: background .12s;
}

.sheet-link:last-child {
    border-bottom: none;
}

.sheet-link:hover {
    background: #1e293b;
}

.sheet-link svg {
    color: var(--txt-secondary);
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   POS dark premium (body.pos-dark-page — ya nativo en body oscuro)
   ═══════════════════════════════════════════════════════════════════ */

body.pos-dark-page {
    background: #0f1117;
}

body.pos-dark-page .topbar {
    background: transparent;
    border: none;
    box-shadow: none;
}

body.pos-dark-page .app-title {
    color: #f1f5f9;
}

body.pos-dark-page .text-muted {
    color: var(--txt-secondary) !important;
}

body.pos-dark-page .btn-bolsa-trabajo {
    background: #243447;
    color: #cbd5e1;
    border: 1px solid #2d3f55;
}

body.pos-dark-page .btn-bolsa-trabajo:hover {
    background: #1e3a5f;
    color: #e2e8f0;
}

body.pos-dark-page .btn.btn-outline-dark {
    border-color: #2d3f55;
    color: #94a3b8;
    background: transparent;
}

/* wrap */
.pos-wrap {
    max-width: 700px;
    margin: 0 auto;
    padding-bottom: 24px;
}

/* alert cita */
.pos-alert-cita {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #1e3a5f;
    border: 1px solid #2563eb;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;   /* era 13px */
    color: #93c5fd;
    margin-bottom: 10px;
}

/* branch form */
.pos-branch-form {
    margin-bottom: 10px;
}

.pos-branch-form .pos-field-label {
    color: var(--txt-label);
}

/* secciones */
.pos-section {
    background: #161b27;
    border-radius: 20px;
    padding: 18px;
    border: 1px solid #2d3f55;
    margin-bottom: 8px;
}

.pos-section-label {
    font-size: var(--fs-section);   /* era 10px */
    font-weight: 700;
    color: var(--txt-section);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 14px;
}

.pos-branch-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: #1e293b;
    border-radius: 20px;
    font-size: var(--fs-small);   /* era 11px */
    color: #cbd5e1;
    margin-bottom: 14px;
}

.pos-row2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pos-field {
    display: flex;
    flex-direction: column;
}

.pos-field-label {
    font-size: var(--fs-label);   /* era 10px */
    color: var(--txt-label);
    margin-bottom: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.pos-input {
    padding: 10px 12px;
    border: 1px solid #2d3f55;
    border-radius: 10px;
    font-size: 15px;   /* era 14px */
    color: #e2e8f0;
    background: #0f1117;
    width: 100%;
    outline: none;
    transition: border-color .2s;
}

.pos-input:focus {
    border-color: #3b82f6;
}

.pos-input::placeholder {
    color: var(--txt-placeholder);
}

.pos-select {
    padding: 10px 12px;
    border: 1px solid #2d3f55;
    border-radius: 10px;
    font-size: 14px;   /* era 13px */
    color: #94a3b8;
    background: #0f1117;
    width: 100%;
    outline: none;
    cursor: pointer;
}

.pos-input-inline {
    border: none;
    background: transparent;
    font-size: 13px;   /* era 12px */
    color: #94a3b8;
    width: 70px;
    padding: 0;
    outline: none;
}

.pos-btn-ghost {
    background: none;
    border: none;
    padding: 6px 0;
    font-size: 13px;   /* era 12px */
    color: var(--txt-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color .15s;
}

.pos-btn-ghost:hover {
    color: #e2e8f0;
}

.pos-btn-dark {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;   /* era 13px */
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.pos-btn-dark:hover {
    background: #334155;
}

.pos-quick-client {
    background: #0f1117;
    border-radius: 14px;
    padding: 14px;
    margin-top: 10px;
    border: 1px solid #2d3f55;
}

/* ítems */
.pos-item-card {
    background: #0f1117;
    border-radius: 14px;
    padding: 14px;
    border: 1px solid #2d3f55;
    margin-bottom: 8px;
}

.pos-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #1e293b;
}

.pos-item-subtotal-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-item-subtotal-val {
    font-size: 16px;   /* era 15px */
    font-weight: 700;
    color: #f1f5f9;
}

.pos-btn-remove {
    background: none;
    border: 1px solid #2d3748;
    color: var(--txt-secondary);
    border-radius: 8px;
    width: 28px;
    height: 28px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.pos-btn-remove:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.pos-btn-add {
    width: 100%;
    padding: 12px;
    border: 1px dashed #2d3f55;
    border-radius: 12px;
    background: none;
    color: var(--txt-secondary);
    font-size: 14px;   /* era 13px */
    cursor: pointer;
    transition: all .15s;
    margin-top: 4px;
}

.pos-btn-add:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* resumen */
.pos-summary {
    background: #161b27;
    border-radius: 20px;
    padding: 18px;
    border: 1px solid #2d3f55;
    margin-bottom: 8px;
}

.pos-sum-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;   /* era 13px */
    color: var(--txt-secondary);
    padding: 5px 0;
}

.pos-sum-row span:last-child {
    color: #94a3b8;
}

.pos-sum-divider {
    border: none;
    border-top: 1px solid #1e293b;
    margin: 12px 0;
}

.pos-sum-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.pos-sum-total span:first-child {
    font-size: 15px;   /* era 14px */
    font-weight: 600;
    color: #94a3b8;
}

.pos-sum-total-val {
    font-size: 38px;
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: -1px;
    line-height: 1;
}

/* pagos */
.pos-pay-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.pos-pay-input {
    font-size: 20px !important;
    font-weight: 700 !important;
    text-align: right;
    padding: 12px !important;
}

.pos-diff-wrap {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
}

.pos-btn-guardar {
    width: 100%;
    padding: 17px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .01em;
    box-shadow: 0 8px 24px rgba(37,99,235,.35);
    transition: opacity .15s, transform .15s;
}

.pos-btn-guardar:hover {
    opacity: .92;
    transform: translateY(-1px);
}

.pos-btn-guardar:active {
    transform: translateY(0);
}

/* últimas ventas en oscuro */
body.pos-dark-page .card-box {
    background: #161b27;
    border: 1px solid #2d3f55;
    box-shadow: none;
}

body.pos-dark-page .table {
    color: #94a3b8;
}

body.pos-dark-page .table thead th {
    color: var(--txt-label);
    border-color: #2d3f55;
}

body.pos-dark-page .table td {
    border-color: #2d3f55;
}

body.pos-dark-page .text-center.text-muted {
    color: #94a3b8 !important;
}

/* select oscuro en branch form */
body.pos-dark-page .pos-branch-form .pos-select {
    background: #161b27;
    color: #94a3b8;
    border-color: #2d3f55;
}

.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 10px; }
.w-100 { width: 100%; }

/* ═══════════════════════════════════════════════════════════════════
   Dashboard rediseño
   ═══════════════════════════════════════════════════════════════════ */
.dash-wrap {
    max-width: 700px;
    margin: 0 auto;
    padding-bottom: 24px;
}

.dash-date {
    font-size: var(--fs-label);   /* era 11px */
    font-weight: 700;
    color: var(--txt-label);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 10px;
    padding: 0 2px;
}

/* Métricas */
.dash-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.dash-metric {
    background: #161b27;
    border-radius: 16px;
    padding: 13px;
    border: 1px solid #2d3f55;
    position: relative;
    overflow: hidden;
}

.dash-metric-accent {
    position: absolute;
    top: 0; right: 0;
    width: 56px; height: 56px;
    border-radius: 0 16px 0 56px;
    opacity: .07;
}

.dash-metric-icon {
    width: 30px; height: 30px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 8px;
}

.dash-metric-label {
    font-size: 13px;
    font-weight: 700;
    color: #7c8fa8;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
}

.dash-metric-val {
    font-size: 26px;
    font-weight: 800;
    color: #f1f5f9;
    line-height: 1;
    margin-bottom: 4px;
}

.dash-metric-sub {
    font-size: 13px;
    color: #94a3b8;
}

/* Cards */
.dash-card {
    background: #161b27;
    border-radius: 16px;
    padding: 14px;
    border: 1px solid #2d3f55;
    margin-bottom: 8px;
}

.dash-card-warn {
    border-color: #713f12;
    background: #1c1a10;
}

.dash-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.dash-card-title-warn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fbbf24;
}

/* Barras 7 días */
.dash-bars {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 90px;
    margin-bottom: 4px;
}

.dash-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    justify-content: flex-end;
}

.dash-bar-val {
    font-size: 11px;    /* era 8px */
    color: var(--txt-secondary);
    text-align: center;
    line-height: 1;
    min-height: 10px;
    white-space: nowrap;
    overflow: hidden;
}

.dash-bar {
    width: 100%;
    background: #243447;
    border-radius: 5px 5px 0 0;
    min-height: 4px;
    transition: background .2s;
}

.dash-bar.today {
    background: #3b82f6;
}

.dash-bar-label {
    font-size: 12px;   /* era 9px */
    color: var(--txt-secondary);
    text-align: center;
    line-height: 1.3;
    white-space: nowrap;
    font-weight: 500;
}

.dash-bar-label.today {
    color: #60a5fa;
    font-weight: 700;
}

/* Formas de pago */
.dash-pay-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
    border-color: #2d3f55;
}

.dash-pay-row:last-child { margin-bottom: 0; }

.dash-pay-label {
    font-size: 15px;
    color: #cbd5e1;
    font-weight: 500;
    width: 110px;
    flex-shrink: 0;
}

.dash-pay-bg {
    flex: 1;
    background: #2d3f55;
    border-radius: 4px;
    height: 7px;
    overflow: hidden;
}

.dash-pay-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .4s ease;
}

.dash-pay-amount {
    font-size: 15px;
    font-weight: 700;
    color: #e2e8f0;
    min-width: 60px;
    text-align: right;
}

/* Barberos */
.dash-barber-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 0.5px solid #2d3f55;
}

.dash-barber-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dash-avatar {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;   /* era 11px */
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.dash-barber-info { flex: 1; }
.dash-barber-name { font-size: 15px; font-weight: 600; color: #e2e8f0; }
.dash-barber-sub  { font-size: 13px; color: #94a3b8; }
.dash-barber-commission { font-size: 15px; font-weight: 700; color: #f1f5f9; }

/* Productos */
.dash-product-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 0.5px solid #2d3f55;
}

.dash-product-row:last-child { border-bottom: none; padding-bottom: 0; }

.dash-product-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    flex-shrink: 0;
}

.dash-product-name { flex: 1; font-size: 15px; color: #94a3b8; font-weight: 500; }
.dash-product-qty  { font-size: 13px; color: #7c8fa8; }
.dash-product-amount { font-size: 15px; font-weight: 700; color: #e2e8f0; min-width: 60px; text-align: right; }

/* Inventario bajo */
.dash-stock-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 0.5px solid #2d2006;
}

.dash-stock-row:last-child { border-bottom: none; padding-bottom: 0; }

.dash-stock-name   { font-size: 15px; font-weight: 600; color: #fbbf24; }
.dash-stock-branch { font-size: 13px; color: #713f12; margin-top: 1px; }

.dash-stock-badge {
    font-size: 13px;
    font-weight: 700;
    color: #fca5a5;
    background: #450a0a;
    padding: 4px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Estados vacíos */
.dash-empty {
    font-size: 13px;   /* era 12px */
    color: #94a3b8;
    text-align: center;
    padding: 12px 0;
}

.dash-empty-ok {
    color: #4ade80;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Textos principales del dashboard — contraste alto */
.dash-metric-val,
.dash-barber-name,
.dash-barber-commission,
.dash-product-amount,
.dash-pay-amount,
.dash-stock-name,
.pos-sum-total-val,
.pos-item-subtotal-val,
.card-box h3,
.card-box h2 {
    color: #f1f5f9;
}

/* Textos secundarios */
.dash-metric-sub,
.dash-barber-sub,
.dash-product-qty,
.dash-bar-val,
.pos-mini-label,
.pos-field-label,
.pos-section-label,
small {
    color: #94a3b8;
}

/* Resumen total */
.dash-sum-divider {
    border-top-color: #1e293b;
}

.dash-sum-row span,
.pos-sum-row span {
    color: #94a3b8;
}

/* ═══════════════════════════════════════════════════════════════════
   Dark Kit — componentes reutilizables
   ═══════════════════════════════════════════════════════════════════ */
.dk-wrap {
    max-width: 700px;
    margin: 0 auto;
    padding-bottom: 24px;
}

.dk-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.dk-page-title {
    font-size: 22px;
    font-weight: 800;
    color: #f1f5f9;
    line-height: 1.1;
    margin: 0;
}

.dk-page-sub {
    font-size: 13px;   /* era 12px */
    color: var(--txt-secondary);
    margin: 3px 0 0;
}

.dk-total-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: var(--fs-label);   /* era 10px */
    font-weight: 700;
    color: var(--txt-label);
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

.dk-total-badge span {
    font-size: 20px;
    font-weight: 800;
    color: #22c55e;
    letter-spacing: -.5px;
}

/* Cards */
.dk-card {
    background: #161b27;
    border-radius: 20px;
    padding: 18px;
    border: 1px solid #2d3f55;
    margin-bottom: 8px;
}

.dk-card-label {
    font-size: var(--fs-section);   /* era 10px */
    font-weight: 700;
    color: var(--txt-section);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 14px;
}

/* Formulario */
.dk-form { display: flex; flex-direction: column; gap: 0; }

.dk-form-grid3 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
    margin-bottom: 14px;
}

@media (min-width: 500px) {
    .dk-form-grid3 {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }
}

.dk-form-grid2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.dk-field {
    display: flex;
    flex-direction: column;
}

.dk-label {
    font-size: var(--fs-label);   /* era 10px */
    font-weight: 700;
    color: var(--txt-label);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 6px;
}

.dk-input {
    background: #0f1117;
    border: 1px solid #2d3f55;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;   /* era 14px */
    color: #e2e8f0;
    outline: none;
    width: 100%;
    transition: border-color .2s;
}

.dk-input:focus { border-color: #3b82f6; }
.dk-input::placeholder { color: var(--txt-placeholder); }

.dk-input-amount {
    font-size: 18px;
    font-weight: 700;
    text-align: right;
    color: #f1f5f9;
}

.dk-select {
    background: #0f1117;
    border: 1px solid #2d3f55;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;   /* era 13px */
    color: #94a3b8;
    outline: none;
    width: 100%;
    cursor: pointer;
    transition: border-color .2s;
}

.dk-select:focus { border-color: #3b82f6; }

.dk-hint {
    font-size: var(--fs-small);   /* era 10px */
    color: var(--txt-secondary);
    margin-top: 4px;
}

/* Botones */
.dk-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(37,99,235,.3);
    transition: opacity .15s, transform .15s;
}

.dk-btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.dk-btn-primary:active { transform: translateY(0); }

.dk-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 12px;
    background: none;
    color: #94a3b8;
    border: 1px solid #2d3f55;
    border-radius: 12px;
    font-size: 15px;   /* era 14px */
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}

.dk-btn-ghost:hover { border-color: #94a3b8; color: #e2e8f0; }

/* Filas de gastos */
.dk-expense-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #1e293b;
}

.dk-expense-row:last-of-type { border-bottom: none; }

.dk-expense-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.dk-expense-info { flex: 1; min-width: 0; }

.dk-expense-cat {
    font-size: 15px;   /* era 14px */
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 2px;
}

.dk-expense-meta {
    font-size: var(--fs-small);   /* era 11px */
    color: var(--txt-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dk-expense-right {
    text-align: right;
    flex-shrink: 0;
}

.dk-expense-amount {
    font-size: 16px;   /* era 15px */
    font-weight: 700;
    color: #f1f5f9;
}

.dk-expense-date {
    font-size: var(--fs-small);   /* era 11px */
    color: var(--txt-secondary);
    margin-top: 2px;
}

.dk-expense-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0 0;
    margin-top: 8px;
    border-top: 1px solid #2d3f55;
    font-size: 15px;   /* era 14px */
    font-weight: 700;
    color: #94a3b8;
}

.dk-expense-total-row span:last-child {
    font-size: 19px;   /* era 18px */
    color: #22c55e;
}

.dk-empty {
    font-size: 14px;   /* era 13px */
    color: var(--txt-secondary);
    text-align: center;
    padding: 20px 0;
}

/* Stats semana (adelantos) */
.dk-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.dk-stat {
    background: #161b27;
    border: 1px solid #2d3f55;
    border-radius: 14px;
    padding: 14px;
}

.dk-stat-label {
    font-size: var(--fs-label);   /* era 10px */
    font-weight: 700;
    color: var(--txt-label);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 6px;
}

.dk-stat-val {
    font-size: 21px;   /* era 20px */
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: -.5px;
}

/* Filas de adelantos */
.dk-advance-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #1e293b;
}

.dk-advance-row:last-child { border-bottom: none; padding-bottom: 0; }

.dk-advance-avatar {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: #94a3b8;
    flex-shrink: 0;
}

.dk-advance-info { flex: 1; min-width: 0; }

.dk-advance-name {
    font-size: 15px;   /* era 14px */
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 2px;
}

.dk-advance-meta {
    font-size: var(--fs-small);   /* era 11px */
    color: var(--txt-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dk-advance-right {
    text-align: right;
    flex-shrink: 0;
}

.dk-advance-amount {
    font-size: 17px;   /* era 16px */
    font-weight: 700;
    color: #f59e0b;
    margin-bottom: 3px;
}

.dk-edit-link {
    font-size: var(--fs-small);   /* era 11px */
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
}

.dk-edit-link:hover { color: #93c5fd; }


/* ── Legibilidad: ajustes generales ──────────────────────────────── */
.dash-metric-label { color: var(--txt-label); }
.dash-metric-sub, .dash-product-qty { color: var(--txt-secondary); }
.badge { font-size: 12px; }
/* Rojo más claro para que se lea sobre fondo oscuro */
.text-danger { color: #f87171 !important; }
.btn-outline-danger { color: #f87171; border-color: #f87171; }
.btn-outline-danger:hover { color: #fff; background: #dc2626; border-color: #dc2626; }

/* ══ Fotos de cortes ═══════════════════════════════════════════════ */

/* Visor (app.js → a[data-lightbox]) */
.photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;   /* encima de los modales (citas usa 9999) */
    background: rgba(2, 6, 23, .92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 12px 16px;
}
.photo-lightbox img {
    max-width: 100%;
    max-height: calc(100vh - 110px);
    border-radius: 10px;
    object-fit: contain;
}
.photo-lightbox-caption {
    margin-top: 10px;
    color: #cbd5e1;
    font-size: 14px;
    text-align: center;
}
.photo-lightbox-close {
    position: absolute;
    top: 10px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #334155;
    background: #0f172a;
    color: #f1f5f9;
    font-size: 26px;
    line-height: 1;
}

/* Tarjeta "Último corte" (POS y detalle de cita) */
.last-cut {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #2d3f55;
    border-radius: 14px;
    background: #0f1117;
}
.last-cut-thumb {
    flex: 0 0 auto;
    width: 76px;
    height: 76px;
    border-radius: 10px;
    overflow: hidden;
    background: #1e293b;
    display: block;
}
.last-cut-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.last-cut-body { min-width: 0; font-size: 14px; color: #cbd5e1; line-height: 1.35; }
.last-cut-title {
    font-size: var(--fs-label, 13px);
    font-weight: 700;
    color: var(--txt-label, #b4c0d0);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.last-cut-meta { color: var(--txt-secondary, #94a3b8); font-size: 13px; }
.last-cut-notes { font-style: italic; color: #e2e8f0; }
.last-cut-link { font-size: 13px; color: #60a5fa; text-decoration: none; }
.detail-item .last-cut span { display: inline; margin: 0; }   /* detalle de cita */
.last-cut-empty { margin-top: 8px; font-size: 13px; color: var(--txt-secondary, #94a3b8); }

/* Campo para tomar/subir la foto */
.cut-photo-field {
    margin-top: 10px;
    padding: 10px;
    border: 1px dashed #2d3f55;
    border-radius: 14px;
}
.cut-photo-field input[type="file"] {
    width: 100%;
    font-size: 14px;
    color: #cbd5e1;
}
.cut-photo-field input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #334155;
    background: #1e293b;
    color: #e2e8f0;
    font-weight: 600;
}
.cut-photo-preview {
    display: block;
    margin-top: 8px;
    max-width: 140px;
    max-height: 140px;
    border-radius: 10px;
    object-fit: cover;
}

/* Galería del historial (Clientes) */
.cuts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
@media (min-width: 576px) { .cuts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 992px) { .cuts-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cut-card {
    border: 1px solid #2d3f55;
    border-radius: 12px;
    overflow: hidden;
    background: #0f1117;
    display: flex;
    flex-direction: column;
}
.cut-card a.cut-card-img { display: block; aspect-ratio: 1 / 1; background: #1e293b; }
.cut-card a.cut-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cut-card-body { padding: 8px 10px; font-size: 13px; color: #cbd5e1; line-height: 1.35; flex: 1; }
.cut-card-date { font-weight: 700; color: #f1f5f9; }
.cut-card-latest { font-size: 11px; font-weight: 700; color: #4ade80; text-transform: uppercase; letter-spacing: .05em; }
.cut-card form { padding: 0 10px 10px; }


/* ── Dashboard: resumen mensual (últimos 5 meses) ─────────────────── */
.dash-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dash-branch-form { margin: 0; }
.dash-branch-select {
    background: #0f172a; color: #cbd5e1; border: 1px solid #2d3f55; border-radius: 8px;
    padding: 5px 8px; font-size: 13px; max-width: 100%;
}

.dash-months-chart { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 8px; }
.dash-month-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dash-month-pair { width: 100%; height: 110px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.dash-mbar { flex: 1; max-width: 26px; border-radius: 4px 4px 0 0; min-height: 2px; }
.dash-mbar-in  { background: #22c55e; }
.dash-mbar-out { background: #f59e0b; }
.dash-month-name { font-size: 12px; font-weight: 600; color: var(--txt-secondary, #94a3b8); text-transform: capitalize; }
.dash-month-col.current .dash-month-name { color: #60a5fa; font-weight: 700; }
.dash-month-profit { font-size: 12px; font-weight: 700; white-space: nowrap; }
.dash-month-profit.pos { color: #4ade80; }
.dash-month-profit.neg { color: #f87171; }

.dash-months-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--txt-secondary, #94a3b8); margin-bottom: 12px; }
.dash-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.dash-dot-in  { background: #22c55e; }
.dash-dot-out { background: #f59e0b; }

.dash-months-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.dash-months-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
.dash-months-table th, .dash-months-table td { padding: 7px 8px; border-bottom: 1px solid #243447; text-align: right; white-space: nowrap; color: #e2e8f0; }
.dash-months-table thead th { color: #94a3b8; font-weight: 700; line-height: 1.25; vertical-align: bottom; }
.dash-months-table thead th small { font-weight: 500; color: #7c8fa8; }
.dash-months-table thead th.current { color: #60a5fa; }
.dash-months-table tbody th { text-align: left; font-weight: 600; color: #cbd5e1; position: sticky; left: 0; background: #161b27; }
.dash-months-table tr.sub th, .dash-months-table tr.sub td { font-size: 12px; color: #94a3b8; font-weight: 500; }
.dash-months-table tr.total th, .dash-months-table tr.total td { border-top: 2px solid #3b4b63; border-bottom: none; font-weight: 800; font-size: 14px; }
.dash-months-table td.pos { color: #4ade80; }
.dash-months-table td.neg { color: #f87171; }
.dash-months-note { margin-top: 10px; font-size: 12px; line-height: 1.45; color: #7c8fa8; }
