/* ============================================================
   FortiFactu STYLE SYSTEM
   Paleta: Turquesa #00b2a9, Fondo claro #f5f6f8, Tarjetas Blancas
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #f5f6f8;
    --card: #ffffff;
    --border: #e5e7eb;
    --primary: #00b2a9;
    --primary-h: #009990;
    --primary-10: rgba(0, 178, 169, .10);
    --primary-20: rgba(0, 178, 169, .20);
    --text-h: #1f2937;
    --text-b: #374151;
    --text-s: #6b7280;
    --text-muted: #9ca3af;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #3b82f6;
    --sidebar-w: 250px;
    --topbar-h: 56px;
    --radius: 10px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --shadow: 0 4px 12px rgba(0, 0, 0, .07);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .10);
}

/* ---- Reset ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text-b);
    min-height: 100vh;
    line-height: 1.5;
}

/* ============================================================
   BARRA DE DESPLAZAMIENTO (SCROLLBAR) TURQUESA FortiFactu
   ============================================================ */
::-webkit-scrollbar,
html::-webkit-scrollbar,
body::-webkit-scrollbar,
div::-webkit-scrollbar,
aside::-webkit-scrollbar,
main::-webkit-scrollbar,
section::-webkit-scrollbar {
    width: 10px !important;
    height: 10px !important;
}

::-webkit-scrollbar-track,
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
div::-webkit-scrollbar-track,
aside::-webkit-scrollbar-track,
main::-webkit-scrollbar-track,
section::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
    border-radius: 8px !important;
}

::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
div::-webkit-scrollbar-thumb,
aside::-webkit-scrollbar-thumb,
main::-webkit-scrollbar-thumb,
section::-webkit-scrollbar-thumb {
    background: #00b2a9 !important;
    border-radius: 8px !important;
    border: 2px solid #f1f5f9 !important;
}

::-webkit-scrollbar-thumb:hover,
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
div::-webkit-scrollbar-thumb:hover,
aside::-webkit-scrollbar-thumb:hover,
main::-webkit-scrollbar-thumb:hover,
section::-webkit-scrollbar-thumb:hover {
    background: #008f88 !important;
}

* {
    scrollbar-width: thin !important;
    scrollbar-color: #00b2a9 #f1f5f9 !important;
}

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

/* ==========================
   LAYOUT PRINCIPAL
   ========================== */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ==========================
   SIDEBAR
   ========================== */

.sidebar {
    width: var(--sidebar-w);
    background: var(--primary);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .25s ease;
}

.sidebar-logo {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .15);
    min-height: var(--topbar-h);
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, .2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-logo-text {
    font-size: 16px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.sidebar-logo-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, .7);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-group-label {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, .5);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 10px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, .92);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    letter-spacing: 0.2px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, .15);
    color: white;
}

.nav-item.active {
    background: rgba(255, 255, 255, .2);
    color: white;
    font-weight: 700;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-item svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke: rgba(255, 255, 255, 0.85);
    transition: stroke 0.2s;
}

.nav-item:hover svg,
.nav-item.active svg {
    stroke: #ffffff;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, .25);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 12px;
}

/* --- Grupos y Submenús (Acordeón Sidebar) --- */
.nav-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 2px;
}

.nav-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.nav-group-header:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.nav-group.expanded .nav-group-header,
.nav-group.active .nav-group-header {
    color: #ffffff;
    font-weight: 600;
}

.nav-chevron {
    transition: transform 0.22s ease;
    opacity: 0.75;
}

.nav-group.expanded .nav-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

.nav-group-items {
    display: none;
    flex-direction: column;
    gap: 3px;
    margin: 4px 0 6px 20px;
    padding: 2px 0 2px 10px;
    border-left: 2px solid rgba(255, 255, 255, 0.22);
}

.nav-group.expanded .nav-group-items {
    display: flex;
}

.nav-subitem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.nav-subitem:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    transform: translateX(3px);
}

.nav-subitem.active {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.nav-subitem svg {
    stroke: rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
    transition: stroke 0.18s ease;
}

.nav-subitem:hover svg,
.nav-subitem.active svg {
    stroke: #ffffff;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, .15);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s;
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, .1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, .25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-info {
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: white;
    truncate;
}

.user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, .6);
}

/* ==========================
   TOPBAR
   ========================== */

.topbar {
    height: var(--topbar-h);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-h);
}

.topbar-spacer {
    flex: 1;
}

.topbar-search {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    width: 260px;
    gap: 8px;
    color: var(--text-s);
}

.topbar-search input {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    padding: 8px 0;
    width: 100%;
    color: var(--text-b);
}

.topbar-search input:focus {
    outline: none;
}

.topbar-search input::placeholder {
    color: var(--text-muted);
}

.topbar-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.topbar-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.topbar-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

