@charset "UTF-8";

:root {
    --app-main-blue: #4678ad;
    --app-dark-blue: #22436c;
    --app-light-blue: #e8f0f8;
    --app-header-grad-1: #dbe7f4;
    --app-header-grad-2: #c4d7ec;
    --app-border-color: #b0c4de;
    --app-card-bg: #ffffff;
    --app-card-hover: #f7faff;
    --app-text-dark: #1e293b;
}

body {
    background-color: #e5edf5;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--app-text-dark);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Window Container Mockup */
.desktop-window {
    max-width: 920px;
    margin: 20px auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    border: 1px solid #7c98b6;
}

/* Window Titlebar */
.window-titlebar {
    background: #ffffff;
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #d0dbe5;
    user-select: none;
    font-size: 13px;
    color: #333;
}

.window-title-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.window-controls {
    display: flex;
    gap: 12px;
    color: #555;
}

.window-controls i {
    cursor: pointer;
    font-size: 13px;
    transition: color 0.15s;
}

.window-controls i:hover {
    color: #d9534f;
}

/* Siscon Header Bar */
.siscon-header-bar {
    background: linear-gradient(180deg, var(--app-header-grad-1) 0%, var(--app-header-grad-2) 100%);
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--app-border-color);
}

.siscon-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.siscon-logo-badge {
    background: #1c4984;
    color: #ffffff;
    font-weight: 900;
    font-size: 24px;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-flex;
    align-items: baseline;
    letter-spacing: -1px;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.4), 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
}

.siscon-logo-badge .sup-sc {
    font-size: 10px;
    vertical-align: super;
    margin-left: 2px;
    color: #90cdf4;
}

.siscon-header-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--app-dark-blue);
    text-shadow: 1px 1px 0 rgba(255,255,255,0.7);
    margin: 0;
}

.btn-help-box {
    background: #2b6cb0;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border: 1px solid #1a4971;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.3);
    transition: background 0.15s;
}

.btn-help-box:hover {
    background: #1d4f82;
    color: #ffffff;
}

/* Panel Body */
.panel-grid-container {
    background-color: var(--app-main-blue);
    padding: 24px;
    position: relative;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.module-card {
    background: var(--app-card-bg);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #1e293b;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    min-height: 140px;
    position: relative;
    user-select: none;
}

.module-card:hover:not(.disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    background: var(--app-card-hover);
    color: #0d6efd;
}

.module-card.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(80%);
    background: #f1f5f9;
}

.module-card.disabled .lock-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #64748b;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

