/* ============================================================
   Tema Restaurante - identidad visual global del sistema
   Se carga DESPUES de farmacia.css / estilos.css y solo
   sobrescribe presentacion: no altera ids, names ni logica.
   Paleta alineada con pos_restaurante.css (pantalla de venta).
   ============================================================ */

:root {
    /* Marca */
    --rt-primario: #c2410c;          /* terracota (texto blanco AA) */
    --rt-primario-hover: #9a3412;
    --rt-primario-suave: #fdeee4;
    --rt-acento: #f59e0b;            /* ambar */
    --rt-acento-hover: #d97706;
    --rt-oliva: #5b7a1f;
    --rt-oliva-suave: #eef3e2;
    --rt-vino: #9f1239;
    --rt-vino-suave: #fbe8ee;
    --rt-canela: #b45309;
    --rt-canela-suave: #fdf1e1;

    /* Superficies */
    --rt-fondo: #f8f4ef;             /* crema calida del area de trabajo */
    --rt-superficie: #ffffff;
    --rt-borde: #ece3d8;
    --rt-borde-fuerte: #dccfbf;

    /* Barra lateral (espresso) */
    --rt-sidebar: #2a1d17;
    --rt-sidebar-sub: #22170f;
    --rt-sidebar-hover: rgba(255, 255, 255, .06);
    --rt-sidebar-texto: #e9dfd5;
    --rt-sidebar-texto-suave: #b3a293;

    /* Texto */
    --rt-texto: #2b2320;
    --rt-texto-suave: #6f625a;

    --rt-radio: 12px;
    --rt-radio-sm: 8px;
    --rt-sombra: 0 1px 2px rgba(42, 29, 23, .06), 0 4px 14px rgba(42, 29, 23, .06);
    --rt-sombra-hover: 0 6px 22px rgba(42, 29, 23, .12);
    --rt-fuente: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Variables del tema base redirigidas a la paleta */
    --color-primary: var(--rt-primario);
    --color-secondary: var(--rt-primario-hover);
    --color-toggle: var(--rt-primario-hover);
    --color-title-form: var(--rt-primario-suave);
    --color-treeview: var(--rt-sidebar-sub);
    --color-item: var(--rt-sidebar-hover);
    --font-family-primary: var(--rt-fuente);
    --font-family-sans-serif: var(--rt-fuente);
    --primary: var(--rt-primario);
    --success: var(--rt-oliva);
    --warning: var(--rt-acento);
    --danger: #b91c1c;
    --info: #0e7490;
}

/* ---------- Base ---------- */
body,
body.app {
    font-family: var(--rt-fuente);
    color: var(--rt-texto);
    background-color: var(--rt-fondo);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--rt-primario);
}

a:hover {
    color: var(--rt-primario-hover);
}

::selection {
    background: var(--rt-primario);
    color: #fff;
}

body::-webkit-scrollbar-thumb {
    background-color: var(--rt-borde-fuerte);
    border-radius: 8px;
}

body::-webkit-scrollbar-track {
    box-shadow: none;
    background: var(--rt-fondo);
}

/* ---------- Encabezado superior ---------- */
.app-header {
    background: var(--rt-superficie);
    border-bottom: 1px solid var(--rt-borde);
    box-shadow: 0 1px 8px rgba(42, 29, 23, .05);
}

.app-header__logo {
    background: var(--rt-sidebar);
    color: #fff;
    font-family: var(--rt-fuente);
    font-weight: 700;
    letter-spacing: .04em;
    font-size: 19px;
}

/* Icono de marca: se elige en Configuraciones > Empresa */
.app-header__logo .rt-marca-icono {
    color: var(--rt-acento);
    margin-right: 10px;
    font-size: 16px;
}

/* Logo del sistema (si se subio uno, reemplaza al icono) */
.app-header__logo .rt-marca-logo {
    max-height: 32px;
    max-width: 60px;
    object-fit: contain;
    vertical-align: middle;
    margin: -3px 10px 0 0;
}

.app-header__logo:hover,
.app-header__logo:focus {
    color: #fff;
    text-decoration: none;
}

.app-sidebar__toggle,
.app-sidebar__toggle:hover,
.app-sidebar__toggle:focus {
    color: var(--rt-texto);
    background: transparent;
}

.app-sidebar__toggle:hover {
    background: var(--rt-primario-suave);
    color: var(--rt-primario);
}

.app-header .text-white,
.app-header .text-light,
.app-header #fecha2 {
    color: var(--rt-texto-suave) !important;
}

.app-header #fecha2 {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .05em;
    background: var(--rt-fondo);
    border: 1px solid var(--rt-borde);
    border-radius: 999px;
    padding: 5px 14px !important;
}

.app-nav__item {
    color: var(--rt-texto);
    border-radius: 999px;
}

.app-nav__item:hover,
.app-nav__item:focus {
    background: var(--rt-primario-suave);
    color: var(--rt-primario);
}

.app-nav__item:hover .text-white,
.app-nav__item:focus .text-white {
    color: var(--rt-primario) !important;
}

.app-header .dropdown-menu.settings-menu {
    border: 1px solid var(--rt-borde) !important;
    border-radius: var(--rt-radio);
    box-shadow: var(--rt-sombra-hover);
    padding: 6px;
    overflow: hidden;
}

.dropdown-item {
    border-radius: var(--rt-radio-sm);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--rt-primario-suave);
    color: var(--rt-primario-hover);
}

