﻿/* ===== DASHBOARD STYLES ===== */
* {
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

body {
    background-color: #f5f7fa;
    overflow-x: hidden;
    margin: 0;
}

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    min-height: 100vh;
    background: linear-gradient(180deg, #1a3a2f 0%, #1e4d3d 100%);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 100%;
    height: 65px;
    flex-shrink: 0;
}

    .sidebar-logo-icon svg {
        width: 100%;
        height: 100%;
    }

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

    .sidebar-logo-text .logo-firma {
        font-size: 18px;
        font-weight: 600;
        color: #ffffff;
    }

    .sidebar-logo-text .logo-digital {
        font-size: 18px;
        font-weight: 600;
        color: #4ade80;
    }

    .sidebar-logo-text small {
        font-size: 11px;
        color: rgba(255,255,255,0.6);
    }

.sidebar-menu-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-item {
    margin: 4px 12px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
}

    .sidebar-nav-link:hover {
        background: rgba(255,255,255,0.1);
        color: #ffffff;
    }

.sidebar-nav-item.active .sidebar-nav-link {
    background: #2d7a4e;
    color: #ffffff;
}

.sidebar-nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-nav-text {
    flex: 1;
}

.sidebar-nav-arrow {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.sidebar-nav-link.has-submenu:not(.collapsed) .sidebar-nav-arrow {
    transform: rotate(180deg);
}

.sidebar-subnav {
    list-style: none;
    padding: 8px 0 8px 48px;
    margin: 0;
}

.sidebar-subnav-link {
    display: block;
    padding: 8px 12px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

    .sidebar-subnav-link:hover {
        color: #ffffff;
        background: rgba(255,255,255,0.05);
    }

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 13px;
    width: 100%;
    border-radius: 6px;
    transition: all 0.2s ease;
}

    .sidebar-collapse-btn:hover {
        background: rgba(255,255,255,0.1);
        color: #ffffff;
    }

/* Overlay para mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.main-wrapper {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    min-width: 0;
}

.topbar-new {
    background: #ffffff;
    padding: 12px 24px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #374151;
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 16px;
    max-width: 400px;
    flex: 1;
    min-width: 0;
}

    .topbar-search i {
        color: #9ca3af;
    }

    .topbar-search input {
        border: none;
        background: transparent;
        outline: none;
        width: 100%;
        font-size: 14px;
        color: #374151;
    }

        .topbar-search input::placeholder {
            color: #9ca3af;
        }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.topbar-docs-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    color: #059669;
    font-size: 14px;
    font-weight: 500;
}

    .topbar-docs-badge i {
        color: #10b981;
    }

.topbar-notification {
    position: relative;
    background: none;
    border: none;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-org-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    height: 42px;
    transition: all 0.2s ease;
    min-width: 180px;
}

    .topbar-org-selector:hover {
        border-color: #d1d5db;
        background: #f3f4f6;
    }

    .topbar-org-selector:focus-within {
        border-color: #2d7a4e;
        box-shadow: 0 0 0 3px rgba(45, 122, 78, 0.1);
        background: #ffffff;
    }

    .topbar-org-selector i:first-child {
        color: #6b7280;
        font-size: 14px;
        flex-shrink: 0;
    }

.org-select {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 10px 20px 10px 0;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    width: 100%;
}

    .org-select::-ms-expand {
        display: none;
    }

.topbar-org-selector i:last-child {
    position: absolute;
    right: 14px;
    font-size: 10px;
    color: #9ca3af;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.topbar-org-selector:focus-within i:last-child {
    color: #2d7a4e;
}

.topbar-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

.user-role {
    font-size: 12px;
    color: #6b7280;
}

.topbar-user-profile .dropdown-toggle {
    color: #6b7280;
    font-size: 12px;
}

    .topbar-user-profile .dropdown-toggle::after {
        display: none;
    }

.main-content {
    flex: 1;
    padding: 24px;
    min-width: 0;
}

.main-content, .page-content, .content-wrapper {
    min-width: 0;
}

.dashboard-content {
    max-width: 100%;
}

.dashboard-header {
    margin-bottom: 24px;
}

.dashboard-subtitle {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}

.stat-card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.stat-change {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

    .stat-change.positive {
        color: #10b981;
    }

    .stat-change.negative {
        color: #ef4444;
    }

    .stat-change.neutral {
        color: #f59e0b;
    }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon-primary {
    background: #ecfdf5;
    color: #10b981;
}

.stat-icon-warning {
    background: #fef3c7;
    color: #f59e0b;
}

.stat-icon-info {
    background: #dbeafe;
    color: #3b82f6;
}

.stat-icon-success {
    background: #d1fae5;
    color: #059669;
}

/* ===== DOCUMENTS SECTION ===== */
.documents-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}

.documents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.documents-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.custom-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.custom-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(180deg, #1a3a2f 0%, #1e4d3d 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

    .custom-tab-btn:hover {
        background: #1f2937;
    }

    .custom-tab-btn.active {
        background: linear-gradient(180deg, #2d7a5f 0%, #1e4d3d 100%);
        box-shadow: 0 0 0 2px #4ade80;
        color: #ffffff;
        font-weight: 600;
    }

    .custom-tab-btn i {
        font-size: 14px;
    }

/* ===== FILTERS ===== */
.documents-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.search-input {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0 14px;
    height: 44px;
    min-width: 200px;
    flex: 1;
    transition: all 0.2s ease;
}

    .search-input:focus-within {
        border-color: #2d7a4e;
        box-shadow: 0 0 0 3px rgba(45, 122, 78, 0.1);
        background: #ffffff;
    }

    .search-input i {
        color: #9ca3af;
        font-size: 14px;
        flex-shrink: 0;
    }

    .search-input input {
        border: none;
        background: transparent;
        outline: none;
        width: 100%;
        font-size: 14px;
        font-family: 'Poppins', sans-serif;
        color: #374151;
    }

        .search-input input::placeholder {
            color: #9ca3af;
        }

.filter-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0 14px;
    position: relative;
    height: 44px;
    min-width: 160px;
    transition: all 0.2s ease;
}

    .filter-dropdown:hover {
        border-color: #d1d5db;
        background: #f3f4f6;
    }

    .filter-dropdown:focus-within {
        border-color: #2d7a4e;
        box-shadow: 0 0 0 3px rgba(45,122,78,0.1);
        background: #ffffff;
    }

    .filter-dropdown i:first-child {
        color: #6b7280;
        font-size: 14px;
        flex-shrink: 0;
    }

    .filter-dropdown select {
        border: none;
        background: transparent;
        outline: none;
        font-size: 14px;
        color: #374151;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        padding: 10px 24px 10px 4px;
        font-family: 'Poppins',sans-serif;
        cursor: pointer;
        width: 100%;
        font-weight: 500;
    }

        .filter-dropdown select::-ms-expand {
            display: none;
        }

    .filter-dropdown i:last-child {
        position: absolute;
        right: 12px;
        font-size: 10px;
        color: #9ca3af;
        pointer-events: none;
        transition: all 0.2s ease;
    }

    .filter-dropdown:focus-within i:last-child {
        color: #2d7a4e;
    }

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0 14px;
    height: 44px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    white-space: nowrap;
}

    .filter-btn:hover {
        border-color: #d1d5db;
        background: #f3f4f6;
    }

    .filter-btn.active {
        background: #1a3a2f;
        color: #ffffff;
        border-color: #1a3a2f;
    }

    .filter-btn i {
        font-size: 14px;
    }

.filter-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #6b7280;
    flex-wrap: wrap;
}

