﻿:root {
    --brand: #0b5ed7;
    --text-muted: #6c757d;
}

body {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.card {
    border-radius: 0.9rem;
}

.table > :not(caption) > * > * {
    padding: 0.75rem 0.6rem;
}

#viewDocumentModal #view_estado_badge {
    white-space: nowrap;
}

#viewDocumentModal #view_proveedor {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
}

#viewDocumentModal #view_monto_total {
    white-space: nowrap;
}

#viewDocumentModal .doc-left-card {
    border: 1px solid #e6eaf0;
    border-radius: 0.85rem;
    background: #fff;
    padding: 1rem;
}

#viewDocumentModal .doc-top-grid {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-start;
}

#viewDocumentModal .doc-top-main {
    min-width: 0;
    flex: 1;
}

#viewDocumentModal .doc-kv-row {
    display: grid;
    grid-template-columns: 98px 12px minmax(0, 1fr);
    align-items: baseline;
    margin-bottom: 0.35rem;
}

#viewDocumentModal .doc-kv-label {
    font-size: 0.79rem;
    font-weight: 600;
    color: #1f3558;
}

#viewDocumentModal .doc-kv-sep {
    color: #7a8798;
}

#viewDocumentModal .doc-kv-value {
    color: #303946;
    word-break: break-word;
}

#viewDocumentModal .doc-kv-total-row .doc-kv-value {
    color: #0d47c7;
    font-size: 1.08rem;
    font-weight: 700;
}

#viewDocumentModal .doc-tax-line {
    margin-top: 0.2rem;
    color: #6f7b88;
    font-size: 0.8rem;
}

#viewDocumentModal .doc-tax-grid {
    margin-top: 0.2rem;
    display: grid;
    gap: 0.1rem;
}

#viewDocumentModal .doc-tax-row {
    display: grid;
    grid-template-columns: 98px 12px minmax(0, 1fr);
    align-items: baseline;
    color: #6f7b88;
    font-size: 0.8rem;
}

#viewDocumentModal .doc-tax-label {
    font-weight: 400;
    color: inherit;
}

#viewDocumentModal .doc-top-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.55rem;
}

#viewDocumentModal #editButtonContainer .btn {
    border-radius: 999px;
}

#viewDocumentModal #editButtonContainer .btn-outline-primary {
    border-color: #0d6efd;
    color: #0d6efd;
}

#viewDocumentModal #view_estado_badge.bg-warning {
    background-color: #fff2c7 !important;
    color: #856404 !important;
}

.badge.text-bg-warning {
    background-color: #fff2c7 !important;
    color: #856404 !important;
}

.badge.text-bg-success,
.badge.bg-success {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
}

.badge.text-bg-danger,
.badge.bg-danger {
    background-color: #f8d7da !important;
    color: #842029 !important;
}

.badge.text-bg-secondary,
.badge.bg-secondary {
    background-color: #e2e3e5 !important;
    color: #41464b !important;
}

#viewDocumentModal .doc-toolbar-lite {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

#viewDocumentModal .doc-toolbar-lite .btn-link {
    color: #0d47c7;
    font-weight: 600;
}

#viewDocumentModal .doc-soft-divider {
    border: 0;
    border-top: 1px solid #ebeff4;
    margin: 0.75rem 0 0;
}

#viewDocumentModal .doc-section-title {
    color: #0d47c7;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

#viewDocumentModal .doc-data-label {
    color: #17315b;
    font-size: 0.77rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

#viewDocumentModal .doc-data-value {
    color: #2f3947;
    font-size: 0.87rem;
}

/* ================================================================
   ADMIN MODULE — ERP panels (cost centers + accounting categories)
   Scope: .adm-* — no Bootstrap collisions.
   ================================================================ */

/* ── Card header area ── */
.adm-panel-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.adm-panel-subtitle {
    font-size: 0.77rem;
    color: #64748b;
    margin: 0.15rem 0 0;
}

/* ── Table column headers ── */
.adm-th {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 0.55rem 0.75rem !important;
    white-space: nowrap;
}

/* ── Centro de costo name (read-only display) ── */
.adm-centro-name {
    font-size: 0.87rem;
    font-weight: 500;
    color: #1e293b;
}

/* ── ERP code: styled monospace chip ── */
.adm-erp-code-display {
    display: inline-block;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 0.15em 0.55em;
    border-radius: 5px;
    letter-spacing: 0.03em;
}

/* ── Live preview text ── */
.adm-preview-text {
    font-size: 0.78rem;
    color: #94a3b8;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ── Pending ERP row ── */
.adm-row-pending {
    background-color: #fffbeb !important;
}

/* ── Tiendas visual separator ── */
.adm-tiendas-section-row td {
    border-top: 2px solid #e2e8f0 !important;
    padding-bottom: 0 !important;
    background: transparent;
}

.adm-tiendas-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0.1rem 0 0.4rem;
}

