/* Gestión de Mantenimiento PTT · lenguaje visual de la plantilla Crextio, con tema claro/oscuro y acentos */
@font-face { font-family: "Outfit"; font-weight: 300; font-display: swap; src: url(../fonts/outfit-latin-300-normal.woff2) format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 400; font-display: swap; src: url(../fonts/outfit-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 500; font-display: swap; src: url(../fonts/outfit-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 600; font-display: swap; src: url(../fonts/outfit-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 700; font-display: swap; src: url(../fonts/outfit-latin-700-normal.woff2) format("woff2"); }

:root {
  --accent: #E41F26; --accent-ink: #fff;
  --bg-from: #F6F5F3; --bg-to: #ECE9E4;
  --ink: #2a2c31; --muted: #6b7280; --faint: #9ca3af;
  --line: rgba(42, 44, 49, 0.08);
  --card: rgba(255, 255, 255, 0.72); --card-border: #fff; --solid: #fff;
  --field: #f6f6f3; --field-border: #e5e7eb;
  --chip: rgba(42, 44, 49, 0.06);
  --contrast: #2a2c31; --contrast-ink: #fff; --contrast-muted: #a1a1aa; --contrast-line: rgba(255,255,255,.08); --contrast-chip: rgba(255,255,255,.08);
  --ok: #15803d;      --ok-bg: #dcfce7;
  --warn: #a16207;    --warn-bg: #fef3c7;
  --bad: #b91c1c;     --bad-bg: #fee2e2;
  --info: #1d4ed8;    --info-bg: #dbeafe;
  --violet: #6d28d9;  --violet-bg: #ede9fe;
  --radius: 2rem;
  --shadow: 0 1px 2px rgba(20, 22, 28, 0.04), 0 8px 24px rgba(20, 22, 28, 0.04);
  --pop: 0 20px 50px rgba(20,22,28,.16);
  color-scheme: light;
}
:root[data-tema="oscuro"] {
  --ink: #e7e7ea; --muted: #a1a1aa; --faint: #71717a;
  --line: rgba(255, 255, 255, 0.07);
  --card: rgba(32, 34, 40, 0.72); --card-border: rgba(255,255,255,.06); --solid: #1f2127;
  --field: #17191e; --field-border: rgba(255,255,255,.1);
  --chip: rgba(255, 255, 255, 0.07);
  --contrast: #0d0e11; --contrast-ink: #f4f4f5; --contrast-muted: #a1a1aa;
  --ok: #4ade80; --ok-bg: rgba(34,197,94,.14);
  --warn: #fbbf24; --warn-bg: rgba(245,158,11,.14);
  --bad: #f87171; --bad-bg: rgba(239,68,68,.15);
  --info: #93c5fd; --info-bg: rgba(59,130,246,.16);
  --violet: #c4b5fd; --violet-bg: rgba(139,92,246,.16);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --pop: 0 20px 50px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Outfit", system-ui, sans-serif; color: var(--ink); background: linear-gradient(135deg, var(--bg-from) 0%, var(--bg-to) 100%) fixed; background-color: var(--bg-from); min-height: 100vh; -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.45; }
[x-cloak] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, #000); outline-offset: 2px; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.logo-claro { display: block; } .logo-oscuro { display: none; }
[data-tema="oscuro"] .logo-claro { display: none; } [data-tema="oscuro"] .logo-oscuro { display: block; }

/* ---------- Shell ---------- */
.layout { display: block; }
.main > .shell, .stack > * { min-width: 0; }
.side { display: none; }
.main { min-width: 0; }
.shell { max-width: 1600px; margin: 0 auto; padding: 1rem 1rem 6rem; }
@media (min-width: 768px) { .shell { padding: 1.5rem 1.5rem 3rem; } }
@media (min-width: 1280px) { .shell { padding: 2rem; } }
@media (min-width: 1024px) {
  [data-menu="lateral"] .layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
  [data-menu="lateral"] .side { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 0; height: 100vh; padding: 1.5rem 1rem; border-right: 1px solid var(--line); background: var(--card); backdrop-filter: blur(18px); }
  [data-menu="lateral"] .nav, [data-menu="lateral"] .topbar .brand { display: none; }
}
.side .brand { align-self: stretch; }
.side nav { display: grid; gap: .15rem; overflow-y: auto; }
.side nav a { display: flex; align-items: center; gap: .6rem; padding: .62rem .8rem; border-radius: 1rem; font-size: .9rem; color: var(--muted); }
.side nav a:hover { background: var(--chip); color: var(--ink); }
.side nav a.active { background: var(--contrast); color: var(--contrast-ink); }
.side nav a .count { margin-left: auto; }
.side .foot { margin-top: auto; font-size: .72rem; color: var(--faint); padding: 0 .5rem; }

.topbar { display: flex; align-items: center; gap: .75rem; }
.brand { display: inline-flex; align-items: center; gap: .8rem; white-space: nowrap; padding: .2rem 0; }
.brand img { height: 2.7rem; width: auto; }
.brand-name { padding-left: .8rem; border-left: 1px solid var(--line); }
.brand-name { font-weight: 500; font-size: .95rem; line-height: 1.1; }
.brand-name small { display: block; font-size: .68rem; color: var(--muted); font-weight: 400; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.search-pill { display: none; align-items: center; gap: .5rem; background: var(--card); border: 1px solid var(--card-border); border-radius: 999px; padding: .55rem 1rem; min-width: 18.5rem; box-shadow: var(--shadow); }
.search-pill input { border: 0; background: transparent; outline: none; width: 100%; font-size: .9rem; }
@media (min-width: 900px) { .search-pill { display: flex; } }
.icon-btn { position: relative; width: 2.6rem; height: 2.6rem; border-radius: 999px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow); flex: none; }
.icon-btn:hover { background: var(--solid); }
.dot { position: absolute; top: .4rem; right: .45rem; min-width: .6rem; height: .6rem; border-radius: 99px; background: var(--accent); box-shadow: 0 0 0 2px var(--solid); }
.avatar { width: 2.6rem; height: 2.6rem; border-radius: 999px; display: grid; place-items: center; background: var(--contrast); color: var(--accent); font-weight: 600; font-size: .85rem; flex: none; border: 0; }
[data-tema="oscuro"] .avatar { background: var(--accent); color: var(--accent-ink); }
.avatar.sm { width: 2rem; height: 2rem; font-size: .72rem; }
.avatar.xs { width: 1.6rem; height: 1.6rem; font-size: .62rem; }
.avatar.soft { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--ink); }

.nav { margin-top: 1rem; display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; background: var(--card); border: 1px solid var(--card-border); border-radius: 999px; padding: .3rem; box-shadow: var(--shadow); }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; padding: .5rem 1rem; border-radius: 999px; font-size: .88rem; color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; }
.nav a:hover { background: var(--chip); color: var(--ink); }
.nav a.active { background: var(--contrast); color: var(--contrast-ink); }
.count { background: var(--accent); color: var(--accent-ink); border-radius: 99px; font-size: .7rem; padding: 0 .45rem; font-weight: 600; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 2rem; margin: 2rem 0 1.5rem; }
.page-head h1 { font-size: 2.1rem; font-weight: 400; letter-spacing: -.02em; line-height: 1.1; }
@media (min-width: 768px) { .page-head h1 { font-size: 2.8rem; } }
.page-head .sub { color: var(--muted); margin-top: .35rem; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.crumb { font-size: .85rem; color: var(--muted); display: inline-flex; gap: .35rem; align-items: center; margin-bottom: .5rem; }
.crumb a:hover { color: var(--ink); text-decoration: underline; }

.bigstats { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; }
.bigstat { display: flex; align-items: flex-start; gap: .6rem; }
.bigstat .ico { color: var(--faint); margin-top: .7rem; }
.bigstat b { display: block; font-size: 2.6rem; font-weight: 300; line-height: 1; letter-spacing: -.02em; }
.bigstat span { font-size: .82rem; color: var(--muted); }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid > * { min-width: 0; }
.g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
.g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .g-2, .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.g-main { grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.mt { margin-top: 1.25rem; } .mt-sm { margin-top: .75rem; }
.stack > * + * { margin-top: 1.25rem; }

/* ---------- Cards ---------- */
.card { background: var(--card); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); min-width: 0; }
@media (min-width: 768px) { .card { padding: 1.6rem; } }
.card.dark { background: var(--contrast); color: var(--contrast-ink); border-color: var(--contrast); }
[data-tema="oscuro"] .card.dark { border-color: rgba(255,255,255,.06); }
.card.dark .muted, .card.dark .s { color: var(--contrast-muted); }
.card.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.card-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 1.2rem; font-weight: 500; }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.card-link { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: .25rem; background: none; border: 0; padding: 0; }
.card-link:hover { color: var(--ink); }
.card.dark .card-link { color: #d4d4d8; }
a.card { display: block; transition: transform .15s ease, box-shadow .15s ease; }
a.card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(20,22,28,.08); }
.kpi .ico-box { width: 2.4rem; height: 2.4rem; border-radius: .9rem; display: grid; place-items: center; background: var(--solid); box-shadow: var(--shadow); }
.kpi .val { font-size: 2.3rem; font-weight: 300; margin-top: 1rem; letter-spacing: -.02em; line-height: 1; }
.kpi .lbl { color: var(--muted); font-size: .9rem; margin-top: .35rem; }
.card.dark .kpi .lbl, .card.dark.kpi .lbl { color: var(--contrast-muted); }
.card.accent .lbl, .card.accent .muted { color: inherit; opacity: .8; }
.kpi .trend { font-size: .72rem; font-weight: 600; padding: .15rem .5rem; border-radius: 99px; }
.bar { height: .4rem; background: var(--chip); border-radius: 99px; overflow: hidden; margin-top: 1rem; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--ink); }
.bar.thin { height: .3rem; margin-top: .5rem; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .82rem; } .xs { font-size: .72rem; } .strong { font-weight: 600; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; }
.big { font-size: 2.2rem; font-weight: 300; line-height: 1.05; }

.pills { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.pill-bar { display: flex; flex-direction: column; gap: .3rem; font-size: .75rem; color: var(--muted); }
.pill-bar > div { height: 2.2rem; border-radius: 999px; display: flex; align-items: center; padding: 0 1rem; font-size: .8rem; font-weight: 500; color: var(--ink); background: var(--solid); border: 1px solid var(--card-border); min-width: 5rem; white-space: nowrap; overflow: hidden; }
.pill-bar .dark { background: var(--contrast); color: var(--contrast-ink); }
.pill-bar .acc { background: var(--accent); color: var(--accent-ink); }
.pill-bar .hatch { background: repeating-linear-gradient(-45deg, var(--chip) 0 2px, transparent 2px 8px), var(--card); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border-radius: 999px; padding: .62rem 1.15rem; font-size: .88rem; font-weight: 500; border: 1px solid var(--card-border); background: var(--card); color: var(--ink); box-shadow: var(--shadow); white-space: nowrap; transition: background .15s, transform .1s; text-decoration: none; }
.btn:hover { background: var(--solid); }
.btn:active { transform: scale(.98); }
.btn.dark { background: var(--contrast); border-color: var(--contrast); color: var(--contrast-ink); }
.btn.dark:hover { filter: brightness(1.15); }
.btn.acc { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.acc:hover { filter: brightness(1.05); }
.btn.ghost { color: inherit; background: transparent; box-shadow: none; border-color: transparent; }
.btn.ghost:hover { background: var(--chip); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: .4rem .8rem; font-size: .8rem; }
.btn.lg { padding: .9rem 1.4rem; font-size: 1rem; }
.btn.block { width: 100%; }
.btn[disabled], .btn.cargando { opacity: .5; pointer-events: none; }
.card.dark .btn:not(.acc):not(.dark) { background: rgba(255,255,255,.1); border-color: transparent; color: var(--contrast-ink); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .15rem .6rem; font-size: .74rem; font-weight: 500; white-space: nowrap; background: var(--chip); color: var(--ink); border: 0; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); }
.badge.violet { background: var(--violet-bg); color: var(--violet); }
.badge.dark { background: var(--contrast); color: var(--contrast-ink); } .badge.acc { background: var(--accent); color: var(--accent-ink); }
.badge .pt { width: .45rem; height: .45rem; border-radius: 99px; background: currentColor; }
.card.dark .badge:not(.ok):not(.warn):not(.bad):not(.info):not(.acc):not(.violet) { background: var(--contrast-chip); color: var(--contrast-ink); }
.crit { width: 1.5rem; height: 1.5rem; border-radius: .5rem; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700; }
.crit.A { background: var(--bad-bg); color: var(--bad); } .crit.B { background: var(--warn-bg); color: var(--warn); } .crit.C { background: var(--chip); color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -.25rem; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-weight: 400; font-size: .76rem; color: var(--muted); padding: .55rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: .8rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--chip); }
.tbl .r { text-align: right; } .tbl .c { text-align: center; }
.cell-main { font-weight: 500; } .cell-sub { font-size: .76rem; color: var(--muted); }
.who { display: flex; align-items: center; gap: .6rem; }
.mas { text-align: center; padding-top: .8rem; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.field { display: flex; align-items: center; gap: .5rem; background: var(--solid); border: 1px solid var(--field-border); border-radius: 999px; padding: .5rem .9rem; font-size: .88rem; }
.field input, .field select { border: 0; outline: none; background: transparent; min-width: 0; }
.field input { width: 12rem; }
.field select option { background: var(--solid); }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--card-border); border-radius: 999px; padding: .2rem; gap: .15rem; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: .4rem .85rem; font-size: .82rem; color: var(--muted); }
.seg button.on { background: var(--contrast); color: var(--contrast-ink); }