/* ---------- Barra lateral ---------- */
.app-sidebar {
    background-color: var(--rt-sidebar);
    box-shadow: none;
    border-right: 1px solid rgba(0, 0, 0, .2);
}

.app-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, .15);
    border-radius: 8px;
}

.app-sidebar__user {
    margin: 4px 12px 14px;
    padding: 12px;
    border-radius: var(--rt-radio);
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .06);
}

.app-sidebar__user-avatar {
    border-radius: 50%;
    border: 2px solid var(--rt-acento);
    width: 40px !important;
    height: 40px !important;
    margin-right: 12px;
}

.app-sidebar__user-name a.text-warning {
    color: #fbd38d !important;
    font-weight: 600;
    font-size: 14px;
}

.app-sidebar__user-name label {
    color: var(--rt-sidebar-texto-suave) !important;
    font-size: 11px;
    letter-spacing: .08em;
}

.app-menu {
    padding: 0 10px 20px;
}

.app-menu > li {
    margin-bottom: 2px;
}

.app-menu__item {
    color: var(--rt-sidebar-texto);
    border-left: 0;
    border-radius: var(--rt-radio-sm);
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
}

.app-menu__icon {
    color: var(--rt-sidebar-texto-suave);
    text-align: center;
    margin-right: 6px;
}

.app-menu__item.active,
.app-menu__item:hover,
.app-menu__item:focus {
    background: var(--rt-sidebar-hover);
    color: #fff;
}

.app-menu__item:hover > .app-menu__icon,
.app-menu__item:focus > .app-menu__icon {
    color: var(--rt-acento);
}

.treeview.is-expanded [data-toggle="treeview"] {
    background: var(--rt-primario);
    color: #fff;
    font-weight: 600;
}

.treeview.is-expanded [data-toggle="treeview"] .app-menu__icon {
    color: #fff;
}

.treeview-menu {
    background: transparent;
    border-radius: 0 0 var(--rt-radio-sm) var(--rt-radio-sm);
}

.treeview.is-expanded .treeview-menu {
    padding: 4px 0 6px;
}

.treeview-item {
    color: var(--rt-sidebar-texto-suave);
    padding: 8px 10px 8px 22px;
    margin: 1px 0;
    border-radius: var(--rt-radio-sm);
    font-size: 13.5px;
}

/* Saldo pendiente de una factura con abonos */
.rt-saldo-pendiente {
    background: #fffbeb;
    border-color: #f59e0b !important;
    color: #92400e;
}

/* Subtitulos dentro de un grupo del menu (p. ej. Facturas / Notas de credito) */
.treeview-menu .rt-menu-seccion {
    padding: 10px 10px 3px 22px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--rt-acento);
    opacity: .85;
    list-style: none;
}

.treeview-menu .rt-menu-seccion:first-child {
    padding-top: 4px;
}

.treeview-item .icon {
    width: 18px;
    text-align: center;
    opacity: .85;
}

.treeview-item.active,
.treeview-item:hover,
.treeview-item:focus {
    background: var(--rt-sidebar-hover);
    color: #fff;
}

.treeview-item:hover > .icon {
    color: var(--rt-acento);
    opacity: 1;
}

.app-menu .text-danger {
    color: #f87171 !important;
}

/* Barra lateral colapsada: el nombre de la seccion flotante */
@media (min-width: 768px) {
    .sidebar-mini.sidenav-toggled .app-menu__label {
        background: var(--rt-primario);
        border-radius: 0 var(--rt-radio-sm) var(--rt-radio-sm) 0;
    }

    .sidebar-mini.sidenav-toggled .treeview-menu {
        background: var(--rt-sidebar);
    }

    .sidebar-mini.sidenav-toggled .app-menu {
        padding: 0 4px 20px;
    }
}

/* ---------- Area de contenido ---------- */
.app-content {
    background-color: var(--rt-fondo);
}

.app-title {
    background: var(--rt-superficie);
    border: 1px solid var(--rt-borde);
    border-radius: var(--rt-radio);
    box-shadow: var(--rt-sombra);
    padding: 16px 22px;
    margin: -10px 0 24px;
}

@media (max-width: 480px) {
    .app-title {
        margin: -5px 0 15px;
        padding: 14px 16px;
    }
}

.app-title h3,
.app-title h1 {
    color: var(--rt-texto);
    font-weight: 700;
    font-size: 1.35rem;
    margin: 0;
    letter-spacing: -.01em;
}

.app-title h3::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 20px;
    border-radius: 3px;
    background: var(--rt-primario);
    margin-right: 10px;
    vertical-align: -3px;
}

.app-breadcrumb .breadcrumb-item,
.app-breadcrumb .breadcrumb-item a {
    color: var(--rt-texto-suave);
    font-size: 13px;
}

.app-breadcrumb .breadcrumb-item:last-child a {
    color: var(--rt-primario);
    font-weight: 600 !important;
}

.sticky-footer {
    color: var(--rt-texto-suave);
    font-size: 12px;
}

/* ---------- Tarjetas ---------- */
.card {
    border: 1px solid var(--rt-borde);
    border-radius: var(--rt-radio);
    box-shadow: var(--rt-sombra) !important;
    overflow: hidden;
    background: var(--rt-superficie);
}

.card-body,
.modal-body {
    background-color: var(--rt-superficie);
}