.adm-tiendas-header::before,
.adm-tiendas-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ── Category group header row ── */
.adm-group-row > td {
    padding: 0.5rem 0.75rem 0.3rem !important;
    border-top: 2px solid #f1f5f9 !important;
    background: #f8fafc;
}

.adm-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #475569;
}

/* First group row: no extra border at top */
.adm-group-row:first-child > td {
    border-top: 0 !important;
}

/* Shared app layout: compact sidebar + wider content panel */
.app-sidebar-col {
    width: 100%;
}

.app-main-col {
    width: 100%;
}

@media (min-width: 992px) {
    .app-sidebar-col {
        flex: 0 0 18%;
        max-width: 18%;
    }

    .app-main-col {
        flex: 0 0 82%;
        max-width: 82%;
    }
}

@media (min-width: 1200px) {
    .app-sidebar-col {
        flex: 0 0 16%;
        max-width: 16%;
    }

    .app-main-col {
        flex: 0 0 84%;
        max-width: 84%;
    }
}

/* Shared review flow timeline */
.app-flow-track {
    position: relative;
    margin: .25rem 0 .5rem;
    height: 40px;
}

.app-flow-track::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 5%;
    right: 5%;
    height: 3px;
    background: #dbe3eb;
    border-radius: 999px;
}

.app-flow-steps {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
}

.app-flow-step {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 2px solid #cfd8e3;
    background: #e9eef5;
    color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.app-flow-step.active {
    border-color: #0d6efd;
    background: #0d6efd;
    color: #fff;
}

/* ================================================================
   KC PROFILE DROPDOWN — navbar usuario (v1.0)
   Scope: .kc-profile-* — zero colisiones con Bootstrap existente.
   Reversible: eliminar este bloque + revertir header.php.
   ================================================================ */

/* ── Trigger ── */
.kc-profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.65rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    color: #1e293b;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.kc-profile-trigger:hover,
.kc-profile-trigger:focus-visible {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #1e293b;
    outline: none;
    box-shadow: none;
}

/* Ocultar el caret nativo de Bootstrap */
.kc-profile-trigger.dropdown-toggle::after {
    display: none;
}

/* ── Avatar pequeño (trigger) ── */
.kc-avatar-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.35);
}

/* ── Bloque de texto (nombre + email) en trigger ── */
.kc-profile-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.25;
}

.kc-profile-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kc-profile-email {
    font-size: 11px;
    color: #64748b;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Chevron animado ── */
.kc-chevron {
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform 0.22s ease;
}

.kc-profile-trigger[aria-expanded="true"] .kc-chevron {
    transform: rotate(180deg);
}

/* ── Panel flotante ── */
.kc-profile-panel {
    min-width: 284px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.13), 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    background: #ffffff;
    margin-top: 6px !important;
}

.kc-profile-panel.show {
    animation: kcDropIn 0.17s ease forwards;
}

@keyframes kcDropIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0)   scale(1);     }
}

/* ── Cabecera del panel (perfil) ── */
.kc-panel-header {
    padding: 1.4rem 1.25rem 1.2rem;
    text-align: center;
    background: linear-gradient(to bottom, #f8faff 0%, #ffffff 100%);
}

/* ── Avatar grande (panel) ── */
.kc-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 0.85rem;
}

.kc-avatar-lg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

/* ── Botón de cámara (preparado para avatar real futuro) ── */
.kc-camera-btn {
    position: absolute;
    bottom: 0;
    right: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #334155;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: default;
    padding: 0;
    opacity: 0.65;
    transition: opacity 0.15s;
}

.kc-camera-btn:not(:disabled):hover {
    opacity: 1;
    cursor: pointer;
}

/* ── Nombre y email en panel ── */
.kc-panel-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kc-panel-email {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 0.65rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Badge de rol ── */
.kc-role-badge {
    display: inline-block;
    padding: 0.2em 0.8em;
    background: #eff6ff;
    color: #2563eb;
    font-size: 11px;
    font-weight: 600;
    border-radius: 99px;
    letter-spacing: 0.03em;
}

/* ── Divisor ── */
.kc-divider {
    margin: 0.2rem 0;
    border-color: #f1f5f9;
    opacity: 1;
}

/* ── Ítems de navegación ── */
.kc-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.2rem;
    font-size: 13.5px;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}

.kc-nav-item:hover {
    background: #f1f5f9;
    color: #2563eb;
    text-decoration: none;
}

.kc-nav-item:hover .kc-nav-icon {
    color: #2563eb;
}

/* ── Icono de ítem ── */
.kc-nav-icon {
    color: #94a3b8;
    flex-shrink: 0;
    transition: color 0.12s;
}

/* ── Ítem Cerrar sesión ── */
.kc-nav-logout {
    color: #dc2626;
    margin-bottom: 0.25rem;
}

.kc-nav-logout .kc-nav-icon {
    color: #dc2626;
    opacity: 0.75;
    transition: color 0.12s, opacity 0.12s;
}

.kc-nav-logout:hover {
    background: #fff1f2;
    color: #b91c1c;
}