/* ---------- Forms ---------- */
.form { display: grid; gap: .9rem; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.form > *, .form label, .form > div > p, .form .dialog-foot { grid-column: 1 / -1; }
@media (min-width: 560px) { .form .half { grid-column: span 3; } .form .tercio { grid-column: span 2; } }
.form label { display: grid; gap: .35rem; font-size: .8rem; color: var(--muted); align-content: start; }
.form input:not([type=checkbox]):not([type=radio]):not([type=file]), .form select, .form textarea { border: 1px solid var(--field-border); border-radius: .9rem; padding: .7rem .9rem; background: var(--field); font-size: .95rem; color: var(--ink); width: 100%; }
.form input[type=file] { font-size: .85rem; color: var(--muted); }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); background: var(--solid); }
.form textarea { min-height: 5.5rem; resize: vertical; }
.form .ayuda { font-size: .74rem; color: var(--faint); }
.check { display: flex !important; align-items: center; gap: .6rem !important; font-size: .9rem !important; color: var(--ink) !important; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.err { color: var(--bad); font-size: .85rem; background: var(--bad-bg); padding: .6rem .8rem; border-radius: .8rem; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.choice { border: 1px solid var(--field-border); background: var(--field); border-radius: 1rem; padding: .75rem; text-align: left; font-size: .88rem; color: var(--ink); }
.choice.on { border-color: var(--contrast); background: var(--contrast); color: var(--contrast-ink); }

/* ---------- Dialog ---------- */
.overlay { position: fixed; inset: 0; background: rgba(12,13,16,.45); backdrop-filter: blur(4px); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .overlay { align-items: center; padding: 1.5rem; } }
.dialog { background: var(--solid); color: var(--ink); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 1.75rem 1.75rem 0 0; padding: 1.5rem; box-shadow: var(--pop); animation: pop .18s ease-out; }
@media (min-width: 640px) { .dialog { border-radius: 1.75rem; padding: 1.75rem; } }
.dialog.wide { max-width: 780px; }
.dialog-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.1rem; }
.dialog-head h2 { font-size: 1.35rem; }
.dialog-head .x { margin-left: auto; }
.dialog-foot { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.25rem; flex-wrap: wrap; grid-column: 1 / -1; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .dialog, .toast { animation: none; } a.card, .kan-card { transition: none; } }

/* ---------- Dropdown ---------- */
.rel { position: relative; }
.dropdown { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 40; background: var(--solid); border-radius: 1.4rem; box-shadow: var(--pop); padding: .5rem; width: min(23rem, calc(100vw - 2rem)); max-height: 75vh; overflow: auto; border: 1px solid var(--card-border); }
.dropdown .item { display: flex; gap: .75rem; padding: .7rem; border-radius: 1rem; align-items: flex-start; width: 100%; border: 0; background: none; text-align: left; }
.dropdown .item:hover { background: var(--field); }
.dropdown .item.no-leida { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.dropdown .head { padding: .6rem .7rem .4rem; display: flex; align-items: center; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 70; background: var(--contrast); color: var(--contrast-ink); padding: .85rem 1.25rem; border-radius: 999px; font-size: .9rem; box-shadow: var(--pop); display: flex; gap: .6rem; align-items: center; max-width: calc(100vw - 2rem); }
.toast.error { background: var(--bad); color: #fff; }
.toast .ok { color: var(--accent); }
@media (max-width: 767px) { .toast { bottom: 5.5rem; } }

/* ---------- Lists ---------- */
.list > * { display: flex; align-items: center; gap: .85rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: 0; }
.card.dark .list > * { border-color: var(--contrast-line); }
.list .grow { flex: 1; min-width: 0; }
.list .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .s { font-size: .78rem; color: var(--muted); }
.ico-round { width: 2.3rem; height: 2.3rem; border-radius: 999px; display: grid; place-items: center; flex: none; background: var(--chip); }
.card.dark .ico-round { background: var(--contrast-chip); }
.ico-round.bad { background: var(--bad-bg); color: var(--bad); } .ico-round.warn { background: var(--warn-bg); color: var(--warn); }
.ico-round.ok { background: var(--ok-bg); color: var(--ok); } .ico-round.info { background: var(--info-bg); color: var(--info); }
.ico-round.acc { background: var(--accent); color: var(--accent-ink); }
.timeline > div { position: relative; padding-left: 2.2rem; padding-bottom: 1.1rem; }
.timeline > div::before { content: ""; position: absolute; left: .7rem; top: 1.6rem; bottom: 0; width: 1px; background: var(--line); }
.timeline > div:last-child::before { display: none; }
.timeline .tl-dot { position: absolute; left: 0; top: .1rem; width: 1.45rem; height: 1.45rem; border-radius: 99px; background: var(--solid); box-shadow: var(--shadow); display: grid; place-items: center; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; padding: .7rem 1rem; font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--accent); font-weight: 500; }

.kv { display: grid; grid-template-columns: 1fr; }
@media (min-width: 640px) { .kv { grid-template-columns: 1fr 1fr; column-gap: 2rem; } .kv.uno { grid-template-columns: 1fr; } }
.kv > div { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.kv > div > span:first-child { color: var(--muted); }
.kv > div > span:last-child { text-align: right; font-weight: 500; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(13rem, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: .5rem; }
.kan-col { background: color-mix(in srgb, var(--card) 60%, transparent); border: 1px solid var(--card-border); border-radius: 1.6rem; padding: .9rem; min-height: 12rem; }
.kan-col h4 { font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; padding: .2rem .3rem .7rem; font-weight: 500; }
.kan-card { display: block; background: var(--solid); border-radius: 1.15rem; padding: .9rem; box-shadow: var(--shadow); margin-bottom: .6rem; transition: transform .12s; }
.kan-card:hover { transform: translateY(-2px); }
.kan-card .t { font-weight: 500; font-size: .9rem; margin: .4rem 0 .3rem; }

.checklist label { display: flex; gap: .75rem; align-items: center; padding: .7rem .2rem; border-bottom: 1px solid var(--line); cursor: pointer; font-size: .92rem; }
.checklist label:last-child { border-bottom: 0; }
.checklist input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); flex: none; }
.checklist .done { text-decoration: line-through; color: var(--faint); }

.stepper { display: flex; gap: .3rem; flex-wrap: wrap; }
.stepper span { font-size: .75rem; padding: .35rem .75rem; border-radius: 999px; background: var(--chip); color: var(--muted); }
.stepper span.done { background: var(--contrast); color: var(--contrast-ink); }
.stepper span.cur { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.cal .dow { font-size: .72rem; color: var(--muted); text-align: center; padding-bottom: .3rem; }
.cal .day { min-height: 4.4rem; background: var(--card); border-radius: .9rem; padding: .4rem; font-size: .75rem; overflow: hidden; }
.cal .day.out { opacity: .35; } .cal .day.today { outline: 2px solid var(--accent); }
.cal .day b { font-weight: 500; display: block; margin-bottom: .25rem; }
.cal .ev { display: block; border-radius: .45rem; padding: .15rem .35rem; margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: color-mix(in srgb, var(--accent) 22%, transparent); font-size: .68rem; }
.cal .ev.bad { background: var(--bad-bg); color: var(--bad); } .cal .ev.dark { background: var(--contrast); color: var(--contrast-ink); }
@media (max-width: 640px) { .cal .day { min-height: 3.2rem; } .cal .ev { font-size: 0; height: .4rem; padding: 0; } }

/* ---------- Charts ---------- */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: inherit; font-size: 11px; fill: var(--muted); }
.chart .grid-line { stroke: var(--line); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: .2rem; margin-right: .35rem; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr 2.5rem; align-items: center; gap: .6rem; font-size: .85rem; margin: .45rem 0; }
.hbar .track { height: .7rem; background: var(--chip); border-radius: 99px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.hbar .track i.acc { background: var(--accent); }
.stackbar { display: flex; height: .8rem; border-radius: 99px; overflow: hidden; background: var(--chip); }
.stackbar i { display: block; height: 100%; }

/* ---------- Equipo / QR ---------- */
.qr-box { background: #fff; border-radius: 1.4rem; padding: 1rem; display: grid; place-items: center; }
.qr-box img { width: 100%; max-width: 210px; }
.hero-eq { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.eq-ico { width: 4.2rem; height: 4.2rem; border-radius: 1.4rem; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.label-print { display: none; }
@media print {
  body { background: #fff !important; }
  body.printing-label .layout, body.printing-label .overlay, body.printing-label .toast, body.printing-label .bottom-nav, body.printing-label .tema-fab, body.printing-label .demo-banner { display: none !important; }
  body.printing-label .label-print { display: flex !important; gap: 5mm; align-items: center; border: 1px solid #000; border-radius: 3mm; padding: 4mm; width: 95mm; font-family: "Outfit", sans-serif; color: #000; }
  .label-print .qr { width: 32mm; height: 32mm; }
  .label-print .logo { height: 9mm; width: auto; margin-bottom: 1mm; }
}

/* ---------- Portal QR ---------- */
.portal { max-width: 460px; margin: 0 auto; }
.big-action { display: flex; align-items: center; gap: 1rem; width: 100%; text-align: left; padding: 1.1rem 1.2rem; border-radius: 1.4rem; border: 1px solid var(--card-border); background: var(--card); color: var(--ink); box-shadow: var(--shadow); font-size: 1rem; font-weight: 500; }
.big-action.acc { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.big-action small { display: block; font-weight: 400; font-size: .8rem; opacity: .75; }
.big-action svg { flex: none; }
.photo-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.photo { width: 4.8rem; height: 4.8rem; border-radius: 1rem; background: var(--chip); display: grid; place-items: center; color: var(--faint); flex: none; overflow: hidden; border: 0; padding: 0; position: relative; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .pdf { font-size: .7rem; font-weight: 600; color: var(--bad); }
.photo-add { border: 1.5px dashed var(--field-border); background: transparent; cursor: pointer; }
.scanner { position: relative; border-radius: 1.4rem; overflow: hidden; background: #111; aspect-ratio: 1/1; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; inset: 18%; border: 3px solid var(--accent); border-radius: 1.2rem; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.visor { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.85); display: grid; place-items: center; padding: 1rem; }
.visor img { max-height: 88vh; border-radius: 1rem; }

/* ---------- Login ---------- */
.login { display: grid; min-height: 100vh; grid-template-columns: 1fr; }
@media (min-width: 960px) { .login { grid-template-columns: 1.15fr 1fr; } }
.login-side { position: relative; display: none; flex-direction: column; justify-content: space-between; padding: 3rem; color: #fff; background: linear-gradient(160deg, rgba(20,21,24,.15) 0%, rgba(20,21,24,.82) 100%), var(--login-img, none) center/cover no-repeat, linear-gradient(160deg, #2a2c31 0%, #E41F26 140%); }
@media (min-width: 960px) { .login-side { display: flex; } }
.login-side .logo-box { align-self: flex-start; }
.login-side .logo-box img { height: 4.2rem; width: auto; filter: drop-shadow(0 2px 10px rgba(0,0,0,.35)); }
.login-side h1 { font-size: 3.2rem; line-height: 1.05; font-weight: 600; letter-spacing: -.03em; text-shadow: 0 2px 20px rgba(0,0,0,.3); }
.login-side .chips { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.login-side .chip { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(10px); border-radius: 1rem; padding: .8rem 1.1rem; }
.login-side .chip b { display: block; font-size: 1.3rem; }
.login-side .chip span { font-size: .78rem; opacity: .85; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.login-box { width: 100%; max-width: 400px; }
.login-box h2 { font-size: 2rem; font-weight: 600; letter-spacing: -.02em; }
.login-logo { height: 3.6rem; width: auto; margin-bottom: 2rem; }
@media (min-width: 960px) { .login-logo { display: none !important; } }

.demo-banner { background: var(--contrast); color: #e5e7eb; font-size: .78rem; text-align: center; padding: .45rem 1rem; }
.demo-banner b { color: var(--accent); font-weight: 600; }
[data-tema="oscuro"] .demo-banner { background: #000; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.cargando-pagina { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }

/* ---------- Pie de página ---------- */
.pie { margin-top: 3rem; padding: 1.25rem 4.75rem 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; justify-content: space-between; font-size: .78rem; color: var(--muted); }
.pie a { color: var(--ink); font-weight: 500; }
.pie a:hover { color: var(--accent); }
.pie .ver { font-variant-numeric: tabular-nums; }

/* ---------- Panel de apariencia (como la plantilla) ---------- */
.tema-fab { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 45; width: 3.3rem; height: 3.3rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); border: 4px solid color-mix(in srgb, var(--solid) 70%, transparent); box-shadow: var(--pop); display: grid; place-items: center; }
@media (max-width: 767px) { .tema-fab { bottom: 5.4rem; right: .9rem; width: 2.9rem; height: 2.9rem; } }
.tema-panel { position: fixed; right: 1.25rem; bottom: 5.4rem; z-index: 46; width: min(19rem, calc(100vw - 2rem)); background: var(--solid); border-radius: 1.6rem; padding: 1.25rem; box-shadow: var(--pop); border: 1px solid var(--card-border); }
@media (max-width: 767px) { .tema-panel { bottom: 9rem; right: .9rem; } }
.tema-panel h4 { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 1rem 0 .5rem; }
.tema-panel .seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; background: var(--field); }
.tema-panel .seg button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem; }
.tema-panel .seg button.on { background: var(--solid); color: var(--ink); box-shadow: var(--shadow); }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.swatch { aspect-ratio: 1; border-radius: .9rem; border: 2px solid transparent; display: grid; place-items: center; font-weight: 700; }
.swatch.on { border-color: var(--ink); }
.tema-panel .actual { font-size: .75rem; color: var(--muted); text-align: center; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--line); }

/* Bottom nav en móvil */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-around; background: color-mix(in srgb, var(--solid) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--card-border); padding: .45rem .5rem calc(.45rem + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(20,22,28,.06); }
.bottom-nav a, .bottom-nav button { display: grid; justify-items: center; gap: .15rem; font-size: .66rem; color: var(--muted); background: none; border: 0; padding: .2rem .4rem; }
.bottom-nav .active { color: var(--ink); font-weight: 600; }
.bottom-nav .scan { width: 3.2rem; height: 3.2rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; margin-top: -1.4rem; box-shadow: 0 8px 20px rgba(20,22,28,.25); }
@media (min-width: 768px) { .bottom-nav { display: none; } }
@media (max-width: 767px) {
  .btn, .btn.sm { min-height: 2.6rem; }
  .btn.ghost.sm { min-width: 2.6rem; }
  .card-link { min-height: 2.6rem; padding: 0 .25rem; }
  .crumb a, .pie a { display: inline-block; padding: .55rem 0; }
  .field { min-height: 2.75rem; }
  .field input, .field select { min-height: 1.9rem; }
  .bottom-nav a, .bottom-nav button { min-width: 3.4rem; min-height: 2.75rem; }
  .card-head .right { margin-left: 0; }
}
.hide-sm { display: none; }
@media (min-width: 768px) { .hide-sm { display: initial; } .hide-md { display: none !important; } }
