/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f4f6f8; color: #1a1a1a; }

/* ===== LOGIN ===== */
.login-wrapper {
    height: 100vh;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.login-greenbar {
    height: 52px;
    background: #22c55e;
    flex-shrink: 0;
}
.login-card {
    flex: 1;
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 0;
}
.login-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.login-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.18) 55%, rgba(0,0,0,0.4) 100%);
}
.login-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: stretch;
    height: 100%;
}
.login-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 48px 40px;
}
.login-logos-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 20px;
    align-items: center;
    min-width: 0;
}
.login-img-siagcic {
    height: 150px;
    max-width: 55%;
    width: auto;
    object-fit: contain;
    object-position: left center;
}
.login-img-laredo {
    height: 124px;
    max-width: 42%;
    width: auto;
    object-fit: contain;
    object-position: left center;
}
.login-form-panel {
    width: 340px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 32px;
    background: rgba(10,15,12,0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: -8px 0 30px rgba(0,0,0,0.2);
    flex-shrink: 0;
}
.login-home-icon {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.login-title {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
    text-align: center;
}
.login-panel-label {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    margin-bottom: 28px;
    text-align: center;
}
.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
}
.login-field-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.login-input {
    width: 100%;
    height: 44px;
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 0 14px;
    font-size: 15px;
    outline: none;
    margin-bottom: 18px;
    background: rgba(255,255,255,0.92);
    transition: border-color 0.2s;
}
.login-input:focus { border-color: #22c55e; }
.login-btn {
    width: 100%;
    height: 50px;
    background: #22c55e;
    color: #0a1f13;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s;
}
.login-btn:hover { background: #1ea54f; }
.login-error {
    color: #ff8a8a;
    font-size: 13px;
    margin-bottom: 8px;
}

/* Descarga de la app móvil, al costado del formulario */
.login-app {
    margin-top: auto;
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px 16px 16px;
    border-radius: 14px;
    background: rgba(10,15,12,0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.login-app-qr {
    width: 132px;
    height: 132px;
    border-radius: 8px;
    background: #fff;
    image-rendering: pixelated;
}
.login-app-titulo {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 6px;
}
.login-app-detalle {
    max-width: 210px;
    font-size: 13px;
    line-height: 1.35;
    color: rgba(255,255,255,0.8);
    margin-bottom: 12px;
}
.login-app-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    background: #22c55e;
    color: #0a1f13;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s;
}
.login-app-btn:hover { background: #1ea54f; }
/* En el celular el formulario va arriba y la descarga debajo: ahí no hace falta el QR. */
@media (max-width: 820px) {
    .login-wrapper { height: auto; min-height: 100vh; overflow: visible; }
    .login-content { flex-direction: column-reverse; justify-content: flex-end; }
    .login-form-panel { width: 100%; }
    .login-left { padding: 24px; gap: 24px; }
    .login-img-siagcic { height: 80px; }
    .login-img-laredo { height: 66px; }
    .login-app { margin-top: 0; align-self: stretch; padding: 16px; }
    .login-app-qr, .login-app-detalle { display: none; }
}

/* ===== SHELL / SIDEBAR ===== */
.shell {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 248px;
    min-height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: 2px 0 12px rgba(0,0,0,0.06);
}

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 18px 18px;
    border-bottom: 1px solid #f0f0f0;
}
.brand-icon {
    width: 42px;
    height: 42px;
    background: #16a34a;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(22,163,74,0.35);
}
.brand-text {
    display: flex;
    flex-direction: column;
}
.brand-name {
    font-size: 12.5px;
    font-weight: 500;
    color: #555;
    line-height: 1.35;
}
.brand-name--bold {
    font-size: 14px;
    font-weight: 800;
    color: #111;
}

/* Section labels */
.nav-section-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: #bbb;
    padding: 14px 20px 6px;
    text-transform: uppercase;
}

/* Nav */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 4px 10px;
    gap: 2px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
    position: relative;
}
.nav-item:hover {
    background: #f4f4f5;
    color: #111;
}
.nav-item--active {
    background: #f0fdf4 !important;
    color: #16a34a !important;
    font-weight: 700;
}
.nav-item--active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: #16a34a;
    border-radius: 0 3px 3px 0;
}

/* Nav icons */
.nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.nav-item:hover .nav-icon { transform: scale(1.08); }
.nav-icon--blue   { background: #eff6ff; color: #3b82f6; }
.nav-icon--orange { background: #fff7ed; color: #f97316; }
.nav-icon--purple { background: #f5f3ff; color: #8b5cf6; }
.nav-icon--red    { background: #fef2f2; color: #ef4444; }

/* Danger zone */
.nav-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 10px 16px;
}
.sidebar-nav--danger .nav-item--danger {
    color: #ef4444;
    font-weight: 600;
}
.sidebar-nav--danger .nav-item--danger:hover {
    background: #fef2f2;
    color: #dc2626;
}
.sidebar-nav--danger .nav-item--danger-active {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

/* Ítems restringidos a SuperAdmin */
.nav-item--locked {
    opacity: 0.45;
    cursor: not-allowed;
    user-select: none;
}
.nav-item--locked:hover { background: none; }
.nav-item--locked .nav-icon { filter: grayscale(1); }
.nav-lock-icon { margin-left: auto; flex-shrink: 0; color: inherit; }

/* Footer */
.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid #f0f0f0;
    padding: 12px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f9f9f9;
    margin-bottom: 2px;
}
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #16a34a;
    color: white;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.user-name {
    font-size: 13px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role {
    font-size: 11px;
    color: #999;
}
.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 10px;
    color: #ef4444;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: background 0.15s, color 0.15s;
}
.sidebar-logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

.main-content {
    margin-left: 248px;
    flex: 1;
    padding: 28px 32px;
    min-height: 100vh;
}

/* ===== DASHBOARD HEADER ===== */
.dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.dash-breadcrumb {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}
.dash-breadcrumb strong { color: #111; }
.dash-title {
    font-size: 24px;
    font-weight: 800;
    color: #111;
}
.dash-subtitle {
    font-size: 13px;
    color: #888;
    margin-top: 2px;
}
.dash-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: white;
    border-radius: 10px;
    padding: 6px 8px 6px 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.dash-date-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.dash-date-input {
    height: 32px;
    border: 1.5px solid #e4e4e4;
    border-radius: 7px;
    padding: 0 8px;
    font-size: 13px;
    outline: none;
    background: #fafafa;
    color: #333;
    transition: border-color 0.15s, background 0.15s;
}
.dash-date-input:focus { border-color: #22c55e; background: white; }
.dash-arrow { font-size: 13px; color: #aaa; }
.dash-filter-divider {
    width: 1px;
    align-self: stretch;
    background: #eee;
}
.dash-quick-filters {
    display: flex;
    gap: 2px;
    background: #f4f4f5;
    padding: 3px;
    border-radius: 8px;
}
.dash-qbtn {
    height: 26px;
    padding: 0 11px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: #666;
    transition: all 0.15s;
}
.dash-qbtn:hover { color: #16a34a; }
.dash-qbtn--active { background: #16a34a; color: white; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.dash-apply-btn {
    height: 32px;
    padding: 0 16px;
    background: #1d4ed8;
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.dash-apply-btn:hover { background: #1e40af; }

/* ===== KPI CARDS ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.kpi-card {
    background: white;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kpi-icon--blue   { background: #eff6ff; color: #3b82f6; }
.kpi-icon--purple { background: #f5f3ff; color: #8b5cf6; }
.kpi-icon--red    { background: #fef2f2; color: #ef4444; }
.kpi-icon--teal   { background: #f0fdfa; color: #14b8a6; }
.kpi-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.kpi-label {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}
.kpi-value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
}
.kpi-value--dark   { color: #111; }
.kpi-value--purple { color: #8b5cf6; }
.kpi-value--red    { color: #ef4444; }
.kpi-value--orange { color: #f59e0b; }
.kpi-delta {
    font-size: 12px;
    font-weight: 500;
}
.kpi-delta--green { color: #16a34a; }
.kpi-delta--red   { color: #ef4444; }
.kpi-delta--gray  { color: #888; }

/* ===== CHARTS ===== */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.chart-card {
    background: white;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.chart-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.donut-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}
.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.legend-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #444;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.legend-name { flex: 1; }
.legend-pct { font-weight: 700; color: #111; }
.bar-wrap { width: 100%; }
.heatmap-wrap { width: 100%; }
.heatmap-legend-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 400;
    color: #666;
}
.heatmap-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.heatmap-dot--baja   { background: #22c55e; }
.heatmap-dot--media  { background: #f59e0b; }
.heatmap-dot--alta   { background: #ef4444; }
.svg-hover { cursor: pointer; transition: opacity 0.15s; }
.svg-hover:hover { opacity: 0.75; }
.heatmap-map {
    width: 100%;
    height: 220px;
    border-radius: 10px;
    overflow: hidden;
    z-index: 0; /* evita que los controles de Leaflet queden sobre el modal */
}

/* ===== MÉTRICAS ESPECÍFICAS ===== */
.metrics-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}
.metrics-section-title span { color: #888; font-weight: 400; }
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.metric-card {
    background: white;
    border-radius: 14px;
    padding: 20px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    border-top: 4px solid transparent;
    transition: box-shadow 0.2s, transform 0.15s;
}
.metric-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); transform: translateY(-2px); }
.metric-card--open { box-shadow: 0 4px 20px rgba(0,0,0,0.14); }
.metric-card--blue   { border-top-color: #3b82f6; background: #eff6ff; }
.metric-card--green  { border-top-color: #22c55e; background: #f0fdf4; }
.metric-card--purple { border-top-color: #8b5cf6; background: #f5f3ff; }
.metric-tag {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #888;
}
.metric-name {
    font-size: 15px;
    font-weight: 700;
    color: #111;
    margin: 4px 0 8px;
}
.metric-big {
    font-size: 40px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 8px;
}
.metric-big--blue   { color: #3b82f6; }
.metric-big--green  { color: #16a34a; }
.metric-big--purple { color: #8b5cf6; }
.metric-desc {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}
.metric-link {
    font-size: 12px;
    color: #3b82f6;
    font-weight: 600;
    cursor: pointer;
}
/* ===== MODAL MÉTRICAS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}
.modal-box {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 1020px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 26px 30px 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    position: relative;
}
.modal-box:has(.modal-charts-grid) { max-width: 1180px; }
.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}
.modal-eyebrow {
    font-size: 12px;
    color: #999;
    font-weight: 600;
    margin-bottom: 2px;
}
.modal-title {
    font-size: 19px;
    font-weight: 800;
    color: #111;
}
.modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    color: #555;
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.modal-close:hover { background: #e2e2e2; }

/* Tabla dentro del modal */
.modal-table-wrap {
    overflow-x: auto;
    margin-bottom: 22px;
    border: 1px solid #eee;
    border-radius: 10px;
}
.modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.modal-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    font-weight: 700;
    padding: 10px 14px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}
.modal-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #f2f2f2;
    color: #333;
    white-space: nowrap;
}
.modal-table td:first-child { white-space: normal; min-width: 220px; }
.modal-table tr:last-child td { border-bottom: none; }
.modal-table td.mono { font-variant-numeric: tabular-nums; }
.pct-good { color: #16a34a; font-weight: 700; }
.chip-si { color: #16a34a; font-weight: 700; }
.chip-no { color: #ef4444; font-weight: 700; }

/* PP: cada derivación de la IAG, verde si coincide con el área correcta */
.pp-explicacion { font-size: 12.5px; color: #555; margin: 0 0 10px; line-height: 1.5; }
.pp-deriv {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.pp-deriv--ok { background: #dcfce7; color: #166534; }
.pp-deriv--no { background: #fee2e2; color: #b91c1c; }
.pp-deriv--vacia { color: #aaa; }
.modal-table--pp th, .modal-table--pp td { padding-left: 8px; padding-right: 8px; }
.modal-table--pp td:first-child { min-width: 170px; }
.modal-table--pp td:nth-last-child(2) { white-space: normal; min-width: 130px; }
.modal-table tfoot .pp-promedio td {
    background: #f0fdf4;
    border-top: 2px solid #bbf7d0;
    font-weight: 700;
    color: #166534;
}

/* Grid de mini-gráficos dentro del modal: 2 gráficos grandes por vistazo,
   los otros 2 se ven pasando de página con las flechas de .chart-pager. */
.modal-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.mini-chart-card {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 16px;
    position: relative;
    min-height: 220px;
}
.mini-chart-card--center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.mini-chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.mini-chart-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #555;
    margin: 0;
}
.mini-chart-zoom-btn {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    border: 1px solid #e2e2e2;
    background: white;
    color: #666;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.mini-chart-zoom-btn:hover { background: #f0f0f0; color: #111; }
.mini-chart-caption {
    font-size: 11.5px;
    color: #888;
    margin-top: 8px;
    line-height: 1.45;
}

/* Ampliar un gráfico a pantalla completa (misma marca, el SVG con viewBox
   escala solo; para tablas/hbar se agranda la tipografía aparte). */
.chart-zoom-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1100;
}
.mini-chart-card--zoom {
    position: fixed;
    inset: 6vh 6vw;
    z-index: 1101;
    background: white;
    box-shadow: 0 24px 70px rgba(0,0,0,0.45);
    display: flex;
    flex-direction: column;
    overflow: auto;
}
.mini-chart-card--zoom .mini-chart-title { font-size: 18px; }
/* Los <svg> traen width/height fijos (son "hints" de la más baja prioridad en
   CSS): esta regla siempre gana y los hace ocupar el espacio disponible al
   ampliar, sin depender de que cada gráfico calcule bien su tamaño grande. */
.mini-chart-card--zoom svg { width: 100% !important; height: auto !important; max-height: 66vh; }
.mini-chart-card--zoom .confusion-table { font-size: 15px; }
.mini-chart-card--zoom .hbar-row { font-size: 14px; margin-bottom: 10px; }
.mini-chart-card--zoom .hbar-fill,
.mini-chart-card--zoom .hbar-track { height: 14px; }
.mini-chart-card--zoom .mini-chart-legend { font-size: 13px; margin-top: 14px; }
.mini-chart-card--zoom .mini-chart-caption { font-size: 13px; }

/* Paginador de 2 páginas bajo cada grupo de gráficos */
.chart-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
}
.chart-pager-arrow {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #e2e2e2;
    background: white;
    color: #333;
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.chart-pager-arrow:hover:not(:disabled) { background: #f0f0f0; }
.chart-pager-arrow:disabled { opacity: 0.35; cursor: default; }
.chart-pager-label { font-size: 12.5px; font-weight: 700; color: #666; min-width: 32px; text-align: center; }
.mini-chart-legend {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 6px;
    font-size: 11px;
    color: #555;
}
.mini-chart-legend span { display: flex; align-items: center; gap: 5px; }
.mini-chart-legend i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

/* Matriz de confusión */
.confusion-wrap { overflow-x: auto; }
.confusion-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px;
    font-size: 10.5px;
}
.confusion-table th {
    color: #999;
    font-weight: 600;
    padding: 3px 2px;
    text-align: center;
}
.confusion-table td {
    text-align: center;
    padding: 6px 4px;
    border-radius: 6px;
    color: #999;
}
.confusion-table td.diag { background: #3b82f6; color: white; font-weight: 800; }
.confusion-table td.off  { background: #e0e7ff; color: #4b5563; font-weight: 600; }
.confusion-row-label { text-align: right !important; color: #888; font-weight: 600; padding-right: 6px !important; }

/* Barras horizontales (eficiencia / tiempos) */
.hbar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
    font-size: 11px;
}
.hbar-row:last-of-type { margin-bottom: 0; }
.hbar-label { width: 118px; flex-shrink: 0; color: #555; }
.hbar-track {
    flex: 1;
    height: 8px;
    background: #eee;
    border-radius: 5px;
    overflow: hidden;
    display: block;
}
.hbar-fill { height: 100%; display: block; border-radius: 5px; }

/* ===== INCIDENCIAS: TOOLBAR ===== */
.inc-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}
.inc-vista-tabs {
    display: flex;
    gap: 4px;
    margin: 4px 0 18px;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 10px;
    width: fit-content;
}
.inc-vista-tab {
    border: none;
    background: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.inc-vista-tab:hover { color: #333; }
.inc-vista-tab.active { background: white; color: #16a34a; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.inc-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    background: white;
    border: 1.5px solid #e4e4e4;
    border-radius: 8px;
    color: #999;
    min-width: 240px;
}
.inc-search input {
    border: none;
    outline: none;
    font-size: 14px;
    flex: 1;
    color: #333;
    background: transparent;
}
.inc-area-select {
    height: 38px;
    padding: 0 12px;
    border: 1.5px solid #e4e4e4;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
}

/* ===== INCIDENCIAS: TABLERO ===== */
.inc-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    align-items: start;
}
.inc-column {
    background: #ececeb;
    border-radius: 16px;
    padding: 16px;
}
.inc-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.inc-column-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}
.inc-range-pill {
    color: white;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
}
.inc-column-title {
    font-size: 14px;
    font-weight: 700;
    color: #222;
}
.inc-count-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: white;
    border: 1.5px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}
.inc-sort-row {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
    padding-left: 2px;
}
.inc-sort-btn {
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    padding: 0;
}
.inc-sort-btn--active { color: #16a34a; text-decoration: underline; }
.inc-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.inc-card {
    position: relative;
    background: white;
    border: 1.5px solid;
    border-radius: 12px;
    padding: 14px 40px 14px 14px;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s;
}
.inc-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.1); transform: translateY(-1px); }
.inc-card-title { font-size: 13.5px; font-weight: 700; color: #111; margin-bottom: 4px; line-height: 1.3; }
.inc-card-area { font-size: 11.5px; color: #888; }
.inc-card-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: white;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== INCIDENCIAS: MODAL DE DETALLE ===== */
.inc-modal-box {
    display: flex;
    width: 100%;
    max-width: 920px;
    /* Alto fijo (no sólo un tope): así cada columna sabe cuánto espacio real
       tiene y puede hacer scroll por su cuenta en vez de que las dos
       columnas se repartan un único scroll compartido, que es lo que hacía
       sentir aplastado todo lo de abajo (el comentario, el botón) cuando la
       columna derecha traía mucho contenido (evidencia + checklist + línea
       de tiempo). */
    height: 88vh;
    max-height: 88vh;
    overflow: hidden;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    position: relative;
}
.inc-modal-left {
    flex: 1.5;
    overflow-y: auto;
    padding: 26px 28px;
    border-left: 5px solid;
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}
.inc-priority-tag {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}
.inc-modal-title {
    font-size: 19px;
    font-weight: 800;
    color: #111;
    margin-bottom: 18px;
}
.inc-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin-bottom: 8px;
}
.inc-label--spaced { margin-top: 18px; }
.inc-box {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.inc-box-text { font-size: 13px; color: #444; line-height: 1.6; }
.inc-citizen-box { display: flex; flex-direction: column; gap: 8px; }
.inc-citizen-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #333; }
.inc-citizen-row svg { color: #888; flex-shrink: 0; }
.inc-evidence-row { display: flex; gap: 14px; }
.inc-evidence-btn {
    flex: 1;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s;
}
.inc-evidence-btn:hover { background: #ededed; }
.inc-evidence-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
}
.inc-evidence-label { font-size: 11px; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: 0.3px; }
.inc-evidence-btn--disabled { cursor: not-allowed; opacity: 0.5; }
.inc-evidence-btn--disabled:hover { background: #f5f5f5; }

/* ===== INCIDENCIAS: galería de evidencia ===== */
.inc-sub-overlay { z-index: 1100; }
.inc-gallery-box { max-width: 720px; }
.inc-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.inc-gallery-thumb {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #f0f0f0;
    border: 1px solid #eee;
}
.inc-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.15s; }
.inc-gallery-thumb:hover img { transform: scale(1.05); }

.inc-lightbox-overlay { z-index: 1200; background: rgba(0,0,0,0.85); flex-direction: column; }
.inc-lightbox-img { max-width: 90vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.inc-lightbox-close { position: fixed; top: 22px; right: 26px; background: rgba(255,255,255,0.15); color: white; }
.inc-lightbox-close:hover { background: rgba(255,255,255,0.3); }

/* ===== INCIDENCIAS: mapa de ubicación ===== */
.inc-map-box { max-width: 640px; }
.inc-map-frame {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eee;
}
.inc-map-frame iframe { width: 100%; height: 100%; border: 0; }
.inc-map-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    font-size: 12px;
    color: #666;
}
.inc-map-link {
    margin-left: auto;
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
}
.inc-map-link:hover { text-decoration: underline; }

.inc-modal-right {
    flex: 1;
    overflow-y: auto;
    background: #fafafa;
    border-left: 1px solid #eee;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
    padding: 26px 22px 22px;
    display: flex;
    flex-direction: column;
    position: relative;
}
.inc-modal-close { position: absolute; top: 14px; right: 14px; }
.inc-cat-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.inc-cat-number { font-size: 32px; font-weight: 900; line-height: 1; }
.inc-priority-pill {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
}
.inc-cat-area { font-size: 13px; color: #666; margin-bottom: 4px; }
.inc-time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    color: #666;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}
.inc-time-row strong { color: #222; font-weight: 700; }
.inc-toggle-row { display: flex; gap: 10px; margin-bottom: 4px; }
.inc-toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    background: white;
    transition: all 0.15s;
}
.inc-toggle-btn--si { border: 1.5px solid #22c55e; color: #16a34a; }
.inc-toggle-btn--si.active { background: #22c55e; color: white; }
.inc-toggle-btn--no { border: 1.5px solid #ef4444; color: #ef4444; }
.inc-toggle-btn--no.active { background: #ef4444; color: white; }
.inc-manual-hint {
    font-size: 12px;
    color: #888;
    font-style: italic;
    margin: 10px 0 0;
    line-height: 1.4;
}
.inc-manual-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #555;
    font-weight: 600;
    margin: 14px 0 0;
    cursor: pointer;
}
.inc-manual-check input { width: 15px; height: 15px; cursor: pointer; accent-color: #16a34a; }
.inc-edit-fields {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.inc-edit-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #999;
    margin-top: 8px;
}
.inc-edit-input {
    height: 36px;
    border: 1.5px solid #ddd;
    border-radius: 7px;
    padding: 0 10px;
    font-size: 13px;
    outline: none;
    background: white;
}
.inc-edit-input:focus { border-color: #22c55e; }
.inc-save-btn {
    width: 100%;
    display: block;
    height: 38px;
    margin-top: 12px;
    background: #1d4ed8;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.inc-save-btn:hover { background: #1e40af; }
.inc-save-btn:disabled {
    background: #dbe4f7;
    color: #8ba0d6;
    cursor: not-allowed;
}
.inc-retry-btn {
    width: 100%;
    display: block;
    height: 34px;
    margin-top: 8px;
    background: white;
    color: #1d4ed8;
    border: 1.5px solid #1d4ed8;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.inc-retry-btn:hover { background: #eff6ff; }
.inc-retry-btn:disabled { opacity: 0.6; cursor: default; }
.inc-right-spacer { flex: 1; min-height: 14px; }
.inc-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.inc-delete-btn:hover { background: #fecaca; }
.hbar-val { width: 40px; text-align: right; font-weight: 700; color: #333; flex-shrink: 0; }

/* ===== USUARIOS ===== */
.usr-new-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 42px;
    padding: 0 22px;
    background: #16a34a;
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(22,163,74,0.3);
    transition: background 0.15s, transform 0.15s;
    flex-shrink: 0;
}
.usr-new-btn:hover { background: #15803d; transform: translateY(-1px); }
.usr-new-btn-plus { font-size: 17px; font-weight: 800; line-height: 1; }

.usr-table-wrap {
    background: white;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.usr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.usr-table thead tr { background: white; }
.usr-table th {
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 11.5px;
    font-weight: 800;
    color: #333;
    padding: 15px 20px;
    border-bottom: 1.5px solid #eaeaea;
}
.usr-table td {
    padding: 14px 20px;
    color: #444;
    vertical-align: middle;
}
.usr-table tbody tr:nth-child(even) { background: #f2f2f2; }
.usr-table tbody tr:hover { background: #eaf7ee; }
.usr-filter-row th {
    padding: 8px 12px 12px;
    border-bottom: 1.5px solid #eaeaea;
    text-transform: none;
    letter-spacing: normal;
}
.usr-filter-input, .usr-filter-select {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1.5px solid #e4e4e4;
    border-radius: 7px;
    background: #fafafa;
    font-size: 12.5px;
    font-weight: 400;
    color: #333;
    box-sizing: border-box;
}
.usr-filter-input:focus, .usr-filter-select:focus { background: white; outline: none; box-shadow: 0 0 0 2px #22c55e; }
.usr-filter-select { cursor: pointer; }

/* Franja de herramientas de "Incidencias procesadas": vive DENTRO de la misma
   tarjeta que la tabla (.usr-table-wrap tiene overflow:hidden, así que
   respeta solo las esquinas de arriba) para que se lea como una sola pieza
   en vez de dos cajas sueltas. Los filtros deciden qué filas se ven; esto
   decide en qué orden, y es un dato aparte a propósito. */
.inc-orden-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: #fafafa;
    border-bottom: 1px solid #ececec;
}
.inc-orden-conteo { font-size: 12.5px; font-weight: 700; color: #444; white-space: nowrap; }
.inc-orden-label { font-size: 12.5px; font-weight: 600; color: #777; white-space: nowrap; }
.inc-orden-bar .usr-filter-select {
    width: auto;
    min-width: 190px;
    height: 32px;
    background: white;
}
.inc-orden-sep { flex: 1; }
.inc-sla-filtro {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    font-size: 12px;
    font-weight: 700;
    color: #b91c1c;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
}
.inc-sla-filtro:hover { background: #fee2e2; }
.inc-sla-filtro input { accent-color: #dc2626; cursor: pointer; }

@media (max-width: 720px) {
    .inc-orden-bar { flex-wrap: wrap; }
    .inc-orden-sep { flex-basis: 100%; height: 0; }
}

/* Semáforo de plazo vencido: el área se pasó del tiempo previsto. */
.inc-sla-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 20px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 10.5px;
    font-weight: 800;
    white-space: nowrap;
}
.inc-sla-texto { color: #b91c1c; }

.usr-area-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 10.5px;
    font-weight: 700;
}

/* ---- Línea de tiempo de una incidencia (seguimiento tipo envío) ---- */
.seg-linea {
    list-style: none;
    margin: 10px 0 0;
    padding: 0 0 0 6px;
    border-left: 2px solid #e8e8e8;
}
.seg-paso { position: relative; padding: 0 0 16px 18px; }
.seg-paso:last-child { padding-bottom: 0; }
.seg-punto {
    position: absolute;
    left: -7px;
    top: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px #e0e0e0;
}
.seg-estado { margin: 0; font-size: 12.5px; font-weight: 800; color: #111; }
.seg-estado-nota { margin-left: 5px; font-size: 11px; font-weight: 600; color: #d97706; }
.seg-meta { margin: 2px 0 0; font-size: 11px; color: #777; }
.seg-comentario {
    margin: 5px 0 0;
    font-size: 11.5px;
    color: #444;
    background: #f7f7f7;
    border-radius: 6px;
    padding: 6px 9px;
    line-height: 1.45;
}

/* ============ PANEL DEL ÁREA MUNICIPAL ============ */
.sidebar--area .nav-section-label { color: #9ca3af; }
.brand-icon--area { background: #0f766e; }

.area-nota {
    margin: 16px 14px;
    padding: 11px 13px;
    border-radius: 9px;
    background: #f0fdfa;
    border: 1px solid #ccfbf1;
    color: #0f766e;
    font-size: 11.5px;
    line-height: 1.5;
}

.area-tarjetas {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}
@media (max-width: 1100px) {
    .area-tarjetas { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
    .area-tarjetas { grid-template-columns: repeat(2, 1fr); }
}
.area-tarjeta {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 10px;
    border: 1.5px solid #ececec;
    border-radius: 14px;
    background: white;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.area-tarjeta:hover { border-color: #cfcfcf; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.08); }
.area-tarjeta--activa { border-color: #0f766e; box-shadow: 0 0 0 2px #0f76661a, 0 4px 10px rgba(15,118,110,0.12); }
.area-tarjeta-num { font-size: 26px; font-weight: 800; color: #111; line-height: 1; }
.area-tarjeta-num--alerta { color: #b91c1c; }
.area-tarjeta-txt { font-size: 11.5px; font-weight: 700; color: #666; }
.area-tarjeta-sub { font-size: 9.5px; font-weight: 600; color: #aaa; margin-top: 1px; }
/* La tarjeta de "Fuera de plazo" avisa sola, sin que haga falta hacer clic
   para enterarse de que hay algo urgente. */
.area-tarjeta--roja { border-color: #fecaca; background: #fff8f8; }
.area-tarjeta--roja.area-tarjeta--activa { border-color: #dc2626; box-shadow: 0 0 0 2px #fecaca, 0 4px 10px rgba(220,38,38,0.15); }

.area-lista { display: flex; flex-direction: column; gap: 10px; }
.area-fila {
    display: flex;
    align-items: stretch;
    gap: 14px;
    background: white;
    border: 1.5px solid #ececec;
    border-radius: 14px;
    padding: 15px 18px 15px 0;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.area-fila:hover { border-color: #0f766e; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.08); }
.area-fila--vencida { border-color: #fecaca; background: #fffafa; }
.area-fila--vencida:hover { border-color: #dc2626; }
.area-fila-barra { width: 5px; flex: 0 0 5px; border-radius: 0 3px 3px 0; }
.area-fila-cuerpo { flex: 1; min-width: 0; }
.area-fila-codigo { margin: 0; font-size: 10.5px; font-weight: 800; color: #888; letter-spacing: .3px; text-transform: uppercase; }
.area-fila-titulo {
    margin: 4px 0 0;
    font-size: 14.5px;
    font-weight: 700;
    color: #111;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.area-fila-meta {
    margin: 5px 0 0;
    font-size: 11.5px;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.area-fila-derecha {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 7px;
    flex: 0 0 auto;
}
.area-fila-plazo { font-size: 11px; color: #777; font-weight: 600; }

.area-vacio {
    background: white;
    border: 1.5px dashed #e0e0e0;
    border-radius: 14px;
    padding: 48px 20px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

.area-fotos { display: flex; gap: 8px; flex-wrap: wrap; }
.area-foto {
    width: 78px;
    height: 78px;
    border-radius: 8px;
    overflow: hidden;
    border: 1.5px solid #e8e8e8;
    display: block;
}
.area-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }

.area-mapa-link {
    display: inline-block;
    margin-top: 7px;
    font-size: 12px;
    font-weight: 700;
    color: #0f766e;
}

.area-input-file {
    width: 100%;
    margin-top: 6px;
    font-size: 12px;
    padding: 9px;
    border: 1.5px dashed #cfcfcf;
    border-radius: 8px;
    background: #fafafa;
    box-sizing: border-box;
}
.area-textarea {
    width: 100%;
    margin-top: 6px;
    padding: 9px 11px;
    border: 1.5px solid #e4e4e4;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12.5px;
    color: #333;
    resize: vertical;
    box-sizing: border-box;
}
.area-textarea:focus { outline: none; border-color: #0f766e; }

/* Zonas de carga de evidencia: una para fotos, otra para documentos. Son
   <label for="..."> disfrazadas de tarjeta clicable — el <input type=file>
   real queda oculto, así se ve igual en todos los navegadores en vez del
   botón nativo (que cambia de aspecto según el sistema operativo). */
.area-evid-input-oculto {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}
.area-evid-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.area-evid-zona {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 16px 10px;
    border: 1.5px dashed #d4d4d4;
    border-radius: 12px;
    background: #fafafa;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, background .15s;
}
.area-evid-zona:hover { border-color: #0f766e; background: #f0fdfa; }
.area-evid-icono {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}
.area-evid-icono--foto { background: #3b82f6; }
.area-evid-icono--doc { background: #7c3aed; }
.area-evid-titulo { font-size: 12.5px; font-weight: 700; color: #222; }
.area-evid-nota { font-size: 10.5px; color: #999; }

/* Documentos subidos: chip con la extensión como distintivo de color, en vez
   de intentar mostrar una miniatura (no se puede, no son imágenes). */
.area-docs { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.area-doc-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f5f5f5;
    border: 1px solid #ececec;
    text-decoration: none;
    transition: background .15s;
}
.area-doc-chip:hover { background: #eee; }
.area-doc-ext {
    flex-shrink: 0;
    padding: 3px 7px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .3px;
    color: white;
    background: #6b7280;
}
.area-doc-ext--pdf { background: #dc2626; }
.area-doc-ext--doc, .area-doc-ext--docx { background: #2563eb; }
.area-doc-ext--xls, .area-doc-ext--xlsx { background: #16a34a; }
.area-doc-nombre {
    flex: 1;
    font-size: 12.5px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Sólo se usa en la vista del administrador, que mezcla evidencia del
   ciudadano y del área en una misma lista y necesita distinguir de quién es. */
.area-doc-origen {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .3px;
}

/* Checklist de lo que falta para poder resolver: gris mientras no se cumple,
   verde con tilde apenas se cumple — así queda clarísimo por qué el botón
   sigue apagado, sin tener que leer un párrafo de texto. */
.area-requisitos { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.area-requisito {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    color: #aaa;
}
.area-requisito svg { flex-shrink: 0; color: #ddd; }
.area-requisito--ok { color: #15803d; }
.area-requisito--ok svg { color: #16a34a; }

/* Aviso de incidencia nueva (complementa al correo, no lo reemplaza): sólo
   aparece mientras el panel está abierto y conectado. */
.area-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 200;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 320px;
    max-width: calc(100vw - 44px);
    padding: 14px 14px 14px 16px;
    background: white;
    border-radius: 14px;
    border: 1px solid #e6e6e6;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
    cursor: pointer;
    animation: area-toast-entrada .25s ease-out;
}
@keyframes area-toast-entrada {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.area-toast-icono {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0f766e;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(15,118,110,0.35);
}
.area-toast-cuerpo { flex: 1; min-width: 0; }
.area-toast-titulo { margin: 0; font-size: 13px; font-weight: 800; color: #111; }
.area-toast-detalle {
    margin: 3px 0 0;
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.area-toast-cerrar {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #bbb;
    font-size: 13px;
    line-height: 1;
    padding: 2px;
}
.area-toast-cerrar:hover { color: #666; }

@media (max-width: 480px) {
    .area-toast { right: 12px; bottom: 12px; left: 12px; width: auto; }
}

.alerta-ok {
    margin: 10px 0;
    padding: 10px 13px;
    border-radius: 8px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 12.5px;
}
.usr-name { font-weight: 700; color: #111; }
.usr-muted { color: #666; }
.usr-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}
.usr-badge--super { background: #bbf7d0; color: #15803d; }
.usr-badge--regular { background: #fef08a; color: #854d0e; }
.usr-actions { display: flex; align-items: center; gap: 14px; }
.usr-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.15s, transform 0.15s;
}
.usr-action-btn:hover { transform: scale(1.12); }
.usr-action-btn--edit { color: #3b82f6; }
.usr-action-btn--edit:hover { background: #eff6ff; }
.usr-action-btn--delete { color: #ef4444; }
.usr-action-btn--delete:hover { background: #fef2f2; }

/* Modal Nuevo/Editar Usuario */
.usr-modal-box {
    background: white;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px;
    padding: 26px 28px 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.usr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.usr-modal-title { font-size: 19px; font-weight: 800; color: #111; }
.usr-field-label {
    display: block;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin: 14px 0 6px;
}
.usr-field-label:first-of-type { margin-top: 0; }
.usr-input {
    width: 100%;
    height: 42px;
    border: none;
    border-radius: 9px;
    padding: 0 14px;
    font-size: 14px;
    outline: none;
    background: #ececec;
    color: #222;
    transition: background 0.15s, box-shadow 0.15s;
}
.usr-input:focus { background: white; box-shadow: 0 0 0 2px #22c55e; }
.usr-field-row { display: flex; gap: 14px; }
.usr-field-col { flex: 1; min-width: 0; }
.usr-select-wrap { position: relative; }
.usr-select {
    width: 100%;
    height: 42px;
    border: none;
    border-radius: 9px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    background: #ececec;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}
.usr-select-chevron { transition: transform 0.15s; color: #777; }
.usr-select-chevron.open { transform: rotate(180deg); }
.usr-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 9px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    overflow: hidden;
    z-index: 10;
}
.usr-select-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 11px 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: #333;
    background: white;
    border: none;
    cursor: pointer;
}
.usr-select-option:hover { background: #f4f4f4; }
.usr-select-option.active { background: #ececec; }
.usr-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}
.usr-cancel-btn {
    flex: 1;
    height: 44px;
    background: #e2e2e2;
    color: #333;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.usr-cancel-btn:hover { background: #d4d4d4; }
.usr-save-btn {
    flex: 1;
    height: 44px;
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.usr-save-btn:hover { background: #1ea54f; }

/* ===== CONFIRM MODAL (reutilizable) ===== */
.confirm-overlay { z-index: 1100; }
.confirm-box {
    background: white;
    width: 100%;
    max-width: 360px;
    border-radius: 16px;
    padding: 32px 28px 26px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.confirm-icon-wrap { display: flex; justify-content: center; margin-bottom: 16px; }
.confirm-message {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    line-height: 1.4;
    margin-bottom: 22px;
}
.confirm-actions { display: flex; gap: 12px; }
.confirm-btn {
    flex: 1;
    height: 42px;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.confirm-btn--no { background: #e2e2e2; color: #333; }
.confirm-btn--no:hover { background: #d4d4d4; }
.confirm-btn--si { background: #22c55e; color: white; }
.confirm-btn--si:hover { background: #1ea54f; }

/* ===== PAPELERA ===== */
.pap-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: #fee2e2;
    border: 1.5px solid #fca5a5;
    border-radius: 24px;
    color: #dc2626;
    font-size: 12.5px;
    font-weight: 700;
    flex-shrink: 0;
}
.pap-alert svg { flex-shrink: 0; }
.pap-table-wrap {
    background: white;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.pap-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pap-table th {
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 11.5px;
    font-weight: 800;
    color: #333;
    padding: 15px 20px;
    border-bottom: 1.5px solid #eaeaea;
}
.pap-table th.pap-th-danger { color: #dc2626; }
.pap-table td { padding: 14px 20px; color: #444; vertical-align: middle; }
.pap-table tbody tr:nth-child(even) { background: #f7f7f7; }
.pap-table tbody tr:hover { background: #fef2f2; }
.pap-inc-name { font-weight: 700; color: #111; }
.pap-area { color: #888; }
.pap-prior-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 50%;
    color: white;
    font-size: 11.5px;
    font-weight: 800;
}
.pap-deleted-by { color: #dc2626; font-weight: 700; }
.pap-fecha { color: #666; }
.pap-restore-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #f4f4f4;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.25s;
}
.pap-restore-btn:hover { background: #dcfce7; color: #16a34a; transform: rotate(-70deg); }
.pap-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 14px;
}
.pap-empty svg { margin-bottom: 10px; opacity: 0.5; }

/* ===== MENSAJES DE ERROR EN PÁGINA ===== */
.alerta-error {
    background: #fee2e2;
    border: 1.5px solid #fca5a5;
    color: #b91c1c;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
}
