* {
    box-sizing: border-box;
}

:root {
    --app-bg: #f4f6f9;
    --app-surface: #ffffff;
    --app-border: #e3e8ef;
    --app-text: #1f2937;
    --app-muted: #6b7280;
    --app-primary: #2563eb;
    --app-primary-soft: #eff6ff;
    --app-sidebar: #111827;
    --app-sidebar-hover: #1f2937;
    --app-success: #15803d;
    --app-warning: #b45309;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--app-bg);
    color: var(--app-text);
    font-family: Arial, Helvetica, sans-serif;
}

body {
    min-height: 100vh;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
}

.app-navbar {
    height: 64px;
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-left,
.navbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar-toggle {
    border: 0;
    background: transparent;
    font-size: 22px;
    color: var(--app-text);
    padding: 6px;
}

.brand {
    font-weight: 800;
    font-size: 20px;
}

.navbar-user {
    color: var(--app-muted);
    font-size: 14px;
}

.navbar-action {
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-text);
    border-radius: 7px;
    padding: 8px 12px;
}

.app-body {
    display: flex;
    min-height: calc(100vh - 64px);
}

.app-sidebar {
    width: 250px;
    background: var(--app-sidebar);
    color: #fff;
    flex: 0 0 250px;
    transition: width .2s ease, transform .2s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-title {
    font-size: 20px;
    font-weight: 800;
}

.sidebar-subtitle {
    font-size: 12px;
    opacity: .65;
    margin-top: 4px;
}

.sidebar-menu {
    padding: 10px;
}

.sidebar-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    margin-bottom: 4px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: rgba(255,255,255,.88);
    text-align: left;
}

.sidebar-item:hover {
    background: var(--app-sidebar-hover);
}

.sidebar-item.active {
    background: rgba(255,255,255,.12);
}

.sidebar-icon {
    width: 24px;
    text-align: center;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1;
    padding: 24px;
}

.app-footer {
    border-top: 1px solid var(--app-border);
    background: var(--app-surface);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    color: var(--app-muted);
    font-size: 13px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 22px;
}