.kc-nav-logout:hover .kc-nav-icon {
    color: #b91c1c;
    opacity: 1;
}

/* ── Responsive — móvil ── */
@media (max-width: 575.98px) {
    .kc-profile-text,
    .kc-chevron {
        display: none;
    }
    .kc-profile-panel {
        min-width: 260px;
    }
    .kc-profile-trigger {
        padding: 0.35rem 0.5rem;
    }
}

/* ═══════════════════════════════════════════════
   SHARED DASHBOARD  (.fin-dash-table · .fin-flow · .fin-filter-select)
   ═══════════════════════════════════════════════ */
.fin-dash-table thead th {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
    font-weight: 600;
}
.fin-filter-select.fin-placeholder { color: #6c757d; }
.fin-filter-select.fin-placeholder option:not([value=""]):not([value="0"]) { color: #212529; }
.fin-flow { display: flex; align-items: flex-start; }
.fin-flow-step { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; }
.fin-flow-sep { flex: 1; height: 2px; background: #dee2e6; margin-top: 14px; }
.fin-flow-sep.done { background: #0d6efd; }
.fin-flow-dot { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; border: 2px solid #dee2e6; background: #fff; color: #adb5bd; }
.fin-flow-step.done .fin-flow-dot { background: #0d6efd; border-color: #0d6efd; color: #fff; }
.fin-flow-step.current .fin-flow-dot { border-color: #0d6efd; color: #0d6efd; background: #e7f0ff; }
.fin-flow-step.current .fin-flow-dot::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #0d6efd; display: block; }
.fin-flow-label { font-size: .72rem; font-weight: 600; color: #adb5bd; margin-top: .4rem; text-align: center; white-space: nowrap; }
.fin-flow-step.done .fin-flow-label,
.fin-flow-step.current .fin-flow-label { color: #0d6efd; }

/* ═══════════════════════════════════════════════
   LOGIN PAGE  (.lp-*)
   ═══════════════════════════════════════════════ */
.lp-wrapper {
    max-width: 440px;
    margin: 0.75rem auto 3rem;
}
.lp-brand-header {
    text-align: center;
    margin-bottom: 1.75rem;
}
.lp-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    border-radius: 13px;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.9rem;
}
.lp-illustration {
    display: block;
    margin: 0 auto 1.1rem;
}
.lp-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.35rem;
    letter-spacing: -0.025em;
    line-height: 1.25;
}
.lp-subtitle {
    font-size: 0.8375rem;
    color: #64748b;
    margin: 0;
    letter-spacing: 0.005em;
}
.lp-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.06), 0 16px 36px rgba(37,99,235,.07);
    padding: 0 2rem 2rem;
    overflow: hidden;
}
.lp-card-accent {
    height: 4px;
    background: linear-gradient(90deg, #2563eb 0%, #4f46e5 58%, #7c3aed 100%);
    margin: 0 -2rem 2rem;
}
.lp-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
    letter-spacing: 0.005em;
}
.lp-input.form-control {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    padding: 0.62rem 0.9rem;
    color: #0f172a;
    background: #f8fafc;
    box-shadow: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.lp-input.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.11);
    background: #fff;
    outline: none;
}
.lp-input.form-control::placeholder {
    color: #cbd5e1;
}
.lp-password-wrap {
    position: relative;
}
.lp-password-wrap .lp-input {
    padding-right: 2.75rem;
}
.lp-eye-btn {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    transition: color 0.12s, background 0.12s;
    line-height: 1;
}
.lp-eye-btn:hover {
    color: #475569;
    background: #f1f5f9;
}
.lp-row-below-pass {
    margin-top: 0.6rem;
}
.lp-check .form-check-input {
    border-radius: 5px;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
}
.lp-check .form-check-input:checked {
    background-color: #2563eb;
    border-color: #2563eb;
    box-shadow: none;
}
.lp-check .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.lp-check-label {
    font-size: 0.8125rem;
    color: #64748b;
    cursor: pointer;
}
.lp-submit-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff !important;
    border: none;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    letter-spacing: 0.01em;
    margin-top: 0.5rem;
    transition: opacity 0.15s, box-shadow 0.15s, transform 0.1s;
}
.lp-submit-btn:hover {
    opacity: 0.92;
    box-shadow: 0 4px 18px rgba(37,99,235,.32);
    color: #fff !important;
}
.lp-submit-btn:active {
    opacity: 1;
    box-shadow: none;
    transform: translateY(1px);
}
.lp-submit-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(37,99,235,.25);
}
.lp-footer-note {
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 1.25rem;
    margin-bottom: 0;
    line-height: 1.55;
}
@media (max-width: 575.98px) {
    .lp-wrapper {
        margin-top: 0.25rem;
    }
    .lp-card {
        border-radius: 14px;
        padding: 0 1.4rem 1.6rem;
    }
    .lp-card-accent {
        margin: 0 -1.4rem 1.75rem;
    }
    .lp-title {
        font-size: 1.3rem;
    }
    .lp-illustration {
        width: 130px;
        height: auto;
    }
}