.module-icon-wrap {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.module-icon-wrap img, .module-icon-wrap svg {
    max-height: 68px;
    max-width: 92px;
    object-fit: contain;
    border-radius: 4px;
}

.module-title {
    font-weight: 700;
    font-size: 15px;
    text-align: center;
    color: #2c3e50;
    margin: 0;
}

.panel-footer-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

.btn-salir {
    background: #ffffff;
    color: #333333;
    border: 1px solid #cbd5e1;
    font-weight: 600;
    padding: 6px 28px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    text-decoration: none;
    transition: all 0.15s;
}

.btn-salir:hover {
    background: #f8fafc;
    color: #d9534f;
    border-color: #d9534f;
}

/* Configuration Modal Styling */
.modal-config-dialog {
    max-width: 860px;
}

.modal-config-header {
    background: linear-gradient(180deg, var(--app-header-grad-1) 0%, var(--app-header-grad-2) 100%);
    border-bottom: 1px solid var(--app-border-color);
    padding: 10px 16px;
}

.modal-config-body {
    background: #f8fafc;
    padding: 20px 24px;
}

.form-label-config {
    font-weight: 600;
    color: #334155;
    font-size: 14px;
    margin-bottom: 4px;
}

.config-input {
    border: 1px solid #94a3b8;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    background-color: #ffffff;
}

.config-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.limpiar-datos-box {
    background-color: #fff1f2;
    border: 1.5px solid #fecdd3;
    border-radius: 6px;
    padding: 14px;
    margin-top: 15px;
}

.limpiar-datos-box h6 {
    color: #9f1239;
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 14px;
}

.btn-limpiar {
    background-color: #e11d48;
    color: #ffffff;
    font-weight: 700;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    transition: background 0.15s;
}

.btn-limpiar:hover {
    background-color: #be123c;
    color: white;
}

/* Right buttons in Config modal */
.config-side-btn {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #94a3b8;
    color: #1e293b;
    font-weight: 600;
    font-size: 13.5px;
    padding: 7px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.15s ease;
    text-align: center;
}

.config-side-btn:hover {
    background-color: #f1f5f9;
    border-color: #475569;
    color: #0f172a;
}

.btn-actualizar {
    background-color: #ffffff;
    border: 1.5px solid #334155;
    color: #0f172a;
    font-weight: 700;
    padding: 7px 24px;
    border-radius: 4px;
}

.btn-actualizar:hover {
    background-color: #0f172a;
    color: #ffffff;
}

/* Carousel/Image preview box */
.config-preview-box {
    border: 1.5px solid #94a3b8;
    background: #ffffff;
    border-radius: 6px;
    padding: 8px;
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
}

.config-preview-box img {
    max-height: 110px;
    max-width: 100%;
    object-fit: contain;
}

/* Login Page Custom Style */
.login-body {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: #ffffff;
    border-radius: 10px;
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.login-header {
    background: linear-gradient(180deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
    text-align: center;
    padding: 25px 20px 20px;
}

.siscon-logo {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -1px;
}

.siscon-logo .sis-s {
    font-size: 40px;
    color: #ffffff;
}

.siscon-logo .sis-is {
    color: #93c5fd;
}

.siscon-logo .sis-icon {
    color: #f59e0b;
    margin: 0 2px;
}

.siscon-logo .sis-con {
    color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .desktop-window {
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .modules-grid {
        grid-template-columns: 1fr;
    }
}

/* Registro de Entidades UI */
.modal-entidades-dialog {
    max-width: 1060px;
}

.entidades-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.btn-entidad-action {
    background-color: #ffffff;
    border: 1px solid #94a3b8;
    color: #1e293b;
    font-size: 13.5px;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.15s ease;
}

.btn-entidad-action:hover {
    background-color: #f1f5f9;
    border-color: #475569;
}

.btn-entidad-action.btn-pdf {
    background-color: #dc2626;
    color: #ffffff;
    border-color: #b91c1c;
    font-weight: 600;
}

.btn-entidad-action.btn-pdf:hover {
    background-color: #b91c1c;
    color: #ffffff;
}

.btn-entidad-action.btn-excel {
    background-color: #16a34a;
    color: #ffffff;
    border-color: #15803d;
    font-weight: 600;
}

.btn-entidad-action.btn-excel:hover {
    background-color: #15803d;
    color: #ffffff;
}

.entidades-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
    position: relative;
    z-index: 1050;
}

.entidades-grid-wrapper {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    min-height: 420px;
    overflow-x: auto;
}

.table-entidades-grid {
    margin-bottom: 0;
    font-size: 13.5px;
    border-collapse: collapse;
    width: 100%;
}

.table-entidades-grid thead th {
    background-color: #f1f5f9;
    color: #334155;
    font-weight: 600;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    white-space: nowrap;
}

.table-entidades-grid tbody td {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    vertical-align: middle;
    color: #1e293b;
}

.table-entidades-grid tbody tr:hover {
    background-color: #f8fafc;
}

.table-entidades-grid tbody tr.empty-grid-row td {
    height: 28px;
    background-color: #ffffff;
}

/* ==========================================================================
   Multi-level Accounts TreeView Styles
   ========================================================================== */
.treeview-container {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    overflow-x: auto;
    max-height: 480px;
    user-select: none;
}

.treeview, .treeview ul {
    list-style: none;
    padding-left: 18px;
    margin: 0;
    position: relative;
}

.treeview ul {
    border-left: 1px dotted #94a3b8;
    margin-left: 7px;
}

.treeview li {
    margin: 3px 0;
    position: relative;
    white-space: nowrap;
}

.treeview li::before {
    content: '';
    position: absolute;
    top: 10px;
    left: -11px;
    width: 10px;
    height: 1px;
    border-top: 1px dotted #94a3b8;
}

.tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    border: 1px solid #64748b;
    background-color: #ffffff;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    margin-right: 4px;
    vertical-align: middle;
    font-weight: bold;
    color: #1e293b;
}

.tree-node-text {
    cursor: pointer;
    padding: 1px 4px;
    border-radius: 2px;
    color: #0f172a;
    display: inline-block;
    transition: background-color 0.1s ease;
}

.tree-node-text:hover {
    background-color: #e2e8f0;
}

.tree-node-text.active-node {
    background-color: #0078d7 !important;
    color: #ffffff !important;
}

.tree-node-group {
    font-weight: bold;
    color: #000000;
}

.tree-node-detail {
    font-weight: normal;
    color: #1e293b;
}

/* ==========================================================================
   Presupuesto Calendar Styles
   ========================================================================== */
.calendar-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background-color: #ffffff;
}

.calendar-table thead th {
    background-color: #2c7bb6;
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    padding: 8px 4px;
    border: 1px solid #1f5d8c;
}

.calendar-day-cell {
    height: 100px;
    vertical-align: top;
    border: 1px solid #cbd5e1;
    padding: 4px;
    background-color: #ffffff;
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.calendar-day-cell:hover {
    background-color: #f1f5f9;
}

.calendar-day-cell.other-month {
    background-color: #f8fafc;
    color: #94a3b8;
}

.calendar-day-cell.today-cell {
    border: 2px solid #0078d7;
}

.calendar-day-num {
    font-size: 12px;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 3px;
}

.presu-pills-container {
    max-height: 75px;
    overflow-y: auto;
}

.presu-pill {
    display: block;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 2px;
    margin-bottom: 2px;
    text-decoration: none;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform 0.1s ease;
}

.presu-pill:hover {
    transform: scale(1.02);
}

/* Pendiente de pago: Fondo rojo y letras rojas / blancas */
.presu-pill-pending {
    background-color: #c9302c !important;
    color: #ffffff !important;
    border-left: 3px solid #79100d;
    font-weight: bold;
}

/* Pagado: Fondo verde suave y letras negras */
.presu-pill-paid {
    background-color: #d4edda !important;
    color: #155724 !important;
    border-left: 3px solid #28a745;
    font-weight: bold;
}

/* Modales hijos o sub-ventanas apiladas */
#modalProdLotes,
#modalProdVariantes,
#modalProdCombo,
#modalProdPromo,
#modalAutorizacionEliminar {
    overflow-y: auto;
}

/* ==========================================================================
   ESTILOS DE VENTANA ESCRITORIO SISCON (Cuentas por Cobrar / Cuentas por Pagar)
   ========================================================================== */
.modal-siscon-window {
    background-color: #f0f0f0 !important;
    border: 1px solid #7a9db9 !important;
    border-radius: 4px !important;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45) !important;
    overflow: hidden;
}