.breadcrumb {
    color: var(--app-muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.page-header h1 {
    margin: 0 0 6px;
    font-size: 28px;
}

.page-header p {
    margin: 0;
    color: var(--app-muted);
}

.page-actions {
    display: flex;
    gap: 8px;
}

.btn {
    border: 1px solid var(--app-border);
    background: #fff;
    border-radius: 7px;
    padding: 9px 13px;
}

.btn-secondary {
    color: var(--app-text);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-card,
.content-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 10px;
}

.dashboard-card {
    min-height: 120px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.dashboard-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--app-primary-soft);
    font-size: 22px;
}

.dashboard-card-label {
    display: block;
    color: var(--app-muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.dashboard-card strong {
    display: block;
    font-size: 24px;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.content-card {
    padding: 18px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h2 {
    margin: 0 0 5px;
    font-size: 18px;
}

.card-header p {
    margin: 0;
    color: var(--app-muted);
    font-size: 13px;
}

.empty-state {
    min-height: 220px;
    border: 1px dashed var(--app-border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--app-muted);
    text-align: center;
}

.empty-state-icon {
    font-size: 34px;
    margin-bottom: 5px;
}

.status-list,
.finance-list {
    display: grid;
    gap: 12px;
}

.status-list > div,
.finance-list > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--app-border);
}

.status-list > div:last-child,
.finance-list > div:last-child {
    border-bottom: 0;
}

.status-list span,
.finance-list span {
    color: var(--app-muted);
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-action {
    border: 1px solid var(--app-border);
    background: #fff;
    border-radius: 7px;
    padding: 12px;
    text-align: left;
}

.flash {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 7px;
}

.flash-success {
    background: #e8f7ed;
    border: 1px solid #b7e4c7;
}

.flash-error {
    background: #ffe8e8;
    border: 1px solid #efb4b4;
}

.sidebar-collapsed .app-sidebar {
    width: 72px;
    flex-basis: 72px;
}

.sidebar-collapsed .sidebar-header {
    padding-left: 10px;
    padding-right: 10px;
}

.sidebar-collapsed .sidebar-title,
.sidebar-collapsed .sidebar-subtitle,
.sidebar-collapsed .sidebar-item span:last-child {
    display: none;
}

.sidebar-collapsed .sidebar-item {
    justify-content: center;
}

@media (max-width: 1050px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .app-sidebar {
        position: fixed;
        top: 64px;
        bottom: 0;
        left: 0;
        z-index: 900;
        transform: translateX(-100%);
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .navbar-user {
        display: none;
    }

    .app-content {
        padding: 16px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }
}

.text-right { text-align: right; }
.text-muted { color: var(--app-muted); }

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

.btn-small {
    padding: 6px 9px;
    font-size: 12px;
    margin-left: 4px;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.table-summary {
    color: var(--app-muted);
    font-size: 14px;
}

.table-search {
    width: min(320px, 100%);
    border: 1px solid var(--app-border);
    border-radius: 7px;
    padding: 9px 12px;
    background: #fff;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--app-border);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--app-muted);
    letter-spacing: .02em;
}

.data-table tbody tr:hover {
    background: #fafbfd;
}

.status-badge,
.mini-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.status-active {
    background: #e8f7ed;
    color: var(--app-success);
}

.status-inactive {
    background: #f1f3f5;
    color: var(--app-muted);
}

.mini-badge {
    margin-left: 5px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

.actions-cell {
    white-space: nowrap;
}

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

.form-section-title {
    grid-column: 1 / -1;
    font-size: 16px;
    font-weight: 700;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--app-border);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid var(--app-border);
    border-radius: 7px;
    padding: 10px 11px;
    background: #fff;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-checkbox {
    justify-content: flex-end;
}

.form-checkbox label {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 39px;
}

.form-checkbox input {
    width: auto;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.detail-list {
    display: grid;
    gap: 12px;
}

.detail-list > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--app-border);
}

.detail-list span {
    color: var(--app-muted);
}

.simple-list {
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.simple-list li,
.address-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--app-border);
}

.address-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.address-item span,
.address-item small {
    color: var(--app-muted);
}

@media (max-width: 850px) {
    .form-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .table-search {
        width: 100%;
    }
}

/* ============================================================
   DATATABLES - ESTÁNDAR SIGDA
   ============================================================ */

.content-card .dt-container {
    font-size: 13px;
}

.content-card .dt-layout-row {
    margin: 0;
    padding: 0 0 14px 0;
}

.content-card .dt-layout-row:last-child {
    padding-top: 14px;
    padding-bottom: 0;
}

.content-card .dt-search input,
.content-card .dt-length select {
    border: 1px solid var(--app-border) !important;
    border-radius: 7px !important;
    font-size: 13px !important;
    box-shadow: none !important;
}

.content-card .dt-search input {
    min-width: 260px;
    margin-left: 7px !important;
    padding: 7px 10px !important;
}

.content-card .dt-length select {
    padding: 6px 28px 6px 9px !important;
    margin: 0 5px !important;
}

.content-card .dt-info {
    color: var(--app-muted);
    font-size: 12px;
}

.content-card .dt-paging .dt-paging-button {
    border-radius: 6px !important;
    font-size: 12px;
    min-width: 32px;
}

.content-card .dt-paging .dt-paging-button.current {
    background: var(--app-primary) !important;
    color: #fff !important;
    border-color: var(--app-primary) !important;
}

.sigda-table {
    margin-bottom: 0 !important;
}

.sigda-table thead th {
    background: #fafbfc !important;
    border-bottom: 1px solid var(--app-border) !important;
    color: #687385 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: .035em;
    white-space: nowrap;
}

.sigda-table tbody td {
    font-size: 13px;
    padding: 9px 10px !important;
}

.sigda-table tbody tr:hover {
    background: #f8fafc !important;
}

.table-id {
    color: #7b8492;
    font-size: 12px;
}

.action-menu-button {
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #6b7280;
    font-size: 21px;
    line-height: 1;
    display: inline-grid;
    place-items: center;
}

.action-menu-button:hover,
.action-menu-button:focus {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #111827;
}

.action-dropdown {
    min-width: 175px;
    padding: 5px !important;
    border: 1px solid var(--app-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .12) !important;
}

.action-dropdown .dropdown-item {
    border-radius: 6px;
    font-size: 12px;
    padding: 8px 10px;
}

.action-dropdown .dropdown-item:hover {
    background: #f8fafc;
}

.action-icon {
    display: inline-block;
    width: 22px;
    text-align: center;
    margin-right: 5px;
}

.client-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.client-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 32px;
}

.client-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.client-info strong {
    color: #1f2937;
    font-size: 13px;
    font-weight: 600;
}

.client-info small {
    color: #9ca3af;
    font-size: 11px;
}

.credit-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-active {
    background: #ecfdf3;
    color: #15803d;
}

.status-inactive {
    background: #f3f4f6;
    color: #6b7280;
}

@media (max-width: 700px) {
    .content-card .dt-search input {
        min-width: 180px;
        width: 100%;
        margin-left: 0 !important;
    }

    .content-card .dt-layout-row {
        gap: 10px;
    }
}

/* Toast global SIGDA */
.sigda-toast-popup {
    font-size: 13px !important;
}

.action-icon {
    width: 20px;
    text-align: center;
    font-size: 14px;
    margin-right: 7px;
}

.action-view {
    color: #2563eb;
}

.action-edit {
    color: #f59e0b;
}

.action-danger-icon {
    color: #dc2626;
}

.action-success-icon {
    color: #16a34a;
}

.table-code { font-size: 12px; font-weight: 700; color: #475569; }

/* ============================================================
   COLORES DE ICONOS DEL MENÚ SIGDA
   ============================================================ */

.sidebar-icon {
    width: 24px;
    min-width: 24px;
    text-align: center;
    font-size: 15px;
    transition: transform .15s ease, filter .15s ease;
}

.sidebar-item:hover .sidebar-icon {
    transform: scale(1.08);
    filter: brightness(1.08);
}

.menu-blue { color: #60a5fa; }
.menu-cyan { color: #22d3ee; }
.menu-orange { color: #fb923c; }
.menu-purple { color: #a78bfa; }
.menu-teal { color: #2dd4bf; }
.menu-green { color: #4ade80; }
.menu-indigo { color: #818cf8; }
.menu-amber { color: #fbbf24; }
.menu-sky { color: #38bdf8; }
.menu-pink { color: #f472b6; }
.menu-lime { color: #a3e635; }
.menu-violet { color: #c084fc; }
.menu-slate { color: #94a3b8; }

.sidebar-item.active {
    background: rgba(255, 255, 255, .12);
}

.sidebar-item.active .sidebar-icon {
    filter: brightness(1.1);
}

@media (max-width: 760px) {
    .sidebar-icon {
        font-size: 16px;
    }
}

/* ============================================================
   SELECT2 SIGDA
   ============================================================ */

.select-with-button {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.select-with-button .select2-container {
    flex: 1;
    min-width: 0;
}

.select-add-button {
    width: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.select2-container--default .select2-selection--single {
    height: 38px;
    border: 1px solid var(--app-border);
    border-radius: 7px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    font-size: 13px;
    padding-left: 11px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.select2-dropdown {
    border-color: var(--app-border);
    font-size: 13px;
}

.select2-results__option {
    padding: 8px 10px;
}

.select2-results__option--highlighted {
    background-color: var(--app-primary) !important;
}

.action-pdf {
    color: #dc3545 !important;
}



/* ============================================================
   SUBMENÚS DEL SIDEBAR SIGDA
   ============================================================ */

.sidebar-separator {
    height: 1px;
    margin: 10px 4px;
    background: rgba(255,255,255,.08);
}

.sidebar-group {
    margin-bottom: 4px;
}

.sidebar-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: rgba(255,255,255,.88);
    text-align: left;
    cursor: pointer;
}

.sidebar-group-toggle:hover,
.sidebar-group-toggle.active {
    background: var(--app-sidebar-hover);
}

.sidebar-group-main {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.sidebar-group-chevron {
    font-size: 11px;
    opacity: .7;
    transition: transform .18s ease;
}

.sidebar-group.is-open .sidebar-group-chevron {
    transform: rotate(180deg);
}

.sidebar-submenu {
    padding: 4px 0 4px 38px;
}

.sidebar-subitem {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    margin: 2px 0;
    border-radius: 6px;
    color: rgba(255,255,255,.72);
    text-decoration: none;
    font-size: 13px;
}

.sidebar-subitem:hover {
    color: #fff;
    background: rgba(255,255,255,.06);
}

.sidebar-subitem.active {
    color: #fff;
    background: rgba(255,255,255,.11);
}

.sidebar-subitem.disabled {
    opacity: .48;
    cursor: not-allowed;
}

.sidebar-subitem small {
    display: block;
    margin-left: 5px;
    font-size: 9px;
    opacity: .75;
}

.sidebar-subitem.disabled .sidebar-label {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.sidebar-subitem-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
}

.sidebar-collapsed .sidebar-group-toggle {
    justify-content: center;
}

.sidebar-collapsed .sidebar-group-main {
    justify-content: center;
}

.sidebar-collapsed .sidebar-group-chevron,
.sidebar-collapsed .sidebar-submenu {
    display: none !important;
}

.sidebar-collapsed .sidebar-group-toggle .sidebar-label,
.sidebar-collapsed .sidebar-subitem .sidebar-label {
    display: none;
}

/* Usuario actual en navbar */
.navbar-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
}

.navbar-user-role {
    margin-top: 3px;
    font-size: 11px;
    color: #64748b;
}

.navbar-logout {
    color: #dc3545;
    text-decoration: none;
}

.navbar-logout:hover {
    color: #b02a37;
}

/* ============================================================
   LOGIN SIGDA
   ============================================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--app-bg);
}

.login-card {
    width: min(420px, 100%);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    padding: 30px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, .08);
}

.login-card h1 {
    margin: 0 0 6px;
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    color: var(--app-text);
}

.login-card > p {
    margin: 0 0 24px;
    text-align: center;
    color: var(--app-muted);
}

.login-card form {
    display: grid;
    gap: 16px;
}

.login-card form > div {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.login-card label {
    font-size: 13px;
    font-weight: 600;
    color: var(--app-text);
}

.login-card input {
    width: 100%;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
    color: var(--app-text);
    outline: none;
}

.login-card input:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.login-card button[type="submit"] {
    width: 100%;
    border: 1px solid var(--app-primary);
    border-radius: 8px;
    padding: 11px 14px;
    background: var(--app-primary);
    color: #fff;
    font-weight: 700;
    margin-top: 4px;
}

.login-card button[type="submit"]:hover {
    filter: brightness(.96);
}

.login-error {
    margin-bottom: 16px;
    padding: 11px 13px;
    border: 1px solid #efb4b4;
    border-radius: 8px;
    background: #ffe8e8;
    color: #b42318;
    font-size: 13px;
}

.btn.btn-success {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #ffffff !important;
}

.btn.btn-success:hover,
.btn.btn-success:focus,
.btn.btn-success:active {
    background-color: #157347 !important;
    border-color: #146c43 !important;
    color: #ffffff !important;
}

/* =========================================================
   AJUSTE DE INVENTARIO
   ========================================================= */

#modalAjusteInventario .modal-content {
    border: 0;
    border-radius: 16px;
    overflow: hidden;
}

#modalAjusteInventario .modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid #e9ecef;
}

#modalAjusteInventario .modal-title {
    font-weight: 600;
    font-size: 18px;
}

#modalAjusteInventario .modal-body {
    padding: 22px;
}

#modalAjusteInventario .alert {
    border: 0;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 22px;
}

#modalAjusteInventario .form-grid {
    gap: 18px;
}

#modalAjusteInventario .form-group label {
    font-weight: 600;
    margin-bottom: 7px;
}

#modalAjusteInventario .form-group small {
    display: block;
    margin-top: 6px;
    line-height: 1.4;
}

#modalAjusteInventario input,
#modalAjusteInventario select {
    min-height: 44px;
}

#modalAjusteInventario #ajuste_stock_actual {
    background: #f3f6f9;
    font-weight: 700;
    font-size: 17px;
    color: #495057;
}

#modalAjusteInventario #ajuste_stock_fisico {
    font-size: 18px;
    font-weight: 600;
}

#modalAjusteInventario #ajuste_stock_fisico:focus {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .12);
}

#modalAjusteInventario #ajuste_diferencia {
    background: #f8f9fa;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

#modalAjusteInventario #ajuste_tipo {
    font-weight: 600;
}

#modalAjusteInventario .modal-footer {
    padding: 16px 22px;
    border-top: 1px solid #e9ecef;
}

#modalAjusteInventario .modal-footer .btn-primary {
    min-width: 170px;
}

/*EDITABLE*/
.inventario-stock-row {
    cursor: pointer;
    transition: background-color .15s ease;
}

.inventario-stock-row:hover {
    background-color: #f5f8ff;
}

.inventario-stock-row-active > td {
    background-color: #e8f0fe !important;
}

.inventario-filtro-producto {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.inventario-filtro-producto > span {
    color: #6c757d;
}

.inventario-filtro-producto > strong {
    color: #212529;
}

.inventario-filtro-producto .btn {
    margin-left: 6px;
}

    .envase-simple-table {
        margin-bottom: 0;
        border-collapse: separate;
        border-spacing: 0;
        width: 100%;
    }

    .envase-simple-table thead th {
        background: #f8fafc;
        color: #475569;
        font-size: .78rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .04em;
        border-bottom: 1px solid #e2e8f0;
        padding: 13px 16px;
        white-space: nowrap;
    }

    .envase-simple-table tbody td {
        color: #334155;
        font-size: .9rem;
        padding: 14px 16px;
        border-bottom: 1px solid #e2e8f0;
        vertical-align: middle;
    }

    .envase-simple-table tbody tr:last-child td {
        border-bottom: 0;
    }

    .envase-simple-table tbody tr:hover {
        background: #f8fafc;
    }

    .envase-simple-table strong {
        color: #1e293b;
    }

    .action-icon-button {
        width: 36px;
        height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #dbe3ee;
        border-radius: 9px;
        background: #fff;
        color: #2563eb;
        text-decoration: none;
        transition: all .2s ease;
    }

    .action-icon-button:hover {
        background: #eff6ff;
        border-color: #bfdbfe;
        color: #1d4ed8;
    }

    .action-icon-button i {
        font-size: 17px;
    }

    .envases-clientes-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: stretch;
}

.envases-clientes-card {
    min-width: 0;
}

.envases-clientes-info {
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.envases-clientes-info-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 21px;
    margin-bottom: 18px;
}

.envases-clientes-info h4 {
    margin: 0 0 8px;
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
}

.envases-clientes-info p {
    margin: 0 0 22px;
    color: #64748b;
    line-height: 1.6;
    font-size: 14px;
}

.envases-clientes-info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #475569;
    font-size: 14px;
    line-height: 1.5;
}

.envases-clientes-info-item + .envases-clientes-info-item {
    margin-top: 14px;
}

.envases-clientes-info-item i {
    color: #2563eb;
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

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

    .envases-clientes-info {
        order: -1;
    }
}

.envases-movimientos-table th,
.envases-movimientos-table td {
    padding: 10px 12px;
}

.envases-movimientos-table th {
    white-space: nowrap;
    font-size: 12px;
}

.envases-movimientos-table td {
    font-size: 13px;
}

.envases-movimientos-table tbody tr:hover {
    background: #f8fafc;
}

.envases-movimientos-table tbody tr.movimiento-salida > * {
    background-color: #fff1f1 !important;
}

.envases-movimientos-table tbody tr.movimiento-entrada > * {
    background-color: #f1faf4 !important;
}

.envases-movimientos-table tbody tr.movimiento-neutral > * {
    background-color: #fafafa !important;
}

.envases-movimientos-table tbody tr.movimiento-salida:hover > * {
    background-color: #ffe8e8 !important;
}

.envases-movimientos-table tbody tr.movimiento-entrada:hover > * {
    background-color: #e8f7ed !important;
}

.envases-movimientos-table tbody tr.movimiento-neutral:hover > * {
    background-color: #f5f5f5 !important;
}

.envase-patrimonio-row {
    cursor: pointer;
    transition: background-color .15s ease;
}

.envase-patrimonio-row:hover > * {
    background-color: #f8fafc !important;
}

.envase-patrimonio-row-active > * {
    background-color: #eff6ff !important;
}

.envase-patrimonio-row-active > td:first-child {
    border-left: 3px solid #2563eb;
}

.envase-control-ok {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 7px;
    background: #ecfdf3;
    color: #15803d;
    font-size: 12px;
    font-weight: 600;
}

.envase-control-faltan {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 7px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 12px;
    font-weight: 600;
}

.envase-control-sobran {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 7px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
}

.envases-patrimonio-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: stretch;
}

.envases-patrimonio-card {
    min-width: 0;
}

.envases-patrimonio-table {
    width: 100%;
}

.envases-patrimonio-table thead th {
    padding: 10px 12px;
    font-size: 12px;
    white-space: nowrap;
}

.envases-patrimonio-table tbody td {
    padding: 10px 12px;
    font-size: 13px;
    white-space: nowrap;
}

.envases-patrimonio-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.envases-patrimonio-info-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border-radius: 11px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 20px;
}

.envases-patrimonio-info h4 {
    margin: 0 0 8px;
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
}

.envases-patrimonio-info p {
    margin: 0 0 20px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.envases-patrimonio-info-item {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

.envases-patrimonio-info-item + .envases-patrimonio-info-item {
    margin-top: 13px;
}

.envases-patrimonio-info-item i {
    margin-top: 2px;
    color: #2563eb;
    flex-shrink: 0;
}

@media (max-width: 1100px) {
    .envases-patrimonio-layout {
        grid-template-columns: 1fr;
    }

    .envases-patrimonio-info {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 14px;
        align-items: start;
    }

    .envases-patrimonio-info-icon {
        grid-row: 1 / span 3;
        margin-bottom: 0;
    }

    .envases-patrimonio-info h4,
    .envases-patrimonio-info p {
        margin-left: 0;
    }
}

@media (max-width: 767.98px) {
    .envases-patrimonio-layout {
        gap: 12px;
    }

    .envases-patrimonio-card,
    .envases-patrimonio-info {
        border-radius: 12px;
    }

    .envases-patrimonio-table {
        min-width: 780px;
    }

    .envases-patrimonio-table thead th,
    .envases-patrimonio-table tbody td {
        padding: 9px 10px;
        font-size: 12px;
    }

    .envases-patrimonio-info {
        display: block;
        padding: 20px;
    }

    .envases-patrimonio-info-icon {
        margin-bottom: 14px;
    }

    .envases-patrimonio-info h4 {
        font-size: 17px;
    }
}

@media (max-width: 480px) {
    .envases-patrimonio-table {
        min-width: 700px;
    }

    .envases-patrimonio-info {
        padding: 18px;
    }
}

.info-layout {
    display:grid;
    grid-template-columns:minmax(0,1fr) 300px;
    gap:18px;
    align-items:stretch;
}

.info-card {
    min-width:0;
}

.info-panel {
    padding:24px;
}

.info-panel-icon {
    width:44px;
    height:44px;
    border-radius:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#eef4ff;
    color:#2563eb;
    font-size:21px;
    margin-bottom:16px;
}

.info-panel h4 {
    margin:0 0 10px;
    font-size:18px;
}

.info-panel p {
    margin:0 0 18px;
    color:#64748b;
    font-size:14px;
    line-height:1.6;
}

.info-panel-item {
    display:flex;
    align-items:flex-start;
    gap:10px;
    margin-bottom:14px;
    font-size:13px;
    line-height:1.5;
}

.info-panel-item i {
    color:#2563eb;
    font-size:16px;
    margin-top:2px;
    flex-shrink:0;
}

@media (max-width:1100px) {
    .info-layout {
        grid-template-columns:1fr;
    }

    .info-panel {
        display:none;
    }
}

@media (max-width:767.98px) {
    .info-layout {
        gap:12px;
    }

    .info-card {
        width:100%;
    }
}

/* =========================================================
   VENTA - DETALLE
========================================================= */

.venta-show {
    max-width: 1400px;
    margin: 0 auto;
}

.venta-show-header {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 20px;
}

.venta-show-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.venta-show-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.venta-show-subtitle {
    opacity: .85;
}

.venta-show-number {
    font-size: 1.15rem;
    font-weight: 700;
    background: rgba(255, 255, 255, .14);
    padding: 8px 12px;
    border-radius: 10px;
    white-space: nowrap;
}

.venta-show-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
    gap: 18px;
}

.venta-show-card {
    background: #fff;
    border: 1px solid #e7eaf0;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 18px;
}

.venta-show-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #edf0f5;
    font-weight: 700;
    color: #1f2937;
}

.venta-show-card-body {
    padding: 20px;
}

.venta-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.venta-info-item small {
    display: block;
    color: #64748b;
    font-size: .75rem;
    margin-bottom: 4px;
}

.venta-info-item strong {
    color: #1f2937;
}

.venta-show-table {
    width: 100%;
    margin: 0;
}

.venta-show-table th {
    background: #f8fafc;
    font-size: .76rem;
    text-transform: uppercase;
    color: #475569;
}

.venta-resumen {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px;
}

.venta-resumen-linea {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 11px;
    color: #64748b;
}

.venta-resumen-linea strong {
    color: #334155;
}

.venta-resumen-total {
    border-top: 1px solid #dbe1ea;
    padding-top: 13px;
    margin-top: 13px;
    font-size: 1.2rem;
}

.venta-resumen-total strong:last-child {
    color: #4f46e5;
}

.venta-pago {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #edf0f5;
}

.venta-pago:last-child {
    border-bottom: 0;
}

.estado-venta {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 700;
    background: #dcfce7;
    color: #166534;
}

.saldo-venta {
    margin-top: 14px;
    padding: 12px;
    border-radius: 10px;
    font-weight: 700;
}

.venta-saldo-pendiente {
    background: #fff7ed;
    color: #c2410c;
}

.venta-saldo-pagado {
    background: #f0fdf4;
    color: #166534;
}

@media (max-width: 900px) {

    .venta-show-grid {
        grid-template-columns: 1fr;
    }

    .venta-show-header-top {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {

    .venta-info-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   VENTAS - FORMULARIO
========================================================= */

.venta-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

.venta-header {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    border-radius: 18px;
    padding: 24px 26px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(79, 70, 229, .15);
}

.venta-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.venta-header-title i {
    font-size: 1.5rem;
}

.venta-header-subtitle {
    opacity: .86;
    font-size: .92rem;
}

.venta-card {
    background: #fff;
    border: 1px solid #e8eaf0;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(15, 23, 42, .05);
    margin-bottom: 18px;
    overflow: hidden;
}

.venta-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #edf0f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.venta-card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    color: #1f2937;
}

.venta-card-title i {
    color: #4f46e5;
}

.venta-card-body {
    padding: 20px;
}

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

.venta-field {
    min-width: 0;
}

.venta-field-full {
    grid-column: 1 / -1;
}

.venta-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 7px;
}

.venta-input,
.venta-select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d9dee8;
    border-radius: 10px;
    padding: 9px 12px;
    background: #fff;
    color: #1f2937;
    outline: none;
    transition: .2s;
}

.venta-input:focus,
.venta-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.cliente-selector {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.btn-nuevo-cliente {
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    padding: 9px 14px;
    background: #10b981;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.btn-nuevo-cliente:hover {
    background: #059669;
    color: #fff;
}

.cliente-info {
    margin-top: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.cliente-info-item small {
    display: block;
    color: #64748b;
    font-size: .72rem;
    margin-bottom: 3px;
}

.cliente-info-item strong {
    color: #1f2937;
    font-size: .86rem;
    word-break: break-word;
}

.venta-help {
    display: block;
    margin-top: 6px;
    font-size: .75rem;
    color: #64748b;
}

.btn-agregar-producto {
    border: 0;
    border-radius: 10px;
    padding: 9px 14px;
    background: #4f46e5;
    color: #fff;
    font-weight: 600;
}

.btn-agregar-producto:hover {
    background: #4338ca;
    color: #fff;
}

.tabla-venta-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow-x: auto;
}

.tabla-venta {
    width: 100%;
    margin: 0;
    min-width: 900px;
}

.tabla-venta thead th {
    background: #f8fafc;
    color: #475569;
    font-size: .77rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    white-space: nowrap;
    padding: 13px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.tabla-venta tbody td {
    padding: 11px 12px;
    vertical-align: middle;
}

.producto-select {
    min-width: 250px;
}

.precio-input {
    width: 115px;
    text-align: right;
    font-weight: 600;
}

.cantidad-input {
    width: 90px;
    text-align: center;
}

.importe-linea {
    font-weight: 700;
    white-space: nowrap;
}

.stock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: 5px 8px;
    border-radius: 8px;
    background: #eef2ff;
    color: #4338ca;
    font-size: .78rem;
    font-weight: 700;
}

.btn-eliminar-producto {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 9px;
    background: #fee2e2;
    color: #dc2626;
}

.btn-eliminar-producto:hover {
    background: #fecaca;
}

.venta-empty {
    padding: 45px 20px !important;
    color: #94a3b8;
}

.envase-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
}

.envase-box-title {
    font-weight: 700;
    color: #92400e;
    margin-bottom: 5px;
}

.pago-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.resumen-venta {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px;
}

.resumen-titulo {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 14px;
}

.resumen-linea {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #64748b;
    margin-bottom: 10px;
}

.resumen-linea strong {
    color: #334155;
}

.resumen-total {
    border-top: 1px solid #dbe1ea;
    padding-top: 13px;
    margin-top: 12px;
    font-size: 1.2rem;
}

.resumen-total strong:last-child {
    color: #4f46e5;
}

.venta-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 5px;
}