.card-header {
    border-bottom: 1px solid var(--rt-borde);
}

.card-header.bg-primary {
    background: var(--rt-primario) !important;
    border-bottom: 0;
}

.card-header.bg-primary h5,
.card-header.bg-primary h4 {
    font-weight: 600 !important;
    letter-spacing: .03em;
    font-size: 15px;
}

.card-header.bg-primary .text-warning {
    color: #fde3c4 !important;
}

.card-header.p-2 {
    padding: 12px 16px !important;
}

/* Tarjetas de indicadores del panel (franja superior de color) */
.card.h-100 > .card-header.p-1 {
    padding: 0 !important;
    height: 4px;
    min-height: 4px;
}

.card.h-100 {
    transition: transform .15s ease, box-shadow .15s ease;
}

.card.h-100:hover {
    transform: translateY(-2px);
    box-shadow: var(--rt-sombra-hover) !important;
}

.card.h-100 .pointer {
    color: var(--rt-texto-suave) !important;
    font-size: 12px !important;
    font-weight: 700;
    letter-spacing: .06em;
    text-decoration: none;
}

.card.h-100 .pointer:hover {
    color: var(--rt-primario) !important;
}

.card.h-100 .h5 {
    font-size: 1.6rem;
    font-weight: 700 !important;
    color: var(--rt-texto);
}

.card.h-100 .col-auto > i.fa-2x {
    width: 52px;
    height: 52px;
    line-height: 52px;
    text-align: center;
    border-radius: 14px;
    font-size: 22px;
    background: var(--rt-primario-suave);
    color: var(--rt-primario) !important;
}

/* Rotacion de colores por tarjeta para distinguirlas de un vistazo */
.rt-kpi:nth-child(4n+2) .card-header.p-1 { background: var(--rt-oliva) !important; }
.rt-kpi:nth-child(4n+2) .col-auto > i.fa-2x { background: var(--rt-oliva-suave); color: var(--rt-oliva) !important; }
.rt-kpi:nth-child(4n+3) .card-header.p-1 { background: var(--rt-acento) !important; }
.rt-kpi:nth-child(4n+3) .col-auto > i.fa-2x { background: var(--rt-canela-suave); color: var(--rt-canela) !important; }
.rt-kpi:nth-child(4n+4) .card-header.p-1 { background: var(--rt-vino) !important; }
.rt-kpi:nth-child(4n+4) .col-auto > i.fa-2x { background: var(--rt-vino-suave); color: var(--rt-vino) !important; }

/* ---------- Botones ---------- */
.btn {
    border-radius: var(--rt-radio-sm);
    font-weight: 600;
    letter-spacing: .02em;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn:focus,
.btn.focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rt-primario) 20%, transparent) !important;
}

.btn-primary {
    background-color: var(--rt-primario);
    border-color: var(--rt-primario);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
    background-color: var(--rt-primario-hover);
    border-color: var(--rt-primario-hover);
    color: #fff;
}

.btn-warning {
    background-color: var(--rt-acento);
    border-color: var(--rt-acento);
    color: #2b1d0e;
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:not(:disabled):not(.disabled):active {
    background-color: var(--rt-acento-hover);
    border-color: var(--rt-acento-hover);
    color: #1f1409;
}

.card-header .btn-warning {
    background: #fff;
    border-color: #fff;
    color: var(--rt-primario-hover);
}

.card-header .btn-warning:hover,
.card-header .btn-warning:focus {
    background: var(--rt-primario-suave);
    border-color: var(--rt-primario-suave);
    color: var(--rt-primario-hover);
}

.card-header .btn-warning .text-gray-400 {
    color: inherit !important;
}

.btn-success {
    background-color: var(--rt-oliva);
    border-color: var(--rt-oliva);
}

.btn-success:hover,
.btn-success:focus,
.btn-success:not(:disabled):not(.disabled):active {
    background-color: #4a6418;
    border-color: #4a6418;
}

.btn-info {
    background-color: #0e7490;
    border-color: #0e7490;
}

.btn-info:hover,
.btn-info:focus {
    background-color: #0b5f76;
    border-color: #0b5f76;
}

.btn-danger {
    background-color: #b91c1c;
    border-color: #b91c1c;
}

.btn-danger:hover,
.btn-danger:focus {
    background-color: #991b1b;
    border-color: #991b1b;
}

.btn-secondary {
    background-color: #fff;
    border-color: var(--rt-borde-fuerte);
    color: var(--rt-texto);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--rt-fondo);
    border-color: var(--rt-borde-fuerte);
    color: var(--rt-texto);
}

.btn-outline-primary {
    color: var(--rt-primario);
    border-color: var(--rt-primario);
}

.btn-outline-primary:hover {
    background: var(--rt-primario);
    border-color: var(--rt-primario);
    color: #fff;
}

