/* ==========================================================================
   MIHORA SKIN para PLADECO — solo apariencia (colores, vidrio, fondo, cabecera, componentes).
   Se carga DESPUÉS de pladeco-ui.css (ver core/ui_head.php). No toca datos ni lógica.
   Lenguaje visual de mihora.valdiviadigital.cl: azul MiHora · material de vidrio visionOS ·
   formas geométricas en movimiento · cabecera de vidrio con navegación compacta · tarjetas, filtros y tablas de vidrio.
   Para volver al diseño anterior basta quitar la línea que carga este archivo en core/ui_head.php.
   ========================================================================== */

/* 1 · PALETA MIHORA ------------------------------------------------------ */
html:root,
html:root[data-theme="light"] {
  --bg: #eef2f7;
  --surface: #fbfdff;
  --surface-2: #eaf0f9;
  --hover: #e2eaf7;
  --hover-strong: #d3dff3;
  --line: rgba(15, 23, 42, .09);
  --line-strong: rgba(15, 23, 42, .16);
  --text: #0f172a;
  --text-2: #475569;
  --muted: #5b6b82;
  --subtle: #70809a;
  --accent: #2563eb;
  --accent-text: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, .14);
  --on-accent: #ffffff;
  --info-text: #1d4ed8;
  --scrim: rgba(15, 23, 42, .5);
  --shadow-pop: 0 28px 64px -26px rgba(15, 23, 42, .30);
  --hdr-bg: rgba(255, 255, 255, .58);
  --primary: #1d4ed8; --primary-dark: #1e40af;
  --brand: #2563eb; --brand-2: #3b82f6; --brand-strong: #1d4ed8;
  --shadow-sm: 0 2px 8px -3px rgba(15, 23, 42, .10);
  --shadow-md: 0 10px 40px -12px rgba(15, 23, 42, .18);
  --shadow-lg: 0 28px 64px -26px rgba(15, 23, 42, .28);
  --color-sombra: rgba(15, 23, 42, .07);
  --color-sombra-fuerte: rgba(15, 23, 42, .20);
  /* vidrio */
  --glass-bg: radial-gradient(135% 170% at 4% -16%, rgba(255, 255, 255, .72) 0%, rgba(255, 255, 255, 0) 46%), linear-gradient(150deg, rgba(255, 255, 255, .62) 0%, rgba(255, 255, 255, .40) 100%);
  --glass-border: rgba(255, 255, 255, .75);
  --glass-edge: rgba(15, 23, 42, .08);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 -18px 30px -18px rgba(15, 23, 42, .06) inset, 0 28px 64px -26px rgba(15, 23, 42, .20), 0 2px 8px -3px rgba(15, 23, 42, .07);
  --glass-blur: blur(38px) saturate(245%) brightness(1.08);
  --ring: rgba(37, 99, 235, .16);
}
html:root[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111a2e;
  --surface-2: #16213a;
  --hover: #1b2845;
  --hover-strong: #243457;
  --line: rgba(148, 163, 184, .16);
  --line-strong: rgba(148, 163, 184, .28);
  --text: #e5edf7;
  --text-2: #bcc8da;
  --muted: #98a6bd;
  --subtle: #8190a8;
  --accent: #3b82f6;
  --accent-text: #93c5fd;
  --accent-soft: rgba(59, 130, 246, .20);
  --on-accent: #ffffff;
  --info-text: #93c5fd;
  --scrim: rgba(2, 6, 18, .72);
  --shadow-pop: 0 32px 76px -26px rgba(0, 0, 0, .75);
  --hdr-bg: rgba(20, 27, 45, .62);
  --primary: #2563eb; --primary-dark: #1d4ed8;
  --brand: #3b82f6; --brand-2: #60a5fa; --brand-strong: #2563eb;
  --shadow-sm: 0 2px 10px -3px rgba(0, 0, 0, .35);
  --shadow-md: 0 18px 48px -16px rgba(0, 0, 0, .65);
  --shadow-lg: 0 32px 76px -26px rgba(0, 0, 0, .7);
  --color-sombra: rgba(0, 0, 0, .28);
  --color-sombra-fuerte: rgba(0, 0, 0, .55);
  --glass-bg: radial-gradient(135% 170% at 4% -16%, rgba(255, 255, 255, .09) 0%, rgba(255, 255, 255, 0) 46%), linear-gradient(150deg, rgba(30, 41, 66, .62) 0%, rgba(17, 26, 46, .55) 100%);
  --glass-border: rgba(255, 255, 255, .13);
  --glass-edge: rgba(255, 255, 255, .06);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 -18px 34px -18px rgba(0, 0, 0, .35) inset, 0 32px 76px -26px rgba(0, 0, 0, .6), 0 2px 10px -3px rgba(0, 0, 0, .3);
  --glass-blur: blur(38px) saturate(200%) brightness(1.04);
  --ring: rgba(59, 130, 246, .26);
}
@media (prefers-color-scheme: dark) {
  html:root:not([data-theme="light"]) {
    --bg: #0b1120; --surface: #111a2e; --surface-2: #16213a; --hover: #1b2845; --hover-strong: #243457;
    --line: rgba(148, 163, 184, .16); --line-strong: rgba(148, 163, 184, .28);
    --text: #e5edf7; --text-2: #bcc8da; --muted: #98a6bd; --subtle: #8190a8;
    --accent: #3b82f6; --accent-text: #93c5fd; --accent-soft: rgba(59, 130, 246, .20); --on-accent: #ffffff; --info-text: #93c5fd;
    --scrim: rgba(2, 6, 18, .72); --shadow-pop: 0 32px 76px -26px rgba(0, 0, 0, .75); --hdr-bg: rgba(20, 27, 45, .62);
    --primary: #2563eb; --primary-dark: #1d4ed8; --brand: #3b82f6; --brand-2: #60a5fa; --brand-strong: #2563eb;
    --shadow-sm: 0 2px 10px -3px rgba(0, 0, 0, .35); --shadow-md: 0 18px 48px -16px rgba(0, 0, 0, .65); --shadow-lg: 0 32px 76px -26px rgba(0, 0, 0, .7);
    --color-sombra: rgba(0, 0, 0, .28); --color-sombra-fuerte: rgba(0, 0, 0, .55);
    --glass-bg: radial-gradient(135% 170% at 4% -16%, rgba(255, 255, 255, .09) 0%, rgba(255, 255, 255, 0) 46%), linear-gradient(150deg, rgba(30, 41, 66, .62) 0%, rgba(17, 26, 46, .55) 100%);
    --glass-border: rgba(255, 255, 255, .13); --glass-edge: rgba(255, 255, 255, .06);
    --glass-shadow: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 -18px 34px -18px rgba(0, 0, 0, .35) inset, 0 32px 76px -26px rgba(0, 0, 0, .6), 0 2px 10px -3px rgba(0, 0, 0, .3);
    --glass-blur: blur(38px) saturate(200%) brightness(1.04); --ring: rgba(59, 130, 246, .26);
  }
}
html:root { --radius: 20px; --glass-blur-soft: blur(24px) saturate(200%); }