.modal-venta {
    border: 0;
    border-radius: 16px;
    overflow: hidden;
}

.modal-venta-header {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    padding: 17px 20px;
}

@media (max-width: 900px) {

    .venta-grid,
    .pago-grid {
        grid-template-columns: 1fr;
    }

    .venta-field-full {
        grid-column: auto;
    }

    .cliente-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {

    .venta-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .cliente-selector {
        grid-template-columns: 1fr;
    }

    .venta-header {
        padding: 20px;
    }

    .venta-card-body {
        padding: 15px;
    }

    .venta-actions {
        flex-direction: column;
    }

    .venta-actions .btn {
        width: 100%;
    }
}

.liquidacion-dinero-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.liquidacion-dinero-grid .venta-field {
    margin-bottom: 0;
}

.liquidacion-dinero-grid .venta-label {
    margin-bottom: 5px;
}

.liquidacion-dinero {
    height: 38px;
    padding: 6px 10px;
    font-size: 14px;
}

.liquidacion-dinero-grid .venta-help {
    display: block;
    margin-top: 4px;
    line-height: 1.2;
    font-size: 12px;
}

@media (max-width: 900px) {
    .liquidacion-dinero-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .liquidacion-dinero-grid {
        grid-template-columns: 1fr;
    }
}

#formLiquidacionDespacho .resumen-venta {
    padding: 16px;
}