.topbar-avatar:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 178, 169, 0.2);
}

.topbar-avatar.has-logo {
    background: #ffffff;
    border: 2px solid rgba(0, 178, 169, 0.45);
}

.topbar-avatar-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
    border-radius: 50%;
    background: #ffffff;
    display: block;
    box-sizing: border-box;
}

/* ==========================
   MAIN CONTENT
   ========================== */

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-body {
    flex: 1;
    padding: 28px 28px;
}

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

.page-header-left h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-h);
}

.page-header-left p {
    font-size: 14px;
    color: var(--text-s);
    margin-top: 2px;
}

/* ==========================
   CARDS / KPI
   ========================== */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-body {
    padding: 20px;
}

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

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-h);
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    border-radius: 0 0 var(--radius) var(--radius);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: box-shadow .2s;
}

.kpi-card:hover {
    box-shadow: var(--shadow);
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.kpi-icon-teal {
    background: rgba(0, 178, 169, .12);
}

.kpi-icon-blue {
    background: rgba(59, 130, 246, .12);
}

.kpi-icon-orange {
    background: rgba(245, 158, 11, .12);
}

.kpi-icon-green {
    background: rgba(16, 185, 129, .12);
}

.kpi-icon-red {
    background: rgba(239, 68, 68, .12);
}

.kpi-icon-purple {
    background: rgba(139, 92, 246, .12);
}

.kpi-data {}

.kpi-label {
    font-size: 12px;
    color: var(--text-s);
    font-weight: 500;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-h);
    line-height: 1.2;
    margin: 2px 0;
}

.kpi-change {
    font-size: 12px;
    font-weight: 500;
}

.kpi-change.up {
    color: var(--success);
}

.kpi-change.down {
    color: var(--danger);
}

/* ==========================
   TABLES
   ========================== */

.table-wrapper,
.table-responsive {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

table.data-table,
table.table,
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    background: #ffffff;
}

table.data-table thead th,
table.table thead th,
.table thead th {
    padding: 16px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    vertical-align: middle;
}

table.data-table tbody tr,
table.table tbody tr,
.table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color .15s ease;
}

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

table.data-table tbody tr:last-child,
table.table tbody tr:last-child,
.table tbody tr:last-child,
table.data-table tbody tr:last-child td,
table.table tbody tr:last-child td,
.table tbody tr:last-child td {
    border-bottom: none;
}

table.data-table td,
table.table tbody td,
.table tbody td {
    padding: 17px 20px;
    color: #1e293b;
    vertical-align: middle;
    line-height: 1.5;
    font-size: 13.5px;
}

/* ==========================
   BADGES / STATUS
   ========================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.25;
}

.badge-success {
    background: rgba(16, 185, 129, .12);
    color: #059669;
}

.badge-danger {
    background: rgba(239, 68, 68, .12);
    color: #dc2626;
}

.badge-warning {
    background: rgba(245, 158, 11, .12);
    color: #d97706;
}

.badge-info {
    background: rgba(59, 130, 246, .12);
    color: #2563eb;
}

.badge-teal {
    background: rgba(0, 178, 169, .12);
    color: var(--primary);
}

.badge-neutral {
    background: var(--bg);
    color: var(--text-s);
    border: 1px solid var(--border);
}

/* ==========================
   BUTTONS
   ========================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-h);
}

.btn-secondary {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-b);
}

.btn-secondary:hover {
    background: #eaecf0;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary-10);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-s);
}

.btn-ghost:hover {
    background: var(--bg);
    color: var(--text-b);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* ==========================
   FORMS
   ========================== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-b);
}

.form-control {
    padding: 10px 14px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-b);
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 178, 169, .1);
}

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-help {
    font-size: 12px;
    color: var(--text-s);
}

.form-error {
    font-size: 12px;
    color: var(--danger);
}

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

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

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

/* ==========================
   MODALS
   ========================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
}

.modal-overlay.visible {
    display: flex;
}

.modal-box {
    background: var(--card);
    border-radius: 14px;
    width: 100%;
    max-width: 540px;
    box-shadow: var(--shadow-lg);
    animation: modalIn .2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-head h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-h);
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-s);
    cursor: pointer;
    line-height: 1;
    padding: 2px;
}

.modal-close:hover {
    color: var(--text-h);
}

.modal-body {
    padding: 24px;
}

.modal-foot {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg);
    border-radius: 0 0 14px 14px;
}

/* ==========================
   SEARCH / FILTERS
   ========================== */

.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    flex: 1;
    min-width: 200px;
    gap: 8px;
}

.search-box input {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    padding: 9px 0;
    width: 100%;
    color: var(--text-b);
}

.search-box input:focus {
    outline: none;
}

.search-box-icon {
    color: var(--text-s);
    font-size: 16px;
}