/* 2 · FONDO MIHORA: degradados ambientales + formas geométricas en movimiento + grano --- */
html body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  letter-spacing: -.01em;
  position: relative; overflow-x: hidden;
  background:
    radial-gradient(1100px 700px at 12% -8%, rgba(96, 165, 250, .34) 0%, transparent 55%),
    radial-gradient(900px 650px at 100% 8%, rgba(37, 99, 235, .22) 0%, transparent 52%),
    radial-gradient(1000px 800px at 50% 115%, rgba(29, 78, 216, .15) 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
html:root[data-theme="dark"] body {
  background:
    radial-gradient(1200px 800px at 15% -10%, #1e293b 0%, transparent 55%),
    radial-gradient(1000px 700px at 110% 10%, #172554 0%, transparent 50%),
    var(--bg);
  background-attachment: fixed;
}
@media (prefers-color-scheme: dark) {
  html:root:not([data-theme="light"]) body {
    background:
      radial-gradient(1200px 800px at 15% -10%, #1e293b 0%, transparent 55%),
      radial-gradient(1000px 700px at 110% 10%, #172554 0%, transparent 50%),
      var(--bg);
    background-attachment: fixed;
  }
}
/* grano sutil */
html body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* formas geométricas: ver bloque 11 (.geometric-bg, partial core/ui_bg.php) */

/* 3 · CABECERA MIHORA ---------------------------------------------------- */
html body .pd-header {
  background: var(--hdr-bg);
  -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 40px -12px rgba(15, 23, 42, .18);
}
html:root[data-theme="dark"] body .pd-header { box-shadow: 0 18px 48px -16px rgba(0, 0, 0, .65); }
html body .pd-header:hover { box-shadow: 0 12px 48px -12px rgba(15, 23, 42, .22); }
.pd-title__main { font-size: 1rem; font-weight: 700; letter-spacing: 0; background: linear-gradient(135deg, var(--brand-strong), var(--brand)); -webkit-background-clip: text; background-clip: text; color: transparent; }
html:root[data-theme="dark"] .pd-title__main { background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; }
@media (prefers-color-scheme: dark) { html:root:not([data-theme="light"]) .pd-title__main { background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; } }
.pd-title__sub { font-size: .65rem; color: var(--muted); }
/* navegación: botones compactos como los de MiHora */
html body .pd-header .pd-link {
  padding: .22rem .55rem; border-radius: 6px; font: 500 .72rem/1.25 var(--font-ui); color: var(--brand-strong); gap: .3rem;
}
html:root[data-theme="dark"] body .pd-header .pd-link { color: var(--brand-2); }
@media (prefers-color-scheme: dark) { html:root:not([data-theme="light"]) body .pd-header .pd-link { color: var(--brand-2); } }
html body .pd-header .pd-link i { font-size: .66rem; width: auto; }
html body .pd-header .pd-link:hover,
html body .pd-header .pd-link.active,
html body .pd-header .pd-link[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.pd-header__inner::after { border-top-color: var(--line); }
/* usuario: píldora con avatar (user-trigger de MiHora) */
html body .pd-header .pd-user {
  flex-direction: column; align-items: flex-start; justify-content: center; position: relative;
  background: var(--ring); border: 1px solid var(--line); border-radius: 30px; padding: .2rem .85rem .2rem 2.35rem; min-height: 34px; transition: all .2s;
}
html body .pd-header .pd-user::before {
  content: "\f007"; font: 900 .7rem/26px "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome"; text-align: center; color: #fff;
  position: absolute; left: .4rem; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
}
html body .pd-header .pd-user__name { font-size: .7rem; font-weight: 500; color: var(--brand-strong); }
html body .pd-header .pd-user__unit { font-size: .55rem; color: var(--muted); }
html:root[data-theme="dark"] body .pd-header .pd-user__name { color: var(--brand-2); }
@media (prefers-color-scheme: dark) { html:root:not([data-theme="light"]) body .pd-header .pd-user__name { color: var(--brand-2); } }
html body .pd-header .pd-logout {
  border-radius: 30px; border: 1px solid var(--line); background: var(--ring); color: var(--text-2); font: 500 .7rem/1.2 var(--font-ui); padding: .35rem .8rem;
}
html body .pd-header .pd-logout:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
html body .pd-chip { background: var(--accent-soft); color: var(--accent-text); }
html body .pd-iconbtn { background: var(--ring); border-color: var(--line); border-radius: 12px; color: var(--brand-strong); }
html body .pd-iconbtn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.pd-pcg__tip, .pd-toast { background: var(--brand-strong); }
/* menú lateral y menús desplegables: vidrio */
html body .pd-drawer { background: var(--glass-bg), var(--surface); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-right: 1px solid var(--glass-edge); }
html body .pd-dlink.active, html body .pd-dlink:hover { background: var(--brand); color: #fff; }

/* 4 · MATERIAL DE VIDRIO (tarjetas, paneles, filtros, modales) ------------ */
html body :is(.card, .stat-card, .dashboard-card, .hito-card, .info-box, .tarea-detail, .resumen-item, .empty-state, .welcome-box,
  .evidencia-item, .objetivo-item, .accion-item, .item-validacion, .hito-acordeon-item, .filtros-container, .search-historial,
  .search-form, .filtros-activos, .tabla-contenedor, .login-container) {
  background: var(--glass-bg), var(--surface);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-radius: var(--radius);
  transition: transform .4s cubic-bezier(.16, 1, .3, 1), box-shadow .4s cubic-bezier(.16, 1, .3, 1), background .3s ease, border-color .3s ease;
}
html body :is(.card, .stat-card, .dashboard-card, .hito-card):hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 1px rgba(255, 255, 255, .6) inset, 0 34px 74px -22px rgba(37, 99, 235, .28), 0 4px 14px -4px rgba(37, 99, 235, .12);
  border-color: var(--glass-border);
}
html:root[data-theme="dark"] body :is(.card, .stat-card, .dashboard-card, .hito-card):hover { box-shadow: 0 1px 1px rgba(255, 255, 255, .08) inset, 0 38px 84px -22px rgba(0, 0, 0, .7), 0 4px 16px -4px rgba(0, 0, 0, .45); }
@media (prefers-color-scheme: dark) { html:root:not([data-theme="light"]) body :is(.card, .stat-card, .dashboard-card, .hito-card):hover { box-shadow: 0 1px 1px rgba(255, 255, 255, .08) inset, 0 38px 84px -22px rgba(0, 0, 0, .7), 0 4px 16px -4px rgba(0, 0, 0, .45); } }
html body .welcome-box { background: var(--glass-bg), var(--accent-soft); }
html body .quick-stat, html body .action-btn { background: var(--ring); border-color: var(--line); }
html body .action-btn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
/* cifras de tarjetas de estadística: azul MiHora */
html body :is(.stat-number, .stat-value) { color: var(--brand-strong); }
html:root[data-theme="dark"] body :is(.stat-number, .stat-value) { color: var(--brand-2); }
@media (prefers-color-scheme: dark) { html:root:not([data-theme="light"]) body :is(.stat-number, .stat-value) { color: var(--brand-2); } }
/* modales */
html body .modal, html body .modal-overlay { background: rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
html body :is(.modal-content, .filter-modal-content) {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 24px; box-shadow: 0 20px 48px rgba(0, 0, 0, .3);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
html body :is(.modal-header, .filter-modal-header) { border-bottom: 1px solid var(--line); }
html body :is(.modal-header h2, .modal-header h3, .filter-modal-header h3) { color: var(--brand-strong); }
html:root[data-theme="dark"] body :is(.modal-header h2, .modal-header h3, .filter-modal-header h3) { color: var(--brand-2); }
html body :is(.modal-footer) { border-top: 1px solid var(--line); }

/* 5 · BOTONES (píldoras con degradé azul, como MiHora) -------------------- */
html body .btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: #fff; border: 0; border-radius: 30px; font-weight: 600;
  box-shadow: 0 6px 18px -8px rgba(37, 99, 235, .55);
}
html body .btn-primary:hover { filter: none; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 16px var(--ring), 0 10px 24px -10px rgba(37, 99, 235, .6); }
html body .btn-secondary { background: var(--ring); color: var(--text); border: 1px solid var(--line-strong); border-radius: 30px; }
html body .btn-secondary:hover { background: var(--hover-strong); color: var(--text); }
html body :is(.btn-success, .btn-danger, .btn-warning) { border-radius: 30px; }
html body .btn-clear-filters { background: var(--ring); border-radius: 30px; }
html body .btn-clear-filters:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 6 · FORMULARIOS Y FILTROS ----------------------------------------------- */
html body :is(input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="date"],
  input[type="datetime-local"], input[type="time"], input[type="search"], input[type="tel"], input[type="url"],
  input:not([type]), select, textarea) {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
}
html:root:not([data-theme="dark"]) body :is(input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="date"], input[type="search"], select, textarea) { background: rgba(255, 255, 255, .7); }
html body :is(input, select, textarea):focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
html body :is(.filtro-select, .filtro-input, .search-input, .search-input-unidades, .search-historial input) { background: var(--surface); border-radius: 12px; }
html body :is(.filtro-select, .filtro-input, .search-input, .search-input-unidades, .search-historial input):focus { box-shadow: 0 0 0 3px var(--ring); }
html body :is(.filtro-label, .filtro-group label, label) { color: var(--text-2); }
html body .filtro-activo { background: var(--ring); color: var(--accent-text); }

/* 7 · TABLAS (estilo .tabla-bitacora de MiHora) ---------------------------- */
html body :is(.tabla-contenedor, .table-container, .table-responsive, .tabla-wrapper) { border-radius: 14px; overflow-x: auto; }
html body th {
  background: rgba(37, 99, 235, .07); color: var(--text-2); font-size: .64rem; letter-spacing: .5px; font-weight: 700;
  text-transform: uppercase; border-bottom: 2px solid var(--line-strong); border-color: var(--line);
}
html:root[data-theme="dark"] body th { background: rgba(255, 255, 255, .05); color: var(--text-2); }
@media (prefers-color-scheme: dark) { html:root:not([data-theme="light"]) body th { background: rgba(255, 255, 255, .05); } }
html body td { border-bottom: 1px solid var(--line); color: var(--text); }
html body tbody tr { transition: background .2s ease; }
html body tbody tr:hover { background: var(--ring); }

/* 8 · MENSAJES, ETIQUETAS, PESTAÑAS ---------------------------------------- */
html body .tab.active { color: var(--brand-strong); border-bottom-color: var(--brand); }
html:root[data-theme="dark"] body .tab.active { color: var(--brand-2); }
@media (prefers-color-scheme: dark) { html:root:not([data-theme="light"]) body .tab.active { color: var(--brand-2); } }
html body .tab:hover { background: var(--ring); }
html body main a:not([class]) { color: var(--brand-strong); }
html:root[data-theme="dark"] body main a:not([class]) { color: var(--brand-2); }
@media (prefers-color-scheme: dark) { html:root:not([data-theme="light"]) body main a:not([class]) { color: var(--brand-2); } }
html body ::selection { background: var(--ring); }
html body :focus-visible { outline-color: var(--brand); }

/* 9 · ACCESO (login MiHora: tarjeta de vidrio, icono azul) ---------------- */
html body .login-container { border-radius: 28px; box-shadow: var(--glass-shadow); }
html body .login-icon { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: #fff; box-shadow: 0 8px 20px -8px rgba(37, 99, 235, .55); }
html body .login-header h1 { background: linear-gradient(135deg, var(--brand-strong), var(--brand)); -webkit-background-clip: text; background-clip: text; color: transparent; }
html:root[data-theme="dark"] body .login-header h1 { background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; }
@media (prefers-color-scheme: dark) { html:root:not([data-theme="light"]) body .login-header h1 { background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; } }
html body .login-container .btn, html body .login-container button[type="submit"] { border-radius: 30px; }
html body .time-display { background: var(--ring); }

/* 10 · PIE (igual a MiHora) ------------------------------------------------ */
html body .pd-footer { background: transparent; border-top: 1px solid var(--line); color: var(--muted); }

/* activo/hover en oscuro: texto blanco (gana a la regla de color de tema) */
html:root[data-theme="dark"] body .pd-header .pd-link:hover, html:root[data-theme="dark"] body .pd-header .pd-link.active, html:root[data-theme="dark"] body .pd-header .pd-link[aria-current="page"] { color: #fff; }
@media (prefers-color-scheme: dark) { html:root:not([data-theme="light"]) body .pd-header .pd-link:hover, html:root:not([data-theme="light"]) body .pd-header .pd-link.active { color: #fff; } }

/* 11 · FORMAS GEOMÉTRICAS (idénticas a .geometric-bg de MiHora, en azul) --------------------- */
.geometric-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.geometric-bg .shape { position: absolute; border-radius: 50%; will-change: transform, filter, opacity; }
.geometric-bg .shape:nth-child(1) { width: 460px; height: 460px; top: -140px; right: -120px; background: radial-gradient(circle at 30% 30%, #93c5fd, #2563eb 60%, transparent 78%); animation: mhd1 35s cubic-bezier(.45,.05,.55,.95) infinite; animation-delay: -6s; }
.geometric-bg .shape:nth-child(2) { width: 360px; height: 360px; bottom: -100px; left: -90px; background: radial-gradient(circle at 30% 30%, #60a5fa, #1d4ed8 60%, transparent 78%); animation: mhd2 40s ease-in-out infinite; animation-delay: -38s; }
.geometric-bg .shape:nth-child(3) { width: 260px; height: 260px; top: 38%; left: 2%; background: radial-gradient(circle at 30% 30%, #bfdbfe, #3b82f6 60%, transparent 78%); animation: mhd3 45s cubic-bezier(.37,.09,.6,.9) infinite; animation-delay: -92s; }
.geometric-bg .shape:nth-child(4) { width: 200px; height: 200px; bottom: 22%; right: 8%; background: radial-gradient(circle at 30% 30%, #1d4ed8, #0f172a 65%, transparent 78%); animation: mhd4 30s ease-in-out infinite; animation-delay: -21s; }
.geometric-bg .shape:nth-child(5) { width: 420px; height: 420px; top: 2%; left: 38%; background: radial-gradient(circle at 30% 30%, #60a5fa, #2563eb 60%, transparent 78%); animation: mhd5 45s cubic-bezier(.42,0,.58,1) infinite; animation-delay: -140s; }
.geometric-bg .shape:nth-child(6) { width: 220px; height: 220px; bottom: 12%; right: 42%; background: radial-gradient(circle at 30% 30%, #93c5fd, #1d4ed8 60%, transparent 78%); animation: mhd6 35s ease-in-out infinite; animation-delay: -57s; }
html:root[data-theme="dark"] .geometric-bg .shape { filter: brightness(1.15); }
@media (prefers-color-scheme: dark) { html:root:not([data-theme="light"]) .geometric-bg .shape { filter: brightness(1.15); } }
@keyframes mhd1 { 0%{transform:translate(0,0) scale(1) rotate(0);filter:blur(70px);opacity:.20} 16%{transform:translate(160px,90px) scale(1.14) rotate(10deg);filter:blur(88px);opacity:.27} 34%{transform:translate(60px,240px) scale(.92) rotate(-6deg);filter:blur(62px);opacity:.15} 55%{transform:translate(-180px,160px) scale(1.08) rotate(6deg);filter:blur(94px);opacity:.24} 78%{transform:translate(-230px,-60px) scale(.96) rotate(-9deg);filter:blur(75px);opacity:.16} 100%{transform:translate(0,0) scale(1) rotate(0);filter:blur(70px);opacity:.20} }
@keyframes mhd2 { 0%{transform:translate(0,0) scale(1);filter:blur(70px);opacity:.20} 20%{transform:translate(-140px,-170px) scale(.9) rotate(-8deg);filter:blur(58px);opacity:.14} 42%{transform:translate(70px,-260px) scale(1.16) rotate(5deg);filter:blur(92px);opacity:.28} 66%{transform:translate(210px,-90px) scale(.95) rotate(9deg);filter:blur(80px);opacity:.18} 85%{transform:translate(120px,80px) scale(1.05);filter:blur(96px);opacity:.24} 100%{transform:translate(0,0) scale(1);filter:blur(70px);opacity:.20} }
@keyframes mhd3 { 0%{transform:translate(0,0);filter:blur(60px);opacity:.13} 24%{transform:translate(130px,-70px) scale(1.2);filter:blur(78px);opacity:.19} 47%{transform:translate(260px,60px) scale(.88);filter:blur(54px);opacity:.09} 70%{transform:translate(90px,190px) scale(1.1);filter:blur(82px);opacity:.17} 88%{transform:translate(-100px,90px);filter:blur(65px);opacity:.11} 100%{transform:translate(0,0);filter:blur(60px);opacity:.13} }
@keyframes mhd4 { 0%{transform:translate(0,0);filter:blur(52px);opacity:.10} 18%{transform:translate(-90px,80px) scale(1.18);filter:blur(70px);opacity:.16} 40%{transform:translate(-170px,-40px) scale(.9);filter:blur(46px);opacity:.07} 63%{transform:translate(-60px,-150px) scale(1.08);filter:blur(74px);opacity:.15} 84%{transform:translate(100px,-60px);filter:blur(58px);opacity:.08} 100%{transform:translate(0,0);filter:blur(52px);opacity:.10} }
@keyframes mhd5 { 0%{transform:translate(0,0);filter:blur(78px);opacity:.08} 22%{transform:translate(150px,120px) scale(.92);filter:blur(92px);opacity:.13} 46%{transform:translate(280px,-30px) scale(1.15);filter:blur(70px);opacity:.06} 68%{transform:translate(120px,-190px) scale(.94);filter:blur(98px);opacity:.14} 89%{transform:translate(-110px,-90px);filter:blur(84px);opacity:.09} 100%{transform:translate(0,0);filter:blur(78px);opacity:.08} }
@keyframes mhd6 { 0%{transform:translate(0,0);filter:blur(56px);opacity:.10} 19%{transform:translate(-120px,-100px) scale(1.14);filter:blur(72px);opacity:.17} 41%{transform:translate(-230px,50px) scale(.9);filter:blur(48px);opacity:.06} 64%{transform:translate(-80px,180px) scale(1.06);filter:blur(76px);opacity:.15} 86%{transform:translate(110px,70px);filter:blur(60px);opacity:.08} 100%{transform:translate(0,0);filter:blur(56px);opacity:.10} }
@media (max-width: 768px), (prefers-reduced-motion: reduce) { .geometric-bg .shape { display: none; } }

/* 12 · ESTRUCTURA DE PÁGINA MIHORA ------------------------------------------------------------
   contenedor centrado 1400px · cabecera de página (título + acción) · tarjetas de vidrio · tipografía compacta */
html body { font-size: 13px; line-height: 1.5; }
html body .pd-header { position: sticky; top: 0; z-index: 1000; }
html body .main-content, html body main.main-content {
  position: relative; z-index: 1; max-width: 1400px; width: 100%; margin: 0 auto; padding: 1.5rem; box-sizing: border-box;
}
html body :is(.container, .contenedor, .contenido-principal) { position: relative; z-index: 1; max-width: 1400px; margin-left: auto; margin-right: auto; }
html body :is(h1, .page-title, .titulo-pagina, .page-header h1) {
  font-size: 1.3rem; font-weight: 700; color: var(--brand-strong); letter-spacing: -.01em;
  display: flex; align-items: center; gap: 10px; margin: 0 0 1rem;
}
html:root[data-theme="dark"] body :is(h1, .page-title, .titulo-pagina) { color: var(--brand-2); }
@media (prefers-color-scheme: dark) { html:root:not([data-theme="light"]) body :is(h1, .page-title, .titulo-pagina) { color: var(--brand-2); } }
html body :is(h1, .page-title) i { opacity: .8; }
html body :is(.page-header, .header-section, .section-header) { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
html body :is(.page-header, .header-section) :is(h1, h2) { margin-bottom: 0; }
html body :is(h2) { font-size: 1.05rem; font-weight: 700; color: var(--text); }
html body :is(h3) { font-size: .9rem; font-weight: 700; }
/* tarjetas: borde degradado + hilo de luz superior (idéntico al .glass de MiHora) */
html body :is(.card, .stat-card, .dashboard-card, .hito-card, .filtros-container, .tabla-contenedor, .welcome-box, .login-container) { position: relative; isolation: isolate; }
html body :is(.card, .stat-card, .dashboard-card, .hito-card, .filtros-container, .tabla-contenedor, .welcome-box, .login-container)::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1; padding: 1px; opacity: .65;
  background: linear-gradient(155deg, rgba(255,255,255,.6), rgba(255,255,255,.02) 42%, rgba(255,255,255,.16) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
html body :is(.card, .stat-card, .dashboard-card, .hito-card, .filtros-container, .tabla-contenedor, .welcome-box, .login-container)::after {
  content: ""; position: absolute; left: 5%; right: 5%; top: 0; height: 1px; border-radius: 999px; pointer-events: none; z-index: 1; opacity: .5;
  background: linear-gradient(90deg, transparent, rgba(147,197,253,.9), transparent);
}
html:root[data-theme="dark"] body :is(.card, .stat-card, .dashboard-card, .hito-card, .filtros-container, .tabla-contenedor)::after { opacity: .22; }
html body :is(.card, .dashboard-card, .filtros-container, .welcome-box) { padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
/* rejillas de estadísticas y paneles (distribución MiHora: tarjetas compactas en rejilla) */
html body :is(.stats-grid, .dashboard-grid, .hitos-grid, .cards-grid) { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
html body .stat-card { padding: 1rem 1.15rem; text-align: left; }
html body :is(.stat-number, .stat-value) { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
html body :is(.stat-label, .quick-stat-label) { font-size: .65rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
/* botones (tamaño y forma de MiHora) */
html body :is(.btn, .btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .action-btn, button[type="submit"]) {
  font-size: .75rem; font-weight: 600; padding: 10px 20px; border-radius: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
}
html body .pd-header :is(.pd-link, .pd-logout, .pd-user, .pd-iconbtn) { font-size: .66rem; }
html body .pd-header .pd-link { padding: .2rem .5rem; border-radius: 6px; font-weight: 500; }
/* formularios (form-group de MiHora) */
html body .form-group { margin-bottom: 14px; }
html body .form-group label, html body label { font-size: .65rem; font-weight: 600; color: var(--text-2); margin-bottom: 4px; display: block; }
html body :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]) { font-size: .75rem; padding: 10px 12px; font-family: inherit; }
/* tablas (users-table de MiHora) */
html body table { width: 100%; border-collapse: collapse; }
html body th { text-align: left; padding: 12px 14px; font-size: .6rem; }
html body td { padding: 10px 14px; font-size: .7rem; vertical-align: middle; }
html body tbody tr:hover td { background: var(--ring); }
html body .badge { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: .6rem; font-weight: 600; }
/* alertas / mensajes */
html body :is(.alert, .message-box, .mensaje, .success, .error) { border-radius: 14px; font-size: .75rem; }
/* pestañas como píldoras */
html body .tabs { gap: 6px; border-bottom: 0; margin-bottom: 1rem; flex-wrap: wrap; }
html body .tab { border: 1px solid var(--line); border-radius: 30px; padding: 8px 18px; font-size: .72rem; font-weight: 600; background: var(--ring); }
html body .tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
html:root[data-theme="dark"] body .tab.active { color: #fff; }
/* pie (igual a .site-footer) */
html body footer.pd-footer {
  background: var(--glass-bg), var(--surface); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  border-top: 1px solid var(--line); padding: 1rem; text-align: center; color: var(--muted); font-size: .7rem; margin-top: 2rem; position: relative; z-index: 1;
}
@media (max-width: 768px) {
  html body .main-content { padding: 1rem; }
  html body :is(h1, .page-title) { font-size: 1.1rem; }
  html body th, html body td { padding: 6px 8px; font-size: .6rem; }
  html body :is(.stats-grid, .dashboard-grid) { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  /* móvil MiHora: sin menú lateral; la navegación se muestra en píldoras */
  html body .pd-header .menu-toggle { display: none; }
}

/* 13 · NAVEGACIÓN SIEMPRE VISIBLE (como MiHora: en móvil las píldoras pasan a varias líneas, sin menú lateral) */
@media (max-width: 1100px) {
  html body .pd-header__inner::after { display: block; }
  html body .pd-header .pd-nav--drawer { display: flex; }
  html body .pd-header .pd-user, html body .pd-header .pd-logout { display: flex; }
  html body .pd-header .menu-toggle, html body .pd-header--exec .menu-toggle { display: none; }
}
@media (max-width: 768px) {
  html body .pd-header--exec .pd-nav-wrap { position: static; transform: none; opacity: 1; visibility: visible; padding: 0; background: transparent; border: 0; box-shadow: none; max-height: none; overflow: visible; display: flex; }
  html body .pd-header--exec .pd-nav { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; gap: .1rem; }
  html body .pd-header--exec .pd-nav > li { display: block; }
  html body .pd-header--exec .pd-link { width: auto; padding: .2rem .5rem; font-size: .62rem; }
  html body .pd-header--exec .pd-user, html body .pd-header--exec .pd-logout { display: flex; }
  html body .pd-only-mobile { display: none; }
  html body .pd-header--exec .pd-actions { margin-left: 0; }
  html body.pd-fixed-header { --header-height: 108px; }
}
@media (max-width: 640px) { html body .pd-header .pd-user__unit { display: none; } html body .pd-header .pd-user__name { display: inline; } }

/* 14 · AJUSTES DE ENCAJE */
html body .pd-header__inner { box-sizing: border-box; width: 100%; }
html body .pd-pcg__tip { left: auto; right: 0; transform: none; }
html body .stats-grid:has(> .stat-card) { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); justify-content: stretch; }
@media (max-width: 768px) { html body .stats-grid:has(> .stat-card) { grid-template-columns: repeat(2, 1fr); } }
