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

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.08);
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

html, body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

a, .btn-link {
    color: var(--primary);
    text-decoration: none;
}

/* Header Dashboard */
.dashboard-header {
    margin-bottom: 24px;
}

.header-action-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.dashboard-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
    letter-spacing: -0.02em;
}

.dashboard-header p {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
}

/* Filter Bar & 2-Column Grid Layout */
.filter-bar {
    display: flex;
    gap: 16px;
    background: #ffffff;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filters-card-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    background: #ffffff;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    margin-bottom: 24px;
}

.filter-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.filter-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-column-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
}

.filter-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.topo-row {
    margin-top: auto;
}

.flex-1 {
    flex: 1;
    min-width: 0;
}

.btn-clear-filters {
    background: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-filters:hover {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

@media (max-width: 1100px) {
    .filters-card-container {
        grid-template-columns: 1fr;
    }
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-box {
    flex: 1;
    min-width: 260px;
}

.filter-group label {
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-input, .filter-select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: #1e293b;
    outline: none;
    background: #ffffff;
    box-sizing: border-box;
    font-family: inherit;
    transition: all 0.2s;
}

.filter-input:focus, .filter-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -2px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-action {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.btn-view:hover {
    background-color: #f1f5f9;
    border-color: #0f172a;
}

.btn-edit:hover {
    background-color: rgba(79, 70, 229, 0.08);
    border-color: #6366f1;
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9;
}

/* Table Cards */
.table-card, .table-container {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.cases-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.cases-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.cases-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.cases-table tr:hover {
    background-color: #f8fafc;
}

.row-locked {
    background-color: rgba(239, 68, 68, 0.02);
}

.sortable-header {
    cursor: pointer;
    user-select: none;
}

.sortable-header:hover {
    background-color: #f1f5f9 !important;
}

/* Status & Badges */
.status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.badge-viable { background: #dcfce7; color: #15803d; }
.badge-inadmisible { background: #fee2e2; color: #b91c1c; }
.badge-inviable { background: #ffedd5; color: #c2410c; }
.badge-terminado { background: #e0e7ff; color: #4338ca; }
.badge-exceso { background: #fef3c7; color: #b45309; }
.badge-pendiente { background: #f1f5f9; color: #475569; }
.badge-default { background: #f1f5f9; color: #64748b; }

.badge-year {
    background: #f1f5f9;
    color: #334155;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
}

.coord-badge {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-family: monospace;
}

.topo-badges-list {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.topo-pill {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
}

.topo-measured { background: #dbeafe; color: #1d4ed8; }
.topo-drawn { background: #f3e8ff; color: #7e22ce; }
.topo-signed { background: #dcfce7; color: #15803d; }

.rut-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-ok { background: #dcfce7; color: #15803d; }
.badge-error { background: #fee2e2; color: #b91c1c; }

.lock-indicator {
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    background: rgba(239, 68, 68, 0.08);
    border-radius: 6px;
}

.lock-available {
    color: #10b981;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Pagination */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #64748b;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-page {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #334155;
    transition: all 0.2s;
}

.btn-page:hover:not(:disabled) {
    border-color: #6366f1;
    color: #4f46e5;
}

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

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    z-index: 1050;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-card {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.modal-large {
    max-width: 960px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.modal-header h2 {
    font-size: 1.2rem;
    margin: 0;
    color: #1e293b;
    font-weight: 700;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.btn-close:hover {
    color: #0f172a;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #4f46e5;
    margin: 20px 0 14px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #e0e7ff;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.section-title:first-of-type {
    margin-top: 0;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.col-3 { flex: 1 1 calc(25% - 12px); min-width: 160px; }
.col-4 { flex: 1 1 calc(33.333% - 12px); min-width: 180px; }
.col-5 { flex: 1 1 calc(41.666% - 12px); min-width: 200px; }
.col-6 { flex: 1 1 calc(50% - 12px); min-width: 220px; }
.col-8 { flex: 1 1 calc(66.666% - 12px); min-width: 260px; }
.col-12 { flex: 1 1 100%; }

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

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #1e293b;
    font-size: 0.9rem;
    box-sizing: border-box;
    font-family: inherit;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control[readonly], .form-control:disabled {
    background-color: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
}

.text-area {
    min-height: 70px;
    resize: vertical;
}

.input-addon {
    display: flex;
    gap: 8px;
    align-items: center;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.loading-container {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin: 0 auto 16px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.text-muted {
    color: #94a3b8;
}

.font-bold {
    font-weight: 700;
}

.alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    margin-top: 16px;
}

/* Toggle Switch */
.toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

.toggle-status {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    transition: all 0.3s ease;
}

.toggle-yes {
    background: #dcfce7;
    color: #15803d;
}

.toggle-no {
    background: #f1f5f9;
    color: #94a3b8;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 9999px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-switch:hover .toggle-slider {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.toggle-switch.toggle-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.toggle-switch.toggle-disabled .toggle-slider {
    background: #e2e8f0;
}

.toggle-switch.toggle-disabled:hover .toggle-slider {
    box-shadow: none;
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS (Mobile, Tablet, Desktop)
   ========================================================================== */

/* Tablet & Mobile Screens (< 1024px) */
@media (max-width: 1024px) {
    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    .filter-bar {
        padding: 14px;
        gap: 12px;
    }

    .modal-card {
        max-width: 95vw;
    }
}

/* Mobile Screens (< 768px) */
@media (max-width: 768px) {
    .dashboard-header {
        margin-bottom: 16px;
    }

    .dashboard-header h1 {
        font-size: 1.35rem;
    }

    .header-action-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .header-action-container .btn-primary {
        width: 100%;
        justify-content: center;
    }

    /* Filter Bar Stacking */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }

    .filter-group {
        width: 100% !important;
    }

    .search-box {
        min-width: 100%;
    }

    /* Form Rows & Columns Stacking */
    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .col-2, .col-3, .col-4, .col-5, .col-6, .col-8, .col-12 {
        flex: 1 1 100% !important;
        min-width: 100% !important;
    }

    /* Tables Smooth Touch Scrolling & Action Buttons */
    .table-card, .table-container {
        border-radius: 10px;
        margin-bottom: 16px;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    .cases-table th, .cases-table td {
        padding: 10px 12px;
        font-size: 0.82rem;
    }

    .action-buttons {
        gap: 4px;
    }

    /* Modals Mobile Full Overlay */
    .modal-backdrop {
        padding: 8px;
    }

    .modal-card {
        max-width: 100vw;
        max-height: 95vh;
        border-radius: 12px;
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-header h2 {
        font-size: 1.05rem;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        flex-direction: column;
        gap: 10px;
    }

    .modal-footer button {
        width: 100%;
    }
}

/* Extra Small Devices (< 480px) */
@media (max-width: 480px) {
    .dashboard-header h1 {
        font-size: 1.2rem;
    }

    .cases-table {
        font-size: 0.78rem;
    }

    .status-pill, .badge-role {
        font-size: 0.72rem;
        padding: 3px 8px;
    }
}

/* Modal Header History Button (Admin Only) */
.btn-history-header {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-history-header:hover {
    background-color: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

/* ==========================================================================
   DASHBOARD STYLES (Home.razor) - Rich Aesthetics & Grid Layouts
   ========================================================================== */

.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 32px;
}

/* Dashboard Header Card */
.dashboard-header-card {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 100%);
    border-radius: 16px;
    padding: 28px 32px;
    color: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(49, 46, 129, 0.35);
    position: relative;
    overflow: hidden;
}

.dashboard-header-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.header-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 0.03em;
}

.header-titles h1 {
    font-size: 1.85rem;
    font-weight: 800;
    margin: 0 0 6px 0;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.header-titles p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin: 0;
}

.year-selector-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 18px;
    border-radius: 12px;
}

.year-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.04em;
}

.year-select {
    background: #ffffff;
    color: #0f172a;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.spinner-large {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin-bottom: 16px;
}

/* Section Cards */
.section-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.section-subtitle {
    font-size: 0.88rem;
    color: #64748b;
}

/* KPI Grid & Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.kpi-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.kpi-total { border-top: 4px solid #4f46e5; }
.kpi-viable { border-top: 4px solid #16a34a; }
.kpi-inadmisible { border-top: 4px solid #dc2626; }
.kpi-tramite { border-top: 4px solid #ca8a04; }

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.kpi-icon {
    font-size: 1.5rem;
}

.kpi-tag {
    font-size: 0.75rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
    padding: 3px 8px;
    border-radius: 6px;
}

.kpi-badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 9999px;
}

.kpi-body {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.kpi-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.kpi-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    margin-top: 4px;
}

.kpi-footer {
    font-size: 0.78rem;
    color: #94a3b8;
}

.mini-progress-bg {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.mini-progress-bar {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.bg-viable { background: #16a34a; }
.bg-inadmisible { background: #dc2626; }
.bg-tramite { background: #ca8a04; }

/* Tech Grid & Cards */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.tech-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
}

.tech-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tech-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #1e293b;
}

.tech-icon {
    font-size: 1.2rem;
}

.tech-count {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.5s ease;
}

.fill-measured { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.fill-drawn { background: linear-gradient(90deg, #a855f7, #7e22ce); }
.fill-signed { background: linear-gradient(90deg, #22c55e, #16a34a); }
.fill-commune { background: linear-gradient(90deg, #6366f1, #4f46e5); }

/* Two Column Layout */
.two-column-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.status-list-card, .top-communes-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

.status-name-pill {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 9999px;
}

/* Quick Actions Card */
.quick-actions-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.quick-actions-card h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 16px 0;
}

.quick-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.btn-quick {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.btn-quick:hover {
    border-color: #6366f1;
    background: #f5f3ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(99, 102, 241, 0.15);
}

.btn-quick-icon {
    font-size: 2rem;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-quick-text {
    display: flex;
    flex-direction: column;
}

.btn-quick-text strong {
    font-size: 0.95rem;
    color: #0f172a;
    font-weight: 700;
}

.btn-quick-text small {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

/* ==========================================================================
   ALERT PAGES STYLES (AlertDru.razor & AlertGoce.razor)
   ========================================================================== */

/* Summary Cards (Resumen de Alertas) */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-cards .card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-cards .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px -2px rgba(0, 0, 0, 0.08);
}

.alert-card {
    border-left: 5px solid #ef4444 !important;
}

.alert-card-prop {
    border-left: 5px solid #f59e0b !important;
}

.summary-cards h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #64748b;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.summary-cards .count {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1;
}

/* Tabs Container (Pestañas de Navegación) */
.tabs-container {
    display: flex;
    gap: 8px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    width: fit-content;
}

.tab-button {
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tab-button:hover {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.6);
}

.tab-button.active {
    background: #ffffff;
    color: #4f46e5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Search Bar Wrapper */
.search-bar-wrapper {
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    max-width: 500px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.92rem;
    color: #1e293b;
    outline: none;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    font-family: inherit;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Status & Badges en Tablas de Alertas */
.rut-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-ok {
    background: #dcfce7;
    color: #15803d;
}

.status-error {
    background: #fee2e2;
    color: #b91c1c;
}

.status-none {
    background: #f1f5f9;
    color: #64748b;
}

.badge-rut-error {
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

/* Badges de Género */
.gender-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #64748b;
}

.gender-m {
    background: #dbeafe;
    color: #1d4ed8;
}

.gender-f {
    background: #fce7f3;
    color: #be185d;
}

.btn-correct {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-correct:hover {
    background: #fde68a;
    color: #92400e;
}

/* Success State Containers (Alertas, Duplicados, etc.) */
.success-state {
    background-color: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #15803d;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    margin: 20px 0;
}

.success-state p {
    margin: 0;
    font-size: 1rem;
}