/* Gantt de taller PTT · misma línea visual de Mantención PTT (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; }

/* Barra superior fija: al bajar se compacta con desenfoque y sombra suave */
.shell { --pad: 1rem; }
@media (min-width: 768px) { .shell { --pad: 1.5rem; } }
@media (min-width: 1280px) { .shell { --pad: 2rem; } }
.barra { position: sticky; top: 0; z-index: 35; margin: calc(var(--pad) * -1) calc(var(--pad) * -1) 0; padding: var(--pad) var(--pad) .4rem;
  transition: padding .28s ease, background-color .28s ease, box-shadow .28s ease, backdrop-filter .28s ease; }
.barra.compacta { padding-top: .6rem; padding-bottom: .6rem; background: color-mix(in srgb, var(--bg-from) 78%, transparent);
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); box-shadow: 0 10px 30px -18px rgba(20,22,28,.35); }
.barra .nav { transition: margin-top .28s ease; }
.barra.compacta .nav { margin-top: .55rem; }
.barra .brand img { transition: height .28s ease; }
.barra.compacta .brand img { height: 2.2rem; }
[data-menu="lateral"] .barra.compacta { border-radius: 0 0 1.25rem 1.25rem; }
@media (max-width: 767px) { .barra .nav { margin-top: .6rem; } }
@media (prefers-reduced-motion: reduce) { .barra, .barra .nav, .barra .brand img { transition: none; } }

.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); }
/* Lista con scroll propio y sin separadores (próximos vencimientos) */
.lista-scroll { max-height: 27rem; overflow-y: auto; overscroll-behavior: contain; margin: 0 -.5rem; padding: 0 .5rem .75rem;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 2.5rem), transparent); }
.lista-scroll > * { border-bottom: 0 !important; padding: .55rem .5rem; border-radius: 1rem; transition: background-color .15s; }
.lista-scroll > a:hover, .lista-scroll > a:focus-visible { background: var(--contrast-chip); }
.lista-scroll::-webkit-scrollbar { width: 6px; }
.lista-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 99px; }
.lista-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 1rem; }

.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; } }