.page-size-select {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    outline: none;
    font-family: 'Poppins', sans-serif;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    color: #374151;
    font-weight: 500;
}

    .page-size-select:hover {
        border-color: #d1d5db;
    }

    .page-size-select:focus {
        border-color: #2d7a4e;
        box-shadow: 0 0 0 3px rgba(45,122,78,0.1);
    }

.view-toggle {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 10px;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    white-space: nowrap;
}

    .view-toggle-btn:hover {
        color: #374151;
    }

    .view-toggle-btn.active {
        background: #ffffff;
        color: #111827;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

/* ===== DATE POPOVER ===== */
.date-filter-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    min-width: 280px;
    max-width: calc(100vw - 32px);
}

    .date-filter-popover.show {
        display: block;
        animation: fadeIn 0.2s ease;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.date-filter-popover label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    display: block;
}

.date-filter-popover input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease;
}

    .date-filter-popover input:focus {
        border-color: #2d7a4e;
        box-shadow: 0 0 0 3px rgba(45,122,78,0.1);
        outline: none;
    }

.date-filter-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}

    .date-filter-actions button {
        padding: 10px 20px;
        border-radius: 8px;
        font-size: 13px;
        cursor: pointer;
        font-family: 'Poppins', sans-serif;
        font-weight: 500;
        transition: all 0.2s ease;
    }

.btn-clear-date {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #374151;
}

    .btn-clear-date:hover {
        background: #e5e7eb;
    }

.btn-apply-date {
    background: #1a3a2f;
    border: none;
    color: #ffffff;
}

    .btn-apply-date:hover {
        background: #15302a;
    }

