:root {
    --bg-page: #f3dac1;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --surface-1: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --border-color: #dbe3ec;
    --shadow-color: rgba(15, 23, 42, 0.08);
    --navbar-bg: rgb(244, 160, 50);
    --dropdown-bg: #ffffff;
    --dropdown-hover-bg: #f3ac56;
    --dropdown-hover-text: #ffffff;
    --table-head-bg: #f1f5f9;
    --table-striped-bg: #f9fafb;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --input-text: #212529;
    --focus-ring: rgba(13, 110, 253, 0.25);
}

html[data-theme="dark"] {
    --bg-page: #111827;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --surface-1: #1f2937;
    --surface-2: #243244;
    --surface-3: #2c3b4f;
    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.45);
    --navbar-bg: #1a2433;
    --dropdown-bg: #1f2937;
    --dropdown-hover-bg: #314158;
    --dropdown-hover-text: #f8fafc;
    --table-head-bg: #223044;
    --table-striped-bg: #27364a;
    --input-bg: #1f2937;
    --input-border: #475569;
    --input-text: #e5e7eb;
    --focus-ring: rgba(96, 165, 250, 0.35);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    transition: background-color 0.25s ease, color 0.25s ease;
}

.navbar-brand img {
    height: 60px;
}

.navbar {
    background-color: var(--navbar-bg);
    transition: background-color 0.25s ease;
}

main {
    margin-top: 70px;
}

.navbar-nav .nav-link {
    color: var(--text-main);
    -webkit-text-stroke: 0.5px #0d6efd;
    font-size: 0.85rem;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.navbar-nav .dropdown-menu .dropdown-item {
    font-size: 0.85rem;
}

.navbar .tipo-cambio-dia {
    font-size: 0.7rem;
    line-height: 1.2;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    text-align: center;
}

.dropdown-menu {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--dropdown-bg);
    box-shadow: 0 12px 28px var(--shadow-color);
}

.dropdown-item:hover {
    background-color: var(--dropdown-hover-bg);
    color: var(--dropdown-hover-text);
}

.dropdown-item,
.dropdown-item:focus,
.dropdown-item:active {
    color: var(--text-main);
}

.dropdown-divider {
    border-top-color: var(--border-color);
}

main {
    margin-top: 70px;
}

.card,
.modal-content,
.list-group-item,
.table-responsive,
.accordion-item {
    background-color: var(--surface-1);
    color: var(--text-main);
    border-color: var(--border-color);
}

.shadow,
.shadow-sm,
.shadow-lg {
    box-shadow: 0 10px 24px var(--shadow-color) !important;
}

.table {
    color: var(--text-main);
    border-color: var(--border-color);
}

.table > :not(caption) > * > * {
    background-color: var(--surface-1);
    color: var(--text-main);
    border-color: var(--border-color);
}