/* ---------- Colores utilitarios ---------- */
.bg-primary { background-color: var(--rt-primario) !important; }
.bg-success { background-color: var(--rt-oliva) !important; }
.bg-warning { background-color: var(--rt-acento) !important; }
.bg-danger  { background-color: #b91c1c !important; }
.bg-info    { background-color: #0e7490 !important; }
.bg-dark    { background-color: var(--rt-sidebar) !important; }
.bg-light   { background-color: #f6f1ea !important; }

.text-primary { color: var(--rt-primario) !important; }
.text-success { color: var(--rt-oliva) !important; }
.text-info    { color: #0e7490 !important; }
.text-danger  { color: #b91c1c !important; }

.border-primary { border-color: var(--rt-borde-fuerte) !important; }

.badge-primary { background-color: var(--rt-primario); }
.badge-success { background-color: var(--rt-oliva); }
.badge-warning { background-color: var(--rt-acento); color: #2b1d0e; }

/* Campos resaltados (antes amarillo khaki) */
.bg-amarillo {
    background-color: #fffaf3 !important;
}

/* ---------- Formularios ---------- */
.form-control,
.custom-select {
    border: 1px solid var(--rt-borde-fuerte);
    border-radius: var(--rt-radio-sm);
    color: var(--rt-texto);
}

.form-control:focus,
.custom-select:focus {
    border-color: var(--rt-primario);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rt-primario) 15%, transparent);
}

label,
.col-form-label {
    color: var(--rt-texto);
    font-weight: 600;
}

.input-group-text {
    background: var(--rt-fondo);
    border-color: var(--rt-borde-fuerte);
    color: var(--rt-texto-suave);
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--rt-primario);
    border-color: var(--rt-primario);
}

.select2-container--bootstrap4 .select2-selection {
    border: 1px solid var(--rt-borde-fuerte) !important;
    border-radius: var(--rt-radio-sm) !important;
}

.select2-container--bootstrap4.select2-container--focus .select2-selection {
    border-color: var(--rt-primario) !important;
}

.select2-container--bootstrap4 .select2-results__option--highlighted,
.select2-container--bootstrap4 .select2-results__option--highlighted.select2-results__option[aria-selected=true] {
    background-color: var(--rt-primario) !important;
}

#search_select ~ .select2-container--bootstrap4 .select2-selection,
#search_select ~ .select2-container--bootstrap4 .select2-search--inline .select2-search__field {
    background-color: var(--rt-sidebar) !important;
}

.input_lg ~ .select2-container--bootstrap4 .select2-selection {
    background-color: var(--rt-texto-suave) !important;
}

.ft {
    background-color: var(--rt-canela-suave);
    border-color: var(--rt-acento);
}

.ft:focus {
    background-color: #fde7c8;
}

/* ---------- Tablas ---------- */
.table {
    color: var(--rt-texto);
}

table.table.border {
    border-color: var(--rt-borde) !important;
    border-radius: var(--rt-radio-sm);
}

table > thead > tr > th,
table > thead > tr > th.bg-light {
    background: var(--rt-fondo) !important;
    color: var(--rt-texto-suave) !important;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase !important;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--rt-borde) !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

table > tbody > tr > td {
    color: var(--rt-texto) !important;
    border-top-color: var(--rt-borde) !important;
    vertical-align: middle !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #fcfaf7;
}

.table-hover tbody tr:hover {
    background-color: var(--rt-primario-suave);
}

.page-item.active .page-link {
    background-color: var(--rt-primario);
    border-color: var(--rt-primario);
}

.page-link {
    color: var(--rt-primario);
    border-color: var(--rt-borde);
    border-radius: 6px;
    margin: 0 2px;
}

.page-link:hover {
    color: var(--rt-primario-hover);
    background: var(--rt-primario-suave);
}

div.dataTables_wrapper div.dataTables_filter input,
div.dataTables_wrapper div.dataTables_length select {
    border-radius: var(--rt-radio-sm);
    border: 1px solid var(--rt-borde-fuerte);
}

.botonPagination {
    border-color: var(--rt-primario);
    border-radius: var(--rt-radio-sm);
}

.botonPagination:hover {
    background-color: var(--rt-primario-suave) !important;
}

/* ---------- Modales ---------- */
.modal-content {
    border: 0;
    border-radius: var(--rt-radio);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(42, 29, 23, .25);
}

.modal-header {
    border-bottom: 1px solid var(--rt-borde);
}

.modal-header.bg-primary .close,
.modal-header.bg-primary .modal-title {
    color: #fff;
}

.modal-footer {
    border-top: 1px solid var(--rt-borde);
    background: var(--rt-fondo);
}

/* ---------- Alertas SweetAlert2 ---------- */
.swal2-popup {
    border-radius: 16px !important;
    font-family: var(--rt-fuente) !important;
}

.swal2-styled.swal2-confirm {
    background-color: var(--rt-primario) !important;
    border-radius: var(--rt-radio-sm) !important;
}

.swal2-styled.swal2-cancel {
    border-radius: var(--rt-radio-sm) !important;
}

/* ---------- Inicio de sesion ---------- */
body.rt-login {
    background: var(--rt-sidebar) !important;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(245, 158, 11, .18) 0, transparent 40%),
        radial-gradient(circle at 85% 80%, color-mix(in srgb, var(--rt-primario) 30%, transparent) 0, transparent 45%) !important;
    min-height: 100vh;
    background-attachment: fixed !important;
}

body.rt-login .login-content::before {
    background: transparent;
}

body.rt-login .login-content .login-box {
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .35);
    min-height: 0;
    width: 380px;
    max-width: calc(100vw - 32px);
    overflow: hidden;
}

body.rt-login .login-content .login-box .login-form {
    padding: 36px 34px 30px;
    position: relative;
}

body.rt-login .rt-login-logo {
    display: block;
    max-width: 220px;
    max-height: 90px;
    margin: 0 auto 14px;
    object-fit: contain;
}