#formLiquidacionDespacho .resumen-titulo {
    margin-bottom: 12px;
}

#formLiquidacionDespacho .resumen-linea {
    padding: 5px 0;
    min-height: auto;
}

#formLiquidacionDespacho .resumen-total {
    margin-top: 6px;
    padding-top: 10px;
}
#formLiquidacionDespacho textarea {
    min-height: 80px;
    height: 80px;
}

/* =========================================================
   REPORTES - LIQUIDACIÓN DIARIA
   ========================================================= */

.reporte-liquidacion {
    max-width: 1500px;
    margin: 0 auto;
}

.reporte-filtro {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.reporte-filtro-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.reporte-filtro .venta-field {
    margin-bottom: 0;
}

.reporte-filtro .venta-label {
    margin-bottom: 5px;
}

.reporte-filtro .venta-input {
    min-height: 38px;
    height: 38px;
}

.reporte-filtro-acciones {
    display: flex;
    gap: 8px;
}

.reporte-resumen-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.reporte-kpi {
    position: relative;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    padding: 16px;
    min-height: 105px;
    overflow: hidden;
}

.reporte-kpi-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: 18px;
    margin-bottom: 10px;
}

.reporte-kpi-label {
    display: block;
    color: var(--app-muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.reporte-kpi strong {
    display: block;
    font-size: 23px;
    line-height: 1.15;
    color: #1e293b;
}

.reporte-kpi.diferencia-ok .reporte-kpi-icon {
    background: #ecfdf3;
    color: #15803d;
}

.reporte-kpi.diferencia-alerta .reporte-kpi-icon {
    background: #fff7ed;
    color: #c2410c;
}

.reporte-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.reporte-info-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #eef4ff;
    color: var(--app-primary);
    font-size: 18px;
}

.reporte-info-title {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}

.reporte-info-text {
    color: var(--app-muted);
    font-size: 12px;
}

.reporte-card {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.reporte-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--app-border);
}

