/* ==========================================================================
   OCEANFLOW · SENIOR ENTERPRISE AQUACULTURE DESIGN SYSTEM
   Tipografía amplia y ultra-legible, alto contraste WCAG AA/AAA,
   jerarquía visual ejecutiva y componentes de precisión operacional.
   ========================================================================== */

:root {
    color-scheme: light;

    /* Paleta Primitiva & Semántica */
    --ocean-navy: #061A2E;
    --ocean-dark: #041221;
    --ocean-blue: #0B5CAB;
    --ocean-blue-hover: #084887;
    --ocean-teal: #008B94;
    --ocean-cyan: #0891B2;

    --background: #F2F6FA;
    --surface: #FFFFFF;
    --surface-soft: #EBF3F9;
    --surface-elevated: #F7FAFC;
    --surface-inset: #EDF2F7;

    /* Texto de Alto Contraste para lectura rápida en oficina y terreno */
    --text-primary: #071D33;
    --text-secondary: #2C465E;
    --text-tertiary: #4A657D;

    /* Bordes estructurales */
    --border: #D8E3EE;
    --border-subtle: #DCE6F0;
    --border-strong: #B8CADB;
    --border-act: var(--ocean-teal);

    /* Estados semánticos calibrados */
    --success: #0D8A52;
    --warning: #B45309;
    --danger: #C81E1E;

    --ocean-turquoise: var(--ocean-teal);
    --ocean-deep: var(--ocean-dark);
    --ocean-bg-light: var(--background);
    --ocean-green: var(--success);
    --ocean-amber: var(--warning);
    --ocean-red: var(--danger);

    --bg-base: var(--background);
    --bg-surface: var(--surface);
    --bg-surface-solid: var(--surface);
    --bg-surface-elevated: var(--surface-elevated);
    --bg-inset: var(--surface-inset);

    --brand-primary: var(--ocean-blue);
    --brand-accent: var(--ocean-teal);
    --brand-grad: linear-gradient(135deg, #0B5CAB 0%, #008B94 100%);

    --green: var(--success);
    --green-dim: #E3F7ED;
    --amber: var(--warning);
    --amber-dim: #FEF3C7;
    --red: var(--danger);
    --red-dim: #FEE2E2;
    --cyan-dim: #E0F5F7;

    /* Dimensiones y Geometría */
    --sidebar-w: 284px;
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-card: 18px;
    --radius-button: 12px;
    --radius-xl: 999px;

    /* Espaciado sistemático (base 8px) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;

    /* Elevación sutil y profesional */
    --ease: cubic-bezier(.16, 1, .3, 1);
    --transition: all 180ms var(--ease);
    --shadow-card: 0 2px 6px rgba(7, 29, 51, 0.04), 0 10px 26px -8px rgba(7, 29, 51, 0.065);
    --shadow-elevated: 0 14px 36px -8px rgba(7, 29, 51, 0.13);
    --blur: saturate(150%) blur(14px);

    /* Tipografía */
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-head: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;
}

[data-theme="dark"] {
    color-scheme: dark;
    --background: #061524;
    --surface: #0C2238;
    --surface-soft: #13314D;
    --surface-elevated: #122B45;
    --surface-inset: #081A2C;

    --text-primary: #F4F9FD;
    --text-secondary: #C8DCEB;
    --text-tertiary: #97B4C9;

    --border: #1E3E59;
    --border-subtle: #1E3E59;
    --border-strong: #2E587A;

    --bg-base: var(--background);
    --bg-surface: var(--surface);
    --bg-surface-solid: var(--surface);
    --bg-surface-elevated: var(--surface-elevated);
    --bg-inset: var(--surface-inset);

    --brand-primary: #38BDF8;
    --brand-accent: #22C5D0;

    --green: #34D399;
    --green-dim: rgba(16, 185, 129, 0.18);
    --amber: #FBBF24;
    --amber-dim: rgba(245, 158, 11, 0.18);
    --red: #F87171;
    --red-dim: rgba(239, 68, 68, 0.18);
    --cyan-dim: rgba(34, 197, 208, 0.18);

    --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.32);
    --shadow-elevated: 0 18px 42px rgba(0, 0, 0, 0.48);
}