body.rt-login .rt-login-icono {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 18px;
    background: var(--rt-primario-suave);
    color: var(--rt-primario);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

body.rt-login .login-head {
    border-bottom: 0;
    margin-bottom: 4px;
    padding-bottom: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .02em;
}

body.rt-login .login-head a {
    color: var(--rt-texto) !important;
}

body.rt-login .rt-login-sub {
    color: var(--rt-texto-suave);
    font-size: 13px;
    margin-bottom: 24px;
}

body.rt-login .login-form .form-control {
    height: 46px;
    text-align: left !important;
    padding-left: 14px;
    background: #fffaf3 !important;
}

body.rt-login .login-form .btn-primary {
    height: 46px;
    font-size: 15px;
}

body.rt-login .login-form .btn-primary .text-warning {
    color: #fde3c4 !important;
}

body.rt-login #mostrar {
    display: block;
    text-align: right;
    font-size: 12px;
    margin-top: 6px;
    color: var(--rt-texto-suave);
}

body.rt-login #mostrar:hover {
    color: var(--rt-primario);
}

/* Boton "+" de filas colapsadas (DataTables responsive) */
table.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th:first-child::before {
    background-color: var(--rt-primario) !important;
    box-shadow: none !important;
}

table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td:first-child::before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th:first-child::before {
    background-color: var(--rt-oliva) !important;
}

.app-breadcrumb {
    white-space: nowrap;
    flex-wrap: nowrap;
}

/* ============================================================
   Menu lateral contraido (solo iconos, >= 768px)
   - El logo del encabezado se reduce al icono de cubiertos.
   - La tarjeta del usuario se vuelve solo el avatar centrado.
   ============================================================ */
.app-header__logo {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: width .3s ease, font-size .2s ease;
}

@media (min-width: 768px) {
    .sidebar-mini.sidenav-toggled .app-header__logo {
        width: 50px;
        padding: 0;
        font-size: 0;
        text-align: center;
    }

    .sidebar-mini.sidenav-toggled .app-header__logo .rt-marca-icono {
        margin-right: 0;
        font-size: 18px;
    }

    .sidebar-mini.sidenav-toggled .app-header__logo .rt-marca-logo {
        margin-right: 0;
        max-width: 38px;
    }

    .sidebar-mini.sidenav-toggled .app-sidebar__user {
        margin: 6px 0 12px;
        padding: 4px 0;
        background: transparent;
        border: 0;
        justify-content: center;
    }

    .sidebar-mini.sidenav-toggled .app-sidebar__user-avatar {
        width: 34px !important;
        height: 34px !important;
        margin: 0;
    }

    .sidebar-mini.sidenav-toggled .app-menu {
        padding: 0 4px 20px;
    }

    .sidebar-mini.sidenav-toggled .app-menu__item {
        padding: 10px 0 10px 8px;
    }

    .sidebar-mini.sidenav-toggled .app-menu__label {
        left: 46px;
        background: var(--rt-primario);
        color: #fff;
        font-weight: 600;
    }

    .sidebar-mini.sidenav-toggled .treeview:hover .app-menu__item {
        background: var(--rt-primario);
    }

    .sidebar-mini.sidenav-toggled .treeview:hover .app-menu__item .app-menu__icon {
        color: #fff;
    }

    .sidebar-mini.sidenav-toggled .treeview-menu {
        left: 46px;
        background: var(--rt-sidebar);
        border-radius: 0 0 var(--rt-radio-sm) 0;
        box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
    }
}

/* ============================================================
   Paletas seleccionables (Perfil > Apariencia)
   <html data-tema="..."> lo fija un script en el <head> segun la
   preferencia guardada del usuario. Sin atributo = terracota.
   Las variables del POS (--pos-*) se enlazan a las del tema para
   que la pantalla de venta cambie junto con el resto.
   ============================================================ */