/* ===== TABLE ===== */
.documents-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.documents-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

    .documents-table thead th {
        text-align: left;
        padding: 14px 16px;
        font-size: 12px;
        font-weight: 600;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border-bottom: 2px solid #e5e7eb;
        background: #f9fafb;
        white-space: nowrap;
    }

    .documents-table tbody td {
        padding: 16px;
        font-size: 14px;
        color: #374151;
        border-bottom: 1px solid #f3f4f6;
        vertical-align: middle;
    }

    .documents-table tbody tr {
        transition: background 0.15s ease;
    }

        .documents-table tbody tr:hover {
            background: #f9fafb;
        }

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

    .status-badge i {
        font-size: 6px;
    }

.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.status-validating {
    background: #dbeafe;
    color: #2563eb;
}

.status-completed {
    background: #d1fae5;
    color: #059669;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .action-btn:hover {
        background: #e5e7eb;
        color: #374151;
    }

    .action-btn.download:hover {
        background: #d1fae5;
        color: #059669;
    }

    .action-btn.view:hover {
        background: #dbeafe;
        color: #2563eb;
    }

/* ===== GRID VIEW ===== */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.grid-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

    .grid-card:hover {
        box-shadow: 0 8px 24px rgba(0,0,0,0.1);
        border-color: #d1d5db;
        transform: translateY(-2px);
    }

.grid-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 8px;
}

.grid-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    word-break: break-word;
}

.grid-card-actions {
    display: flex;
    gap: 6px;
}

.grid-card-body p {
    margin: 8px 0;
    font-size: 13px;
    color: #6b7280;
    word-break: break-word;
}

    .grid-card-body p strong {
        color: #374151;
        font-weight: 500;
    }

.grid-card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

/* ===== TABS ===== */
.tab-pane {
    display: none;
}

    .tab-pane.active {
        display: block;
    }

/* ===== CUSTOM SELECT ===== */
.custom-select {
    position: relative;
    min-width: 160px;
    font-family: 'Poppins', sans-serif;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0 14px;
    height: 44px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .custom-select-trigger:hover {
        border-color: #d1d5db;
        background: #f3f4f6;
    }

.custom-select.open .custom-select-trigger {
    border-color: #2d7a4e;
    box-shadow: 0 0 0 3px rgba(45, 122, 78, 0.1);
    background: #ffffff;
    border-radius: 10px 10px 0 0;
}

.custom-select-trigger i:first-child {
    color: #6b7280;
    font-size: 14px;
}

.custom-select-trigger span {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-trigger i:last-child {
    font-size: 10px;
    color: #9ca3af;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.custom-select.open .custom-select-trigger i:last-child {
    transform: rotate(180deg);
    color: #2d7a4e;
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: none;
    border-radius: 0 0 10px 10px;
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 1;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transition: all 0.2s ease;
    overflow-y: auto;
}

.custom-select.open .custom-select-options {
    max-height: 250px;
    opacity: 1;
    overflow-y: auto;
}

.custom-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s ease;
}

    .custom-select-option:hover {
        background: #f3f4f6;
    }

    .custom-select-option.selected {
        background: #ecfdf5;
        color: #059669;
    }

    .custom-select-option:last-child {
        border-radius: 0 0 10px 10px;
    }

.option-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-pending {
    background: #f59e0b;
}

.dot-validating {
    background: #3b82f6;
}

.dot-completed {
    background: #10b981;
}

/* ===== UPLOAD SECTION ===== */
.upload-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .upload-section:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

        .upload-section:hover .upload-area {
            border-color: #2d7a4e;
            background: #f0fdf4;
        }

        .upload-section:hover .upload-icon {
            transform: translateY(-4px);
        }

.upload-area {
    border: 2px dashed #a7f3d0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #fafffe;
    transition: all 0.2s ease;
}

.upload-icon {
    width: 56px;
    height: 56px;
    background: #ecfdf5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    transition: transform 0.2s ease;
}

    .upload-icon i {
        font-size: 24px;
        color: #10b981;
    }

.upload-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.upload-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 20px 0;
}

.upload-formats {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.format-badge {
    padding: 6px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.5px;
}

/* ===== DATATABLE PAGINATION ===== */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #e5e7eb !important;
    background: #ffffff !important;
    color: #374151 !important;
    margin: 0 3px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: all 0.2s ease;
}

    .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
        background: #f3f4f6 !important;
        border-color: #d1d5db !important;
        color: #111827 !important;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button.current {
        background: #1a3a2f !important;
        border-color: #1a3a2f !important;
        color: #ffffff !important;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
        color: #9ca3af !important;
        cursor: not-allowed;
    }

