[hidden] { display: none !important; }
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #005375;
  --primary-hover: #003d57;
  --primary-soft: #e4eef3;
  --brand-light: #b4ccd6;
  --danger: #dc2626;
  --ok: #15803d;
  --warn: #b45309;
  --note-bg: #fffbeb;
  --note-border: #fcd34d;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  .brand .logo-light { display: none; }
  .brand .logo-dark { display: block; }
  :root {
    --bg: #0b1120;
    --surface: #111827;
    --surface-2: #0f172a;
    --border: #1f2a3c;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --primary: #5aaed0;
    --primary-hover: #8cc8e0;
    --primary-soft: #14303f;
    --note-bg: #2a2110;
    --note-border: #78591a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.boot { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- auth ---------- */
/* La pantalla de acceso usa siempre un tema oscuro con fondo animado */
.auth-wrap {
  --surface: rgba(255, 255, 255, .06);
  --surface-2: rgba(255, 255, 255, .1);
  --border: rgba(255, 255, 255, .14);
  --text: #f1f5f9;
  --muted: #a5b4cf;
  --primary: #8cc8e0;
  --primary-hover: #b4ccd6;
  color-scheme: dark;
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px;
  color: var(--text);
  background: radial-gradient(ellipse at 50% -20%, #00557a 0%, #04182a 55%, #020a12 100%);
}
.aurora { position: absolute; inset: -20%; z-index: -3; filter: blur(70px); opacity: .75; }
.blob { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; mix-blend-mode: screen; }
.b1 { background: radial-gradient(circle, #0077a8 0%, transparent 65%); top: 0; left: 5%; animation: drift1 18s ease-in-out infinite alternate; }
.b2 { background: radial-gradient(circle, #005375 0%, transparent 65%); bottom: 0; right: 0; animation: drift2 22s ease-in-out infinite alternate; }
.b3 { background: radial-gradient(circle, #5b9fbd 0%, transparent 65%); top: 35%; left: 40%; width: 34vmax; height: 34vmax; animation: drift3 26s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(25vw, 18vh) scale(1.2); } }
@keyframes drift2 { to { transform: translate(-30vw, -15vh) scale(.85); } }
@keyframes drift3 { to { transform: translate(-20vw, 20vh) scale(1.3) rotate(40deg); } }
.grid-bg {
  position: absolute; inset: 0; z-index: -2;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  animation: gridmove 30s linear infinite;
}
@keyframes gridmove { to { background-position: 48px 48px, 48px 48px; } }
.stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }

.auth-card {
  --mx: 50%; --my: -100px;
  position: relative; width: 100%; max-width: 410px; padding: 34px 30px;
  border-radius: 18px; border: 1px solid var(--border);
  background:
    radial-gradient(420px circle at var(--mx) var(--my), rgba(140,200,224,.14), transparent 45%),
    linear-gradient(160deg, rgba(255,255,255,.10), rgba(255,255,255,.03));
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.12);
  animation: cardIn .8s cubic-bezier(.2,.8,.2,1) both;
}
/* Borde con degradado giratorio */
.auth-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--angle, 0deg), transparent 0 60%, #8cc8e0 75%, #b4ccd6 85%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 6s linear infinite;
}
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --angle: 360deg; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(.96); filter: blur(6px); } }
.rise { animation: rise .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.auth-card .auth-sub { animation: rise .6s .18s cubic-bezier(.2,.8,.2,1) both; }
.auth-logo { display: flex; justify-content: center; margin: -4px 0 10px; animation: logoIn .9s .05s cubic-bezier(.2,.8,.2,1) both; }
.auth-logo img { height: 64px; width: auto; filter: drop-shadow(0 6px 22px rgba(90,174,208,.35)); }
@keyframes logoIn { from { opacity: 0; transform: translateY(-10px) scale(.92); filter: blur(4px); } }
.auth-title { text-align: center; font-weight: 700; font-size: 19px; letter-spacing: .01em; animation: rise .6s .12s cubic-bezier(.2,.8,.2,1) both; }
.auth-card .auth-sub { margin-top: 2px; }

.auth-wrap input[type=text], .auth-wrap input[type=email], .auth-wrap input[type=password], .auth-wrap input[type=tel] {
  background: rgba(4, 24, 42, .55); border-color: rgba(255,255,255,.12);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.auth-wrap input:focus { outline: none; border-color: #8cc8e0; background: rgba(4, 24, 42, .85); box-shadow: 0 0 0 4px rgba(140,200,224,.18); }
.auth-wrap .btn.primary {
  position: relative; overflow: hidden; border: 0;
  background: linear-gradient(110deg, #005375, #0a86b5);
  box-shadow: 0 10px 30px -10px rgba(10,134,181,.8);
  transition: transform .15s, box-shadow .2s;
}
.auth-wrap .btn.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -10px rgba(10,134,181,.95); background: linear-gradient(110deg, #005375, #0a86b5); }
.auth-wrap .btn.primary:active { transform: translateY(0) scale(.99); }
.auth-wrap .btn.primary::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); animation: shine 3.5s 1.2s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.auth-wrap .err { background: rgba(220,38,38,.18); color: #fecaca; border: 1px solid rgba(248,113,113,.35); animation: shake .4s; }
.auth-wrap .ok-msg { background: rgba(22,163,74,.18); color: #bbf7d0; border: 1px solid rgba(74,222,128,.35); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.auth-copy { margin-top: 22px; font-size: 12px; color: rgba(165,180,207,.6); animation: rise .8s .6s both; }

@media (prefers-reduced-motion: reduce) {
  .auth-wrap *, .auth-wrap *::before, .auth-wrap *::after { animation: none !important; transition: none !important; }
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); }
.brand img { height: 30px; width: auto; display: block; }
.brand .logo-dark { display: none; }
.brand-sep { width: 1px; height: 22px; background: var(--border); }
.brand-app { font-size: 15px; font-weight: 600; color: var(--muted); }
.app-foot { max-width: 1200px; margin: 0 auto; padding: 0 16px 28px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; color: var(--muted); }
.app-foot img { height: 18px; width: auto; opacity: .7; }
.empty-logo { display: block; margin: 0 auto 14px; height: 56px; width: auto; opacity: .18; }
.auth-card .brand { justify-content: center; margin-bottom: 6px; font-size: 22px; }
.auth-sub { text-align: center; color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.auth-foot { margin-top: 18px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-small { margin-top: 22px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
label .req { color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.err { background: #fee2e2; color: #991b1b; border-radius: 8px; padding: 9px 12px; font-size: 14px; margin-top: 14px; }
.ok-msg { background: #dcfce7; color: #166534; border-radius: 8px; padding: 9px 12px; font-size: 14px; margin-top: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; margin-top: 20px; padding: 11px; }
.btn:disabled { opacity: .6; cursor: default; }
.linkbtn { background: none; border: 0; color: var(--primary); font: inherit; cursor: pointer; padding: 0; }

/* ---------- layout ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 16px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.nav a.active, .nav a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.userbox .who { text-align: right; line-height: 1.2; }
.userbox .who small { color: var(--muted); display: block; font-size: 12px; }
.main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 40px; min-height: calc(100vh - 120px); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 20px 22px; }
.narrow { max-width: 760px; }

/* ---------- list ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.tabs button { border: 0; background: none; padding: 6px 11px; border-radius: 7px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.active { background: var(--primary); color: #fff; }
.tabs .count { opacity: .75; font-weight: 500; margin-left: 4px; }
.filters input[type=search] { width: 240px; }
.filters select { width: auto; }
.spacer { flex: 1; }

table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); }
table.list td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 14px; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover { background: var(--surface-2); }
.subj { font-weight: 600; }
.sub { color: var(--muted); font-size: 12.5px; }
.ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-abierto { background: #dbeafe; color: #1e40af; }
.st-en_curso { background: #ede9fe; color: #5b21b6; }
.st-esperando_cliente { background: #fef3c7; color: #92400e; }
.st-resuelto { background: #dcfce7; color: #166534; }
.st-cerrado { background: #e2e8f0; color: #475569; }
.pr-baja { color: var(--muted); }
.pr-normal { color: var(--text); }
.pr-alta { color: var(--warn); font-weight: 600; }
.pr-urgente { color: var(--danger); font-weight: 700; }
.kind { font-size: 12px; color: var(--muted); text-transform: capitalize; }

/* ---------- ticket detail ---------- */
.detail { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.detail h1 { font-size: 21px; margin: 4px 0 6px; word-break: break-word; }
.thread { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.msg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.msg.tech { border-left: 3px solid var(--primary); }
.msg.nota { background: var(--note-bg); border-color: var(--note-border); }
.msg-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.msg-head b { color: var(--text); }
.msg-body { white-space: pre-wrap; word-break: break-word; }
.event { font-size: 13px; color: var(--muted); text-align: center; }
.event::before, .event::after { content: "—"; margin: 0 8px; opacity: .5; }
.tag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 5px; background: var(--primary-soft); color: var(--primary); margin-left: 6px; }
.tag.nota { background: var(--note-border); color: #422006; }
.gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gallery a { display: block; width: 110px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.side dl { margin: 0; font-size: 14px; }
.side dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-top: 12px; }
.side dt:first-child { margin-top: 0; }
.side dd { margin: 3px 0 0; word-break: break-word; }
.side select { margin-top: 3px; padding: 7px 9px; }
.reply { margin-top: 18px; }
.reply-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- uploads ---------- */
.drop { border: 2px dashed var(--border); border-radius: 10px; padding: 16px; text-align: center; color: var(--muted); font-size: 14px; cursor: pointer; margin-top: 10px; }
.drop.over { border-color: var(--primary); background: var(--primary-soft); }
.previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.preview { position: relative; width: 90px; height: 70px; border-radius: 7px; overflow: hidden; border: 1px solid var(--border); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; line-height: 1; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 100; cursor: zoom-out; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }

/* ---------- toast ---------- */
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; }
#toast div { background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 8px; box-shadow: var(--shadow); font-size: 14px; margin-top: 8px; }
#toast div.error { background: var(--danger); }

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; }
  .detail .side { order: -1; }
  .hide-sm { display: none; }
  .userbox .who { display: none; }
  .topbar-in { gap: 10px; flex-wrap: wrap; }
  .filters input[type=search] { width: 100%; }
  .row { grid-template-columns: 1fr; }
}

/* ---------- acceso técnico (discreto) ---------- */
.portal-corner {
  position: fixed; right: 16px; bottom: 12px; z-index: 5;
  font-size: 11.5px; color: rgba(180, 204, 214, .38); text-decoration: none;
  padding: 4px 8px; border-radius: 6px; transition: color .2s, background .2s;
}
.portal-corner:hover, .portal-corner:focus-visible { color: #b4ccd6; background: rgba(255, 255, 255, .06); text-decoration: none; }
.auth-wrap.is-tech { background: radial-gradient(ellipse at 50% -20%, #0c3b52 0%, #06141f 55%, #020609 100%); }
.auth-wrap.is-tech .auth-card::before { background: conic-gradient(from var(--angle, 0deg), transparent 0 60%, #f59e0b 75%, #b4ccd6 85%, transparent 100%); }
.tech-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fcd34d; border: 1px solid rgba(252, 211, 77, .35); border-radius: 999px; padding: 3px 10px; }

/* ---------- panel de equipo ---------- */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.team-card {
  text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.team-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.team-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.team-card.warn .team-num { color: var(--warn); }
.team-name { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-num { font-size: 22px; font-weight: 700; line-height: 1.3; }
.team-num small { font-size: 12px; font-weight: 500; color: var(--muted); }
.team-stats { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.team-stats .dot { font-size: 11px; font-weight: 700; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 999px; }
.unassigned { color: var(--warn); font-weight: 600; font-size: 13px; }
.assignee { font-size: 13px; }
table.list tr.is-done td { opacity: .65; }
.filters select { max-width: 220px; }

/* ---------- contadores del menú ---------- */
.nav-badge { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; text-align: center; vertical-align: 1px; animation: pop .35s cubic-bezier(.2,.9,.3,1.4); }
.nav-badge.warn { background: #d97706; }
@keyframes pop { from { transform: scale(0); } }

/* ---------- aprobación de cuentas ---------- */
.pending-tag { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 700; color: #b45309; background: #fef3c7; padding: 1px 8px; border-radius: 999px; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: #fee2e2; }
.pending-box { text-align: center; padding: 22px 18px !important; }
.pending-box p { margin: 8px 0 0; line-height: 1.55; }
.pending-icon { width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: #04182a; background: #86efac; animation: pop .5s .2s both cubic-bezier(.2,.9,.3,1.4); }

/* ---------- novedades ---------- */
.news-cat { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.cat-novedad { background: #e0f2fe; color: #075985; }
.cat-mantenimiento { background: #fef3c7; color: #92400e; }
.cat-servicio { background: #ede9fe; color: #5b21b6; }
.cat-aviso { background: #fee2e2; color: #991b1b; }
.cat-seguridad { background: #dcfce7; color: #166534; }
.cat-bg-novedad { --cat: #0284c7; } .cat-bg-mantenimiento { --cat: #d97706; } .cat-bg-servicio { --cat: #7c3aed; }
.cat-bg-aviso { --cat: #dc2626; } .cat-bg-seguridad { --cat: #16a34a; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.news-pin { font-weight: 600; color: var(--text); }
.news-new { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #fff; background: linear-gradient(90deg, #005375, #0a86b5); padding: 2px 8px; border-radius: 999px; animation: glow 2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px rgba(10,134,181,.18); } }
.news-excerpt { color: var(--muted); margin: 6px 0 0; }
.news-more { font-weight: 700; color: var(--primary); font-size: 14px; }
.news-actions { display: flex; gap: 6px; margin-top: 10px; }
.news-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.news-foot .news-actions { margin: 0; }

.news-hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
  margin-bottom: 20px; animation: rise .5s cubic-bezier(.2,.8,.2,1) both; transition: transform .2s, box-shadow .2s;
}
.news-hero::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--cat, var(--primary)); z-index: 1; }
.news-hero:has(.news-hero-img) { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.news-hero:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -18px rgba(0, 83, 117, .45); }
.news-hero-img { min-height: 240px; overflow: hidden; background: var(--surface-2); }
.news-hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s; }
.news-hero:hover .news-hero-img img { transform: scale(1.04); }
.news-hero-body { padding: 26px 28px; }
.news-hero h2 { font-size: 24px; line-height: 1.25; margin: 12px 0 4px; }

.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.news-card {
  display: flex; flex-direction: column; overflow: hidden; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
  animation: rise .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 60ms + .1s);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.news-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 16px 34px -18px rgba(0, 83, 117, .5); }
.news-card-img { height: 140px; overflow: hidden; background: var(--surface-2); }
.news-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.news-card:hover .news-card-img img { transform: scale(1.06); }
.news-card-img.placeholder { display: grid; place-items: center; font-size: 40px; background: linear-gradient(135deg, color-mix(in srgb, var(--cat) 22%, transparent), color-mix(in srgb, var(--cat) 6%, transparent)); }
.news-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.news-card h3 { font-size: 16.5px; line-height: 1.3; margin: 10px 0 2px; }
.news-card .news-actions { margin-top: auto; padding-top: 12px; }

.news-banner {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 11px 16px; border-radius: 12px;
  color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--cat, var(--primary)); box-shadow: var(--shadow); animation: rise .5s both;
}
.news-banner:hover { text-decoration: none; border-color: var(--cat, var(--primary)); }
.news-banner-icon { font-size: 20px; }
.news-banner-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }

.modal { position: fixed; inset: 0; z-index: 90; background: rgba(2, 10, 18, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.modal-card { position: relative; width: 100%; max-width: 720px; background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); animation: cardIn .35s cubic-bezier(.2,.8,.2,1) both; }
.modal-x { position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 20px; cursor: pointer; }
.news-detail-img { width: 100%; max-height: 340px; object-fit: cover; display: block; }
.news-detail-body { padding: 26px 30px 30px; }
.news-detail h2 { font-size: 25px; line-height: 1.25; margin: 12px 0 14px; }
.news-body p { margin: 0 0 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.editor { margin-bottom: 20px; animation: rise .35s both; }
.editor-title { margin: 0; font-size: 17px; }
.preview.wide { width: 220px; height: 120px; }

@media (max-width: 860px) {
  .news-hero:has(.news-hero-img) { grid-template-columns: 1fr; }
  .news-hero-img { min-height: 180px; max-height: 220px; }
  .news-hero h2 { font-size: 20px; }
  .nav { flex-wrap: wrap; }
}
@media (prefers-color-scheme: dark) {
  .cat-novedad { background: #0c3a52; color: #bae6fd; } .cat-mantenimiento { background: #422006; color: #fde68a; }
  .cat-servicio { background: #2e1065; color: #ddd6fe; } .cat-aviso { background: #450a0a; color: #fecaca; }
  .cat-seguridad { background: #052e16; color: #bbf7d0; }
  .pending-tag { background: #422006; color: #fde68a; }
}

/* ---------------------------------------------------------------- resolver: horas */
.resolve-card { max-width: 620px; }
.resolve-form { padding: 24px 24px 22px; }
.resolve-form h2 { margin: 0 0 2px; font-size: 20px; }
.resolve-form .lbl { display: block; font-weight: 600; font-size: 13.5px; margin: 18px 0 6px; }
.req { color: var(--danger); }
.work-rows { display: grid; gap: 8px; }
.work-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto 30px; gap: 8px; align-items: end; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.work-row label { font-size: 11.5px; font-weight: 600; color: var(--muted); margin: 0; display: grid; gap: 3px; }
.work-row input { padding: 7px 8px; }
.work-dur { font-size: 13px; font-weight: 700; color: var(--primary); min-width: 74px; text-align: right; padding-bottom: 9px; }
.work-dur.bad { color: var(--danger); }
.work-rm { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; margin-bottom: 4px; }
.work-rm:hover { color: var(--danger); border-color: var(--danger); }
.work-rows:not(.multi) .work-row .work-rm { visibility: hidden; }
.work-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.work-total { font-size: 14px; }
.resolve-btn { margin-top: 8px; }
.worklog { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.worklog-head { display: flex; justify-content: space-between; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.worklog-head b { color: var(--text); font-size: 13px; text-transform: none; letter-spacing: 0; }
.worklog-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.worklog-row:last-child { border-bottom: 0; }
@media (max-width: 560px) {
  .work-row { grid-template-columns: 1fr 1fr; }
  .work-row label:first-child { grid-column: 1 / -1; }
  .work-dur { text-align: left; padding: 0; }
}

/* ---------------------------------------------------------------- estadísticas */
.stats-filters { margin: 0; }
.range-custom { display: inline-flex; gap: 6px; align-items: center; }
.range-custom input { width: auto; padding: 6px 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi-value { font-size: 28px; font-weight: 750; line-height: 1.25; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.kpi.warn .kpi-value { color: var(--warn); }
.tech-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tech-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.tech-card-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tech-hours { font-size: 26px; font-weight: 750; margin-top: 6px; font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin: 6px 0 4px; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.tech-dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 12px 0 0; font-size: 13px; }
.tech-dl dt { color: var(--muted); }
.tech-dl dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.tech-now { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12.5px; }
.tech-now .dot { font-size: 11px; font-weight: 700; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 999px; }
.tech-now a { margin-left: auto; }
.tech-top { margin-top: 8px; font-size: 12px; }
.chart-card { margin-bottom: 16px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-head h3, .card-title { margin: 0; font-size: 15px; }
.card-title { margin-bottom: 12px; }
.pad-x { padding: 16px 16px 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.chart-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.chart { position: relative; padding-left: 38px; }
.chart-grid { position: absolute; left: 38px; right: 0; top: 0; height: 220px; pointer-events: none; }
.chart-tick { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.chart-tick:first-child { border-top-color: var(--muted); opacity: .6; }
.chart-tick span { position: absolute; left: -38px; top: -8px; width: 32px; text-align: right; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-plot { position: relative; height: 220px; display: flex; align-items: flex-end; gap: 2px; }
.chart-col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; border-radius: 4px; outline: none; cursor: default; }
.chart-col:hover, .chart-col:focus-visible { background: var(--primary-soft); }
.chart-stack { width: 70%; max-width: 26px; display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 0; }
.chart-plot.dense .chart-stack { width: 85%; }
.chart-stack > span { display: block; min-height: 2px; }
.chart-x { display: flex; gap: 2px; margin-top: 6px; }
.chart-x span { flex: 1; font-size: 10.5px; color: var(--muted); text-align: center; white-space: nowrap; overflow: visible; }
.chart-tip { position: absolute; top: 6px; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 8px 10px; font-size: 12.5px; z-index: 3; pointer-events: none; white-space: nowrap; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.stats-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .stats-two { grid-template-columns: 1fr; } }
.hbars { display: grid; gap: 10px; }
.hbar-label { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.hbar-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-scroll { overflow-x: auto; max-height: 460px; overflow-y: auto; }
table.list.compact td { padding: 8px 14px; font-size: 13px; }

/* ---------------------------------------------------------------- privacidad */
.consent { align-items: flex-start; font-weight: 400; font-size: 13px; margin-top: 14px; line-height: 1.45; }
.consent input { margin-top: 3px; flex: none; }
.privacy-layer { margin-top: 12px; font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--surface-2); }
.auth-card .privacy-layer { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.12); color: rgba(226,236,242,.7); }
.privacy-layer summary { cursor: pointer; font-weight: 600; }
.privacy-layer p { margin: 8px 0 0; line-height: 1.5; }
.privacy-card { margin-top: 16px; }
.privacy-card h3 { margin: 0 0 4px; font-size: 15px; }
.danger-tag { color: var(--danger) !important; }
.app-foot a, .auth-copy a { color: inherit; }
.legal-page { max-width: 860px; margin: 0 auto; padding: 20px 16px 40px; }
.legal-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.legal-top img { height: 40px; width: auto; }
.legal-top .logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .legal-top .logo-light { display: none; } .legal-top .logo-dark { display: block; } }
.legal { max-width: 860px; margin: 0 auto; line-height: 1.6; font-size: 14.5px; }
.legal h1 { margin: 0 0 4px; font-size: 24px; }
.legal h2 { font-size: 16px; margin: 22px 0 6px; color: var(--primary); }
.legal ul { margin: 6px 0; padding-left: 20px; }
.legal li { margin: 3px 0; }
.gate-text { font-size: 14px; line-height: 1.5; margin: 0 0 6px; color: rgba(226,236,242,.85); }
.user-actions { text-align: right; line-height: 2.1; }

/* ---------------------------------------------------------------- informes */
.report-card { margin-top: 16px; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding: 16px 16px 4px; }
.report-head h3 { margin: 0 0 2px; font-size: 16px; }
.report-dl { display: flex; gap: 8px; }
.report-filters { padding: 8px 16px 0; margin: 0; }
.report-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 16px 12px; }
.report-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 0 16px 12px; }
.report-tile { background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 8px; padding: 8px 12px; display: grid; }
.report-tile span { font-size: 12px; color: var(--muted); }
.report-tile b { font-size: 20px; font-variant-numeric: tabular-nums; }
.report-out .table-scroll { border-top: 1px solid var(--border); }
.report-out .empty { padding: 24px; }

/* ---- cliente jefe ---- */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--primary-soft); color: var(--primary); }
.link-btn { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0 4px; margin-left: 4px; }
.link-btn:hover { color: var(--primary); }
.type-select { width: auto; padding: 4px 8px; font-size: 13px; font-weight: 600; border-radius: 999px; }
.type-select.type-tecnico { color: var(--primary); border-color: var(--primary); }
.type-select.type-jefe { color: var(--warn); border-color: var(--warn); }

/* ---- tiempo al comentar ---- */
.reply-time { margin-top: 12px; padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); }
.reply-time-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 8px; }
.btn.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.work-logged { margin: 10px 0 4px; padding: 9px 12px; border-radius: 8px; background: var(--primary-soft); font-size: 13.5px; }
.tag.work-tag { background: var(--primary-soft); color: var(--primary); }
.worklog-per { display: grid; gap: 3px; margin: 6px 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
.worklog-per div { display: flex; justify-content: space-between; gap: 8px; }