/* ==========================================================================
   BASE & RESET TIPOGRÁFICO (TEXTO GRANDE Y LEGIBLE)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    min-width: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.55;
    background: var(--bg-base) !important;
    color: var(--text-primary);
    min-width: 320px;
    height: 100dvh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

body::before {
    inset: 0;
    opacity: .55;
    filter: none;
    background:
        radial-gradient(900px 460px at 85% -10%, rgba(8, 145, 178, .07), transparent 70%),
        radial-gradient(680px 380px at 10% 110%, rgba(11, 92, 171, .05), transparent 70%);
}

button, input, select, textarea {
    font: inherit;
}

button, a, select {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid var(--ocean-blue);
    outline-offset: 2px;
}

::selection {
    background: rgba(11, 92, 171, .18);
    color: var(--text-primary);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-thumb {
    background: #AFC3D4;
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}
::-webkit-scrollbar-track {
    background: transparent;
}

img, svg, canvas, video, iframe {
    max-width: 100%;
}

/* ==========================================================================
   SIDEBAR EJECUTIVO LUMINOSO ("OCEAN DAYLIGHT")
   ========================================================================== */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    margin: 0;
    height: 100dvh;
    background: linear-gradient(180deg, #FFFFFF 0%, #F2F8FD 65%, #E4F1FC 100%);
    border: none;
    border-right: 1px solid #D8E6F3;
    border-radius: 0;
    color: #0A2540;
    box-shadow: 4px 0 24px rgba(10, 37, 64, 0.04);
    transition: width 220ms var(--ease), min-width 220ms var(--ease), transform 220ms var(--ease);
    position: relative;
}

[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #08243E 0%, #061A2E 60%, #041221 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: #F0F7FC;
}

.sidebar-brand {
    padding: 24px 22px 18px;
    gap: 14px;
    border-bottom: 1px solid rgba(11, 92, 171, 0.08);
}

.brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #EAF4FE;
    box-shadow: 0 4px 12px rgba(0, 119, 230, 0.12);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .brand-icon {
    background: rgba(255, 255, 255, 0.08);
}

.brand-text {
    color: #0A2540;
    font-size: 1.38rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

[data-theme="dark"] .brand-text {
    color: #FFFFFF;
}

.brand-sub {
    color: #0077E6;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    margin-top: 3px;
}

[data-theme="dark"] .brand-sub {
    color: #7CE8F0;
}

.nav-menu {
    padding: 12px 14px 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(11, 92, 171, .18) transparent;
    position: relative;
    z-index: 2;
}

.nav-menu li {
    margin-bottom: 4px;
}

.nav-section-label {
    margin: 14px 0 6px !important;
    padding: 4px 14px;
    color: #5A7690;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    list-style: none;
}

[data-theme="dark"] .nav-section-label {
    color: #96B7CE;
}

.nav-menu a {
    display: flex;
    align-items: center;
    min-height: 46px;
    gap: 13px;
    padding: 10px 15px;
    color: #2B4660;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.25;
    transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
    position: relative;
}

.nav-link-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .nav-menu a {
    color: #DCEAF3;
}

.nav-menu a i {
    flex: 0 0 24px;
    font-size: 1.35rem;
    color: #3B5B78;
}

[data-theme="dark"] .nav-menu a i {
    color: #9DC0D6;
}

.nav-menu a:hover {
    color: #0077E6;
    background: rgba(0, 119, 230, 0.08);
}

[data-theme="dark"] .nav-menu a:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.09);
}

.nav-menu a:hover i {
    color: #0077E6;
}

.nav-menu a.active {
    color: #FFFFFF !important;
    font-weight: 700;
    background: linear-gradient(90deg, #0077E6 0%, #00B4D8 100%);
    border-color: transparent;
    box-shadow: 0 8px 20px -4px rgba(0, 119, 230, 0.42);
}

.nav-menu a.active i {
    color: #FFFFFF !important;
}

.nav-alert-badge {
    margin-left: auto;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 0.8rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

.sidebar-wave-art {
    position: relative;
    padding: 18px 20px 10px;
    margin-top: auto;
    overflow: hidden;
    pointer-events: none;
}

.sidebar-wave-art svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.sidebar-tagline {
    position: relative;
    z-index: 1;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    line-height: 1.65;
    color: #2B4C6B;
    text-transform: uppercase;
}

[data-theme="dark"] .sidebar-tagline {
    color: #96B7CE;
}

.sidebar-footer {
    position: relative;
    z-index: 2;
    padding: 12px 16px;
    border-top: 1px solid rgba(11, 92, 171, 0.1);
    background: rgba(255, 255, 255, 0.72);
}

[data-theme="dark"] .sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-user {
    min-width: 0;
    gap: 12px;
}

.user-avatar {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    font-size: 0.92rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0077E6, #00B4D8);
    color: #FFFFFF;
}

.sidebar-user-name,
.sidebar #current-user-name {
    color: #0A2540 !important;
    font-size: 0.96rem !important;
    font-weight: 800 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .sidebar-user-name,
[data-theme="dark"] .sidebar #current-user-name {
    color: #FFFFFF !important;
}

.sidebar-user-role,
.sidebar #user-role-display {
    color: #4A657D !important;
    font-size: 0.84rem !important;
    font-weight: 600;
    margin-top: 1px;
}

[data-theme="dark"] .sidebar-user-role,
[data-theme="dark"] .sidebar #user-role-display {
    color: #B4CFE0 !important;
}

.sidebar .icon-btn {
    width: 38px;
    height: 38px;
    border-color: #D0E0EE;
    color: #2B4660;
    background: #FFFFFF;
}