.reporte-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.reporte-card-title i {
    color: var(--app-primary);
}

.reporte-card-subtitle {
    margin-top: 2px;
    color: var(--app-muted);
    font-size: 12px;
}

.reporte-table-wrapper {
    overflow-x: auto;
}

.reporte-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.reporte-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
    padding: 9px 10px;
    border-bottom: 1px solid var(--app-border);
}

.reporte-table td {
    padding: 9px 10px;
    font-size: 12px;
    color: #334155;
    border-bottom: 1px solid #edf0f5;
    white-space: nowrap;
}

.reporte-table tbody tr:hover td {
    background: #fafbfd;
}

.reporte-table tfoot th,
.reporte-table tfoot td {
    background: #f8fafc;
    border-top: 1px solid var(--app-border);
    border-bottom: 0;
    font-weight: 700;
    padding: 10px;
}

.reporte-monto {
    font-weight: 600;
    color: #1e293b;
}

.reporte-diferencia-ok {
    color: #15803d !important;
    font-weight: 700;
}

.reporte-diferencia-alerta {
    color: #c2410c !important;
    font-weight: 700;
}

.reporte-estado {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #15803d;
    font-size: 10px;
    font-weight: 700;
}

.reporte-mercaderia {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 16px;
    background: #fafbfd;
    border-bottom: 1px solid var(--app-border);
}

.reporte-mercaderia-item {
    padding: 10px 12px;
    border: 1px solid #e8edf3;
    border-radius: 9px;
    background: #fff;
}

.reporte-mercaderia-item span {
    display: block;
    color: var(--app-muted);
    font-size: 11px;
    margin-bottom: 3px;
}

.reporte-mercaderia-item strong {
    font-size: 17px;
    color: #1e293b;
}

@media (max-width: 1100px) {
    .reporte-resumen-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 850px) {
    .reporte-filtro-grid {
        grid-template-columns: 1fr 1fr;
    }

    .reporte-filtro-acciones {
        grid-column: 1 / -1;
    }

    .reporte-mercaderia {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .reporte-resumen-grid {
        grid-template-columns: 1fr;
    }

    .reporte-filtro-grid {
        grid-template-columns: 1fr;
    }

    .reporte-filtro-acciones {
        grid-column: auto;
    }

    .reporte-info {
        grid-template-columns: 1fr;
    }
}

.reporte-filtro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr auto;
    gap: 12px;
    align-items: end;
}

/* =========================================================
   PAGOS DE LA VENTA
   ========================================================= */

.pagos-venta-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pago-venta-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) minmax(150px, .8fr) minmax(220px, 1.3fr) 48px;
    gap: 14px;
    align-items: end;
    padding: 16px;
    border: 1px solid #e1e5ee;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.pago-venta-row .venta-field {
    margin: 0;
}

.pago-venta-row .venta-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #344054;
}

.pago-venta-row .venta-select,
.pago-venta-row .venta-input {
    width: 100%;
    min-height: 44px;
}

