/* ==========================================================================
   Estilos Institucionales — Sistema Pericial Forense (Tierra del Fuego)
   Dirección Pericial DJN - PRJ-20260913-BF77B0
   Tipografía Agrandada y Alta Legibilidad para Estaciones Judiciales y Morgue
   ========================================================================== */

:root {
    --petrol-dark: #06232C;
    --petrol-sidebar: #08323E;
    --petrol-light: #0E4A5D;
    --petrol-accent: #38BDF8;
    
    --primary-blue: #08323E;
    --primary-light: #0284C7;
    --primary-dark: #06232C;
    --accent-red: #EF4444;
    --accent-orange: #F97316;
    --accent-green: #059669;
    --accent-yellow: #F59E0B;
    
    --bg-main: #EFF5F7;
    --bg-card: #FFFFFF;
    --border-color: #CBD5E1;
    --border-light: #E2E8F0;
    
    --text-main: #0F172A;
    --text-muted: #64748B;
    --text-light: #FFFFFF;
    
    --shadow-sm: 0 2px 6px rgba(6, 46, 59, 0.04);
    --shadow-md: 0 6px 18px rgba(6, 46, 59, 0.08);
    --shadow-lg: 0 16px 36px rgba(6, 46, 59, 0.12);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(at 8% 8%, #A2D5E6 0px, transparent 55%),
                radial-gradient(at 92% 8%, #DCD1F5 0px, transparent 55%),
                radial-gradient(at 92% 92%, #E7DDF6 0px, transparent 55%),
                radial-gradient(at 8% 92%, #BCE1EF 0px, transparent 55%),
                #BBE0EB;
    color: #0F172A;
    margin: 0;
    padding: 8px;
    min-height: 100vh;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   App Shell & Layout (Fiel a la Imagen de Referencia)
   -------------------------------------------------------------------------- */
.app-shell {
    display: flex;
    min-height: calc(100vh - 16px);
    background: #082830;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(6, 32, 44, 0.22);
}

/* --------------------------------------------------------------------------
   Sidebar Vertical Izquierdo Fijo (Deep Petrol Teal & Active White Card)
   -------------------------------------------------------------------------- */
.app-sidebar {
    width: 88px;
    min-width: 88px;
    background: #082830;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0 16px 0;
    position: sticky;
    top: 0;
    height: calc(100vh - 16px);
    box-sizing: border-box;
    z-index: 100;
    flex-shrink: 0;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
}

.sidebar-logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00D59A 0%, #0284C7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 100%;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-icon-box {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8CA9B2;
    transition: all 0.2s ease;
}

.nav-svg {
    display: block;
    width: 22px;
    height: 22px;
    transition: transform 0.2s ease;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
    color: #8CA9B2;
    margin-top: 5px;
    text-align: center;
    letter-spacing: -0.1px;
    transition: color 0.2s;
}

.nav-tab:hover .nav-icon-box {
    color: #FFFFFF;
}

.nav-tab:hover .nav-label {
    color: #FFFFFF;
}

/* Active Tab: Pure White Squircle con Icono Dark Teal */
.nav-tab.active .nav-icon-box {
    background: #FFFFFF !important;
    color: #082830 !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25) !important;
    transform: scale(1.05);
}

.nav-tab.active .nav-label {
    color: #FFFFFF !important;
    font-weight: 700 !important;
}

.sidebar-bottom {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-semaphore-card {
    width: 60px;
    padding: 6px 0;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    gap: 2px;
}

.semaphore-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #EF4444;
}

.semaphore-count {
    font-size: 9.5px;
    font-weight: 800;
    color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   Viewport Principal (Fondo Frosted Glass con Curvatura de 36px en Esquina)
   -------------------------------------------------------------------------- */
.app-main-viewport {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-top-left-radius: 36px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 16px);
    overflow-y: auto;
    box-shadow: -10px 0 32px rgba(0, 0, 0, 0.1);
}

/* Header Superior Frosted Glass en Dos Niveles */
.viewport-header {
    padding: 22px 36px 16px 36px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.header-tier-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-company-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.company-logo-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00D59A 0%, #0284C7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 213, 154, 0.3);
}

.company-name-text {
    font-size: 15px;
    font-weight: 700;
    color: #1E293B;
    letter-spacing: -0.2px;
}

.header-actions-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.round-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.round-icon-btn:hover {
    background: #F8FAFC;
    color: #0F172A;
    border-color: #CBD5E1;
}

.user-profile-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 24px;
    padding: 3px 12px 3px 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    position: relative;
    cursor: pointer;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #082830;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.user-meta strong {
    font-size: 12.5px;
    color: #0F172A;
}

.user-meta small {
    font-size: 10.5px;
    color: #94A3B8;
}

.user-chevron {
    font-size: 10px;
    color: #94A3B8;
}

.user-switch-select {
    opacity: 0;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.header-tier-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
}

.header-title-block {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.header-breadcrumb {
    font-size: 12px;
    color: #94A3B8;
    font-weight: 500;
}

.header-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-back-arrow {
    font-size: 22px;
    color: #64748B;
    cursor: pointer;
    transition: transform 0.15s;
}

.header-back-arrow:hover {
    transform: translateX(-2px);
    color: #082830;
}

.header-main-title {
    font-size: 30px;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.8px;
    margin: 0;
}

.header-right-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-switch-box {
    display: flex;
    background: rgba(241, 245, 249, 0.85);
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 3px;
}

.view-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.view-btn.active {
    background: #082830;
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(8, 40, 48, 0.25);
}

.btn-create-class {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #082830;
    color: #FFFFFF;
    border: none;
    border-radius: 24px;
    padding: 10px 22px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(8, 40, 48, 0.3);
    transition: all 0.2s;
}

.btn-create-class:hover {
    background: #0C3844;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(8, 40, 48, 0.4);
}

.main-content {
    padding: 0 36px 36px 36px;
    flex: 1;
}

/* --------------------------------------------------------------------------
   Fila Superior: 2 Tarjetas Destacadas (Idénticas a la Imagen de Referencia)
   -------------------------------------------------------------------------- */
.featured-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 28px;
}

.featured-card {
    background: #FFFFFF;
    border-radius: 24px;
    padding: 24px 26px;
    box-shadow: 0 8px 24px rgba(8, 40, 56, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.featured-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(8, 40, 56, 0.09);
}

.featured-card-top {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.featured-thumb {
    width: 88px;
    height: 88px;
    min-width: 88px;
    border-radius: 22px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.thumb-rose {
    background: linear-gradient(135deg, #FF5376 0%, #D8144E 100%);
}

.thumb-emerald {
    background: linear-gradient(135deg, #00D59A 0%, #00885B 100%);
}

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

.featured-sub-line {
    font-size: 12.5px;
    font-weight: 500;
    color: #94A3B8;
    margin-bottom: 6px;
}

.featured-title-line {
    font-size: 20px;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.25;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-desc-text {
    font-size: 13px;
    color: #64748B;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot-green {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.menu-dots-btn {
    color: #94A3B8;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.featured-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid #F1F5F9;
}

.col-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.col-label {
    font-size: 11px;
    font-weight: 500;
    color: #94A3B8;
}

.pill-progress-bar {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 18px;
    background: #F1F5F9;
    border-radius: 10px;
    padding: 2px 4px;
}

.pill-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 14px;
    border-radius: 7px;
    font-size: 9px;
    font-weight: 800;
    color: #FFFFFF;
    padding: 0 6px;
}

.pill-seg.seg-teal { background: #00D59A; }
.pill-seg.seg-yellow { background: #FBBF24; color: #78350F; }
.pill-seg.seg-gray { background: #CBD5E1; color: #475569; }

.trainees-avatars-row {
    display: flex;
    align-items: center;
}

.avatar-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.avatar-circle:first-child { margin-left: 0; }
.avatar-circle.av-teal { background: #CCFBF1; color: #0F766E; }
.avatar-circle.av-mint { background: #D1FAE5; color: #047857; }
.avatar-circle.av-orange { background: #FFEDD5; color: #C2410C; }
.avatar-circle.av-yellow { background: #FEF3C7; color: #B45309; }
.avatar-circle.av-gray { background: #F1F5F9; color: #475569; }
.avatar-circle.av-blue { background: #E0F2FE; color: #0369A1; }
.avatar-circle.av-cyan { background: #082830; color: #FFFFFF; }

.instructor-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.instructor-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #1E293B;
}

/* --------------------------------------------------------------------------
   Drawer / Panel Colapsable de Ingesta Asistida
   -------------------------------------------------------------------------- */
.ingesta-drawer-box {
    background: #FFFFFF;
    border: 1.5px solid #082830;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 12px 36px rgba(8, 40, 48, 0.14);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-inner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1.5px solid #E2E8F0;
    padding-bottom: 14px;
}

.drawer-badge {
    background: #082830;
    color: #00D59A;
    font-size: 10.5px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.8px;
}

.drawer-title {
    font-size: 17px;
    font-weight: 800;
    color: #082830;
    margin: 0;
}

.drawer-close-btn {
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    border-radius: 12px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
}

.drawer-close-btn:hover {
    background: #E2E8F0;
    color: #0F172A;
}

/* --------------------------------------------------------------------------
   Catálogo de Causas & Cuadrícula de Tarjetas ("All Classes")
   -------------------------------------------------------------------------- */
.all-classes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.all-classes-heading {
    font-size: 22px;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.4px;
    margin: 0;
}

.badge-pill-count {
    background: #E2E8F0;
    color: #082830;
    font-size: 12px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 14px;
}

.filter-pills-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    font-size: 11.5px;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-pill.active {
    background: #082830;
    color: #FFFFFF;
    border-color: #082830;
    box-shadow: 0 2px 6px rgba(8, 40, 48, 0.2);
}

.catalogo-search-row {
    width: 100%;
    margin-bottom: 20px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-icon-svg {
    position: absolute;
    left: 14px;
    pointer-events: none;
}

.search-input-field {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border-radius: 24px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    font-size: 13.5px;
    color: #0F172A;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    outline: none;
    transition: all 0.2s;
}

.search-input-field:focus {
    border-color: #00D59A;
    box-shadow: 0 0 0 3px rgba(0, 213, 154, 0.15);
}

/* Grilla de 4 Columnas para Tarjetas de Causas Fiel a la Imagen */
.cards-grid-4col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    width: 100%;
}

.cause-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 16px 18px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 4px 14px rgba(8, 40, 56, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.cause-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(8, 40, 56, 0.08);
}

/* Tarjetas Urgentes con Borde Resaltado Rosa/Coral (Idéntico a Card 2 y 7 en la Imagen) */
.cause-card.urgent-card {
    border: 1.5px solid #FF8096 !important;
    box-shadow: 0 4px 18px rgba(255, 94, 126, 0.12) !important;
}

.card-top-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.card-thumb {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.card-meta-text {
    flex: 1;
    min-width: 0;
}

.card-meta-sub {
    font-size: 11px;
    font-weight: 500;
    color: #94A3B8;
    display: block;
    margin-bottom: 3px;
}

.card-title-text {
    font-size: 13.5px;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.25;
    margin: 0;
    letter-spacing: -0.2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.card-status-dot.dot-green {
    background: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.card-status-dot.dot-red {
    background: #EF4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.card-menu-dots {
    color: #94A3B8;
    font-size: 16px;
    font-weight: 700;
}

.card-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #F8FAFC;
}

.card-progress-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.card-progress-label,
.card-trainees-label {
    font-size: 9.5px;
    font-weight: 600;
    color: #94A3B8;
}

.mini-progress-pill-bar {
    display: flex;
    height: 5px;
    border-radius: 4px;
    background: #F1F5F9;
    overflow: hidden;
    gap: 1px;
    width: 75px;
}

.mini-seg {
    height: 100%;
}

.mini-seg.seg-teal { background: #00D59A; }
.mini-seg.seg-yellow { background: #FBBF24; }
.mini-seg.seg-gray { background: #CBD5E1; }

.card-trainees-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

@media (max-width: 1400px) {
    .cards-grid-4col {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1100px) {
    .cards-grid-4col {
        grid-template-columns: repeat(2, 1fr);
    }
    .featured-cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .app-sidebar {
        width: 78px;
        min-width: 78px;
        padding: 12px 4px;
    }
    .nav-tab {
        width: 68px;
        min-height: 60px;
    }
    .nav-label {
        font-size: 10px;
    }
    .sidebar-semaphore-card {
        width: 70px;
    }
    .app-main-viewport {
        border-radius: 18px;
        margin: 4px 4px 4px 0;
    }
    .viewport-header {
        padding: 10px 16px;
    }
}

/* --------------------------------------------------------------------------
   Layout & Cards
   -------------------------------------------------------------------------- */
.main-content {
    flex: 1;
    padding: 24px 32px 48px 32px;
    max-width: 1680px;
    width: 100%;
    margin: 0 auto;
    overflow-y: auto;
    overflow-x: hidden;
}

.tab-panel {
    display: none;
}

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

.panel-header-bar {
    margin-bottom: 24px;
}

.panel-header-bar h2 {
    font-size: 24px; /* Agrandado */
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.3px;
}

.panel-header-bar p {
    color: var(--text-muted);
    font-size: 15px; /* Agrandado */
    margin-top: 4px;
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 24px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(6, 46, 59, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 8px 28px rgba(6, 46, 59, 0.08);
}

.card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 17px; /* Agrandado */
    margin-bottom: 18px;
    color: var(--primary-blue);
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 12px;
}

/* --------------------------------------------------------------------------
   Forms & Controls (Alta Legibilidad)
   -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.flex-small { flex: 0 0 190px; }

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px; /* Agrandado */
    font-family: inherit;
    color: var(--text-main);
    background-color: #FFFFFF;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(0, 86, 145, 0.15);
}

.form-control-lg {
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 600;
}

.input-textarea {
    width: 100%;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    resize: vertical;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    background: #F8FAFC;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-light);
}

.checkbox-grid label {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-transform: none;
    color: #1E293B;
}

.checkbox-grid input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-highlight {
    background-color: #FFF5F5;
    border: 1.5px solid #FECACA;
    padding: 14px;
    border-radius: var(--radius-sm);
}

.checkbox-highlight label {
    text-transform: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --------------------------------------------------------------------------
   Buttons & Badges
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 24px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.18s ease-in-out;
}

.btn-sm { padding: 6px 14px; font-size: 12.5px; border-radius: 18px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 28px; }
.btn-block { width: 100%; }

.btn-primary { 
    background-color: var(--petrol-sidebar); 
    color: white; 
    box-shadow: 0 4px 12px rgba(8, 50, 62, 0.25);
}
.btn-primary:hover { 
    background-color: var(--petrol-light); 
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(8, 50, 62, 0.35);
}

.btn-secondary { background-color: #E2E8F0; color: #334155; border-color: #CBD5E1; }
.btn-secondary:hover { background-color: #CBD5E1; }

.btn-success { background-color: var(--accent-green); color: white; }
.btn-success:hover { background-color: #1B6A2F; }

.btn-danger { background-color: var(--accent-red); color: white; }
.btn-danger:hover { background-color: #B91C1C; }

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

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-info { background-color: #E0F2FE; color: #0369A1; }
.badge-success { background-color: #DCFCE7; color: #15803D; }
.badge-warning { background-color: #FEF3C7; color: #B45309; }
.badge-danger { background-color: #FEE2E2; color: #B91C1C; }
.badge-primary { background-color: #E0E7FF; color: #3730A3; }
.badge-morgue { background-color: #334155; color: white; margin-bottom: 8px; font-size: 13px; }

/* --------------------------------------------------------------------------
   Depósitos Físicos Cards
   -------------------------------------------------------------------------- */
.depositos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.deposito-card {
    background: white;
    border: 1.5px solid var(--border-color);
    border-top: 5px solid var(--primary-blue);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

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

.deposito-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-dark);
}

.deposito-temp {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-light);
    background: #E0F2FE;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

.progress-bar-bg {
    background: #E2E8F0;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary-light);
    border-radius: 10px;
}

/* --------------------------------------------------------------------------
   Tables (Gran Legibilidad)
   -------------------------------------------------------------------------- */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px; /* Agrandada */
    text-align: left;
}

.data-table th {
    background-color: #E2E8F0;
    color: #1E293B;
    padding: 12px 16px;
    font-weight: 800;
    border-bottom: 2px solid #CBD5E1;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tr:hover {
    background-color: #F8FAFC;
}

/* --------------------------------------------------------------------------
   Touch Mode (Sala de Autopsias - Tablet)
   -------------------------------------------------------------------------- */
.tablet-header {
    border-left: 6px solid #005691;
    padding-left: 18px;
}

.touch-button-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 14px;
}

.btn-touch {
    min-height: 64px; /* Agrandado para toques con guantes quirúrgicos */
    padding: 12px 16px;
    font-size: 15px; /* Agrandado */
    font-weight: 800;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    transition: transform 0.1s, box-shadow 0.1s;
    user-select: none;
}

.btn-touch:active {
    transform: scale(0.97);
}

.touch-icon {
    font-size: 22px;
}

.btn-touch-formol {
    background-color: #E0F2FE;
    border-color: #7DD3FC;
    color: #0369A1;
}

.btn-touch-freezer {
    background-color: #CCFBF1;
    border-color: #5EEAD4;
    color: #0F766E;
}

.btn-touch-adn {
    background-color: #F3E8FF;
    border-color: #D8B4FE;
    color: #6B21A8;
}

.tray-list {
    min-height: 240px;
    max-height: 420px;
    overflow-y: auto;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: #FAFAFA;
}

.tray-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   KPIs & Jefatura
   -------------------------------------------------------------------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: white;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-light);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.kpi-val {
    font-size: 36px; /* Agrandado */
    font-weight: 900;
    color: var(--primary-blue);
    line-height: 1.1;
    margin-top: 8px;
}

.kpi-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --------------------------------------------------------------------------
   Modales
   -------------------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-dialog {
    background: white;
    width: 90%;
    max-width: 560px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-lg {
    max-width: 920px;
}

.modal-header {
    background: #F8FAFC;
    border-bottom: 1.5px solid var(--border-light);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-dark);
}

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

.modal-body {
    padding: 24px;
    max-height: 75vh;
    overflow-y: auto;
    font-size: 15px;
}

.modal-footer {
    background: #F8FAFC;
    border-top: 1.5px solid var(--border-light);
    padding: 14px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.doc-iframe {
    width: 100%;
    height: 650px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   Toast Notifications
   -------------------------------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #0F172A;
    color: white;
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

.toast-success { background: #15803D; }
.toast-danger { background: #B91C1C; }
.toast-warning { background: #B45309; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Helper classes */
.font-mono { font-family: 'JetBrains Mono', monospace; }
.font-bold { font-weight: 800; }
.text-danger { color: var(--accent-red); }
.text-center { text-align: center; }
.border-danger { border-color: var(--accent-red); }
.hidden { display: none !important; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.pt-3 { padding-top: 16px; }
.border-top { border-top: 1.5px solid var(--border-light); }
.max-w-600 { max-width: 680px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 10px; }
.text-muted { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Filtros Dinámicos de un Solo Botón (Quick Filter Chips)
   -------------------------------------------------------------------------- */
.quick-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: #F1F5F9;
    border-radius: 10px;
    border: 1.5px solid #E2E8F0;
}

.filter-label {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    color: #475569;
    letter-spacing: 0.6px;
    margin-right: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-chip {
    background-color: #FFFFFF;
    border: 1.5px solid #CBD5E1;
    color: #334155;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.filter-chip:hover {
    background-color: #F8FAFC;
    border-color: #94A3B8;
    color: #002855;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.filter-chip.active {
    background-color: #002855;
    color: #FFFFFF;
    border-color: #002855;
    box-shadow: 0 2px 8px rgba(0, 40, 85, 0.25);
}

.filter-chip.chip-danger.active {
    background-color: #DC2626;
    border-color: #DC2626;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.filter-chip.chip-primary.active {
    background-color: #0284C7;
    border-color: #0284C7;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.filter-chip.chip-warning.active {
    background-color: #D97706;
    border-color: #D97706;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

.filter-chip.chip-info.active {
    background-color: #2563EB;
    border-color: #2563EB;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.filter-chip.chip-success.active {
    background-color: #16A34A;
    border-color: #16A34A;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

/* --------------------------------------------------------------------------
   Calendario Forense y Agenda Procesal
   -------------------------------------------------------------------------- */
.calendar-nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-current-month {
    font-size: 17px;
    color: #002855;
    min-width: 150px;
    text-align: center;
    text-transform: capitalize;
}

.calendar-layout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
    margin-top: 14px;
}

@media (max-width: 1100px) {
    .calendar-layout-grid {
        grid-template-columns: 1fr;
    }
}

.calendar-main-card {
    padding: 20px;
    background: #FFFFFF;
}

.calendar-weekdays-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    color: #64748B;
    padding-bottom: 12px;
    border-bottom: 2px solid #E2E8F0;
}

.calendar-weekdays-header .weekend {
    color: #94A3B8;
}

.calendar-grid-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.calendar-day {
    min-height: 105px;
    background-color: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.calendar-day:hover {
    border-color: #0284C7;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.calendar-day.today {
    background-color: #F0F9FF;
    border: 2px solid #0284C7;
}

.calendar-day.selected {
    border: 2.5px solid #002855;
    background-color: #F8FAFC;
    box-shadow: 0 0 0 3px rgba(0, 40, 85, 0.15);
}

.calendar-day.other-month {
    background-color: #FAFAFA;
    opacity: 0.45;
}

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

.day-number {
    font-weight: 800;
    font-size: 14px;
    color: #1E293B;
}

.calendar-day.today .day-number {
    color: #0284C7;
    background: #E0F2FE;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.day-event-count {
    font-size: 10px;
    font-weight: 800;
    background: #E2E8F0;
    color: #475569;
    padding: 1px 5px;
    border-radius: 10px;
}

.day-events-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.day-event-pill {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.3;
}

.event-urgencia {
    background: #FEE2E2;
    color: #991B1B;
    border-left: 3px solid #DC2626;
}

.event-autopsia {
    background: #E0F2FE;
    color: #0369A1;
    border-left: 3px solid #0284C7;
}

.event-citacion {
    background: #F3E8FF;
    color: #6B21A8;
    border-left: 3px solid #9333EA;
}

.calendar-sidebar-card {
    padding: 20px;
    background: #FFFFFF;
    position: sticky;
    top: 140px;
}

.calendar-events-container {
    max-height: 600px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.calendar-event-card {
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    padding: 12px 14px;
    background: #FFFFFF;
    transition: all 0.15s ease;
}

.calendar-event-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.calendar-event-card.event-card-urgencia {
    border-left: 5px solid #DC2626;
    background: #FFF5F5;
}

.calendar-event-card.event-card-autopsia {
    border-left: 5px solid #0284C7;
    background: #F0F9FF;
}

.calendar-event-card.event-card-citacion {
    border-left: 5px solid #9333EA;
    background: #FAF5FF;
}

.cal-event-time {
    font-size: 11px;
    font-weight: 800;
    color: #64748B;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.cal-event-title {
    font-size: 14px;
    font-weight: 800;
    color: #0F172A;
    margin-bottom: 3px;
}

.cal-event-sub {
    font-size: 12px;
    color: #475569;
    font-weight: 600;
    margin-bottom: 6px;
}

.cal-event-desc {
    font-size: 12px;
    color: #64748B;
    margin-bottom: 8px;
    line-height: 1.4;
}