html:root {
    --rt-panel: #fdf6ec;             /* tinte de paneles del POS */
    --pos-primario: var(--rt-primario);
    --pos-primario-hover: var(--rt-primario-hover);
    --pos-crema: var(--rt-panel);
    --pos-borde: var(--rt-borde);
    --pos-scroll-thumb: var(--rt-primario);
    --pos-scroll-thumb-hover: var(--rt-primario-hover);
    --pos-scroll-track: color-mix(in srgb, var(--rt-primario) 12%, #fff);
}

html[data-tema="vino"] {
    --rt-primario: #9f1239;
    --rt-primario-hover: #881337;
    --rt-primario-suave: #fce7ee;
    --rt-sidebar: #2b1419;
    --rt-sidebar-sub: #220f13;
    --rt-fondo: #f9f4f5;
    --rt-panel: #fdf2f5;
    --rt-borde: #efdfe4;
    --rt-borde-fuerte: #e0c9d0;
    --rt-vino: #6d28d9;
    --rt-vino-suave: #efe7fc;
}

html[data-tema="oliva"] {
    --rt-primario: #4d7c0f;
    --rt-primario-hover: #3f6212;
    --rt-primario-suave: #eef5e0;
    --rt-sidebar: #1d2415;
    --rt-sidebar-sub: #161c10;
    --rt-fondo: #f5f6ef;
    --rt-panel: #f7f9ef;
    --rt-borde: #e2e7d3;
    --rt-borde-fuerte: #cfd8bb;
    --rt-oliva: #b45309;
    --rt-oliva-suave: #fdf1e1;
}

html[data-tema="oceano"] {
    --rt-primario: #1d4ed8;
    --rt-primario-hover: #1e40af;
    --rt-primario-suave: #e6edfd;
    --rt-sidebar: #0f172a;
    --rt-sidebar-sub: #0b1120;
    --rt-sidebar-texto: #e2e8f0;
    --rt-sidebar-texto-suave: #94a3b8;
    --rt-fondo: #f3f5f9;
    --rt-panel: #f1f5fd;
    --rt-borde: #dde4f0;
    --rt-borde-fuerte: #c8d3e6;
    --rt-texto: #1e293b;
    --rt-texto-suave: #64748b;
}

html[data-tema="menta"] {
    --rt-primario: #0f766e;
    --rt-primario-hover: #115e59;
    --rt-primario-suave: #dff3f1;
    --rt-sidebar: #0f1f1d;
    --rt-sidebar-sub: #0a1614;
    --rt-sidebar-texto: #e0ece9;
    --rt-sidebar-texto-suave: #93aaa5;
    --rt-fondo: #f2f6f5;
    --rt-panel: #eff8f6;
    --rt-borde: #d7e7e4;
    --rt-borde-fuerte: #bfd8d3;
    --rt-texto: #1d2b29;
    --rt-texto-suave: #5d706c;
}

html[data-tema="grafito"] {
    --rt-primario: #374151;
    --rt-primario-hover: #1f2937;
    --rt-primario-suave: #eceef1;
    --rt-sidebar: #111827;
    --rt-sidebar-sub: #0b1220;
    --rt-sidebar-texto: #e5e7eb;
    --rt-sidebar-texto-suave: #9ca3af;
    --rt-fondo: #f4f5f7;
    --rt-panel: #f6f7f9;
    --rt-borde: #e2e5ea;
    --rt-borde-fuerte: #cdd2da;
    --rt-texto: #1f2937;
    --rt-texto-suave: #6b7280;
}

/* Textos oscuros del POS siguen al tema (el cafe solo en terracota) */
html[data-tema="oceano"],
html[data-tema="menta"],
html[data-tema="grafito"] {
    --pos-marron: var(--rt-texto);
}

/* ---------- Selector de apariencia (perfil) ---------- */
.rt-temas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.rt-tema-opcion {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 2px solid var(--rt-borde);
    border-radius: var(--rt-radio);
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.rt-tema-opcion:hover {
    transform: translateY(-2px);
    box-shadow: var(--rt-sombra-hover);
}

.rt-tema-opcion:focus {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rt-primario) 25%, transparent);
}

.rt-tema-opcion input { position: absolute; opacity: 0; pointer-events: none; }

.rt-tema-opcion.activo {
    border-color: var(--rt-primario);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rt-primario) 20%, transparent);
}

.rt-tema-muestra {
    display: flex;
    height: 54px;
}

.rt-tema-muestra span:nth-child(1) { flex: 0 0 30%; }
.rt-tema-muestra span:nth-child(2) { flex: 1 1 auto; }
.rt-tema-muestra span:nth-child(3) { flex: 0 0 18%; }

.rt-tema-nombre {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    font-weight: 600;
    font-size: 13px;
    color: var(--rt-texto);
}

.rt-tema-nombre i {
    color: var(--rt-primario);
    visibility: hidden;
}

.rt-tema-opcion.activo .rt-tema-nombre i {
    visibility: visible;
}

/* Texto secundario neutro (el tema base lo pintaba verde) */
.text-muted { color: var(--rt-texto-suave) !important; }

/* ============================================================
   Campana de notificaciones (stock bajo)
   ============================================================ */
.rt-notif > .app-nav__item {
    position: relative;
}

.rt-notif-badge {
    position: absolute;
    top: 6px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 2px solid #fff;
    box-sizing: content-box;
}

.rt-notif-badge[hidden] {
    display: none;
}

.rt-notif.rt-notif-activa > .app-nav__item .fa-bell {
    color: var(--rt-primario);
}

@keyframes rt-campana {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(16deg); }
    30% { transform: rotate(-14deg); }
    45% { transform: rotate(10deg); }
    60% { transform: rotate(-6deg); }
    75% { transform: rotate(3deg); }
}

.rt-notif.rt-notif-sacudir > .app-nav__item .fa-bell {
    animation: rt-campana .9s ease;
    transform-origin: 50% 0;
}

.rt-notif-menu {
    width: 330px;
    max-width: calc(100vw - 24px);
    padding: 0;
    border: 1px solid var(--rt-borde);
    border-radius: var(--rt-radio);
    box-shadow: var(--rt-sombra-hover);
    overflow: hidden;
}

.rt-notif-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: var(--rt-primario);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
}

.rt-notif-cabecera small {
    font-weight: 500;
    opacity: .9;
}

.rt-notif-lista {
    max-height: 320px;
    overflow-y: auto;
}

.rt-notif-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--rt-borde);
}

.rt-notif-item:hover {
    background: var(--rt-primario-suave);
}