.pago-venta-accion {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-eliminar-pago {
    width: 42px;
    height: 42px;
    border: 1px solid #dc3545;
    border-radius: 9px;
    background: #fff;
    color: #dc3545;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s ease;
}

.btn-eliminar-pago:hover:not(:disabled) {
    background: #dc3545;
    color: #fff;
}

.btn-eliminar-pago:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* Resumen */

.pago-resumen {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 18px;
}

.pago-resumen > div {
    padding: 14px 16px;
    border: 1px solid #e3e7ef;
    border-radius: 10px;
    background: #f8f9fc;
}

.pago-resumen span {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #667085;
}

.pago-resumen strong {
    font-size: 17px;
    color: #1d2939;
}

.pago-estado {
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: 9px;
    font-size: 14px;
    background: #f8f9fc;
    color: #475467;
}

.pago-estado-ok {
    background: #ecfdf3;
    color: #027a48;
}

.pago-estado-error {
    background: #fef3f2;
    color: #b42318;
}

/* Responsive */

@media (max-width: 900px) {

    .pago-venta-row {
        grid-template-columns: 1fr 1fr;
    }

    .pago-venta-row .pago-referencia-group {
        grid-column: 1 / -1;
    }

    .pago-venta-accion {
        justify-content: flex-end;
    }

    .pago-resumen {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {

    .pago-venta-row {
        grid-template-columns: 1fr;
    }

    .pago-venta-row .pago-referencia-group {
        grid-column: auto;
    }

    .pago-venta-accion {
        justify-content: flex-end;
    }
}

/* ================================================================
   PEDIDOS - FORMULARIO NUEVO PEDIDO
================================================================ */

.pedido-form-wrapper {
    width: 100%;
}

.pedido-page-header {
    margin-bottom: 22px;
}

.pedido-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pedido-title-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eaf2ff;
    color: #2563eb;
    font-size: 22px;
    flex-shrink: 0;
}

.pedido-title-row h1 {
    margin: 0 0 4px;
}

.pedido-title-row p {
    margin: 0;
}


/* ================================================================
   ALERTA
================================================================ */

.pedido-error-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    border-radius: 12px;
}

.pedido-error-icon {
    font-size: 18px;
    line-height: 1;
}


/* ================================================================
   SECCIONES
================================================================ */

.pedido-section {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.035);
}

.pedido-section + .pedido-section {
    margin-top: 20px;
}

.pedido-section-header {
    min-height: 82px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #e8edf4;
    background: linear-gradient(
        180deg,
        #ffffff 0%,
        #fbfcfe 100%
    );
}

.pedido-section-heading {
    display: flex;
    align-items: center;
    gap: 13px;
}

.pedido-section-heading h2 {
    margin: 0 0 3px;
    font-size: 19px;
    font-weight: 700;
    color: #172033;
}

.pedido-section-heading p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.pedido-section-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.pedido-icon-blue {
    background: #eaf2ff;
    color: #2563eb;
}

.pedido-icon-green {
    background: #eafaf1;
    color: #16a34a;
}

.pedido-section-body {
    padding: 22px;
}


/* ================================================================
   NÚMERO DE PEDIDO
================================================================ */

.pedido-number-badge {
    min-width: 140px;
    padding: 9px 13px;
    background: #f5f8fc;
    border: 1px solid #e1e8f0;
    border-radius: 10px;
    text-align: right;
}

.pedido-number-badge span {
    display: block;
    margin-bottom: 2px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #64748b;
}

.pedido-number-badge strong {
    color: #1d4ed8;
    font-size: 14px;
}


/* ================================================================
   LABELS
================================================================ */

.pedido-section .form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pedido-label-icon {
    color: #64748b;
    font-size: 13px;
}

.pedido-help-text {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
}


/* ================================================================
   CLIENTE
================================================================ */

.pedido-client-field {
    position: relative;
}

.pedido-client-search {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.pedido-add-client-button {
    width: 48px;
    min-width: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px !important;
    font-size: 16px;
}

.pedido-client-field
.select2-container
.select2-selection--single {
    min-height: 44px;
    border-radius: 9px;
    border-color: #d7e0ea;
}

.pedido-client-field
.select2-container
.select2-selection--single
.select2-selection__rendered {
    line-height: 42px;
}

.pedido-client-field
.select2-container
.select2-selection--single
.select2-selection__arrow {
    height: 42px;
}


/* ================================================================
   DISPONIBILIDAD
================================================================ */

.pedido-availability-box {
    padding: 13px 15px;
    background: #f7faff;
    border: 1px solid #dce8f8;
    border-radius: 11px;
}

.pedido-availability-label {
    display: flex !important;
    align-items: center;
    gap: 11px !important;
    margin: 0 !important;
    cursor: pointer;
}

.pedido-availability-label strong {
    display: block;
    font-size: 13px;
    color: #1e293b;
}

.pedido-availability-label small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #64748b;
    font-weight: 400;
}

.pedido-checkbox {
    width: 20px;
    height: 20px;
    position: relative;
    flex-shrink: 0;
}

.pedido-checkbox input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pedido-checkbox span {
    width: 20px;
    height: 20px;
    display: block;
    border: 2px solid #b7c3d1;
    border-radius: 6px;
    background: #ffffff;
    transition: .15s ease;
}

.pedido-checkbox input:checked + span {
    background: #2563eb;
    border-color: #2563eb;
}

.pedido-checkbox input:checked + span::after {
    content: "✓";
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}


/* ================================================================
   PRODUCTOS
================================================================ */

.pedido-products-header {
    padding-top: 17px;
    padding-bottom: 17px;
}

.pedido-add-product {
    border-radius: 9px;
    padding-left: 14px;
    padding-right: 14px;
}

.pedido-products-body {
    padding: 0 22px 20px;
}

.pedido-table-wrapper {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow-x: auto;
}

.pedido-detail-table {
    min-width: 720px;
}

.pedido-detail-table thead th {
    padding: 13px 14px;
    background: #f7f9fc;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .045em;
    white-space: nowrap;
}

.pedido-detail-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf1f5;
    vertical-align: middle;
}

.pedido-detail-table tbody tr:last-child td {
    border-bottom: 0;
}

.pedido-detail-table tbody tr:hover {
    background: #fbfdff;
}

.pedido-detail-table .form-control {
    min-height: 40px;
}

.pedido-subtotal {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 11px;
    background: #f0fdf4;
    border: 1px solid #d7f1df;
    border-radius: 8px;
    color: #15803d;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.pedido-remove {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 8px;
}

.pedido-products-empty {
    margin-top: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border-radius: 10px;
}

.pedido-empty-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eafaf1;
    color: #16a34a;
}

.pedido-products-empty strong {
    display: block;
    font-size: 12px;
    color: #334155;
}

.pedido-products-empty span {
    display: block;
    font-size: 11px;
    color: #64748b;
}


/* ================================================================
   ACCIONES
================================================================ */

.pedido-form-actions {
    margin-top: 20px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.035);
}

.pedido-form-actions .btn {
    min-height: 42px;
    border-radius: 9px;
}

.pedido-save-button {
    padding-left: 19px;
    padding-right: 19px;
    font-weight: 600;
}

.pedido-cancel-button {
    border: 1px solid #d9e1eb;
    background: #ffffff;
}


/* ================================================================
   MODAL CLIENTE
================================================================ */

.pedido-client-modal {
    border: 0;
    border-radius: 16px;
    overflow: hidden;
}

.pedido-modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid #e7edf4;
    background: #fbfcfe;
}

.pedido-modal-title {
    display: flex;
    align-items: center;
    gap: 11px;
}

.pedido-modal-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #eaf2ff;
    color: #2563eb;
}

.pedido-modal-title h5 {
    margin: 0;
    font-size: 17px;
    color: #172033;
}

.pedido-modal-title p {
    margin: 2px 0 0;
    font-size: 12px;
    color: #64748b;
}

.pedido-client-modal .modal-body {
    padding: 20px;
}

.pedido-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #e7edf4;
    background: #fbfcfe;
}

.pedido-modal-cancel {
    border: 1px solid #d9e1eb;
    background: #ffffff;
}


/* ================================================================
   RESPONSIVE
================================================================ */