/* ==========================
   PAGINATION
   ========================== */

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.page-link {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-s);
    border: 1px solid transparent;
    background: none;
    transition: all .15s;
}

.page-link:hover {
    background: var(--bg);
    color: var(--text-h);
}

.page-link.active {
    background: var(--primary);
    color: white;
}

/* ==========================
   TABS
   ========================== */

.tabs-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}

.tab-item {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-s);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .2s;
}

.tab-item:hover {
    color: var(--primary);
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* ==========================
   TOAST NOTIFICATIONS
   ========================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
}

.toast {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideUp .3s ease;
    min-width: 260px;
}

.toast-success {
    background: #059669;
    color: white;
}

.toast-error {
    background: #dc2626;
    color: white;
}

.toast-warning {
    background: #d97706;
    color: white;
}

.toast-info {
    background: #2563eb;
    color: white;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================
   EMPTY STATE
   ========================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-s);
}

.empty-state .empty-icon {
    font-size: 52px;
    margin-bottom: 16px;
    opacity: .5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-h);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 14px;
    max-width: 360px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

/* ==========================
   DIVIDERS / UTILITIES
   ========================== */

.divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.text-primary {
    color: var(--primary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

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

.text-bold {
    font-weight: 700 !important;
}

.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.mt-0 {
    margin-top: 0 !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.w-full {
    width: 100%;
}

/* ==========================
   CHART CONTAINERS
   ========================== */

.chart-container {
    position: relative;
    width: 100%;
}

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

@media (max-width: 768px) {
    .sidebar {
        width: 0;
    }

    .main-content {
        margin-left: 0;
    }

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

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

    .page-body {
        padding: 16px;
    }
}

/* ==========================
   TOAST: Fixed Positioning
   ========================== */
.toast {
    display: none;
}

/* ==========================
   EXTRA BADGES
   ========================== */
.badge-authorized {
    background: rgba(16, 185, 129, .12);
    color: #059669;
}

.badge-rejected {
    background: rgba(239, 68, 68, .12);
    color: #dc2626;
}

.badge-pending {
    background: rgba(245, 158, 11, .12);
    color: #d97706;
}

.badge-active {
    background: rgba(16, 185, 129, .12);
    color: #059669;
}

.badge-inactive {
    background: rgba(107, 114, 128, .12);
    color: var(--text-s);
}

/* ==========================
   FILTERS BAR INLINE (Reports)
   ========================== */
.filters-bar .form-control:not(.form-select) {
    padding: 8px 12px;
}
/* Sidebar Accordion Styles */
.nav-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px;
}
.nav-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    color: rgba(255, 255, 255, .85);
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .2s;
    opacity: 0.85;
}
.nav-group-header svg {
    stroke: rgba(255, 255, 255, 0.85);
}
.nav-group-header:hover {
    background: rgba(255,255,255,0.05);
    color: white;
    opacity: 1;
}
.nav-group-header:hover svg {
    stroke: white;
}
.nav-group.active > .nav-group-header {
    opacity: 1;
    font-weight: 600;
    color: white;
}
.nav-group.active > .nav-group-header svg {
    stroke: white;
}
.nav-group-items {
    display: none;
    flex-direction: column;
    padding-left: 44px;
    margin-top: 4px;
    margin-bottom: 8px;
    gap: 4px;
}
.nav-group.expanded .nav-group-items {
    display: flex;
}
.nav-group.expanded .nav-chevron {
    transform: rotate(180deg);
}
.nav-chevron {
    transition: transform .2s;
}
.nav-subitem {
    padding: 8px 12px;
    color: rgba(255, 255, 255, .6);
    font-size: 13.5px;
    text-decoration: none;
    border-radius: 6px;
    transition: all .2s;
}
.nav-subitem:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}
.nav-subitem.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

/* ============================================================
   ESTILOS PREMIUM DE ALERTAS Y MODALES (SweetAlert2 FortiFactu Theme)
   ============================================================ */
.swal2-container {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    background: rgba(15, 23, 42, 0.5) !important;
}
.swal2-popup {
    border-radius: 20px !important;
    padding: 28px 24px !important;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25) !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
}
.swal2-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
}
.swal2-html-container {
    font-size: 14px !important;
    color: #475569 !important;
    line-height: 1.6 !important;
    margin-top: 8px !important;
}
.swal2-actions {
    gap: 12px !important;
    margin-top: 24px !important;
}
.swal2-confirm, .swal2-cancel {
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    padding: 11px 22px !important;
    letter-spacing: 0.2px !important;
    transition: all 0.2s ease !important;
    border: none !important;
}
.swal2-confirm:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 178, 169, 0.3) !important;
}
.swal2-cancel:hover {
    transform: translateY(-1px) !important;
    background-color: #475569 !important;
}

