:root {
    --correos-blue: #003B7A;
    --correos-blue-dark: #00254a;
    --correos-red: #E31837;
    --correos-gold: #F5A623;
    --correos-white: #FFFFFF;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* ---- Navbar Gradient ---- */
.navbar-gradient {
    background: linear-gradient(135deg, var(--correos-blue) 0%, var(--correos-blue-dark) 60%, #001a32 100%);
}

/* ---- Hero Section ---- */
.hero-gradient {
    background: linear-gradient(135deg, var(--correos-blue) 0%, #004a99 50%, var(--correos-blue) 100%);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(227, 24, 55, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-gradient::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 40%;
    height: 160%;
    background: radial-gradient(ellipse, rgba(245, 166, 35, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* ---- Card Glassmorphism ---- */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 59, 122, 0.08);
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 20px 60px rgba(0, 59, 122, 0.12);
    transform: translateY(-2px);
}

/* ---- Filter Card ---- */
.filter-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
    border: 1px solid rgba(0, 59, 122, 0.1);
    box-shadow: 0 4px 24px rgba(0, 59, 122, 0.06);
}

@media (max-width: 768px) {
    .filter-card {
        padding: 1.25rem;
    }
}

/* ---- Table Styles ---- */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 24px rgba(0, 59, 122, 0.06);
    -webkit-overflow-scrolling: touch;
}

.table-container::-webkit-scrollbar {
    height: 6px;
}

.table-container::-webkit-scrollbar-thumb {
    background: rgba(0, 59, 122, 0.2);
    border-radius: 10px;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    /* Garantiza el scroll en pantallas pequeÃ±as */
}

@media (min-width: 769px) {
    .table-container table {
        min-width: auto;
    }
}

.table-container thead {
    background: linear-gradient(135deg, var(--correos-blue) 0%, #004a99 100%);
}

.table-container thead th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--correos-white);
}

.table-container tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #e5e7eb;
}

.table-container tbody tr:hover {
    background: rgba(0, 59, 122, 0.03);
}

.table-container tbody td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #374151;
}

/* ---- Buttons ---- */
.btn-primary {
    background: linear-gradient(135deg, var(--correos-blue) 0%, #004a99 100%);
    color: white;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(0, 59, 122, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 59, 122, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(107, 114, 128, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--correos-red) 0%, #c41530 100%);
    color: white;
    padding: 0.375rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.8125rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-view {
    background: linear-gradient(135deg, var(--correos-gold) 0%, #e09520 100%);
    color: var(--correos-blue);
    padding: 0.375rem 1rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.8125rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.3);
}

.btn-view:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245, 166, 35, 0.5);
}

.btn-back {
    background: linear-gradient(135deg, var(--correos-blue) 0%, #004a99 100%);
    color: white;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 59, 122, 0.3);
}

.btn-back:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 59, 122, 0.4);
}

/* ---- Form Elements ---- */
.form-select,
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    background: white;
    transition: all 0.2s ease;
    outline: none;
}

.form-select:focus,
.form-input:focus {
    border-color: var(--correos-blue);
    box-shadow: 0 0 0 3px rgba(0, 59, 122, 0.1);
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ---- Detail Card ---- */
.detail-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 59, 122, 0.08);
    overflow: hidden;
}

.detail-header {
    background: linear-gradient(135deg, var(--correos-blue) 0%, #004a99 50%, var(--correos-blue-dark) 100%);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.detail-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 40%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(245, 166, 35, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.detail-row {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

.detail-row:hover {
    background: rgba(0, 59, 122, 0.02);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 160px;
}

.detail-value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1f2937;
}

/* ---- Loading Spinner ---- */
.spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 3px solid rgba(0, 59, 122, 0.2);
    border-top-color: var(--correos-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---- Fade-in Animation ---- */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Badge ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-urbano {
    background: rgba(0, 59, 122, 0.1);
    color: var(--correos-blue);
}

.badge-rural {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}

.empty-state svg {
    margin: 0 auto 1rem;
    opacity: 0.4;
}

/* ---- Stats Cards ---- */
.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .table-container thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.7rem;
    }

    .table-container tbody td {
        padding: 0.625rem 0.5rem;
        font-size: 0.8rem;
    }

    .btn-view {
        padding: 0.25rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }

    .detail-label {
        margin-bottom: 0.25rem;
        min-width: 100%;
    }

    .btn-primary,
    .btn-secondary,
    .btn-back {
        width: 100%;
        justify-content: center;
    }

    .detail-header {
        padding: 1.5rem;
    }

    .detail-header .flex-wrap {
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .navbar-gradient h1 {
        font-size: 1rem;
    }

    .navbar-gradient p {
        display: none;
    }
}