.rt-notif-icono {
    flex: 0 0 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.rt-notif-icono.bajo { background: #fef3c7; color: #b45309; }
.rt-notif-icono.agotado { background: #fee2e2; color: #b91c1c; }

.rt-notif-texto {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.rt-notif-texto b {
    font-size: 13px;
    color: var(--rt-texto);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rt-notif-texto small {
    font-size: 11px;
    color: var(--rt-texto-suave);
}

.rt-notif-stock {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.rt-notif-stock.bajo { background: #fef3c7; color: #92400e; }
.rt-notif-stock.agotado { background: #fee2e2; color: #991b1b; }

.rt-notif-vacio,
.rt-notif-mas {
    padding: 16px 14px;
    text-align: center;
    color: var(--rt-texto-suave);
    font-size: 13px;
}

.rt-notif-vacio .fa-check-circle {
    color: var(--rt-oliva);
}

.rt-notif-mas {
    padding: 8px 14px;
    font-size: 12px;
}

.rt-notif-pie {
    display: block;
    padding: 9px 14px;
    text-align: center;
    font-size: 12.5px;
    font-weight: 600;
    background: var(--rt-fondo);
    color: var(--rt-primario);
    border-top: 1px solid var(--rt-borde);
}

.rt-notif-pie:hover {
    text-decoration: none;
    background: var(--rt-primario-suave);
    color: var(--rt-primario-hover);
}

/* ============================================================
   Ambiente SRI (pruebas / produccion)
   .rt-ambiente: pildora que indica en que ambiente se factura.
   .rt-secuencial-grupo: tarjetas de secuenciales en Empresa.
   ============================================================ */
.rt-ambiente {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    white-space: nowrap;
    line-height: 1.4;
    cursor: help;
}

.rt-ambiente.pruebas {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.rt-ambiente.produccion {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

/* Sobre fondos de color (franjas) va con fondo blanco para destacar */
.card-header .rt-ambiente.pruebas { background: #fffbeb; }
.card-header .rt-ambiente.produccion { background: #f0fdf4; }

.rt-ambiente.pruebas i {
    animation: rt-ambiente-pulso 1.6s ease-in-out infinite;
}

@keyframes rt-ambiente-pulso {
    50% { transform: scale(1.2) rotate(-10deg); }
}

/* Pildora dentro del boton "Autorizar SRI" */
.rt-ambiente-boton {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    vertical-align: 1px;
}

.rt-secuencial-grupo {
    height: 100%;
    padding: 14px 16px;
    border-radius: var(--rt-radio);
    border: 1px solid var(--rt-borde);
    background: #fff;
}

.rt-secuencial-grupo.en-uso {
    border: 2px solid var(--rt-primario);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--rt-primario) 15%, transparent);
}

.rt-secuencial-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--rt-texto);
}

.rt-secuencial-titulo i { color: var(--rt-primario); }

/* Selector de ambiente bajo los paneles de secuenciales (Empresa) */
.rt-ambiente-selector {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-top: 4px;
    padding: 14px 16px;
    border-radius: var(--rt-radio);
    background: #fff;
    border: 2px dashed var(--rt-borde-fuerte);
}

.rt-ambiente-selector label { font-weight: 700; }

.rt-ambiente-selector-campo {
    flex: 0 1 320px;
    min-width: 220px;
}

/* Aviso del ambiente de las cifras (panel y reportes) */
.rt-ambiente-aviso {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: var(--rt-radio-sm);
    font-size: 13px;
    line-height: 1.4;
}

.rt-ambiente-aviso i { font-size: 16px; flex: 0 0 auto; }
.rt-ambiente-aviso.pruebas { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.rt-ambiente-aviso.produccion { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }

@media (prefers-reduced-motion: reduce) {
    .rt-ambiente.pruebas i { animation: none; }
}

/* Encabezado compacto de la pantalla de venta */
body:has(#pos_layout) .rt-notif-badge {
    top: 0;
    right: 2px;
    min-width: 14px;
    height: 14px;
    line-height: 14px;
    font-size: 9px;
    border-width: 1px;
}

/* ============================================================
   Panel: tablas de alertas en pestañas
   ============================================================ */
.rt-pestanas-card .card-header {
    background: var(--rt-superficie);
    padding: 0 12px;
    border-bottom: 1px solid var(--rt-borde);
}

.rt-pestanas-card .nav-tabs {
    border-bottom: 0;
    gap: 4px;
}

.rt-pestanas-card .nav-tabs .nav-link {
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: 14px 14px 11px;
    color: var(--rt-texto-suave);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .03em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rt-pestanas-card .nav-tabs .nav-link:hover {
    color: var(--rt-texto);
    background: transparent;
}

.rt-pestanas-card .nav-tabs .nav-link.active {
    color: var(--rt-texto);
    background: transparent;
}

.rt-pestanas-card .nav-tabs .nav-link.active.rt-tab-atencion { border-bottom-color: #b91c1c; }
.rt-pestanas-card .nav-tabs .nav-link.active.rt-tab-stock { border-bottom-color: #d97706; }
.rt-pestanas-card .rt-tab-atencion i { color: #b91c1c; }
.rt-pestanas-card .rt-tab-stock i { color: #d97706; }

.rt-contador {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    background: var(--rt-fondo);
    color: var(--rt-texto-suave);
    border: 1px solid var(--rt-borde);
}

.rt-contador.con-datos.rojo { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.rt-contador.con-datos.ambar { background: #fef3c7; color: #92400e; border-color: #fde68a; }

.rt-pestanas-card .tab-content > .tab-pane {
    padding-top: 4px;
}

/* Pestanas en una sola fila (el tema base apilaba los .nav) */
.rt-pestanas-card .nav-tabs { display: flex; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.rt-pestanas-card .nav-tabs .nav-link { white-space: nowrap; padding-left: 10px; padding-right: 10px; }
@media (max-width: 575.98px) { .rt-pestanas-card .nav-tabs .nav-link { font-size: 11.5px; } }
.rt-pestanas-card .nav-tabs .nav-item { margin-bottom: 0; }

/* Selector de icono del sistema (Configuraciones > Empresa) */
.rt-iconos-sistema { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.rt-icono-opcion { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; cursor: pointer; text-align: center; }
.rt-icono-opcion input { position: absolute; opacity: 0; pointer-events: none; }
.rt-icono-caja { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 10px;
    background: var(--rt-superficie); border: 2px solid var(--rt-borde); color: var(--rt-texto); font-size: 20px; transition: all .15s; }
.rt-icono-opcion small { font-size: 11px; line-height: 1.2; }
.rt-icono-opcion:hover .rt-icono-caja { border-color: var(--rt-borde-fuerte); }
.rt-icono-opcion input:checked + .rt-icono-caja { background: var(--rt-primario); border-color: var(--rt-primario); color: #fff; }
.rt-icono-opcion input:focus-visible + .rt-icono-caja { outline: 2px solid var(--rt-acento); outline-offset: 2px; }
.rt-logo-preview { display: inline-flex; align-items: center; justify-content: center; height: 48px; min-width: 48px;
    max-width: 160px; padding: 4px 8px; border: 1px solid var(--rt-borde); border-radius: 8px; background: var(--rt-sidebar); }
.rt-logo-preview img { max-height: 38px; max-width: 144px; object-fit: contain; }
.rt-favicon-preview { width: 32px; height: 32px; object-fit: contain; border: 1px solid var(--rt-borde); border-radius: 6px; background: #fff; }

/* ============================================================
   Notificaciones por tipo: AMBAR = por acabarse (stock),
   MORADO = por caducar / caducado.
   ============================================================ */
.rt-notif-badge.rt-badge-stock { background: #d97706; }
.rt-notif-badge.rt-badge-caduca { background: #7c3aed; }

/* Con los dos tipos a la vez: ambar a la derecha y morado a la izquierda de la campana */
.rt-notif.rt-notif-doble > .app-nav__item {
    padding-left: 22px;
    padding-right: 22px;
}

.rt-notif.rt-notif-doble .rt-notif-badge {
    min-width: 14px;
    height: 16px;
    line-height: 16px;
    padding: 0 3px;
    font-size: 10px;
    right: 0;
}

.rt-notif.rt-notif-doble .rt-badge-caduca {
    right: auto;
    left: 0;
}

body:has(#pos_layout) .rt-notif.rt-notif-doble .rt-badge-caduca {
    right: auto;
    left: 0;
}

.rt-notif-lista {
    max-height: 420px;
}

.rt-notif-seccion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    border-left: 4px solid;
    position: sticky;
    top: 0;
    z-index: 1;
}

.rt-notif-seccion small {
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.rt-notif-seccion.rt-sec-stock { background: #fef3c7; color: #92400e; border-color: #d97706; }
.rt-notif-seccion.rt-sec-caduca { background: #ede9fe; color: #5b21b6; border-color: #7c3aed; }

.rt-notif-item.rt-tipo-stock { border-left: 4px solid #fcd34d; }
.rt-notif-item.rt-tipo-caduca { border-left: 4px solid #c4b5fd; }
.rt-notif-item.rt-tipo-stock:hover { background: #fffbeb; }
.rt-notif-item.rt-tipo-caduca:hover { background: #f5f3ff; }

.rt-notif-icono.por-caducar { background: #ede9fe; color: #6d28d9; }
.rt-notif-icono.caducado { background: #5b21b6; color: #fff; }
.rt-notif-stock.por-caducar { background: #ede9fe; color: #5b21b6; }
.rt-notif-stock.caducado { background: #5b21b6; color: #fff; }

.rt-notif-pie.rt-sec-stock { color: #92400e; border-bottom: 1px solid var(--rt-borde); }
.rt-notif-pie.rt-sec-caduca { color: #5b21b6; border-bottom: 1px solid var(--rt-borde); }
.rt-notif-pie.rt-sec-stock:hover { background: #fffbeb; color: #78350f; }
.rt-notif-pie.rt-sec-caduca:hover { background: #f5f3ff; color: #4c1d95; }
/* Los avisos son enlaces a la edicion del producto */
a.rt-notif-item {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.rt-notif-item:hover {
    text-decoration: none;
    color: inherit;
}

.rt-notif-ir {
    flex: 0 0 auto;
    font-size: 11px;
    color: var(--rt-texto-suave);
    opacity: .5;
    transition: transform .15s, opacity .15s;
}

a.rt-notif-item:hover .rt-notif-ir {
    opacity: 1;
    transform: translateX(2px);
}
/* Administrar Empresa: bloque de WhatsApp */
.rt-whatsapp-config {
    padding: 12px 16px;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #25d366;
    border-radius: var(--rt-radio-sm);
    background: #f0fdf4;
}

.rt-whatsapp-config h6 {
    font-weight: 700;
    color: #15803d;
    text-transform: uppercase;
    font-size: 13px;
    margin-bottom: 6px;
}

.rt-whatsapp-config h6 .fa-whatsapp {
    font-size: 18px;
    color: #25d366;
}