.sidebar .icon-btn:hover {
    color: #0077E6;
    border-color: #0077E6;
    background: #F0F7FF;
}

/* ==========================================================================
   TOPBAR COMANDO OPERACIONAL (BUSCADOR PILL + PERFIL + FILTROS)
   ========================================================================== */
.main-content {
    min-width: 0;
    background: linear-gradient(180deg, #E8F2FC 0%, #F1F7FC 40%, #EDF4FA 100%);
}

[data-theme="dark"] .main-content {
    background: var(--bg-base);
}

.topbar {
    min-height: 74px;
    height: auto;
    margin: 0;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: none;
    border-bottom: 1px solid #DCE8F4;
    border-radius: 0;
    box-shadow: 0 2px 12px rgba(10, 37, 64, 0.03);
    position: relative;
    z-index: 40;
}

[data-theme="dark"] .topbar {
    background: rgba(12, 34, 56, 0.9);
    border-bottom: 1px solid var(--border-subtle);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 380px;
    min-width: 310px;
}

.topbar-search-pill {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 320px;
    width: 100%;
    min-width: 260px;
    max-width: 480px;
    min-height: 44px;
    padding: 6px 12px 6px 16px;
    background: #F3F8FD;
    border: 1px solid #D5E4F2;
    border-radius: 999px;
    transition: var(--transition);
}

[data-theme="dark"] .topbar-search-pill {
    background: var(--bg-inset);
    border-color: var(--border-subtle);
}

.topbar-search-pill:focus-within {
    background: #FFFFFF;
    border-color: #0077E6;
    box-shadow: 0 0 0 3px rgba(0, 119, 230, 0.14);
}

[data-theme="dark"] .topbar-search-pill:focus-within {
    background: var(--bg-surface-elevated);
}

.topbar-search-pill > i {
    color: #5A7690;
    font-size: 1.18rem;
    flex-shrink: 0;
}

.topbar-search-pill input {
    flex: 1 1 auto;
    width: 100% !important;
    min-width: 165px !important;
    border: none !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 2px 0 !important;
    color: var(--text-primary);
    font-size: 0.96rem;
    font-weight: 500;
}

.topbar-search-pill input::placeholder {
    color: #6B859E;
}

.search-kbd {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 6px;
    background: #FFFFFF;
    border: 1px solid #D5E4F2;
    color: #5A7690;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

[data-theme="dark"] .search-kbd {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
    color: var(--text-tertiary);
}

/* Dropdown de resultados del buscador rápido */
.quick-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 340px;
    max-height: 380px;
    overflow-y: auto;
    background: #FFFFFF;
    border: 1px solid #CFE0F0;
    border-radius: 16px;
    box-shadow: 0 18px 40px -10px rgba(7, 29, 51, 0.22);
    padding: 8px;
    z-index: 120;
}

[data-theme="dark"] .quick-search-dropdown {
    background: var(--bg-surface-elevated);
    border-color: var(--border-strong);
}

.quick-search-dropdown.hidden {
    display: none !important;
}

.qs-group-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6A85A0;
    padding: 8px 10px 4px;
}

.qs-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    background: transparent;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    color: var(--text-primary);
    font-family: var(--font-body);
    transition: background 0.15s ease;
}

.qs-item:hover,
.qs-item:focus {
    background: #EFF6FF;
    outline: none;
}

[data-theme="dark"] .qs-item:hover,
[data-theme="dark"] .qs-item:focus {
    background: rgba(56, 189, 248, 0.12);
}

.qs-item-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.qs-item-main i {
    font-size: 1.1rem;
    color: #0077E6;
    flex-shrink: 0;
}

.qs-item-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qs-item-sub {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 500;
    white-space: nowrap;
}