@media (max-width: 767.98px) {

    .pedido-section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .pedido-number-badge {
        width: 100%;
        text-align: left;
    }

    .pedido-section-body {
        padding: 17px;
    }

    .pedido-products-body {
        padding: 0 17px 17px;
    }

    .pedido-form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .pedido-form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .pedido-add-product {
        width: 100%;
        justify-content: center;
    }

    .pedido-client-search {
        gap: 7px;
    }

    .pedido-add-client-button {
        width: 44px;
        min-width: 44px;
    }
}

/*CAJA*/

.caja-detalle {
        --c-texto: #1f2937;
        --c-suave: #6b7280;
        --c-linea: #e5e7eb;
        --c-fondo: #ffffff;
        --c-exito: #0f766e;
        --c-peligro: #b91c1c;
    }

    .caja-detalle .fs-7 { font-size: .8125rem; }

    /* Tarjeta base: una sola sombra, un solo radio. */
    .caja-detalle .panel {
        background: var(--c-fondo);
        border: 1px solid var(--c-linea);
        border-radius: 10px;
        margin-bottom: 1.25rem;
        overflow: hidden;
    }
    .caja-detalle .panel-head {
        padding: 1rem 1.25rem;
        border-bottom: 1px solid var(--c-linea);
        display: flex;
        flex-wrap: wrap;
        gap: .75rem;
        justify-content: space-between;
        align-items: center;
    }

    /* Bloque destacado: el efectivo esperado manda sobre el resto. */
    .caja-detalle .arqueo {
        background: #0f172a;
        color: #f8fafc;
        border-radius: 10px;
        padding: 1.25rem 1.5rem;
    }
    .caja-detalle .arqueo .cifra {
        font-size: clamp(1.75rem, 4vw, 2.5rem);
        font-weight: 700;
        line-height: 1.1;
        font-variant-numeric: tabular-nums;
    }
    .caja-detalle .arqueo .etiqueta { color: #94a3b8; font-size: .875rem; }

    .caja-detalle .metrica {
        border: 1px solid var(--c-linea);
        border-radius: 10px;
        padding: .9rem 1rem;
        height: 100%;
        background: var(--c-fondo);
    }
    .caja-detalle .metrica .rotulo { color: var(--c-suave); font-size: .8125rem; }
    .caja-detalle .metrica .valor {
        font-size: 1.25rem;
        font-weight: 650;
        font-variant-numeric: tabular-nums;
    }

    .caja-detalle .estado {
        padding: .2rem .7rem;
        border-radius: 999px;
        font-size: .75rem;
        font-weight: 700;
    }
    .caja-detalle .estado.abierta  { background: #d1fae5; color: #065f46; }
    .caja-detalle .estado.cerrada  { background: #e5e7eb; color: #374151; }

    .caja-detalle table th {
        background: #f9fafb;
        color: var(--c-suave);
        font-size: .8125rem;
        font-weight: 600;
        padding: .75rem 1rem;
        white-space: nowrap;
    }
    .caja-detalle table td {
        padding: .75rem 1rem;
        font-size: .875rem;
        color: var(--c-texto);
        vertical-align: middle;
    }
    .caja-detalle table tfoot td {
        background: #f9fafb;
        font-weight: 700;
        border-top: 2px solid var(--c-linea);
    }
    .caja-detalle .num { font-variant-numeric: tabular-nums; text-align: right; }

    .caja-detalle .fila-oculta { display: none; }

    @media print {
        .caja-detalle .no-imprimir { display: none !important; }
        .caja-detalle .panel { break-inside: avoid; box-shadow: none; }
        .caja-detalle .arqueo { background: #fff; color: #000; border: 1px solid #000; }
    }
    @media (prefers-reduced-motion: reduce) {
        .caja-detalle * { transition: none !important; }
    }
.caja-detalle .digital-detalle {
    font-size: .75rem;
}

.caja-detalle .filtro-movimientos {
    max-width: 220px;
}

.caja-detalle .kpi-animado {
    transition: transform .2s ease, box-shadow .2s ease;
}

.caja-detalle .kpi-animado:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15,23,42,.07);
}

.caja-detalle .kpi-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 14px;
    flex: 0 0 30px;
    animation: kpiIconPulse 2.8s ease-in-out infinite;
}

@keyframes kpiIconPulse {
    0%,100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .caja-detalle .kpi-animado,
    .caja-detalle .kpi-icon {
        animation: none;
        transition: none;
    }
}

.reporte-impresion {
    display: none;
}

@media print {
    @page {
        size: A4 landscape;
        margin: 10mm 12mm;
    }

    body {
        background: #fff !important;
        color: #111 !important;
    }

    .caja-detalle {
        display: none !important;
    }

    .reporte-impresion {
        display: block !important;
        width: 100%;
        font-family: Arial, Helvetica, sans-serif;
        color: #111827;
        font-size: 10px;
    }

    .reporte-encabezado {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        padding-bottom: 8px;
    }

    .reporte-marca {
        font-size: 18px;
        font-weight: 800;
        letter-spacing: .02em;
    }

    .reporte-titulo {
        margin-top: 2px;
        font-size: 15px;
        font-weight: 700;
        letter-spacing: .04em;
    }

    .reporte-subtitulo {
        margin-top: 2px;
        color: #6b7280;
        font-size: 9px;
    }

    .reporte-numero {
        text-align: right;
    }

    .reporte-numero span {
        display: block;
        color: #6b7280;
        font-size: 9px;
    }

    .reporte-numero strong {
        font-size: 20px;
    }

    .reporte-linea {
        border-bottom: 2px solid #111827;
        margin-bottom: 10px;
    }

    .reporte-datos {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        border: 1px solid #d1d5db;
        margin-bottom: 10px;
    }

    .reporte-datos > div {
        padding: 7px 9px;
        border-right: 1px solid #e5e7eb;
        border-bottom: 1px solid #e5e7eb;
    }

    .reporte-datos > div:nth-child(4n) {
        border-right: 0;
    }

    .reporte-datos span,
    .reporte-resumen span,
    .reporte-arqueo span {
        display: block;
        color: #6b7280;
        font-size: 8px;
        text-transform: uppercase;
        letter-spacing: .03em;
    }

    .reporte-datos strong {
        display: block;
        margin-top: 2px;
        font-size: 9px;
    }

    .reporte-seccion {
        margin-bottom: 10px;
        break-inside: avoid;
    }

    .reporte-seccion-titulo {
        background: #111827;
        color: #fff;
        padding: 6px 8px;
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .04em;
    }

    .reporte-resumen {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        border: 1px solid #d1d5db;
        border-top: 0;
    }

    .reporte-resumen > div {
        padding: 8px;
        border-right: 1px solid #e5e7eb;
    }

    .reporte-resumen > div:last-child {
        border-right: 0;
    }

    .reporte-resumen strong {
        display: block;
        margin-top: 3px;
        font-size: 13px;
    }

    .reporte-resumen .destacado {
        background: #f3f4f6;
    }

    .rojo {
        color: #b91c1c !important;
    }

    .verde {
        color: #047857 !important;
    }

    .reporte-arqueo {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        border: 1px solid #d1d5db;
        border-top: 0;
    }

    .reporte-arqueo > div {
        padding: 9px 12px;
        border-right: 1px solid #e5e7eb;
    }

    .reporte-arqueo > div:last-child {
        border-right: 0;
    }

    .reporte-arqueo strong {
        display: block;
        margin-top: 3px;
        font-size: 16px;
    }

    .reporte-arqueo .faltante {
        background: #fef2f2;
        color: #b91c1c;
    }

    .reporte-arqueo .sobrante {
        background: #ecfdf5;
        color: #047857;
    }

    .reporte-arqueo .cuadrado {
        background: #f0fdf4;
        color: #166534;
    }

    .reporte-observacion {
        margin-top: 6px;
        padding: 7px 9px;
        border: 1px solid #d1d5db;
        background: #f9fafb;
        font-size: 9px;
    }

    .reporte-observacion p {
        margin: 3px 0 0;
    }

    .reporte-tabla {
        width: 100%;
        border-collapse: collapse;
        border: 1px solid #d1d5db;
    }

    .reporte-tabla th {
        background: #f3f4f6;
        color: #374151;
        padding: 6px;
        border: 1px solid #d1d5db;
        font-size: 8px;
        text-transform: uppercase;
        text-align: left;
    }

    .reporte-tabla td {
        padding: 5px 6px;
        border: 1px solid #e5e7eb;
        font-size: 8.5px;
        vertical-align: middle;
    }

    .reporte-tabla tbody tr:nth-child(even) {
        background: #fafafa;
    }

    .reporte-tabla tfoot td {
        background: #f3f4f6;
        font-weight: 700;
        border-top: 2px solid #9ca3af;
    }

    .derecha {
        text-align: right !important;
    }

    .sin-datos {
        text-align: center !important;
        color: #6b7280;
        padding: 10px !important;
    }

    .reporte-firma {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 80px;
        margin-top: 25px;
        break-inside: avoid;
    }

    .reporte-firma div {
        text-align: center;
    }

    .reporte-firma span {
        display: block;
        border-top: 1px solid #374151;
        margin-bottom: 5px;
    }

    .reporte-firma strong {
        font-size: 9px;
        font-weight: 600;
    }

    .reporte-pie {
        border-top: 1px solid #d1d5db;
        margin-top: 15px;
        padding-top: 5px;
        color: #6b7280;
        font-size: 7.5px;
        text-align: center;
    }
}

/*LOGIN*/.sigda-login-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: url('../images/fondo-login.webp') center center / cover no-repeat;
    font-family: Arial, sans-serif;
}