.siscon-top-header {
    background: linear-gradient(180deg, #abc7e6 0%, #b8d2eb 50%, #abc7e6 100%);
    padding: 6px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #8faec9;
}

.siscon-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.siscon-logo-img {
    height: 32px !important;
    max-height: 32px !important;
    width: auto !important;
    border-radius: 3px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    image-rendering: -webkit-optimize-contrast;
}

.siscon-title-text {
    font-size: 18px;
    font-weight: 800;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #1a3c61;
    letter-spacing: 0.5px;
    margin: 0;
}

.siscon-filter-bar {
    background-color: #f0f0f0;
    padding: 10px 14px 6px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: #000000;
}

.siscon-filters-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.siscon-filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.siscon-label {
    font-size: 13px;
    color: #000000;
    white-space: nowrap;
    margin: 0;
}

.siscon-input, .siscon-select {
    background: #ffffff;
    border: 1px solid #7a9db9;
    border-radius: 1px;
    padding: 2px 6px;
    font-size: 13px;
    height: 25px;
    color: #000000;
    outline: none;
}

.siscon-input:focus, .siscon-select:focus {
    border-color: #316ac5;
    box-shadow: 0 0 2px rgba(49, 106, 197, 0.6);
}

.siscon-help-box {
    background: #ffffff;
    border: 1px solid #7a9db9;
    border-radius: 2px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
    color: #000000;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.siscon-help-box:hover {
    background: #e5edf5;
}

.siscon-tab-header {
    background: #f0f0f0;
    padding: 6px 14px 0 14px;
    display: flex;
    gap: 2px;
    border-bottom: 1px solid #7a9db9;
}

.siscon-tab-link {
    background: #e2e8f0;
    border: 1px solid #7a9db9;
    border-bottom: none;
    padding: 3px 12px;
    font-size: 12px;
    color: #000000 !important;
    text-decoration: none;
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
    cursor: pointer;
    font-weight: normal;
}

.siscon-tab-link.active {
    background: #ffffff !important;
    font-weight: 600;
    border-bottom: 1px solid #ffffff;
    margin-bottom: -1px;
    z-index: 3;
}

.siscon-grid-wrap {
    background: #ffffff;
    border: 1px solid #7a9db9;
    margin: 0 14px;
    height: 380px;
    overflow-y: scroll;
    overflow-x: auto;
}

.siscon-grid-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 12px;
    color: #000000;
}

.siscon-grid-table thead th {
    background: #ffffff;
    border: 1px solid #d0d7de;
    padding: 4px 8px;
    font-weight: bold;
    color: #000000;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: inset 0 -1px 0 #d0d7de;
}

.siscon-grid-table tbody td {
    border: 1px solid #e1e4e8;
    padding: 3px 8px;
    height: 22px;
    color: #000000;
    vertical-align: middle;
}

.siscon-grid-table tbody tr:hover td {
    background-color: #f0f7ff;
}

.siscon-footer-bar {
    background: #f0f0f0;
    padding: 8px 14px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.siscon-total-label {
    font-weight: bold;
    font-size: 13px;
    color: #000000;
}

.siscon-total-input {
    background: #e9ecef;
    border: 1px solid #7a9db9;
    border-radius: 1px;
    width: 130px;
    text-align: right;
    font-weight: bold;
    font-size: 13px;
    padding: 2px 6px;
    height: 24px;
    color: #000000;
}

/* SweetAlert2 Modal Layering (Above all submodals and backdrops) */
.swal2-container {
    z-index: 99999 !important;
}