.dataTables_wrapper .dataTables_info {
    font-size: 14px;
    color: #6b7280;
    padding-top: 16px;
    font-family: 'Poppins', sans-serif;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 16px;
}

/* ===== SIDEBAR COLLAPSED ===== */
body.sidebar-collapsed .sidebar {
    width: 70px;
}

body.sidebar-collapsed .sidebar-logo-text,
body.sidebar-collapsed .sidebar-nav-text,
body.sidebar-collapsed .sidebar-nav-arrow,
body.sidebar-collapsed .sidebar-collapse-btn span,
body.sidebar-collapsed .sidebar-subnav {
    display: none;
}

body.sidebar-collapsed .sidebar-nav-link {
    justify-content: center;
    padding: 12px;
}

body.sidebar-collapsed .sidebar-nav-icon {
    margin: 0;
}

body.sidebar-collapsed .main-wrapper {
    margin-left: 70px;
}

body.sidebar-collapsed .sidebar-collapse-btn {
    justify-content: center;
}

/* ===================================================
   RESPONSIVE BREAKPOINTS
   =================================================== */

/* ===== LARGE TABLETS (1200px) ===== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .topbar-org-selector {
        min-width: 140px;
    }
}

/* ===== TABLETS (1024px) ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }

    .main-wrapper {
        margin-left: 200px;
    }

    body.sidebar-collapsed .main-wrapper {
        margin-left: 70px;
    }

    .custom-tabs {
        gap: 6px;
    }

    .custom-tab-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}

/* ===== TABLETS PORTRAIT (768px) ===== */
@media (max-width: 768px) {
    /* Sidebar: oculto por defecto, deslizable */
    .sidebar {
        transform: translateX(-100%);
        width: 240px !important;
        z-index: 1050;
    }

        .sidebar.show {
            transform: translateX(0);
        }

    /* Overlay cuando sidebar está abierto */
    .sidebar-overlay.show {
        display: block;
    }

    .main-wrapper {
        margin-left: 0 !important;
    }

    body.sidebar-collapsed .main-wrapper {
        margin-left: 0 !important;
    }

    /* Topbar */
    .topbar-new {
        padding: 10px 16px;
    }

    .topbar-inner {
        flex-wrap: wrap;
        gap: 12px;
    }

    .topbar-left {
        flex: 1;
    }

    .topbar-search {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: 0;
    }

    .topbar-docs-badge,
    .topbar-org-selector {
        display: none;
    }

    .user-info {
        display: none;
    }

    /* Main content */
    .main-content {
        padding: 16px;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-value {
        font-size: 22px;
    }

    .stat-label {
        font-size: 12px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    /* Documents section */
    .documents-section {
        padding: 16px;
    }

    .documents-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .custom-tabs {
        width: 100%;
    }

    .custom-tab-btn {
        flex: 1;
        justify-content: center;
        font-size: 11px;
        padding: 8px 10px;
        text-align: center;
    }

    /* Filters */
    .documents-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .filter-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        width: 100%;
        min-width: unset;
    }

    .custom-select {
        width: 100%;
    }

    .filter-btn {
        width: 100%;
        justify-content: center;
    }

    .filter-right {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }

    .view-toggle-btn span {
        display: none;
    }

    /* Date popover - asegurar que no se salga de pantalla */
    .date-filter-popover {
        left: 0;
        right: 0;
        min-width: unset;
        width: 100%;
    }

    /* Upload */
    .upload-area {
        padding: 24px 16px;
    }

    .upload-title {
        font-size: 15px;
    }

    /* Grid */
    .grid-container {
        grid-template-columns: 1fr;
    }
}

/* ===== MOBILE (480px) ===== */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-label {
        font-size: 11px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
        border-radius: 8px;
    }

    .custom-tab-btn {
        font-size: 10px;
        padding: 7px 8px;
        gap: 4px;
    }

        .custom-tab-btn i {
            font-size: 12px;
        }

    .topbar-right {
        gap: 10px;
    }

    .documents-table tbody td,
    .documents-table thead th {
        padding: 10px 12px;
        font-size: 13px;
    }

    .upload-area {
        padding: 20px 12px;
    }

    .upload-icon {
        width: 44px;
        height: 44px;
    }

        .upload-icon i {
            font-size: 18px;
        }

    .documents-section {
        padding: 12px;
    }

    .main-content {
        padding: 12px;
    }
}

/* ===== MOBILE MUY PEQUEÑO (360px) ===== */
@media (max-width: 360px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: row;
        align-items: center;
    }

    .custom-tabs {
        flex-direction: column;
    }

    .custom-tab-btn {
        width: 100%;
        font-size: 12px;
    }

    .filter-right {
        flex-direction: column;
        align-items: flex-start;
    }
}