/* ======================================================================  Gantt de taller */
/* Tarjeta de plantilla: barra proporcional de evaluación + armado */
.pl-card h3 { font-weight: 500; letter-spacing: -.01em; }
.pl-fases { display: flex; gap: 3px; height: .55rem; border-radius: 99px; overflow: hidden; }
.pl-fases i { display: block; height: 100%; }
.pl-fases .ev { background: var(--contrast); } .pl-fases .ar { background: var(--accent); }
[data-tema="oscuro"] .pl-fases .ev { background: #e7e7ea; }
.pl-dato { display: flex; gap: 1rem; flex-wrap: wrap; color: var(--muted); }
.pl-dato b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Gantt de la plantilla en días relativos */
.gantt-card { padding-bottom: 1rem; }
.gm { display: grid; grid-template-columns: 2.4rem minmax(15rem, 2fr) 6.2rem minmax(calc(var(--dias) * 1.7rem), 3fr); overflow-x: auto; font-size: .86rem; }
.gm-row { display: contents; }
.gm-row > div { padding: .55rem .5rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; min-width: 0; }
.gm-row.click:hover > div { background: var(--chip); cursor: pointer; }
.gm-head > div { font-size: .74rem; color: var(--muted); padding-top: .2rem; padding-bottom: .45rem; }
.gm-n { color: var(--muted); justify-content: center; }
.gm-t { line-height: 1.3; }
.gm-d { justify-content: space-between; gap: .2rem; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.gm-mover { display: inline-flex; opacity: 0; transition: opacity .15s; }
.gm-row:hover .gm-mover, .gm-mover:focus-within { opacity: 1; }
.gm-mover .btn { padding: .15rem; min-height: 0; box-shadow: none; }
.gm-bars { position: relative; background-image: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px calc(100% / var(--dias))); }
.gm-bars i { position: absolute; top: 50%; height: 1.15rem; transform: translateY(-50%); border-radius: .45rem; min-width: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.gm-bars i.ev { background: var(--contrast); } .gm-bars i.ar { background: var(--accent); }
[data-tema="oscuro"] .gm-bars i.ev { background: #d4d4d8; }
.gm-regla { display: grid !important; grid-template-columns: repeat(var(--dias), minmax(0, 1fr)); padding-left: 0 !important; padding-right: 0 !important; background-image: none; }
.gm-regla span { text-align: center; font-size: .68rem; font-variant-numeric: tabular-nums; border-radius: .35rem; margin: 0 1px; padding: .1rem 0; }
.gm-regla span.ev { background: var(--chip); } .gm-regla span.ar { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.gm-fase { grid-column: 1 / -1; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 1rem .5rem .35rem; }
.lc-ico { background: var(--info-bg) !important; border: 1px solid var(--info); }
@media (max-width: 767px) { .gm { grid-template-columns: 2rem minmax(11rem, 1fr) 4.4rem calc(var(--dias) * 1.5rem); } .gm-mover { opacity: 1; } }

/* Días laborables de la semana */
.dias-sem { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.dias-sem button { border: 1px solid var(--field-border); background: var(--field); color: var(--muted); border-radius: .9rem; padding: .7rem 0; font-size: .85rem; font-weight: 500; }
.dias-sem button.on { background: var(--contrast); border-color: var(--contrast); color: var(--contrast-ink); }
.dias-sem button[disabled] { cursor: default; }

/* ======================================================================  Tablero (al estilo monday) */
.tb { display: grid; gap: 1.5rem; }
.tb-grupo { --g: var(--accent); min-width: 0; }
.tb-ghead { display: flex; align-items: center; gap: .6rem; background: none; border: 0; padding: .2rem 0 .6rem; color: var(--g); font-size: 1.05rem; }
.tb-ghead b { font-weight: 600; }
.tb-ghead .muted, .tb-ghead .badge { font-size: .78rem; }
.tb-chev { display: inline-grid; transition: transform .15s ease; }
.tb-chev.abierto { transform: rotate(90deg); }
.tb-scroll { overflow-x: auto; border-radius: 1rem; background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow); border-left: 6px solid var(--g); }
.tb-row { display: grid; grid-template-columns: minmax(15rem, 2.4fr) 9.5rem 8.5rem 7rem 4.5rem 12rem 8rem 9rem 3.5rem; min-width: 1080px; }
.tb-c { padding: .35rem .5rem; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); display: flex; align-items: center; min-width: 0; font-size: .86rem; }
.tb-c.c { justify-content: center; }
.tb-c:last-child { border-right: 0; }
.tb-head .tb-c { font-size: .72rem; color: var(--muted); padding-top: .55rem; padding-bottom: .55rem; justify-content: center; }
.tb-head .tb-main { justify-content: flex-start; padding-left: 2.6rem; }
.tb-main { position: sticky; left: 0; z-index: 1; background: var(--solid); gap: .3rem; }
.tb-row:hover .tb-c { background: color-mix(in srgb, var(--chip) 60%, var(--solid)); }
.tb-exp { background: none; border: 0; padding: .3rem; color: var(--muted); border-radius: .5rem; display: grid; place-items: center; }
.tb-exp:hover { background: var(--chip); color: var(--ink); }
.tb-nombre { display: grid; text-align: left; background: none; border: 0; padding: .2rem; min-width: 0; color: inherit; border-radius: .5rem; }
.tb-nombre:hover .strong, .tb-nombre:hover .small { text-decoration: underline; text-underline-offset: 3px; }
.tb-nombre > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st { width: 100%; height: 2.1rem; border: 0; border-radius: .45rem; color: #fff; font-size: .8rem; font-weight: 500; padding: 0 .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: filter .12s; }
.st:hover { filter: brightness(1.08); }
.tb-persona { display: flex; align-items: center; gap: .4rem; background: none; border: 0; padding: .2rem .3rem; border-radius: .5rem; width: 100%; color: inherit; min-width: 0; }
.tb-persona:hover { background: var(--chip); }
.tb-persona .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-plan { display: grid; line-height: 1.25; font-size: .8rem; }
.tb-plan i { font-style: normal; }
.atraso { color: var(--bad); font-weight: 500; }
.tb-av { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .45rem; width: 100%; background: none; border: 0; padding: .2rem; color: inherit; }
.tb-av .bar { margin-top: 0; }
.tb-chat { position: relative; background: none; border: 0; color: var(--muted); padding: .35rem; border-radius: .6rem; }
.tb-chat:hover { color: var(--ink); background: var(--chip); }
.tb-n { position: absolute; top: -.1rem; right: -.2rem; background: var(--info); color: #fff; border-radius: 99px; font-size: .6rem; min-width: 1rem; padding: 0 .25rem; font-weight: 600; }
.tb-subs { display: contents; }
.tb-sub .tb-c { background: color-mix(in srgb, var(--chip) 35%, var(--solid)); }
.tb-sub .tb-main { padding-left: 2.6rem; justify-content: space-between; }
.tb-sub .tb-nombre .small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tb-sub .st { height: 1.8rem; font-size: .76rem; }
.tb-fase { min-width: 1080px; padding: .55rem .5rem .3rem 2.6rem; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: color-mix(in srgb, var(--chip) 35%, var(--solid)); border-bottom: 1px solid var(--line); }

/* Menú emergente de las celdas */
.pop { position: fixed; z-index: 90; background: var(--solid); border: 1px solid var(--card-border); border-radius: 1rem; box-shadow: var(--pop); padding: .45rem; max-height: 60vh; overflow: auto; }
.pop-st { display: grid; gap: .3rem; }
.pop-lista .item { display: flex; gap: .55rem; align-items: center; width: 100%; padding: .5rem; border: 0; background: none; border-radius: .7rem; text-align: left; color: inherit; }
.pop-lista .item:hover { background: var(--field); }

/* Vista previa del plan al ingresar */
.ing-prev { background: var(--field); border-radius: 1.2rem; padding: 1rem; }

/* Panel lateral del componente */
.cajon-fondo { justify-content: flex-end; align-items: stretch; padding: 0 !important; }
.cajon { background: var(--solid); width: min(40rem, 100vw); height: 100%; overflow-y: auto; padding: 1.5rem; box-shadow: var(--pop); animation: entra .2s ease-out; }
@keyframes entra { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cajon { animation: none; } .tb-chev { transition: none; } }
.cajon-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.cajon-head h2 { font-size: 1.7rem; font-weight: 500; letter-spacing: -.01em; }
.cajon-head .st { height: 2.4rem; width: auto; flex: none; margin-left: auto; padding: 0 1rem; }
.lt { display: grid; grid-template-columns: 8.5rem 1fr auto; gap: .75rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.lt-txt { display: grid; text-align: left; background: none; border: 0; padding: 0; color: inherit; gap: .15rem; }
.lt-txt:hover .small { text-decoration: underline; text-underline-offset: 3px; }
.act-nueva { background: var(--field); border-radius: 1.2rem; padding: .8rem; margin-bottom: 1.25rem; display: grid; gap: .6rem; }
.act-nueva textarea { border: 0; background: transparent; resize: vertical; min-height: 4.5rem; outline: none; font-size: .92rem; }
.act-barra { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.act-sel { border: 1px solid var(--field-border); background: var(--solid); border-radius: 99px; padding: .35rem .7rem; font-size: .78rem; max-width: 16rem; }
.act { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.photo-x { position: absolute; top: .2rem; right: .2rem; width: 1.3rem; height: 1.3rem; border-radius: 99px; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; padding: 0; }
@media (max-width: 767px) { .cajon { padding: 1.1rem; } .lt { grid-template-columns: 7rem 1fr auto; } }

/* ======================================================================  Vistas del tablero (Ola 3) */
.vistas { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin: -.5rem 0 1rem; overflow-x: auto; scrollbar-width: none; }
.vistas button { display: inline-flex; align-items: center; gap: .4rem; border: 0; background: none; color: var(--muted); padding: .6rem .9rem; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.vistas button.on { color: var(--ink); border-color: var(--accent); font-weight: 500; }

/* Kanban */
.kb { grid-auto-columns: minmax(15rem, 1fr); align-items: start; }
.kb .kan-col { --g: var(--accent); border-top: 4px solid var(--g); transition: background .12s, outline-color .12s; outline: 2px dashed transparent; outline-offset: -4px; }
.kb .kan-col.sobre { outline-color: var(--g); background: color-mix(in srgb, var(--g) 10%, var(--card)); }
.kb h4 > span:first-child { display: inline-flex; align-items: center; gap: .45rem; }
.kb-pt { width: .6rem; height: .6rem; border-radius: 99px; background: var(--g); display: inline-block; }
.kb-card { cursor: pointer; display: grid; gap: .35rem; }
.kb-card[draggable="true"] { cursor: grab; }
.kb-card.arrastrando { opacity: .45; }
.kb-card .t { margin: 0; font-size: 1rem; }
.kb-card .bar { margin-top: .2rem; }
.kb-pie { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-top: .2rem; }
.kb-vacio { border: 1.5px dashed var(--field-border); border-radius: 1rem; padding: 1.2rem .5rem; text-align: center; font-size: .78rem; color: var(--faint); }

/* Gantt y carga */
.gx-card { padding: 1rem; }
.gx { --lab: 15rem; overflow: auto; max-height: 72vh; border-radius: 1rem; border: 1px solid var(--line); background: var(--solid); position: relative; }
.gx-in { position: relative; }
.gx-head { display: flex; position: sticky; top: 0; z-index: 4; background: var(--solid); border-bottom: 1px solid var(--line); }
.gx-lab { width: var(--lab); flex: none; position: sticky; left: 0; z-index: 3; background: var(--solid); border-right: 1px solid var(--line); display: flex; align-items: center; gap: .35rem; padding: 0 .5rem; min-width: 0; }
.gx-esq { z-index: 5; font-size: .72rem; color: var(--muted); }
.gx-escala { position: relative; flex: 1; height: 3rem; }
.gx-meses span { position: absolute; top: .3rem; font-size: .72rem; font-weight: 600; padding-left: .3rem; white-space: nowrap; border-left: 1px solid var(--line); }
.gx-meses span::first-letter { text-transform: uppercase; }
.gx-dias span { position: absolute; bottom: .25rem; text-align: center; font-size: .66rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.gx-dias span.nh { color: var(--faint); }
.gx-dias span.hoy { color: #fff; background: var(--accent); border-radius: .35rem; font-weight: 600; }
.gx-cuerpo { position: relative; }
.gx-fondo { position: absolute; inset: 0 0 0 var(--lab); pointer-events: none; z-index: 0; }
.gx-fondo i { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(-45deg, var(--chip) 0 3px, transparent 3px 7px); }
.gx-hoy { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 2; }
.gx-row { display: flex; min-height: var(--alto, 2.7rem); border-bottom: 1px solid var(--line); position: relative; }
.gx-row:hover .gx-lab { background: color-mix(in srgb, var(--chip) 60%, var(--solid)); }
.gx-sub { min-height: 2.1rem; }
.gx-sub .gx-lab { background: color-mix(in srgb, var(--chip) 35%, var(--solid)); }
.gx-track { position: relative; flex: 1; z-index: 1; }
.gx-sem { width: .55rem; height: .55rem; border-radius: 99px; margin-left: auto; flex: none; background: var(--ok); }
.gx-sem.warn { background: var(--warn); } .gx-sem.bad { background: var(--bad); }
.gx-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 1.35rem; border-radius: .45rem; overflow: hidden; display: flex; align-items: center; color: #fff; font-size: .7rem; font-weight: 500; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.18); user-select: none; }
.gx-bar span { position: relative; padding: 0 .45rem; overflow: hidden; text-overflow: ellipsis; }
.gx-av { position: absolute; inset: 0 auto 0 0; background: rgba(0,0,0,.22); }
.gx-fase.ev { background: #579bfc; } .gx-fase.ar { background: #a25ddc; }
.gx-tarea { --c: #9aa0a8; background: var(--c); height: 1rem; top: 40%; }
.gx-tarea.hecha { opacity: .75; }
.gx-real { position: absolute; bottom: .25rem; height: .28rem; border-radius: 99px; background: #00c875; }
.gx-carga { --c: #579bfc; background: var(--c); transform: none; height: 1.45rem; cursor: pointer; }
.gx.editable .gx-fase, .gx.editable .gx-tarea:not(.hecha) { cursor: grab; touch-action: none; }
.gx.editable .gx-tarea:not(.hecha)::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; background: rgba(255,255,255,.25); }
.gx-bar.arrastrando { cursor: grabbing; box-shadow: 0 6px 16px rgba(0,0,0,.3); z-index: 3; opacity: .92; }
@media (max-width: 767px) { .gx { --lab: 9.5rem; } }

/* Mis tareas */
.mis-grupo { margin-bottom: 1.75rem; }
.mis-t { font-size: 1.15rem; font-weight: 500; margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; }
.mis-card { display: flex; flex-direction: column; }
.mis-acc { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: auto; padding-top: 1rem; }
.mis-acc .btn { min-height: 2.75rem; }

/* ======================================================================  Indicadores (Ola 4) */
.chart text.val { fill: var(--ink); font-weight: 600; font-size: 12px; }
.chart .hov:hover rect:first-child { fill: var(--chip); }
.hbar.ocup { grid-template-columns: minmax(9rem, 15rem) 1fr 6.5rem; margin: .7rem 0; }

/* Gantt de un componente para imprimir o guardar en PDF */
.imp-hoja { background: var(--solid); border-radius: 1.2rem; padding: 1.25rem; box-shadow: var(--shadow); }
.imp-cab { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1rem; flex-wrap: wrap; }
.imp-cab h2 { font-size: 1.3rem; font-weight: 600; }
.imp-dato { margin-left: auto; display: grid; text-align: right; }
.imp-dato b { font-size: 1.2rem; }
.imp-gantt { display: grid; grid-template-columns: 2rem minmax(14rem, 2fr) 7.5rem 8.5rem minmax(calc(var(--n) * 1.1rem), 3fr); font-size: .74rem; overflow-x: auto; }
.imp-fila { display: contents; }
.imp-fila > span { padding: .3rem .35rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; min-width: 0; }
.imp-head > span { font-weight: 600; color: var(--muted); }
.imp-dias { display: grid !important; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); padding: .2rem 0 !important; }
.imp-dias i { font-style: normal; font-size: .52rem; writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; color: var(--muted); justify-self: center; }
.imp-barras { position: relative; height: 1.6rem; padding: 0 !important; background-image: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px calc(100% / var(--n))); }
.imp-barras b { position: absolute; height: .5rem; border-radius: .2rem; }
.imp-barras b.plan { top: .3rem; background: #92d050; }
.imp-barras b.real { bottom: .3rem; background: #579bfc; }
.imp-fase { grid-column: 1 / -1; font-weight: 700; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; padding: .6rem .35rem .2rem; }
@page { size: A4 landscape; margin: 9mm; }
.imp-logo { height: 2.6rem; width: auto; }
@media print {
  /* el papel es blanco aunque la pantalla esté en tema oscuro */
  :root, :root[data-tema="oscuro"] { --ink: #2a2c31; --muted: #5b6270; --faint: #8a919c; --line: rgba(42,44,49,.14); --solid: #fff; --card: #fff;
    --card-border: #ddd; --chip: rgba(42,44,49,.06); --field: #f6f6f3; --contrast: #2a2c31; --contrast-ink: #fff; --contrast-muted: #c4c4c8; color-scheme: light; }
  [data-tema="oscuro"] .logo-claro { display: block !important; }
  [data-tema="oscuro"] .logo-oscuro { display: none !important; }
  body { background: #fff !important; color: #000; font-size: 11px; }
  .barra, .side, .bottom-nav, .pie, .no-print, .toast, .tema-panel, .overlay, .pop { display: none !important; }
  .shell { padding: 0 !important; max-width: none; }
  .card, .imp-hoja { box-shadow: none !important; border: 1px solid #ddd !important; backdrop-filter: none !important; background: #fff !important; break-inside: avoid; }
  .imp-hoja { border: 0 !important; padding: 0; }
  .imp-gantt { overflow: visible; grid-template-columns: 1.6rem minmax(12rem, 2fr) 6.5rem 7.5rem 3fr; }
  .imp-barras b.plan, .imp-barras b.real, .hbar .track i, .chart path { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .page-head { margin-top: 0; }
  .grid.g-4 { grid-template-columns: repeat(4, 1fr); }
  .grid.g-2 { grid-template-columns: repeat(2, 1fr); }
}

/* Botones cómodos para el dedo en celular (auditoría responsive de la Ola 4) */
@media (max-width: 767px) {
  .seg button { min-height: 2.5rem; }
  a.badge { min-height: 2.1rem; padding: .3rem .75rem; }
  a.crumb { padding: .55rem 0; }
  .gm-mover .btn { min-width: 2.4rem; min-height: 2.4rem; }
  .mis-card .tb-nombre { min-height: 2.4rem; }
  .vistas button { min-height: 2.75rem; }
}