.qs-empty {
    padding: 16px 12px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.topbar-selectors {
    flex: 0 1 auto;
    min-width: 0;
}

.topbar-selectors-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-select {
    width: auto !important;
    min-width: 120px;
    max-width: 175px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.topbar-select-org {
    font-weight: 700 !important;
    max-width: 185px;
}

.topbar-select-rol {
    max-width: 155px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 1380px) {
    .topbar-select-rol {
        display: none;
    }
    .topbar-select {
        max-width: 155px;
    }
}

.notif-bell-btn {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 0.74rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFFFFF;
}

.topbar-profile-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 6px;
    border-radius: 999px;
    background: #F4F9FE;
    border: 1px solid #D8E6F3;
    cursor: pointer;
    transition: var(--transition);
}

[data-theme="dark"] .topbar-profile-chip {
    background: var(--bg-surface-elevated);
    border-color: var(--border-subtle);
}

.topbar-profile-chip:hover {
    border-color: #0077E6;
    background: #FFFFFF;
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    font-size: 0.85rem;
}

.topbar-profile-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.topbar-profile-text strong {
    font-size: 0.94rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
}

.topbar-profile-text span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.topbar .input-s {
    min-height: 42px;
    padding: 8px 12px;
    background: #F4F9FE;
    border: 1px solid #CFE0F0;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.92rem !important;
    font-weight: 600;
}

[data-theme="dark"] .topbar .input-s {
    background: var(--bg-inset);
    border-color: var(--border-strong);
}

.topbar .input-s:hover {
    border-color: #0077E6;
}

.topbar .input-s:focus {
    border-color: #0077E6;
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(0, 119, 230, 0.14);
}

.icon-btn {
    min-width: 42px;
    min-height: 42px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: var(--transition);
}

.icon-btn:hover {
    color: #0077E6;
    border-color: #0077E6;
    background: var(--bg-surface-elevated);
}

/* ==========================================================================
   CONTENIDO PRINCIPAL & ENCABEZADOS DE SECCIÓN
   ========================================================================== */
.content-scroll {
    padding: 20px clamp(18px, 2.2vw, 32px) 64px;
    scroll-behavior: smooth;
}

.section {
    max-width: 1520px;
    scroll-margin-top: 18px;
}

.sec-header {
    align-items: flex-end;
    margin-bottom: 28px;
    gap: 20px;
}

.sec-title {
    font-family: var(--font-head);
    color: var(--text-primary);
    font-size: clamp(1.95rem, 2.4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.sec-desc {
    max-width: 820px;
    color: var(--text-secondary);
    font-size: 1.06rem;
    font-weight: 500;
    line-height: 1.55;
    margin-top: 6px;
}

.sec-actions {
    gap: 12px;
}

/* ==========================================================================
   BOTONES Y CONTROLES DE FORMULARIO (TAMAÑO AMPLIO Y CLARO)
   ========================================================================== */
.btn {
    min-height: 46px;
    padding: 11px 20px;
    border-radius: var(--radius-button);
    font-size: 0.96rem;
    font-weight: 700;
    gap: 9px;
    transition: var(--transition);
}

.btn i {
    font-size: 1.15rem;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    color: #FFFFFF;
    background: var(--ocean-blue);
    box-shadow: 0 4px 12px rgba(11, 92, 171, 0.22);
}

.btn-primary:hover {
    background: var(--ocean-blue-hover);
    box-shadow: 0 6px 18px rgba(11, 92, 171, 0.30);
    transform: translateY(-1px);
}

.btn-outline,
.btn-ghost {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
}

.btn-outline:hover,
.btn-ghost:hover {
    border-color: var(--ocean-blue);
    background: var(--bg-surface-elevated);
    color: var(--ocean-blue);
}

.btn-sm {
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
}

.btn-danger-outline {
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid rgba(200, 30, 30, 0.32);
    border-radius: 10px;
    background: var(--bg-surface);
    color: var(--danger);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-danger-outline:hover {
    border-color: var(--danger);
    background: var(--red-dim);
}

.btn-danger-outline:disabled,
.icon-btn:disabled,
.btn:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.input-s {
    min-height: 48px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
}

.input-s::placeholder {
    color: var(--text-tertiary);
    opacity: 0.8;
}

.input-s:focus {
    border-color: var(--ocean-blue);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(11, 92, 171, 0.14);
}

textarea.input-s {
    min-height: 104px;
    resize: vertical;
    line-height: 1.5;
}

.form-row {
    gap: 8px;
    margin-bottom: 18px;
}

.form-label,
.form-row > label {
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
}

.form-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

/* ==========================================================================
   HERO BANNER ESCÉNICO ("OCEANFLOW CONTROL CENTER")
   ========================================================================== */
.control-hero-banner {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    min-height: 174px;
    margin-bottom: -24px;
    padding: 26px 30px 44px;
    border: 1px solid #CFE3F6;
    background: #DCEFFD;
    box-shadow: 0 8px 28px -8px rgba(10, 37, 64, 0.08);
}

[data-theme="dark"] .control-hero-banner {
    border-color: var(--border-subtle);
    background: #092138;
}

.control-hero-artwork {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 58%;
    z-index: 0;
    pointer-events: none;
}

[data-theme="dark"] .control-hero-artwork {
    opacity: 0.45;
    filter: brightness(0.75) saturate(0.9);
}

.control-hero-fade {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(90deg, #E2F1FC 0%, #EAF5FE 36%, rgba(234, 245, 254, 0.72) 56%, rgba(234, 245, 254, 0.05) 78%, rgba(234, 245, 254, 0) 100%);
}

[data-theme="dark"] .control-hero-fade {
    background: linear-gradient(90deg, #081E33 0%, rgba(8, 30, 51, 0.92) 45%, rgba(8, 30, 51, 0.35) 100%);
}

.control-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.control-hero-copy .sec-title {
    font-size: clamp(2.05rem, 2.7vw, 2.55rem);
    font-weight: 800;
    color: #071D33;
    letter-spacing: -0.03em;
}

[data-theme="dark"] .control-hero-copy .sec-title {
    color: #F4F9FD;
}

.control-hero-copy .sec-desc {
    font-size: 1.12rem;
    font-weight: 500;
    color: #2B4C6B;
    margin-top: 4px;
}

[data-theme="dark"] .control-hero-copy .sec-desc {
    color: #C8DCEB;
}

.hero-quick-actions {
    margin-top: 12px;
}

.hero-weather-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 26px -6px rgba(7, 29, 51, 0.14);
}

[data-theme="dark"] .hero-weather-card {
    background: rgba(12, 34, 56, 0.9);
    border-color: var(--border-subtle);
}

.weather-sun-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #FEF3C7;
    color: #F59E0B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
}

.weather-temp {
    font-family: var(--font-head);
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.weather-loc {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
}

.weather-date {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-tertiary);
}

/* ==========================================================================
   TARJETAS KPI EJECUTIVAS (HORIZONTALES Y TABULARES)
   ========================================================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.kpi-grid-hero {
    position: relative;
    z-index: 3;
    padding: 0 8px;
}

.kpi-card {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 132px;
    padding: 20px 22px;
    color: var(--text-primary);
    text-decoration: none;
    background: var(--bg-surface);
    border: 1px solid #DCE8F4;
    border-radius: 20px;
    box-shadow: 0 8px 24px -6px rgba(10, 37, 64, 0.065), 0 2px 6px rgba(10, 37, 64, 0.03);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

[data-theme="dark"] .kpi-card {
    border-color: var(--border-subtle);
}

.kpi-card-horizontal {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    min-height: 118px;
    padding: 18px 20px;
}

.kpi-card-horizontal::before {
    display: none;
}

.kpi-visual-box {
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
    border-radius: 16px;
    background: linear-gradient(145deg, #E3F2FF 0%, #D4ECFF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .kpi-visual-box {
    background: #143552;
}

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

.kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.kpi-trend {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #0D8A52;
    font-size: 0.92rem;
    font-weight: 800;
}

[data-theme="dark"] .trend-badge {
    color: #34D399;
}

.kpi-chevron {
    color: var(--text-tertiary);
    font-size: 1.1rem;
    margin-left: auto;
}

.kpi-card-highlight {
    background: linear-gradient(180deg, var(--bg-surface) 0%, #F5FAFF 100%);
    border-color: #BBD8F5;
}

[data-theme="dark"] .kpi-card-highlight {
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--surface-soft) 100%);
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: #0077E6;
    box-shadow: var(--shadow-elevated);
}

.kpi-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: var(--surface-soft);
    color: var(--ocean-blue);
    font-size: 1.4rem;
}

[data-theme="dark"] .kpi-icon {
    background: #143552;
    color: #67E8F9;
}

.kpi-label {
    margin-bottom: 4px;
    color: #334E68;
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: none;
    line-height: 1.3;
}

[data-theme="dark"] .kpi-label {
    color: var(--text-secondary);
}

.kpi-value {
    font-family: var(--font-head);
    color: #0A2540;
    font-size: clamp(2rem, 2.3vw, 2.45rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.08;
    font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .kpi-value {
    color: var(--text-primary);
}

.kpi-meta,
.kpi-card > span {
    display: block;
    margin-top: 2px;
    color: #5A7690 !important;
    font-size: 0.85rem !important;
    font-weight: 600;
    line-height: 1.35;
}

/* ==========================================================================
   FILA CENTRAL DE 3 COLUMNAS & FILA INFERIOR DE 2 COLUMNAS (CONTROL CENTER)
   ========================================================================== */
.dashboard-mid-grid {
    display: grid;
    grid-template-columns: 1.28fr 1.05fr 0.95fr;
    gap: 20px;
    margin-bottom: 22px;
    align-items: stretch;
}

.dashboard-mid-grid > .panel,
.dashboard-right-stack > .panel,
.dashboard-bottom-grid > .panel {
    margin-bottom: 0;
}

.dashboard-right-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1.12fr;
    gap: 20px;
    margin-bottom: 24px;
}

.panel-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0077E6;
    font-size: 0.94rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}

.panel-link:hover {
    color: #0353A4;
    transform: translateX(2px);
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-green { background: #10B981; }
.dot-amber { background: #F59E0B; }
.dot-red { background: #EF4444; }
.dot-blue { background: #0077E6; }
.dot-cyan { background: #00B4D8; }

.map-status-strip,
.chart-legend-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    padding: 0 22px 12px;
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.map-status-pill,
.chart-legend-strip span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.dashboard-map-panel {
    display: flex;
    flex-direction: column;
}

.dashboard-map-panel .map-body {
    flex: 1;
    min-height: 310px;
    margin: 0 18px 18px;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    border: 1px solid #D8E6F3;
}

.map-floating-count {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 500;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(10, 37, 64, 0.88);
    backdrop-filter: blur(8px);
    color: #FFFFFF;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

/* Marcadores tipo píldora sobre el mapa */
.of-map-pill-icon {
    background: transparent !important;
    border: none !important;
}

.of-map-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(10, 37, 64, 0.9);
    color: #FFFFFF;
    font-family: var(--font-body);
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chart-period-select {
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid #D5E4F2;
    background: #F5F9FD;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.chart-canvas-wrap {
    height: 300px !important;
    padding: 8px 20px 18px !important;
}

/* Alertas Recientes (Columna Derecha Superior) */
.alerts-list-body {
    padding: 6px 18px 18px !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.recent-alert-item:hover {
    transform: translateX(2px);
}

.recent-alert-critical {
    background: #FFF5F5;
    border-color: #FED7D7;
}
.recent-alert-warning {
    background: #FFFBEB;
    border-color: #FDE68A;
}
.recent-alert-info {
    background: #F0F7FF;
    border-color: #BFDBFE;
}

[data-theme="dark"] .recent-alert-critical { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.3); }
[data-theme="dark"] .recent-alert-warning { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.3); }
[data-theme="dark"] .recent-alert-info { background: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.3); }

.recent-alert-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #FFFFFF;
}
.recent-alert-critical .recent-alert-icon { background: #EF4444; }
.recent-alert-warning .recent-alert-icon { background: #F59E0B; }
.recent-alert-info .recent-alert-icon { background: #0077E6; }

.recent-alert-copy {
    flex: 1;
    min-width: 0;
}

.recent-alert-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
}
.recent-alert-critical .recent-alert-title { color: #B91C1C; }
[data-theme="dark"] .recent-alert-critical .recent-alert-title { color: #FCA5A5; }

.recent-alert-sub {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-alert-time {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* Inspecciones Pendientes (Columna Derecha Inferior) */
.inspections-card-body {
    padding: 8px 20px 20px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.inspections-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.inspections-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0077E6, #00B4D8);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 6px 14px rgba(0, 119, 230, 0.25);
}

.inspections-count {
    font-family: var(--font-head);
    font-size: 2.3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.inspections-label {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}
.inspections-label span {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}
.inspections-label small {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-tertiary);
}

.btn-soft-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid #D0E4F7;
    background: #EBF5FF;
    color: #0077E6;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-soft-pill:hover {
    background: #0077E6;
    color: #FFFFFF;
}

/* Tablas Ejecutivas Inferiores */
.compact-exec-table {
    min-width: 560px !important;
}
.compact-exec-table th {
    background: transparent !important;
    border-bottom: 1px solid #E2ECF5 !important;
    padding: 12px 18px !important;
    font-size: 0.84rem !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: #5A7690 !important;
}
.compact-exec-table td {
    padding: 13px 18px !important;
    font-size: 0.96rem !important;
    border-bottom: 1px solid #EDF3F9 !important;
}
.status-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95rem;
}
.status-inline-green { color: #0D8A52; }
.status-inline-amber { color: #D97706; }
.status-inline-red { color: #DC2626; }

.growth-cell {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

/* ==========================================================================
   PANELES, SEMÁFORO OPERACIONAL & OCEANFLOW INTELLIGENCE
   ========================================================================== */
.panel {
    background: var(--bg-surface);
    border: 1px solid #DCE8F4;
    border-radius: 20px;
    box-shadow: 0 6px 22px -6px rgba(10, 37, 64, 0.055), 0 2px 6px rgba(10, 37, 64, 0.025);
    margin-bottom: 24px;
    overflow: hidden;
}

[data-theme="dark"] .panel {
    border-color: var(--border-subtle);
}

.panel-header {
    min-height: 60px;
    padding: 18px 22px 12px;
    background: var(--bg-surface);
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.panel-title {
    font-family: var(--font-head);
    color: var(--text-primary);
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title > i {
    color: var(--ocean-teal);
    font-size: 1.35rem;
}

.panel-subtitle {
    font-size: 0.94rem;
    font-weight: 500;
    color: var(--text-tertiary);
}

.panel-body {
    padding: 20px 22px;
    font-size: 1rem;
}

/* Semáforo Operacional Explicable */
.semaforo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 18px;
}

.semaforo-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-left: 5px solid var(--sem-color, var(--ocean-teal));
    border-radius: 16px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(7, 29, 51, 0.03);
}

.semaforo-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.semaforo-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.semaforo-card-title strong {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}

.semaforo-rules-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.semaforo-rule-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.semaforo-rule-desc {
    font-weight: 500;
    color: var(--text-primary);
}

.semaforo-rule-action {
    font-size: 0.92rem;
    color: var(--brand-primary);
    font-weight: 700;
    margin-top: 4px;
}

.semaforo-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.semaforo-metrics {
    display: flex;
    gap: 16px;
    font-variant-numeric: tabular-nums;
}

.semaforo-metrics strong {
    color: var(--text-primary);
    font-weight: 800;
}

.semaforo-source {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-weight: 600;
}

/* Tarjetas de Hallazgos OceanFlow Intelligence */
.intel-finding-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-left: 5px solid var(--finding-color, var(--ocean-blue));
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 16px;
}

.intel-finding-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.intel-finding-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.intel-finding-detail {
    font-size: 1.02rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 12px;
}

.intel-finding-explanation {
    font-size: 0.95rem;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.intel-finding-action {
    font-size: 0.98rem;
    color: var(--brand-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Gráficos y Mapa */
.dashboard-chart-grid {
    gap: 20px !important;
}

.dashboard-chart-primary,
.dashboard-chart-secondary {
    min-width: 0;
}

.dashboard-chart-primary .panel-body,
.dashboard-chart-secondary .panel-body {
    height: 320px !important;
}

.map-body {
    isolation: isolate;
}

#cultivation-centers-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: #D8EAF0;
}

[data-theme="dark"] #cultivation-centers-map .leaflet-tile {
    filter: brightness(.8) saturate(.85);
}

.map-caption {
    position: absolute;
    z-index: 500;
    bottom: 16px;
    left: 16px;
    max-width: min(640px, calc(100% - 32px));
    padding: 10px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-secondary);
    box-shadow: var(--shadow-card);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
}

[data-theme="dark"] .map-caption {
    background: rgba(12, 34, 56, 0.95);
}

/* ==========================================================================
   TABLAS DE DATOS EMPRESARIALES (LECTURA RÁPIDA Y ESCANEABLE)
   ========================================================================== */
.data-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    position: sticky;
    top: 0;
    padding: 15px 18px;
    background: var(--bg-inset);
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-subtle);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table td {
    padding: 16px 18px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
}

.data-table td.strong,
.data-table td strong.strong {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.02rem;
}

.data-table tbody tr {
    transition: background 140ms ease;
}

.data-table tbody tr:hover td {
    background: var(--bg-surface-elevated);
}

.code-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--brand-primary);
    font-family: var(--font-mono);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

[data-theme="dark"] .code-pill {
    background: rgba(56, 189, 248, 0.14);
    color: #7DD3FC;
}

.metric-highlight {
    color: var(--brand-primary);
    font-weight: 800;
    font-size: 1.05rem;
}

.table-subtext {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   BADGES & ESTADOS SEMÁNTICOS
   ========================================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 5px 12px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.badge-green {
    background: var(--green-dim);
    color: var(--green);
}

.badge-amber {
    background: var(--amber-dim);
    color: var(--amber);
}

.badge-red {
    background: var(--red-dim);
    color: var(--red);
}

.badge-blue {
    background: var(--cyan-dim);
    color: var(--ocean-teal);
}

[data-theme="dark"] .badge-blue {
    color: #67E8F9;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(13, 138, 82, 0.16);
}

.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.empty-state i {
    font-size: 2.6rem;
    color: var(--ocean-teal);
    margin-bottom: 12px;
}

/* ==========================================================================
   MODALES & NAVEGACIÓN COLAPSABLE
   ========================================================================== */
.modal-overlay {
    padding: clamp(14px, 3vw, 32px);
    overflow-y: auto;
    background: rgba(4, 18, 33, 0.62);
    backdrop-filter: blur(6px);
}

.modal-card {
    width: min(880px, 100%);
    max-height: min(90dvh, 920px);
    padding: 32px;
    border: 1px solid var(--border-subtle);
    border-radius: 22px;
    box-shadow: 0 28px 80px rgba(4, 18, 33, 0.28);
}

.sidebar-collapse-btn {
    flex: 0 0 44px;
}

.mobile-only,
.sidebar-scrim {
    display: none;
}

.sidebar-collapsed .sidebar {
    width: 84px;
    min-width: 84px;
}
.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-inline: 10px;
}
.sidebar-collapsed .sidebar-brand > div:last-child,
.sidebar-collapsed .nav-section-label,
.sidebar-collapsed .nav-link-label,
.sidebar-collapsed .nav-alert-badge,
.sidebar-collapsed .sidebar-wave-art,
.sidebar-collapsed .sidebar-user > div:nth-child(2) {
    display: none;
}
.sidebar-collapsed .nav-menu {
    padding-inline: 10px;
}
.sidebar-collapsed .nav-menu a {
    justify-content: center;
    padding-inline: 10px;
}
.sidebar-collapsed .nav-menu a i {
    flex-basis: auto;
    font-size: 1.4rem;
}
.sidebar-collapsed .sidebar-footer {
    padding-inline: 10px;
}
.sidebar-collapsed .sidebar-user {
    justify-content: center;
    flex-wrap: wrap;
}
.sidebar-collapsed .sidebar-user .icon-btn {
    width: 100%;
}
.sidebar-collapsed .sidebar-collapse-btn {
    transform: rotate(180deg);
}

/* ==========================================================================
   DISEÑO RESPONSIVO INTENCIONAL (DESKTOP, TABLET, MOBILE)
   ========================================================================== */
@media (max-width: 1280px) {
    :root {
        --sidebar-w: 256px;
    }
    .dashboard-mid-grid {
        grid-template-columns: 1fr 1fr;
    }
    .dashboard-right-stack {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1.2fr 0.8fr;
    }
}

@media (max-width: 1080px) {
    .topbar {
        flex-wrap: wrap;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dashboard-mid-grid,
    .dashboard-bottom-grid,
    .dashboard-right-stack {
        grid-template-columns: 1fr;
    }
    .dashboard-chart-primary {
        grid-column: span 7 !important;
    }
    .dashboard-chart-secondary {
        grid-column: span 5 !important;
    }
}

@media (max-width: 768px) {
    body {
        display: block;
        height: 100dvh;
        overflow: hidden;
    }
    .sidebar {
        position: fixed;
        z-index: 80;
        left: 0;
        top: 0;
        width: min(310px, calc(100vw - 48px));
        min-width: min(310px, calc(100vw - 48px));
        height: 100dvh;
        margin: 0;
        border-radius: 0 22px 22px 0;
        transform: translateX(-105%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-collapsed .sidebar {
        width: min(310px, calc(100vw - 48px));
        min-width: min(310px, calc(100vw - 48px));
    }
    .sidebar-collapsed .sidebar-brand {
        justify-content: flex-start;
        padding: 22px 20px 18px;
    }
    .sidebar-collapsed .sidebar-brand > div:last-child,
    .sidebar-collapsed .nav-section-label,
    .sidebar-collapsed .nav-link-label,
    .sidebar-collapsed .sidebar-user > div:nth-child(2) {
        display: revert;
    }
    .sidebar-collapsed .nav-menu {
        padding: 10px 14px 18px;
    }
    .sidebar-collapsed .nav-menu a {
        justify-content: flex-start;
        padding: 11px 14px;
    }
    .sidebar-collapsed .nav-menu a i {
        flex-basis: 24px;
    }
    .sidebar-collapsed .sidebar-user {
        justify-content: flex-start;
        flex-wrap: nowrap;
    }
    .sidebar-collapsed .sidebar-user .icon-btn {
        width: 42px;
    }
    .sidebar-scrim {
        position: fixed;
        z-index: 70;
        inset: 0;
        border: 0;
        background: rgba(4, 18, 33, 0.5);
        backdrop-filter: blur(3px);
    }
    body.sidebar-open .sidebar-scrim {
        display: block;
    }
    .main-content {
        height: 100dvh;
    }
    .topbar {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 10px 12px;
        margin: 10px 10px 0;
        padding: 12px 14px;
        border-radius: 16px;
    }
    .topbar-left {
        flex: 1 1 190px;
    }
    .mobile-only {
        display: inline-flex;
    }
    .sidebar-collapse-btn {
        display: none;
    }
    .topbar-breadcrumb {
        font-size: 0.9rem;
        gap: 6px;
        overflow: hidden;
    }
    .topbar-breadcrumb strong {
        font-size: 1rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .topbar-selectors {
        order: 3;
        flex: 1 0 100%;
    }
    .topbar-selectors > div {
        justify-content: stretch;
        gap: 8px !important;
    }
    .topbar-selectors select#global-org-select,
    .topbar-selectors select#global-centro-select {
        width: auto !important;
        min-width: 0;
        flex: 1 1 50%;
    }
    .topbar-right {
        flex: 0 1 auto;
        gap: 8px;
    }
    #sync-status-badge {
        font-size: 0;
        min-width: 38px;
        justify-content: center;
        padding: 8px;
    }
    #sync-status-badge .status-dot {
        width: 10px;
        height: 10px;
    }
    #global-rol-select {
        display: none;
    }
    .content-scroll {
        padding: 20px 14px 44px;
    }
    .sec-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
        margin-bottom: 20px;
    }
    .sec-title {
        font-size: 1.75rem;
    }
    .sec-desc {
        font-size: 0.98rem;
    }
    .sec-actions {
        width: 100%;
    }
    .sec-actions .btn {
        flex: 1;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .kpi-card {
        min-height: 156px;
        padding: 18px;
    }
    .kpi-value {
        font-size: 1.95rem;
    }
    .semaforo-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-chart-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 16px !important;
    }
    .dashboard-chart-primary,
    .dashboard-chart-secondary {
        grid-column: 1 / -1 !important;
    }
    .panel-header {
        padding: 16px 18px;
        flex-wrap: wrap;
    }
    .panel-body {
        padding: 18px;
    }
    .modal-card {
        padding: 22px 18px;
        border-radius: 18px;
    }
}

@media (max-width: 480px) {
    .topbar-breadcrumb > span,
    .topbar-breadcrumb > i {
        display: none;
    }
    .topbar-selectors > div {
        flex-wrap: wrap;
    }
    .topbar-selectors select#global-org-select,
    .topbar-selectors select#global-centro-select {
        flex: 1 1 100%;
        width: 100% !important;
    }
    .kpi-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .sec-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
