/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/JetBrainsMono-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/JetBrainsMono-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/JetBrainsMono-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/JetBrainsMono-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/JetBrainsMono-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/JetBrainsMono-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/PlusJakartaSans-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/PlusJakartaSans-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/PlusJakartaSans-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/PlusJakartaSans-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/PlusJakartaSans-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/PlusJakartaSans-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/PlusJakartaSans-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/PlusJakartaSans-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/fonts/PlusJakartaSans-800-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/fonts/PlusJakartaSans-800-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* ============================================================
   EVA — Sistema de diseño
   Plataforma de escritos · Poder Judicial · v2.0
   ============================================================ */

:root {
  /* Neutrales fríos */
  --bg:            oklch(0.984 0.004 280);
  --bg-2:          oklch(0.968 0.006 282);
  --surface:       oklch(1 0 0);
  --surface-2:     oklch(0.989 0.003 282);
  --border:        oklch(0.918 0.007 285);
  --border-strong: oklch(0.86 0.01 285);
  --text:          oklch(0.255 0.022 281);
  --text-2:        oklch(0.44 0.02 281);
  --muted:         oklch(0.58 0.018 282);
  --faint:         oklch(0.72 0.014 284);

  /* Primario índigo / violeta */
  --primary:        oklch(0.515 0.196 285);
  --primary-strong: oklch(0.448 0.198 286);
  --primary-press:  oklch(0.40 0.18 286);
  --primary-soft:   oklch(0.955 0.026 286);
  --primary-soft-2: oklch(0.918 0.045 286);
  --primary-ring:   oklch(0.515 0.196 285 / 0.32);

  /* Semánticos (misma familia de luminosidad/croma, varía tono) */
  --success:      oklch(0.58 0.13 158);
  --success-soft: oklch(0.952 0.035 160);
  --warning:      oklch(0.70 0.135 70);
  --warning-soft: oklch(0.96 0.045 80);
  --danger:       oklch(0.575 0.195 27);
  --danger-soft:  oklch(0.955 0.03 25);
  --info:         oklch(0.60 0.12 245);
  --info-soft:    oklch(0.955 0.028 245);

  /* Sidebar oscuro */
  --side:        oklch(0.225 0.038 286);
  --side-2:      oklch(0.20 0.036 286);
  --side-border: oklch(0.32 0.04 286);
  --side-text:   oklch(0.80 0.02 286);
  --side-muted:  oklch(0.62 0.025 286);
  --side-active: oklch(0.30 0.075 286);

  --radius:    14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px oklch(0.3 0.03 285 / 0.06), 0 1px 3px oklch(0.3 0.03 285 / 0.05);
  --shadow:    0 2px 6px oklch(0.3 0.03 285 / 0.06), 0 8px 24px oklch(0.3 0.03 285 / 0.07);
  --shadow-lg: 0 12px 40px oklch(0.25 0.04 285 / 0.16);

  --sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

/* ============================================================
   TEMA: Rojo Carbón  (#ec2624 · #000000 · #1e1e1e · #ffffff)
   ============================================================ */
[data-theme="rojo"] {
  --primary:        #ec2624;
  --primary-strong: #cc1d1b;
  --primary-press:  #a81513;
  --primary-soft:   oklch(0.955 0.03 26);
  --primary-soft-2: oklch(0.91 0.055 26);
  --primary-ring:   oklch(0.58 0.2 27 / 0.30);

  --side:        #000000;
  --side-2:      #0a0a0a;
  --side-border: #262626;
  --side-text:   oklch(0.82 0 0);
  --side-muted:  oklch(0.55 0 0);
  --side-active: #1e1e1e;

  --bg:      oklch(0.985 0 0);
  --bg-2:    oklch(0.965 0.002 30);
  --border:  oklch(0.915 0.003 30);
  --border-strong: oklch(0.85 0.004 30);
  --text:    #1e1e1e;
  --text-2:  oklch(0.40 0.005 30);
}
[data-theme="rojo"] .side-item.active { box-shadow: inset 3px 0 0 var(--primary); }
[data-theme="rojo"] .side-avatar { background: linear-gradient(135deg, #ec2624, #7a0f0e); }
[data-theme="rojo"] .kpi-ic[style*="--primary-soft"] { }

/* ============================================================
   TEMA: Carbón total (oscuro)  — sidebar negro + acento rojo, fondo grafito
   ============================================================ */
[data-theme="carbon"] {
  --primary:        #ec2624;
  --primary-strong: #ff4240;
  --primary-press:  #cc1d1b;
  --primary-soft:   oklch(0.30 0.06 27);
  --primary-soft-2: oklch(0.38 0.09 27);
  --primary-ring:   oklch(0.58 0.2 27 / 0.40);

  --bg:      #161616;
  --bg-2:    #1e1e1e;
  --surface: #1e1e1e;
  --surface-2: #262626;
  --border:  #333333;
  --border-strong: #444444;
  --text:    oklch(0.95 0 0);
  --text-2:  oklch(0.78 0 0);
  --muted:   oklch(0.62 0 0);
  --faint:   oklch(0.50 0 0);

  --side:        #000000;
  --side-2:      #0a0a0a;
  --side-border: #262626;
  --side-active: #1e1e1e;

  --success-soft: oklch(0.32 0.05 158);
  --warning-soft: oklch(0.35 0.06 70);
  --danger-soft:  oklch(0.33 0.07 27);
  --info-soft:    oklch(0.32 0.05 245);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 2px 6px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
}
[data-theme="carbon"] .topbar { background: rgba(30,30,30,.85); }
[data-theme="carbon"] .vtoken { background: #000; color: #ff6b6a; }
[data-theme="carbon"] .badge-gray { background: #2a2a2a; }
[data-theme="carbon"] input[type="checkbox"] { accent-color: var(--primary); }
/* lighten semantic badge/text colors so they read on dark soft backgrounds */
[data-theme="carbon"] .badge-success { color: oklch(0.82 0.14 158); }
[data-theme="carbon"] .badge-warning { color: oklch(0.84 0.13 80); }
[data-theme="carbon"] .badge-danger  { color: oklch(0.80 0.16 27); }
[data-theme="carbon"] .badge-info     { color: oklch(0.80 0.12 245); }
[data-theme="carbon"] .badge-primary  { color: oklch(0.82 0.13 27); }
[data-theme="carbon"] .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
/* fix hardcoded dark section titles via attribute hook */
[data-theme="carbon"] .sec-title-success { color: oklch(0.82 0.14 158) !important; }

/* ============================================================
   TEMA: Marea  (#00c2b2 · #071a38 · #ffffff)
   ============================================================ */
[data-theme="marea"] {
  --primary:        #00c2b2;
  --primary-strong: #078f84;
  --primary-press:  #066e66;
  --primary-soft:   #e7f8f6;
  --primary-soft-2: #c9f1ec;
  --primary-ring:   rgba(0, 194, 178, .32);

  --bg:            #f3f6fa;
  --bg-2:          #e7eef6;
  --surface:       #ffffff;
  --surface-2:     #f7fafc;
  --border:        #d9e3ef;
  --border-strong: #c3d0e2;
  --text:          #071a38;
  --text-2:        #3a5274;
  --muted:         #6b82a0;
  --faint:         #93a6bf;

  --side:        #071a38;
  --side-2:      #051428;
  --side-border: #163056;
  --side-text:   #d7e4f4;
  --side-muted:  #8aa3c4;
  --side-active: #102a52;
}
[data-theme="marea"] .side-logo { color: #071a38; }
[data-theme="marea"] .side-avatar { background: linear-gradient(135deg, #00c2b2, #066e66); color: #071a38; }
[data-theme="marea"] .btn-primary,
[data-theme="marea"] .side-item.active .count { color: #071a38; }

/* ============================================================
   TEMA: Abismo  — la misma paleta, en oscuro
   ============================================================ */
[data-theme="abismo"] {
  --primary:        #00c2b2;
  --primary-strong: #5ee0d4;
  --primary-press:  #00a89a;
  --primary-soft:   #12384a;
  --primary-soft-2: #184e58;
  --primary-ring:   rgba(0, 194, 178, .4);

  --bg:        #071a38;
  --bg-2:      #0a2146;
  --surface:   #0c244c;
  --surface-2: #102a56;
  --border:    #1c3d6e;
  --border-strong: #2a5088;
  --text:      #f4f8fc;
  --text-2:    #c5d4e8;
  --muted:     #8aa3c4;
  --faint:     #6d86a8;

  --side:        #041226;
  --side-2:      #030d1c;
  --side-border: #163056;
  --side-text:   #d7e4f4;
  --side-muted:  #8aa3c4;
  --side-active: #0e2a52;

  --success-soft: #12382e;
  --warning-soft: #3a3014;
  --danger-soft:  #3a1820;
  --info-soft:    #132e48;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow:    0 2px 6px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
}
[data-theme="abismo"] .side-logo { color: #071a38; }
[data-theme="abismo"] .side-avatar { background: linear-gradient(135deg, #00c2b2, #066e66); color: #071a38; }
[data-theme="abismo"] .btn-primary,
[data-theme="abismo"] .side-item.active .count { color: #071a38; }
[data-theme="abismo"] .topbar { background: rgba(7, 26, 56, .88); }
[data-theme="abismo"] .vtoken { background: #041226; color: #7ef0e6; }
[data-theme="abismo"] .badge-gray { background: #163056; color: #d7e4f4; }
[data-theme="abismo"] .badge-success { color: #8ee0c2; }
[data-theme="abismo"] .badge-warning { color: #f0d18a; }
[data-theme="abismo"] .badge-danger { color: #ffb0b0; }
[data-theme="abismo"] .badge-info { color: #a9cff8; }
[data-theme="abismo"] .badge-primary { color: #7ef0e6; }
[data-theme="abismo"] .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238aa3c4' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }

/* ============================================================
   TEMA: Cobalto  (#3d6bff · #0c1b33 · #ffffff)
   ============================================================ */
[data-theme="cobalto"] {
  --primary:        #3d6bff;
  --primary-strong: #2454e6;
  --primary-press:  #1a3fba;
  --primary-soft:   #e8eeff;
  --primary-soft-2: #d4defe;
  --primary-ring:   rgba(61, 107, 255, .32);

  --bg:            #f4f7fb;
  --bg-2:          #e8eef8;
  --surface:       #ffffff;
  --surface-2:     #f8faff;
  --border:        #d7e1f0;
  --border-strong: #c0cde2;
  --text:          #0c1b33;
  --text-2:        #3d5274;
  --muted:         #6d82a3;
  --faint:         #95a6c2;

  --side:        #0c1b33;
  --side-2:      #081426;
  --side-border: #1c335c;
  --side-text:   #d5e2f6;
  --side-muted:  #8aa0c4;
  --side-active: #16294d;
}
[data-theme="cobalto"] .side-avatar { background: var(--primary); }

/* ============================================================
   TEMA: Bosque  (#0e8a6c · #0d1f1a · #ffffff)
   ============================================================ */
[data-theme="bosque"] {
  --primary:        #0e8a6c;
  --primary-strong: #0a6b54;
  --primary-press:  #085443;
  --primary-soft:   #e5f6f1;
  --primary-soft-2: #c6ebdf;
  --primary-ring:   rgba(14, 138, 108, .32);
  --bg: #f3f8f6; --bg-2: #e6f1ec; --surface: #ffffff; --surface-2: #f7fbf9;
  --border: #d3e6de; --border-strong: #b7d4c8;
  --text: #0d1f1a; --text-2: #3d5c52; --muted: #6d8a80; --faint: #96b0a6;
  --side: #0d1f1a; --side-2: #081612; --side-border: #1c3a30;
  --side-text: #d7eee6; --side-muted: #8aafa2; --side-active: #16382e;
}

/* ============================================================
   TEMA: Océano  (#0c8ea8 · #062833 · #ffffff)
   ============================================================ */
[data-theme="oceano"] {
  --primary:        #0c8ea8;
  --primary-strong: #0a7086;
  --primary-press:  #085868;
  --primary-soft:   #e4f6fa; --primary-soft-2: #c4ebf4;
  --primary-ring:   rgba(12, 142, 168, .32);
  --bg: #f2f8fa; --bg-2: #e4f1f5; --surface: #ffffff; --surface-2: #f7fbfc;
  --border: #d0e6ee; --border-strong: #b4d4e0;
  --text: #062833; --text-2: #3a5c68; --muted: #6c8c98; --faint: #96b0ba;
  --side: #062833; --side-2: #041c24; --side-border: #144556;
  --side-text: #d4eef4; --side-muted: #88aeb8; --side-active: #0e3c4c;
}

/* ============================================================
   TEMA: Ámbar  (#e39b2d · #1c140c · #ffffff)
   ============================================================ */
[data-theme="ambar"] {
  --primary:        #e39b2d;
  --primary-strong: #b87412;
  --primary-press:  #8f5a0e;
  --primary-soft:   #fbf3e4; --primary-soft-2: #f6e4c4;
  --primary-ring:   rgba(227, 155, 45, .34);
  --bg: #faf7f2; --bg-2: #f3ece2; --surface: #ffffff; --surface-2: #fbf8f4;
  --border: #eadfce; --border-strong: #d8c8ae;
  --text: #1c140c; --text-2: #5c4a34; --muted: #8a745c; --faint: #b09a82;
  --side: #1c140c; --side-2: #120e09; --side-border: #3a2c1c;
  --side-text: #f3e6d4; --side-muted: #b79a78; --side-active: #2e2216;
}
[data-theme="ambar"] .btn-primary,
[data-theme="ambar"] .side-item.active .count,
[data-theme="ambar"] .side-logo { color: #1c140c; }

/* ============================================================
   TEMA: Ciruela  (#9a3d88 · #1a1018 · #ffffff)
   ============================================================ */
[data-theme="ciruela"] {
  --primary:        #9a3d88;
  --primary-strong: #7a2e6c;
  --primary-press:  #5e2254;
  --primary-soft:   #f8eaf5; --primary-soft-2: #efd0e8;
  --primary-ring:   rgba(154, 61, 136, .32);
  --bg: #faf6f8; --bg-2: #f3eaef; --surface: #ffffff; --surface-2: #fbf8fa;
  --border: #eadde6; --border-strong: #d4c0cc;
  --text: #1a1018; --text-2: #5c4454; --muted: #8a7080; --faint: #b098a6;
  --side: #1a1018; --side-2: #110a10; --side-border: #3a2434;
  --side-text: #f3e0ec; --side-muted: #b790a6; --side-active: #2e1c2a;
}

/* ============================================================
   TEMA: Selva  — bosque en oscuro
   ============================================================ */
[data-theme="selva"] {
  --primary: #1db989; --primary-strong: #7ee0c0; --primary-press: #12956e;
  --primary-soft: #14382c; --primary-soft-2: #1a4a3a; --primary-ring: rgba(29, 185, 137, .4);
  --bg: #0c1a14; --bg-2: #12241c; --surface: #14281e; --surface-2: #1a3226;
  --border: #234536; --border-strong: #326350;
  --text: #e8f6f0; --text-2: #c5ddd2; --muted: #8aafa0; --faint: #6d9082;
  --side: #07110d; --side-2: #050c09; --side-border: #1c3a30;
  --side-text: #d7eee6; --side-muted: #8aafa2; --side-active: #143028;
  --success-soft: #14382c; --warning-soft: #3a3014; --danger-soft: #3a1820; --info-soft: #132e38;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 2px 6px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
}
[data-theme="selva"] .topbar { background: rgba(12, 26, 20, .9); }
[data-theme="selva"] .badge-gray { background: #1c3a30; color: #d7eee6; }
[data-theme="selva"] .badge-success { color: #8ee0c2; }
[data-theme="selva"] .badge-warning { color: #f0d18a; }
[data-theme="selva"] .badge-danger { color: #ffb0b0; }
[data-theme="selva"] .badge-info { color: #a9dff0; }
[data-theme="selva"] .badge-primary { color: #7ee0c0; }
[data-theme="selva"] .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238aafa2' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }

/* ============================================================
   TEMA: Noche  — cobalto en oscuro
   ============================================================ */
[data-theme="noche"] {
  --primary: #6d90ff; --primary-strong: #b7c7ff; --primary-press: #4d74f0;
  --primary-soft: #1a2748; --primary-soft-2: #243564; --primary-ring: rgba(109, 144, 255, .4);
  --bg: #0c1428; --bg-2: #121c36; --surface: #141e38; --surface-2: #1a2646;
  --border: #24345c; --border-strong: #34508a;
  --text: #eef2ff; --text-2: #c9d4f0; --muted: #8aa0c8; --faint: #6d84ae;
  --side: #070e1e; --side-2: #050a16; --side-border: #1c335c;
  --side-text: #d5e2f6; --side-muted: #8aa0c4; --side-active: #16294d;
  --success-soft: #12382e; --warning-soft: #3a3014; --danger-soft: #3a1820; --info-soft: #162848;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 2px 6px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
}
[data-theme="noche"] .topbar { background: rgba(12, 20, 40, .9); }
[data-theme="noche"] .badge-gray { background: #1c335c; color: #d5e2f6; }
[data-theme="noche"] .badge-success { color: #8ee0c2; }
[data-theme="noche"] .badge-warning { color: #f0d18a; }
[data-theme="noche"] .badge-danger { color: #ffb0b0; }
[data-theme="noche"] .badge-info { color: #b7c7ff; }
[data-theme="noche"] .badge-primary { color: #b7c7ff; }
[data-theme="noche"] .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238aa0c4' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }

/* Menú de temas */
.theme-menu { position: absolute; top: 46px; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; width: 272px; max-height: min(72vh, 540px); overflow: auto; z-index: 50; }
.theme-group { font-weight: 700; padding: 8px 8px 6px; text-transform: uppercase; font-size: 10.5px; letter-spacing: .6px; color: var(--muted); }
.theme-opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px; border-radius: 9px; border: none; background: transparent; margin-bottom: 2px; cursor: pointer; }
.theme-opt:hover { background: var(--bg-2); }
.theme-opt.on { background: var(--primary-soft); }
.theme-swatches { display: flex; flex: 0 0 auto; }
.theme-swatch { width: 16px; height: 16px; border-radius: 50%; margin-left: -5px; border: 1.5px solid var(--surface); box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.theme-swatch:first-child { margin-left: 0; }
.theme-name { flex: 1; font-weight: 600; font-size: 13px; color: var(--text); }
.theme-opt.on .theme-name { color: var(--primary-strong); }
.theme-check { width: 16px; height: 16px; color: var(--primary-strong); opacity: 0; }
.theme-opt.on .theme-check { opacity: 1; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
::selection { background: var(--primary-soft-2); }

/* Scrollbars */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: oklch(0.85 0.01 285); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: oklch(0.78 0.015 285); background-clip: content-box; }

/* ============================ LAYOUT ============================ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px; flex: 0 0 248px;
  background: linear-gradient(178deg, var(--side) 0%, var(--side-2) 100%);
  color: var(--side-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--side-border);
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 18px 14px 14px 18px; }
.side-brand-text { min-width: 0; flex: 1; }
.side-toggle {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 8px; border: 1px solid var(--side-border);
  background: transparent; color: var(--side-text);
  display: grid; place-items: center; padding: 0;
}
.side-toggle:hover { background: oklch(0.27 0.04 286); color: #fff; }
.side-toggle .when-expanded,
.side-toggle .when-collapsed { display: none; }
.side-toggle .when-expanded { display: grid; }
.side-logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--primary);
  display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: #fff; letter-spacing: -0.5px;
  box-shadow: none;
}
.side-word { font-weight: 800; font-size: 21px; letter-spacing: 1px; color: #fff; line-height: 1; }
.side-sub { font-size: 10.5px; color: var(--side-muted); letter-spacing: 0.2px; margin-top: 3px; font-weight: 500; line-height: 1.35; }

.side-nav { flex: 1; overflow-y: auto; padding: 8px 12px 12px; }
.side-group { margin-top: 16px; }
.side-group-label { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--side-muted); padding: 0 12px 7px; }
.side-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--side-text); font-size: 13.5px; font-weight: 600;
  cursor: pointer; margin-bottom: 2px; transition: background .13s, color .13s;
  border: none; background: transparent; width: 100%; text-align: left;
}
.side-item:hover { background: oklch(0.27 0.04 286); color: #fff; }
.side-item.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--primary); }
.side-item .ic { flex: 0 0 18px; opacity: .9; }
.side-item .count { margin-left: auto; font-size: 11px; font-weight: 700; background: oklch(0.33 0.05 286); color: var(--side-text); padding: 1px 8px; border-radius: 20px; }
.side-item.active .count { background: var(--primary); color: #fff; }

.side-user { padding: 12px; border-top: 1px solid var(--side-border); display: flex; align-items: center; gap: 11px; }
.side-avatar { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, oklch(0.6 0.16 200), oklch(0.55 0.18 286)); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }
.side-user .nm { font-size: 13px; font-weight: 700; color: #fff; line-height: 1.2; }
.side-user .rl { font-size: 11px; color: var(--side-muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 62px; flex: 0 0 62px;
  background: oklch(1 0 0 / 0.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 26px; position: sticky; top: 0; z-index: 30;
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.crumb .cur { color: var(--text); font-weight: 700; }
.crumb-sep { color: var(--faint); }
.topbar-search {
  margin-left: 10px; display: flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 13px; width: 290px; color: var(--muted);
}
.topbar-search input { border: none; background: transparent; outline: none; font-size: 13px; color: var(--text); width: 100%; }
.topbar-spacer { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; color: var(--text-2);
  position: relative; transition: background .12s, border-color .12s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }

.content { flex: 1; overflow-y: auto; padding: 26px 30px 60px; }
.content-narrow { max-width: none; width: 100%; margin: 0; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-title { font-size: 24px; font-weight: 800; letter-spacing: -0.4px; margin: 0; color: var(--text); }
.page-desc { color: var(--muted); font-size: 13.5px; margin-top: 4px; max-width: 60ch; }
.page-head-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

/* ============================ BUTTONS ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 700;
  border: 1px solid transparent; transition: all .13s; white-space: nowrap; color: var(--text);
}
.btn .ic { flex: 0 0 auto; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px var(--primary-ring); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-primary:active { background: var(--primary-press); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-primary:disabled:hover, .btn-primary[disabled]:hover { background: var(--primary); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn-soft { background: var(--primary-soft); color: var(--primary-strong); }
.btn-soft:hover { background: var(--primary-soft-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: oklch(0.92 0.05 25); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(0.95); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 14px; }
.btn-icon { padding: 8px; width: 36px; }

/* ============================ CARDS ============================ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 14.5px; font-weight: 800; letter-spacing: -0.2px; display: flex; align-items: center; gap: 9px; }
.card-title .ic { color: var(--primary); }
.card-sub { font-size: 12px; color: var(--muted); font-weight: 500; }

/* ============================ BADGES ============================ */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 7px; line-height: 1.4; white-space: nowrap; }
.badge .dotc { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-gray { background: var(--bg-2); color: var(--text-2); }
.badge-primary { background: var(--primary-soft); color: var(--primary-strong); }
.badge-success { background: var(--success-soft); color: oklch(0.45 0.12 158); }
.badge-warning { background: var(--warning-soft); color: oklch(0.50 0.12 65); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: oklch(0.46 0.12 245); }
.badge-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.chip .x { color: var(--faint); cursor: pointer; display: inline-flex; }
.chip .x:hover { color: var(--danger); }

/* ============================ TABLES ============================ */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  position: sticky; top: 0; white-space: nowrap;
}
.tbl tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr { transition: background .1s; }
/* Bandeja: color identificativo por estado (borde izquierdo + tinte suave) */
.tbl tbody tr.fila-estado td:first-child { box-shadow: inset 4px 0 0 var(--fila-color, transparent); }
.tbl tbody tr.fila-cola { --fila-color: var(--warning); background: color-mix(in oklab, var(--warning-soft) 45%, transparent); }
.tbl tbody tr.fila-cargado { --fila-color: var(--success); }
.tbl tbody tr.fila-por_firmar { --fila-color: var(--info); background: color-mix(in oklab, var(--info-soft) 45%, transparent); }
.estado-detalle-info { color: oklch(0.46 0.12 245); }
.tbl tbody tr.fila-error { --fila-color: var(--danger); background: color-mix(in oklab, var(--danger-soft) 40%, transparent); }
.tbl tbody tr.fila-cambio td { animation: filaCambio 1.5s ease; }
@keyframes filaCambio { 0% { background: var(--primary-soft-2); } 100% { background: transparent; } }
.estado-badge svg { flex: 0 0 auto; }
.estado-badge.subiendo svg { animation: spin 1.2s linear infinite; }
.estado-detalle { margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.estado-detalle-danger { color: var(--danger); }
.estado-detalle-warning { color: oklch(0.50 0.12 65); }
.estado-detalle-success { color: oklch(0.45 0.12 158); font-family: var(--mono); font-size: 11.5px; }
[data-theme="carbon"] .estado-detalle-warning, [data-theme="abismo"] .estado-detalle-warning, [data-theme="selva"] .estado-detalle-warning, [data-theme="noche"] .estado-detalle-warning { color: #f0d18a; }
[data-theme="carbon"] .estado-detalle-success, [data-theme="abismo"] .estado-detalle-success, [data-theme="selva"] .estado-detalle-success, [data-theme="noche"] .estado-detalle-success { color: #8ee0c2; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { font-variant-numeric: tabular-nums; }
.cell-strong { font-weight: 700; color: var(--text); }
.cell-mono { font-family: var(--mono); font-size: 12px; }
.cell-sub { font-size: 11.5px; color: var(--muted); }

/* row action icons */
.row-actions { display: flex; align-items: center; gap: 6px; }
.act { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; border: 1px solid transparent; transition: all .12s; }
.act:hover { background: var(--surface-2); border-color: var(--border); }
.act.view { color: var(--info); }
.act.edit { color: var(--warning); }
.act.del { color: var(--danger); }
.act.tree { color: var(--primary); }

/* ============================ FORMS ============================ */
.field { margin-bottom: 16px; }
.label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 7px; }
.label .req { color: var(--danger); }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); font-size: 13.5px; color: var(--text); outline: none; transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a7790' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.toggle { width: 40px; height: 23px; border-radius: 20px; background: var(--border-strong); position: relative; transition: background .15s; cursor: pointer; flex: 0 0 auto; border: none; padding: 0; }
.toggle::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle.on { background: var(--primary); }
.toggle.on::after { transform: translateX(17px); }

/* dropzone */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 30px; text-align: center; background: var(--surface-2); transition: all .15s; cursor: pointer; }
.dropzone:hover { border-color: var(--primary); background: var(--primary-soft); }

/* ============================ KPI ============================ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 14px; }
.kpi-val { font-size: 29px; font-weight: 800; letter-spacing: -1px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi-delta { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; margin-top: 7px; }
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }
.kpi-delta.flat { color: var(--muted); }
.kpi-grid.kpi-compact { gap: 8px; margin-bottom: 12px; }
.kpi-grid.kpi-compact .kpi { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.kpi-grid.kpi-compact .kpi-ic { width: 28px; height: 28px; border-radius: 8px; flex: 0 0 28px; }
.kpi-grid.kpi-compact .kpi-body { min-width: 0; }
.kpi-grid.kpi-compact .kpi-main { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.kpi-grid.kpi-compact .kpi-val { font-size: 18px; margin-top: 0; letter-spacing: -.4px; line-height: 1; flex: 0 0 auto; }
.kpi-grid.kpi-compact .kpi-label { margin-top: 0; font-size: 12px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-grid.kpi-compact.cols-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-grid.kpi-compact .kpi-delta { display: flex; align-items: center; gap: 4px; margin-top: 1px; font-size: 11px; font-weight: 600; line-height: 1.2; white-space: nowrap; min-width: 0; }
.kpi-grid.kpi-compact .kpi-delta .muted { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
@media (max-width: 900px) {
  .kpi-grid.kpi-compact, .kpi-grid.kpi-compact.cols-3 { grid-template-columns: 1fr 1fr; }
}

/* ============================ MISC ============================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* alerts */
.alert-item { display: flex; gap: 12px; padding: 13px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); align-items: flex-start; transition: background .12s; }
.alert-item:hover { background: var(--surface-2); }
.alert-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; }
.alert-title { font-size: 13px; font-weight: 700; }
.alert-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.alert-time { font-size: 11px; color: var(--faint); margin-top: 4px; font-weight: 600; }

/* tabs */
.tabs { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.tab { padding: 7px 15px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); border: none; background: transparent; transition: all .12s; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--primary-strong); box-shadow: var(--shadow-sm); }

/* segmented for filters */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.seg button { padding: 7px 13px; font-size: 12.5px; font-weight: 600; background: var(--surface); color: var(--text-2); border: none; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--primary-soft); color: var(--primary-strong); }

/* modal */
.modal-overlay { position: fixed; inset: 0; background: oklch(0.25 0.03 285 / 0.45); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 880px; animation: pop .2s cubic-bezier(.2,.9,.3,1); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 26px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; z-index: 2; }
.modal-body { padding: 24px 26px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 26px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@keyframes pop { from { transform: translateY(12px) scale(.99); } }

/* placeholder image (striped) */
.ph {
  background-color: var(--surface-2);
  background-image: repeating-linear-gradient(135deg, transparent, transparent 9px, oklch(0.9 0.01 285) 9px, oklch(0.9 0.01 285) 10px);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  display: grid; place-items: center; color: var(--muted); font-family: var(--mono); font-size: 11px; text-align: center;
}

/* progress bar */
.pbar { height: 7px; border-radius: 6px; background: var(--bg-2); overflow: hidden; }
.pbar > i { display: block; height: 100%; border-radius: 6px; }

/* var token */
.vtoken { font-family: var(--mono); font-size: 12px; background: var(--side); color: oklch(0.85 0.06 286); padding: 4px 9px; border-radius: 7px; font-weight: 500; display: inline-block; }

/* status dot legend */
.legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.fade-in { animation: fade .25s ease; }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; transform-origin: center; }

input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* Menú comprimido: solo iconos, los enlaces siguen visibles */
html.sidebar-collapsed .sidebar { width: 76px; flex: 0 0 76px; }
html.sidebar-collapsed .side-brand { flex-direction: column; justify-content: center; gap: 12px; padding: 16px 0 12px; }
html.sidebar-collapsed .side-brand-text,
html.sidebar-collapsed .side-group-label,
html.sidebar-collapsed .side-item span,
html.sidebar-collapsed .side-user-text,
html.sidebar-collapsed .side-chev { display: none; }
html.sidebar-collapsed .side-toggle { margin: 0; }
html.sidebar-collapsed .side-toggle .when-expanded { display: none; }
html.sidebar-collapsed .side-toggle .when-collapsed { display: grid; }
html.sidebar-collapsed .side-nav { padding-left: 8px; padding-right: 8px; }
html.sidebar-collapsed .side-item { justify-content: center; padding-left: 0; padding-right: 0; }
html.sidebar-collapsed .side-user { justify-content: center; padding-left: 0; padding-right: 0; }

.side-tip {
  position: fixed; z-index: 80;
  background: var(--side); color: #fff;
  font-size: 13px; font-weight: 650; line-height: 1.2;
  padding: 8px 12px; border-radius: 8px; white-space: nowrap;
  pointer-events: none; box-shadow: var(--shadow-lg);
  border: 1px solid var(--side-border);
}
.side-tip::before {
  content: ""; position: absolute; left: -5px; top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent; border-right-color: var(--side); border-left: 0;
}

@media (max-width: 1080px) {
  html:not(.sidebar-expanded) .sidebar { width: 76px; flex: 0 0 76px; }
  html:not(.sidebar-expanded) .side-brand { flex-direction: column; justify-content: center; gap: 12px; padding: 16px 0 12px; }
  html:not(.sidebar-expanded) .side-brand-text,
  html:not(.sidebar-expanded) .side-group-label,
  html:not(.sidebar-expanded) .side-item span,
  html:not(.sidebar-expanded) .side-user-text,
  html:not(.sidebar-expanded) .side-chev { display: none; }
  html:not(.sidebar-expanded) .side-toggle .when-expanded { display: none; }
  html:not(.sidebar-expanded) .side-toggle .when-collapsed { display: grid; }
  html:not(.sidebar-expanded) .side-nav { padding-left: 8px; padding-right: 8px; }
  html:not(.sidebar-expanded) .side-item { justify-content: center; padding-left: 0; padding-right: 0; }
  html:not(.sidebar-expanded) .side-user { justify-content: center; padding-left: 0; padding-right: 0; }
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- Campana de notificaciones: resumen del estado de los escritos ---- */
.notif-globo { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; line-height: 17px; text-align: center; border: 2px solid var(--surface); box-sizing: content-box; }
.notif-panel { position: absolute; top: 46px; right: 0; width: 360px; max-width: calc(100vw - 24px); max-height: min(78vh, 600px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 50; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; }
.notif-cifras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 12px 12px; border-bottom: 1px solid var(--border); }
.notif-cifra { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: 11px; background: color-mix(in oklch, var(--c) 12%, var(--surface)); text-decoration: none; color: inherit; transition: transform .12s; }
.notif-cifra:hover { transform: translateY(-1px); }
.notif-cifra b { font-size: 20px; font-weight: 800; line-height: 1.15; color: var(--c); }
.notif-cifra span { font-size: 11px; color: var(--muted); margin-top: 2px; text-align: center; }
.notif-lista { padding: 6px; }
.notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: inherit; }
.notif-item:hover { background: var(--bg-2); }
.notif-ic { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--c); background: color-mix(in oklch, var(--c) 14%, var(--surface)); }
.notif-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.notif-txt b { font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-txt span { color: var(--muted); line-height: 1.4; }
.notif-hora { flex: 0 0 auto; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.notif-barra { display: block; height: 5px; border-radius: 3px; background: var(--bg-2); overflow: hidden; margin-top: 4px; }
.notif-barra i { display: block; height: 100%; background: var(--warning); border-radius: 3px; transition: width .3s; }
.notif-vacio { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 12px; color: var(--muted); font-size: 12.5px; text-align: center; }

/* Etiquetas de plantillas: el color llega por --etq y se adapta a temas claros y oscuros */
.etq-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.4; white-space: nowrap; text-decoration: none;
  background: color-mix(in oklab, var(--etq) 14%, var(--surface)); border: 1px solid color-mix(in oklab, var(--etq) 38%, transparent); color: color-mix(in oklab, var(--etq) 62%, var(--text)); }
.etq-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--etq); flex: 0 0 auto; }
a.etq-chip:hover { background: color-mix(in oklab, var(--etq) 24%, var(--surface)); }
.etq-lg { font-size: 13px; padding: 5px 12px 5px 9px; }
.etq-lg i { width: 9px; height: 9px; }
.etq-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.etq-sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); background: var(--etq); cursor: pointer; padding: 0; transition: transform .1s; }
.etq-sw:hover { transform: scale(1.12); }
.etq-sw.on { box-shadow: 0 0 0 2px var(--etq); }
.etq-sw-sm { width: 16px; height: 16px; border-width: 1px; }
.etq-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--border); border-left: 4px solid var(--etq); border-radius: 12px; background: var(--surface); min-width: 0; }
.etq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }

/* Interruptor de carga al PJUD en la barra superior (solo administradores) */
.mc-pill { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px 0 11px; border-radius: 10px; font-size: 12.5px; font-weight: 800; cursor: pointer; border: 1px solid; transition: filter .12s; white-space: nowrap; }
.mc-pill:hover { filter: brightness(0.97); }
.mc-pill .mc-ic { display: inline-flex; }
.mc-pill.prod { background: var(--success-soft); border-color: var(--success); color: color-mix(in oklab, var(--success) 70%, var(--text)); }
.mc-pill.pausa { background: var(--warning-soft); border-color: var(--warning); color: color-mix(in oklab, var(--warning) 60%, var(--text)); animation: mcPulso 2.4s ease-in-out infinite; }
@keyframes mcPulso { 50% { box-shadow: 0 0 0 4px color-mix(in oklab, var(--warning) 22%, transparent); } }
@media (max-width: 760px) { .mc-pill #mc-txt { display: none; } .mc-pill { padding: 0 11px; } }

/* ==================================================================================
   NEXO · línea gráfica Openlogic (docs/openlogic-manual-de-marca.md)
   Tres azules + celeste + neutros claros · Hanken Grotesk 800 / Inter · sin sombras ·
   fondo de puntos que se desvanece desde la esquina superior derecha.
   Tema único: reemplaza a todos los temas anteriores.
   ================================================================================== */
:root, :root[data-theme] {
  --ol-navy: #0A0F4D; --ol-navy-deep: #060A3A; --ol-cobalt: #0A1FA8; --ol-ocean: #0B2A8F;
  --ol-primary: #2B5BFF; --ol-sky: #7CC4FF; --ol-mist: #F3F6FF; --ol-white-tone: #FBFCFF;
  --ol-text: #3F444B; --ol-text-muted: #5B6475; --ol-text-on-dark: #C9D2F5; --ol-line: #DFE4F2;
  --ol-font-display: "Hanken Grotesk", Arial, sans-serif;
  --ol-font-text: Inter, Arial, sans-serif;

  --bg: var(--ol-mist);
  --bg-2: #E9EEFB;
  --surface: var(--ol-white-tone);
  --surface-2: var(--ol-mist);
  --border: var(--ol-line);
  --border-strong: #C6CEE6;
  --text: var(--ol-navy);
  --text-2: var(--ol-text);
  --muted: var(--ol-text-muted);
  --faint: #8A93A8;

  --primary: var(--ol-primary);
  --primary-strong: var(--ol-cobalt);
  --primary-press: var(--ol-navy);
  --primary-soft: #E6ECFF;
  --primary-soft-2: #D3DDFF;
  --primary-ring: rgba(43, 91, 255, 0.28);

  /* Estados de los escritos: se conservan (cola, cargado, error) porque son información, no decoración */
  --info: var(--ol-primary);
  --info-soft: #E6ECFF;

  --side: var(--ol-navy);
  --side-2: var(--ol-navy-deep);
  --side-border: rgba(124, 196, 255, 0.22);
  --side-text: var(--ol-text-on-dark);
  --side-muted: #8E9AD0;
  --side-active: rgba(124, 196, 255, 0.14);

  --radius: 12px;
  --radius-sm: 5px;
  --radius-lg: 24px;
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: none;

  --sans: var(--ol-font-text);
}

body { color: var(--ol-text); font-family: var(--ol-font-text); }
h1, h2, h3, .page-title, .card-title, .kpi-val, .alert-title, .side-word, .modal-head .card-title {
  font-family: var(--ol-font-display); color: var(--ol-navy);
}
.page-title { font-weight: 800; font-size: 30px; letter-spacing: -0.03em; line-height: 1.1; }
.card-title { font-weight: 700; letter-spacing: -0.01em; }
.kpi-val { font-weight: 800; letter-spacing: -0.04em; }
.page-desc { color: var(--ol-text); font-size: 15px; }
.cell-strong { color: var(--ol-navy); }

/* Etiqueta de sección: línea de 48 × 3 px + mayúsculas, sobre el titular de cada página */
.page-head > div:first-child::before {
  content: "Nexo"; display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
  font: 600 12px/1 var(--ol-font-text); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ol-primary);
  padding-left: 60px; background: linear-gradient(var(--ol-primary), var(--ol-primary)) left center / 48px 3px no-repeat;
}

/* Sin sombras: la separación es un borde de 1 px o un cambio de fondo */
.card, .kpi, .modal, .theme-menu, .btn, .btn-primary, .icon-btn, .chip, .tbl-wrap, .dropzone, .alert-item, #toast, .etq-card, .mc-pill, .side-logo { box-shadow: none !important; }
.card, .kpi { border: 1px solid var(--ol-line); border-radius: var(--radius-lg); }
.kpi-grid.kpi-compact .kpi { border-radius: var(--radius); }
.modal { border: 1px solid var(--ol-line); border-radius: var(--radius-lg); }
.modal-overlay { background: rgba(10, 15, 77, 0.45); }

/* Botones y campos: radio de 5 px; un primario Azul Logic y un secundario Azul Noche */
.btn { border-radius: 5px; font-family: var(--ol-font-text); font-weight: 600; }
.btn-primary { background: var(--ol-primary); color: #fff; }
.btn-primary:hover { background: var(--ol-cobalt); }
.btn-ghost { border-color: var(--ol-line); color: var(--ol-navy); background: var(--ol-white-tone); }
.btn-ghost:hover { background: var(--ol-mist); border-color: var(--border-strong); }
.btn-soft { background: var(--ol-navy); color: #fff; }
.input, .select, .textarea, .topbar-search { border-radius: 5px; }
.icon-btn, .act { border-radius: 5px; }
.chip, .badge, .seg { border-radius: 999px; }
.seg button.on { background: var(--ol-navy); color: #fff; }
.toggle.on { background: var(--ol-primary); }
a { color: var(--ol-primary); }
.vtoken { background: var(--ol-navy); color: var(--ol-sky); border-radius: 5px; }
.badge-primary { background: var(--primary-soft); color: var(--ol-cobalt); }
.badge-info { background: var(--primary-soft); color: var(--ol-cobalt); }
#toast { background: var(--ol-navy) !important; border-radius: 12px !important; }
.topbar { background: rgba(251, 252, 255, 0.92); border-bottom: 1px solid var(--ol-line); }
.tbl thead th { color: var(--ol-text-muted); font: 600 11.5px/1.2 var(--ol-font-text); letter-spacing: 0.1em; text-transform: uppercase; }
.tbl tbody tr:hover { background: var(--ol-mist); }
#theme-menu-wrap { display: none !important; } /* la marca define un solo tema */

/* ---- Recurso gráfico: degradado oscuro + brillo + puntos que suben (menú lateral e inicio de sesión) ---- */
.sidebar, body.ol-oscuro {
  background: radial-gradient(circle at 88% 10%, rgba(124, 196, 255, 0.24), transparent 560px),
              linear-gradient(145deg, #060A3A 0%, #0A0F4D 52%, #0B2A8F 100%);
}
.sidebar { border-right: none; overflow: hidden; }
.sidebar::after, body.ol-oscuro::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle, rgba(124, 196, 255, 0.6) 1.6px, transparent 2.4px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 100% 0%, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse 75% 85% at 100% 0%, #000 0%, transparent 70%);
  animation: ol-up 1.2s linear infinite;
}
body.ol-oscuro { position: relative; min-height: 100vh; overflow-x: hidden; }
body.ol-oscuro::after { position: fixed; }
body.ol-oscuro > * { position: relative; z-index: 1; }
.sidebar > * { position: relative; z-index: 1; }
@keyframes ol-up { to { background-position: 0 -26px; } }
.sidebar::after { animation: none; } /* en el menú los puntos quedan fijos: se mira todo el día */
@media (prefers-reduced-motion: reduce) { .sidebar::after, body.ol-oscuro::after { animation: none; } }

/* Logotipo tipográfico, sin isotipo */
.side-logo { display: none !important; }
.ol-logo { font-family: var(--ol-font-display); font-weight: 800; letter-spacing: -0.03em; color: #fff; line-height: 1; text-transform: lowercase; }
.side-word { font-family: var(--ol-font-display); font-weight: 800; font-size: 27px; letter-spacing: -0.03em; text-transform: lowercase; color: #fff; }
.side-sub { color: var(--ol-sky); font: 600 10px/1.2 var(--ol-font-text); letter-spacing: 0.14em; text-transform: uppercase; margin-top: 7px; }
.side-group-label { color: var(--ol-sky); font: 600 10.5px/1 var(--ol-font-text); letter-spacing: 0.14em; }
.side-item { border-radius: 5px; color: var(--ol-text-on-dark); }
.side-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side-item.active, :root[data-theme] .side-item.active { background: rgba(124, 196, 255, 0.14); color: #fff; box-shadow: inset 3px 0 0 var(--ol-sky) !important; }
.side-item.active .count, .side-item .count { background: var(--ol-sky); color: var(--ol-navy); }
.side-toggle { border-color: rgba(124, 196, 255, 0.3); border-radius: 5px; }
.side-toggle:hover { background: rgba(255, 255, 255, 0.08); }
.side-user { border-top: 1px solid rgba(124, 196, 255, 0.22); }

/* Tarjeta sobre fondo oscuro (inicio de sesión) */
.ol-card-oscura { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(124, 196, 255, 0.3); border-radius: 24px; padding: 36px; }
.ol-card-oscura .label { color: var(--ol-text-on-dark); }
.ol-card-oscura .input { background: rgba(255, 255, 255, 0.08); border-color: rgba(124, 196, 255, 0.3); color: #fff; }
.ol-card-oscura .input::placeholder { color: #8E9AD0; }
.ol-etiqueta { display: flex; align-items: center; gap: 14px; font: 600 12px/1 var(--ol-font-text); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ol-sky); }
.ol-etiqueta::before { content: ""; width: 48px; height: 3px; background: var(--ol-sky); }
.ol-titular { font-family: var(--ol-font-display); font-weight: 800; font-size: 34px; line-height: 1.1; letter-spacing: -0.03em; color: #fff; margin: 14px 0 8px; }

/* ---- Menú horizontal (html.menu-horizontal): el menú pasa a una barra superior; se elige con el botón de la barra ---- */
#menu-orientacion .mo-horizontal { display: none; }
html.menu-horizontal #menu-orientacion .mo-lateral { display: none; }
html.menu-horizontal #menu-orientacion .mo-horizontal { display: inline-flex; }
html.menu-horizontal .app { flex-direction: column; }
html.menu-horizontal .sidebar {
  width: 100% !important; flex: 0 0 auto !important; height: auto; min-height: 58px;
  flex-direction: row; align-items: center; gap: 6px; padding: 0 18px;
  position: sticky; top: 0; z-index: 40;
}
html.menu-horizontal .sidebar::after {
  -webkit-mask-image: radial-gradient(ellipse 38% 220% at 100% 0%, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse 38% 220% at 100% 0%, #000 0%, transparent 70%);
}
html.menu-horizontal .side-brand { flex: 0 0 auto; flex-direction: row !important; padding: 10px 16px 10px 2px !important; gap: 10px; }
html.menu-horizontal .side-brand-text { display: block !important; }
html.menu-horizontal .side-word { font-size: 23px; }
html.menu-horizontal .side-sub, html.menu-horizontal .side-toggle, html.menu-horizontal .side-group-label,
html.menu-horizontal .side-chev, html.menu-horizontal .side-user .rl { display: none !important; }
html.menu-horizontal .side-nav {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 0;
  padding: 0 !important; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
html.menu-horizontal .side-nav::-webkit-scrollbar { display: none; }
html.menu-horizontal .side-group { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0 8px; border-left: 1px solid rgba(124, 196, 255, 0.22); }
html.menu-horizontal .side-group:first-child { border-left: none; padding-left: 0; }
html.menu-horizontal .side-item {
  width: auto; margin: 0; padding: 8px 11px !important; white-space: nowrap; font-size: 13px;
  justify-content: flex-start !important; gap: 8px; flex: 0 0 auto;
}
html.menu-horizontal .side-item span { display: inline !important; }
html.menu-horizontal .side-item .count { margin-left: 2px; display: inline-block !important; }
html.menu-horizontal .side-item.active, html.menu-horizontal:root[data-theme] .side-item.active { box-shadow: inset 0 -3px 0 var(--ol-sky) !important; }
html.menu-horizontal .side-user {
  flex: 0 0 auto; border-top: none; border-left: 1px solid rgba(124, 196, 255, 0.22);
  padding: 8px 0 8px 14px !important; justify-content: flex-start !important; gap: 9px;
}
html.menu-horizontal .side-user-text { display: block !important; flex: 0 1 auto !important; max-width: 150px; }
html.menu-horizontal .side-user .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.menu-horizontal .topbar { position: static; }
html.menu-horizontal .main { min-height: 0; }
@media (max-width: 900px) {
  html.menu-horizontal .side-user-text, html.menu-horizontal .side-brand-text .side-sub { display: none !important; }
  html.menu-horizontal .side-item { padding: 8px 9px !important; }
}

/* ---- Agrupaciones del menú (Judicial, Sistema): cabecera clicable ---- */
.side-group { margin-top: 10px; }
.side-group-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; margin-bottom: 2px;
  background: transparent; border: none; border-radius: 5px; cursor: pointer; color: #fff; text-align: left;
}
.side-group-btn:hover { background: rgba(255, 255, 255, 0.06); }
.side-group-btn .ic { color: var(--ol-sky); flex: 0 0 auto; }
.side-group-btn .side-group-label { flex: 1; padding: 0; color: #fff; font: 700 12px/1 var(--ol-font-text); letter-spacing: 0.14em; text-transform: uppercase; }
.side-group-chev { color: var(--ol-sky); transition: transform .15s; flex: 0 0 auto; }
.side-group.plegado .side-group-chev { transform: rotate(-90deg); }
.side-group.plegado .side-group-items { display: none; }
.side-group-items .side-item { padding-left: 16px; }
/* menú lateral comprimido: solo iconos, sin cabeceras */
html.sidebar-collapsed:not(.menu-horizontal) .side-group-btn { display: none; }
html.sidebar-collapsed:not(.menu-horizontal) .side-group.plegado .side-group-items { display: block; }
html.sidebar-collapsed:not(.menu-horizontal) .side-group-items .side-item { padding-left: 0; }
html.sidebar-collapsed:not(.menu-horizontal) .side-group + .side-group { border-top: 1px solid rgba(124, 196, 255, 0.22); padding-top: 8px; }
@media (max-width: 1100px) {
  html:not(.sidebar-expanded):not(.menu-horizontal) .side-group-btn { display: none; }
  html:not(.sidebar-expanded):not(.menu-horizontal) .side-group.plegado .side-group-items { display: block; }
  html:not(.sidebar-expanded):not(.menu-horizontal) .side-group-items .side-item { padding-left: 0; }
}

/* ---- En horizontal cada agrupación es un desplegable ---- */
html.menu-horizontal .sidebar { overflow: visible; }
html.menu-horizontal .side-nav { overflow: visible; gap: 4px; }
html.menu-horizontal .side-group { position: relative; display: block; margin: 0; padding: 0; border-left: none; }
html.menu-horizontal .side-group-btn { display: flex !important; width: auto; margin: 0; padding: 9px 13px; gap: 8px; white-space: nowrap; }
html.menu-horizontal .side-group-btn .side-group-label { display: inline !important; flex: 0 0 auto; }
html.menu-horizontal .side-group.tiene-activo > .side-group-btn { box-shadow: inset 0 -3px 0 var(--ol-sky); }
html.menu-horizontal .side-group.abierto > .side-group-btn { background: rgba(124, 196, 255, 0.14); }
html.menu-horizontal .side-group .side-group-chev { transform: none; }
html.menu-horizontal .side-group.abierto .side-group-chev { transform: rotate(180deg); }
html.menu-horizontal .side-group-items {
  display: none !important; position: absolute; top: calc(100% + 8px); left: 0; min-width: 250px; z-index: 60;
  background: var(--ol-navy); border: 1px solid rgba(124, 196, 255, 0.3); border-radius: 12px; padding: 8px;
}
html.menu-horizontal .side-group.abierto .side-group-items { display: block !important; }
html.menu-horizontal .side-group-items .side-item { display: flex; width: 100%; padding: 9px 12px !important; }
html.menu-horizontal .side-group-items .side-item .count { margin-left: auto; }
html.menu-horizontal .side-group-items .side-item.active, html.menu-horizontal:root[data-theme] .side-group-items .side-item.active { box-shadow: inset 3px 0 0 var(--ol-sky) !important; }