.table-light,
.table-light > th,
.table-light > td,
.table thead.table-light th,
.table thead.table-light td {
    background-color: var(--table-head-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

.table-hover tbody tr:hover > * {
    background-color: var(--surface-2) !important;
}

.table-secondary,
.table-secondary > th,
.table-secondary > td {
    background-color: var(--surface-3) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

.text-muted,
.small.text-muted,
small.text-muted {
    color: var(--text-muted) !important;
}

.form-control,
.form-select,
.form-floating > .form-control,
.form-floating > .form-select,
textarea.form-control {
    background-color: var(--input-bg);
    color: var(--input-text);
    border-color: var(--input-border);
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    background-color: var(--input-bg);
    color: var(--input-text);
    border-color: #60a5fa;
    box-shadow: 0 0 0 0.2rem var(--focus-ring);
}

.form-floating > label {
    color: var(--text-muted);
}

.form-control::placeholder,
textarea.form-control::placeholder {
    color: var(--text-muted);
}

.form-check-input {
    background-color: var(--input-bg);
    border-color: var(--input-border);
}

.modal-header,
.modal-footer,
.card-header,
.card-footer {
    border-color: var(--border-color);
}

.btn-close {
    filter: invert(0);
}

html[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(180%);
}

.alert-light {
    background-color: var(--surface-2);
    color: var(--text-main);
    border-color: var(--border-color);
}

.login-box {
    max-width: 400px;
    margin: 80px auto 0;
    padding: 30px;
    background: var(--surface-1);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    box-shadow: 0 0 25px var(--shadow-color);
}

.theme-toggle-btn {
    min-width: 132px;
    font-weight: 600;
}

.theme-toggle-btn .theme-icon {
    width: 16px;
    text-align: center;
}

.theme-toggle-guest-wrap {
    z-index: 1060;
}

html[data-theme="dark"] .theme-toggle-guest-wrap .theme-toggle-btn {
    color: #e5e7eb;
    border-color: #64748b;
    background-color: #1f2937;
}

html[data-theme="dark"] .bg-white {
    background-color: var(--surface-1) !important;
    color: var(--text-main) !important;
}

html[data-theme="dark"] .bg-light {
    background-color: var(--surface-2) !important;
    color: var(--text-main) !important;
}

html[data-theme="dark"] .text-dark {
    color: var(--text-main) !important;
}

html[data-theme="dark"] .navbar .btn-outline-light {
    color: #f8fafc;
    border-color: #f8fafc;
}

html[data-theme="dark"] .navbar .btn-light {
    background-color: #f8fafc;
    color: #111827;
}

html[data-theme="dark"] .navbar .nav-link.active {
    color: #93c5fd !important;
}

.page-container-1000 {
    max-width: 1000px;
}

.page-container-1100 {
    max-width: 1100px;
}

.page-container-1200 {
    max-width: 1200px;
}

.table-col-nro {
    width: 60px;
}

.table-col-role {
    width: 150px;
}

.table-col-actions-160 {
    width: 160px;
}

.table-col-actions-170 {
    width: 170px;
}

.table-col-actions-180 {
    width: 180px;
}

.table-col-actions-220 {
    width: 220px;
}

.autocomplete-results {
    width: 100%;
    top: 100%;
    left: 0;
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-top: none;
    background: var(--surface-1);
    border-color: var(--border-color);
}

.autocomplete-results .list-group-item {
    border: none;
    border-bottom: 1px solid #eee;
}

.autocomplete-results .list-group-item:hover {
    background: var(--surface-2);
}

.acciones-venta-mobile form {
    width: 100%;
}

.acciones-venta-mobile form .btn {
    width: 100%;
}

@media (min-width: 576px) {
    .acciones-venta-mobile form {
        width: auto;
    }

    .acciones-venta-mobile form .btn {
        width: auto;
    }
}

.toggle-categoria {
    text-decoration: none;
    color: #0d6efd;
    font-weight: 500;
    padding: 4px 0;
}

.toggle-categoria:hover {
    color: #0a58ca;
}

.toggle-categoria .icono {
    transition: transform 0.25s ease;
}

.toggle-categoria[aria-expanded="true"] .icono {
    transform: rotate(180deg);
}

tr.bg-light {
    background-color: var(--surface-2) !important;
    border-left: 3px solid #0d6efd;
}

.tabla-productos-compacta {
    table-layout: fixed !important;
    width: 100% !important;
    font-size: 0.72rem;
}

.tabla-productos-compacta th,
.tabla-productos-compacta td {
    padding: 0.3rem 0.35rem;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: middle;
}

.tabla-productos-compacta img {
    width: 32px;
    height: 32px;
    object-fit: cover;
}

.tabla-productos-compacta .btn-sm {
    padding: 0.15rem 0.35rem;
    font-size: 0.68rem;
}


.detalle-categoria-mobile {
    background-color: var(--surface-2);
}

.collapse {
    transition: height 0.25s ease;
}