.sigda-login-body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(7, 20, 40, .32);
    z-index: 0;
}

.sigda-login-wrapper {
    position: relative;
    z-index: 1;
    width: min(430px, calc(100% - 32px));
    padding: 20px 0;
}

.sigda-login-card {
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 20px;
    padding: 36px;
    box-shadow: 0 20px 55px rgba(15,23,42,.22);
}

.sigda-login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.sigda-login-logo {
    width: 82px;
    height: 82px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.sigda-login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.sigda-login-logo-default {
    background: #eaf2ff;
    border-color: #d6e5ff;
    color: #2563eb;
    font-size: 34px;
}

.sigda-login-system {
    color: #0f172a;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.5px;
}

.sigda-login-company {
    margin-top: 4px;
    color: #2563eb;
    font-size: 14px;
    font-weight: 700;
}

.sigda-login-subtitle {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 13px;
}

.sigda-login-error {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 18px;
    padding: 11px 13px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
}

.sigda-login-group {
    margin-bottom: 17px;
}

.sigda-login-group label {
    display: block;
    margin-bottom: 7px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.sigda-login-input {
    display: flex;
    align-items: center;
    height: 48px;
    border: 1px solid #d7dee8;
    border-radius: 10px;
    background: #fff;
    transition: .2s ease;
}

.sigda-login-input i {
    width: 43px;
    text-align: center;
    color: #64748b;
    font-size: 17px;
}

.sigda-login-input input {
    width: 100%;
    height: 100%;
    padding: 0 12px 0 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #0f172a;
    font-size: 14px;
}

.sigda-login-input input::placeholder {
    color: #94a3b8;
}

.sigda-login-input:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.10);
}

.sigda-login-input:focus-within i {
    color: #2563eb;
}

.sigda-login-button {
    width: 100%;
    height: 48px;
    margin-top: 4px;
    border: 0;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s ease;
    box-shadow: 0 8px 20px rgba(37,99,235,.20);
}

.sigda-login-button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(37,99,235,.28);
}

.sigda-login-button:active {
    transform: translateY(0);
}

.sigda-login-button i {
    margin-right: 6px;
}

.sigda-login-footer {
    margin-top: 24px;
    text-align: center;
    color: #94a3b8;
    font-size: 11px;
}

.sigda-login-footer span {
    margin: 0 4px;
}

@media (max-width: 576px) {
    .sigda-login-wrapper {
        width: min(100% - 24px, 430px);
    }

    .sigda-login-card {
        padding: 28px 22px;
        border-radius: 17px;
    }

    .sigda-login-system {
        font-size: 25px;
    }

    .sigda-login-logo {
        width: 76px;
        height: 76px;
    }
}
/*DASHBOARDA*/
/* ============================================================
   DASHBOARD - ACCESOS RÁPIDOS
   ============================================================ */

.dashboard-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    padding: 24px 26px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--app-border);
}

.dashboard-welcome-label {
    display: block;
    margin-bottom: 3px;
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.dashboard-welcome h2 {
    margin: 0;
    color: #1f2937;
    font-size: 24px;
    font-weight: 700;
}

.dashboard-welcome p {
    margin: 5px 0 0;
    color: var(--app-muted);
    font-size: 13px;
}

.dashboard-welcome-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 21px;
    flex: 0 0 52px;
}

.dashboard-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-quick-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 105px;
    padding: 18px;
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background: #fff;
    text-decoration: none !important;
    transition: .2s ease;
}

.dashboard-quick-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(15,23,42,.08);
}

.dashboard-quick-icon {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 20px;
}

.dashboard-quick-content {
    flex: 1;
    min-width: 0;
}

.dashboard-quick-content h3 {
    margin: 0;
    color: #1f2937;
    font-size: 15px;
    font-weight: 700;
}

.dashboard-quick-content p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.dashboard-quick-arrow {
    color: #94a3b8;
    font-size: 16px;
    transition: .2s ease;
}

.dashboard-quick-card:hover .dashboard-quick-arrow {
    color: #2563eb;
    transform: translateX(3px);
}

.dashboard-blue .dashboard-quick-icon {
    background: #dbeafe;
    color: #2563eb;
}

.dashboard-purple .dashboard-quick-icon {
    background: #ede9fe;
    color: #7c3aed;
}

.dashboard-teal .dashboard-quick-icon {
    background: #ccfbf1;
    color: #0f766e;
}

.dashboard-green .dashboard-quick-icon {
    background: #dcfce7;
    color: #16a34a;
}

.dashboard-sky .dashboard-quick-icon {
    background: #e0f2fe;
    color: #0284c7;
}

.dashboard-pink .dashboard-quick-icon {
    background: #fce7f3;
    color: #db2777;
}

.dashboard-amber .dashboard-quick-icon {
    background: #fef3c7;
    color: #d97706;
}

.dashboard-orange .dashboard-quick-icon {
    background: #ffedd5;
    color: #ea580c;
}

.dashboard-dark .dashboard-quick-icon {
    background: #e2e8f0;
    color: #334155;
}

@media (max-width: 900px) {
    .dashboard-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .dashboard-welcome {
        padding: 20px;
    }

    .dashboard-welcome h2 {
        font-size: 21px;
    }

    .dashboard-quick-grid {
        grid-template-columns: 1fr;
    }
}