/* =====================================================================
   Lion Control · interfaz estilo Apple
   Los colores de marca vienen de config.php (--brand, --brand-dark)
   ===================================================================== */
:root {
  --brand: #0080FC; --brand-rgb: 0, 128, 252; --brand-dark: #000000;
  --bg: #f5f5f7; --bg2: #ececf0; --surface: #ffffff; --surface-2: #fbfbfd;
  --glass: rgba(255, 255, 255, .78); --glass-side: rgba(250, 250, 252, .86);
  --ink: #1d1d1f; --ink-2: #424245; --muted: #6e6e73; --faint: #a1a1a6;
  --sep: rgba(0, 0, 0, .08); --sep-2: rgba(0, 0, 0, .05); --hover: rgba(0, 0, 0, .04);
  --field: rgba(118, 118, 128, .12);
  --blue: #007AFF; --green: #34C759; --amber: #FF9500; --red: #FF3B30;
  --violet: #AF52DE; --teal: #30B0C7; --pink: #FF2D55; --gray: #8E8E93;
  --r-s: 8px; --r: 12px; --r-l: 18px; --r-xl: 22px;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 1px rgba(0, 0, 0, .03);
  --sh-2: 0 0 0 1px rgba(0, 0, 0, .045), 0 2px 8px rgba(0, 0, 0, .04);
  --sh-3: 0 24px 60px rgba(0, 0, 0, .18), 0 4px 14px rgba(0, 0, 0, .08);
  --ease: cubic-bezier(.32, .72, 0, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --bg2: #111113; --surface: #1c1c1e; --surface-2: #232325;
    --glass: rgba(28, 28, 30, .72); --glass-side: rgba(22, 22, 24, .86);
    --ink: #f5f5f7; --ink-2: #d1d1d6; --muted: #98989d; --faint: #636366;
    --sep: rgba(255, 255, 255, .10); --sep-2: rgba(255, 255, 255, .06); --hover: rgba(255, 255, 255, .06);
    --field: rgba(118, 118, 128, .24);
    --blue: #0A84FF; --green: #30D158; --amber: #FF9F0A; --red: #FF453A;
    --violet: #BF5AF2; --teal: #40C8E0; --pink: #FF375F; --gray: #98989D;
    --sh-1: 0 0 0 1px rgba(255, 255, 255, .04); --sh-2: 0 0 0 1px rgba(255, 255, 255, .06);
    --sh-3: 0 24px 60px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .08);
    color-scheme: dark;
  }
}

/* Paleta semántica: .c-<color> define --c */
.c-blue { --c: var(--blue); } .c-green { --c: var(--green); } .c-amber { --c: var(--amber); }
.c-red { --c: var(--red); } .c-violet { --c: var(--violet); } .c-teal { --c: var(--teal); }
.c-pink { --c: var(--pink); } .c-gray { --c: var(--gray); } .c-brand { --c: var(--brand); } .c-none { --c: var(--faint); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font: 14px/1.47 var(--font); letter-spacing: -.01em; background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: none; opacity: .85; }
::selection { background: rgba(var(--brand-rgb), .3); }
h1 { font-size: 30px; line-height: 1.12; font-weight: 700; letter-spacing: -.025em; margin: 0; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
h3 { font-size: 17px; font-weight: 600; letter-spacing: -.015em; margin: 0 0 10px; }
h4 { font-size: 13px; font-weight: 600; margin: 16px 0 8px; }
h1 small, h2 small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .center { text-align: center; }
.nowrap { white-space: nowrap; } .grow { flex: 1; } .red, .bad { color: var(--red); } .warn { color: var(--amber); font-weight: 600; }
kbd { font: 500 11px var(--font); background: var(--field); border-radius: 5px; padding: 1px 6px; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--sep); margin: 6px 0; }

.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }

/* ===================================================================== Layout */
.app { display: flex; min-height: 100vh; }
.side {
  width: 248px; flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--glass-side); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--sep); z-index: 30;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 22px 20px 14px; color: var(--ink); }
.brand-sub { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; padding-left: 2px; }
.brand:hover { opacity: 1; }
.brand-logo { width: 150px; height: auto; display: block; }
.top-logo { display: none; width: 28px; height: 28px; }
.logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 17px; color: #fff;
  background: linear-gradient(145deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 6px rgba(var(--brand-rgb), .35);
}
.brand-t b { display: block; font-size: 15px; letter-spacing: -.02em; }
.brand-t small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.2; }
.search-trigger {
  margin: 2px 12px 10px; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 0; border-radius: 9px;
  background: var(--field); color: var(--muted); font: inherit; cursor: pointer; text-align: left;
}
.search-trigger span { flex: 1; }
.search-trigger:hover { background: color-mix(in srgb, var(--field) 100%, var(--hover)); }
.side nav { flex: 1; overflow-y: auto; padding: 0 10px 10px; }
.nav-g { font-size: 11.5px; font-weight: 600; color: var(--faint); padding: 14px 10px 5px; letter-spacing: .01em; }
.side nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--ink-2); font-weight: 500;
  transition: background .15s;
}
.side nav a .ico { color: var(--muted); width: 19px; height: 19px; transition: color .15s; }
.side nav a:hover { background: var(--hover); opacity: 1; }
.side nav a.active { background: rgba(var(--brand-rgb), .12); color: var(--brand); font-weight: 600; }
.side nav a.active .ico { color: var(--brand); }
.side-foot { display: flex; align-items: center; gap: 6px; padding: 12px 12px 16px; border-top: 1px solid var(--sep); }
.side-foot form { margin: 0; }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--ink); padding: 4px; border-radius: 10px; }
.me:hover { background: var(--hover); opacity: 1; }
.me span { min-width: 0; }
.me b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { display: block; color: var(--muted); font-size: 11.5px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 24px;
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--sep-2);
}
.top-title { font-weight: 600; font-size: 15px; opacity: 0; transition: opacity .2s; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn.burger { display: none; }
.content { padding: 28px 32px 60px; width: 100%; max-width: 1560px; margin: 0 auto; animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.scrim { display: none; }

/* ===================================================================== Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 15px; border-radius: 980px;
  border: 0; font: 600 14px var(--font); letter-spacing: -.01em; cursor: pointer; white-space: nowrap;
  background: var(--field); color: var(--ink); transition: transform .12s, filter .15s, background .15s;
}
.btn:hover { opacity: 1; filter: brightness(.97); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(var(--brand-rgb), .4); }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.ghost { background: transparent; color: var(--blue); }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--red); }
.btn.sm { height: 28px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; height: 44px; font-size: 16px; }
.btn .ico { width: 16px; height: 16px; stroke-width: 2.1; }
.btn:disabled { opacity: .5; cursor: progress; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
  display: inline-grid; place-items: center; font-size: 20px; line-height: 1; transition: background .15s;
}
.icon-btn:hover { background: var(--hover); opacity: 1; }
.icon-btn.xs { width: 24px; height: 24px; }
.icon-btn.xs .ico { width: 15px; height: 15px; }

/* Menú desplegable */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px; border-radius: 14px; z-index: 50;
  background: var(--glass); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--sh-3); border: 1px solid var(--sep); opacity: 0; transform: scale(.96) translateY(-4px); transform-origin: top right;
  pointer-events: none; transition: opacity .16s, transform .2s var(--ease);
}
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
.menu a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-weight: 500; }
.menu a .ico { color: var(--muted); }
.menu a:hover { background: var(--blue); color: #fff; opacity: 1; }
.menu a:hover .ico { color: #fff; }

/* ===================================================================== Encabezados y barras */
.page-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.crumb { font-size: 13px; display: inline-flex; gap: 2px; align-items: center; margin-bottom: 6px; font-weight: 500; }
.toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.month-nav { display: flex; align-items: center; gap: 4px; }
.month-nav b { font-size: 17px; min-width: 150px; text-align: center; letter-spacing: -.02em; }
.hint { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; }

/* Control segmentado */
.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--field); gap: 0; }
.seg a, .seg button, .seg label span {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 7px; border: 0; background: transparent;
  font: 500 13px var(--font); color: var(--ink); cursor: pointer; white-space: nowrap; transition: background .18s, box-shadow .18s;
}
.seg .ico { width: 15px; height: 15px; }
.seg a.on, .seg button.on, .seg label input:checked + span { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 1px rgba(0, 0, 0, .04); font-weight: 600; }
.seg a:hover { opacity: 1; }
.seg-radio label { display: inline-flex; }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }

/* Pestañas (vistas guardadas) */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 6px 14px; border-radius: 980px; color: var(--ink-2); font-weight: 500; font-size: 13px; background: transparent; }
.tabs a:hover { background: var(--hover); opacity: 1; }
.tabs a.active { background: var(--ink); color: var(--bg); }

/* ===================================================================== Tarjetas */
.card { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-2); padding: 20px 22px; margin-bottom: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 520px; margin: 40px auto; }
.card-h { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h3 { margin: 0 auto 0 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid2 > .card { margin-bottom: 0; }
.show-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .ico { width: 40px; height: 40px; color: var(--faint); stroke-width: 1.3; }
.empty-state h3 { color: var(--ink); margin: 10px 0 4px; }
.empty-state p { margin: 0; }

/* ===================================================================== Toasts */
.toasts { position: fixed; top: 64px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 11px 12px 11px 14px; border-radius: 14px;
  background: var(--glass); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--sh-3); border: 1px solid var(--sep); font-weight: 500; animation: tin .45s var(--ease);
}
.toast.out { animation: tout .28s ease forwards; }
@keyframes tin { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes tout { to { opacity: 0; transform: translateX(30px); } }
.toast-i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; background: var(--green); }
.toast-i .ico { width: 15px; height: 15px; stroke-width: 2.4; }
.toast.err .toast-i { background: var(--red); } .toast.warn .toast-i { background: var(--amber); }
.toast-x { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 4px; }
.alert { padding: 12px 16px; border-radius: var(--r); margin-bottom: 16px; font-weight: 500; }
.alert ul { margin: 6px 0 0; padding-left: 18px; font-weight: 400; }
.alert.ok { background: color-mix(in srgb, var(--green) 12%, transparent); }
.alert.err { background: color-mix(in srgb, var(--red) 11%, transparent); color: color-mix(in srgb, var(--red) 80%, var(--ink)); }
.alert.warn { background: color-mix(in srgb, var(--amber) 14%, transparent); }

/* ===================================================================== Píldoras, etiquetas, avatares */
.badge, .pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 980px; font-size: 12px; font-weight: 600;
  white-space: nowrap; line-height: 1.5; background: color-mix(in srgb, var(--c, var(--gray)) 15%, transparent);
  color: color-mix(in srgb, var(--c, var(--gray)) 82%, var(--ink));
}
.b-green { --c: var(--green); } .b-amber { --c: var(--amber); } .b-red { --c: var(--red); } .b-blue { --c: var(--blue); }
.b-violet { --c: var(--violet); } .b-teal { --c: var(--teal); } .b-pink { --c: var(--pink); } .b-gray { --c: var(--gray); }
.pill b { font-weight: 700; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--field); color: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.tag.ok { background: color-mix(in srgb, var(--green) 15%, transparent); color: color-mix(in srgb, var(--green) 80%, var(--ink)); }
.dot-c { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--gray)); margin-right: 6px; flex: none; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.dot.verde { background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 18%, transparent); }
.dot.amarillo { background: var(--amber); box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 20%, transparent); }
.dot.rojo { background: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 18%, transparent); }
.legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.legend .dot { width: 8px; height: 8px; margin-left: 8px; box-shadow: none; }
.avatar {
  --h: 30; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 11px; font-weight: 700; color: #fff; letter-spacing: .02em;
  background: linear-gradient(145deg, hsl(var(--h) 62% 60%), hsl(calc(var(--h) + 25) 58% 46%));
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.av-empty { background: var(--field); color: var(--faint); }

/* Select tipo píldora (status en línea) */
.pill-select {
  appearance: none; -webkit-appearance: none; border: 0; border-radius: 980px; padding: 3px 24px 3px 10px; font: 600 12px var(--font);
  cursor: pointer; width: auto; min-width: 0;
  background: color-mix(in srgb, var(--c, var(--gray)) 15%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
  color: color-mix(in srgb, var(--c, var(--gray)) 85%, var(--ink));
}
.pill-select:focus { outline: 2px solid rgba(var(--brand-rgb), .4); }
.pill-green { --c: var(--green); } .pill-amber { --c: var(--amber); } .pill-red { --c: var(--red); } .pill-blue { --c: var(--blue); }
.pill-violet { --c: var(--violet); } .pill-teal { --c: var(--teal); } .pill-gray { --c: var(--gray); } .pill-pink { --c: var(--pink); }
.pill-none { --c: var(--faint); }

/* ===================================================================== Tablas */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 12px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--sep); background: var(--surface); position: sticky; top: 0; z-index: 1;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--sep-2); vertical-align: middle; }
.table.compact td, .table.compact th { padding: 9px 12px; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--hover); }
.table tr:last-child td { border-bottom: 0; }
.row-link { font-weight: 600; color: var(--ink); }
.row-link:hover { color: var(--blue); }
.table td a:not(.btn):not(.icon-btn) { font-weight: 500; }
.row-danger td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.row-danger { background: color-mix(in srgb, var(--red) 4%, transparent); }
.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.row-muted td { opacity: .5; }
.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 9px; vertical-align: middle; background: var(--field); }
.thumb.xs { width: 28px; height: 28px; border-radius: 7px; }
.bar { height: 6px; background: var(--field); border-radius: 3px; overflow: hidden; min-width: 90px; margin-bottom: 3px; }
.bar span { display: block; height: 100%; background: var(--green); border-radius: 3px; }

/* Parrilla */
.grid-table td { padding: 8px 12px; }
.grid-table tr.weekend { background: color-mix(in srgb, var(--field) 30%, transparent); }
.grid-table tr.today { background: rgba(var(--brand-rgb), .08); }
.grid-table tr.cont td { border-top: 0; }
.date-cell { width: 58px; white-space: nowrap; }
.dnum { font-size: 17px; font-weight: 700; letter-spacing: -.02em; display: inline-block; width: 24px; }
.dname { font-size: 11.5px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
tr.today .dnum { color: var(--brand); }
.grid-table .tema { min-width: 240px; }
.grid-table .tema a { color: var(--ink); font-weight: 500; }
.grid-table .tema a:hover { color: var(--blue); }
.grid-table .tema small { display: block; color: var(--muted); font-size: 12px; }
.grid-table .acc a { color: var(--ink-2); font-size: 13px; display: inline-flex; align-items: center; white-space: nowrap; }
.add-slot { color: var(--faint); font-size: 13px; display: inline-flex; gap: 4px; align-items: center; opacity: 0; transition: opacity .15s; }
tr:hover .add-slot { opacity: 1; color: var(--blue); }
.hist { display: block; color: var(--muted); margin-bottom: 3px; }
.resp-pick { display: inline-flex; align-items: center; gap: 6px; position: relative; font-weight: 400; }
select.bare { border: 0; background: transparent; padding: 2px 0; width: auto; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.right-cell { text-align: right; }
.stats-row { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.ring-stat { display: flex; align-items: center; gap: 12px; }
.ring-stat b { display: block; font-size: 22px; letter-spacing: -.02em; line-height: 1.1; }
.ring-stat span { color: var(--muted); font-size: 13px; }
.ring { width: 46px; height: 46px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring-bg { stroke: var(--field); }
.ring-fg { stroke: var(--brand); stroke-linecap: round; transition: stroke-dasharray .6s var(--ease); }
.pills-wrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ===================================================================== Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kcol { background: color-mix(in srgb, var(--field) 55%, transparent); border-radius: var(--r-l); padding: 10px; min-height: 200px; transition: background .15s, box-shadow .15s; }
.kcol.over { background: rgba(var(--brand-rgb), .12); box-shadow: inset 0 0 0 2px rgba(var(--brand-rgb), .5); }
.kcol-h { display: flex; align-items: center; gap: 4px; padding: 4px 6px 10px; font-size: 13px; }
.kcount { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 12px; background: var(--surface); border-radius: 980px; padding: 0 8px; }
.kcards { display: flex; flex-direction: column; gap: 8px; min-height: 60px; max-height: 70vh; overflow-y: auto; }
.kcard {
  display: flex; flex-direction: column; gap: 6px; background: var(--surface); border-radius: 12px; padding: 11px 12px; color: var(--ink);
  box-shadow: var(--sh-1), 0 0 0 1px var(--sep-2); cursor: grab; transition: transform .15s var(--ease), box-shadow .15s;
}
.kcard:hover { opacity: 1; box-shadow: var(--sh-2); transform: translateY(-1px); }
.kcard.dragging { opacity: .4; transform: rotate(1.5deg); }
.kcard.saving { opacity: .6; }
.kcard.late { box-shadow: inset 3px 0 0 var(--red), var(--sh-1); }
.kc-acc { font-size: 11.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; }
.kt { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.kmeta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.kdate { display: inline-flex; gap: 3px; align-items: center; }
.kdate .ico { width: 13px; height: 13px; }
.kdate.bad { color: var(--red); font-weight: 600; }

/* ===================================================================== Formularios */
input, select, textarea {
  font: 15px var(--font); color: var(--ink); width: 100%; border: 1px solid transparent; border-radius: 10px; padding: 9px 12px;
  background: var(--field); transition: box-shadow .15s, background .15s; letter-spacing: -.01em;
}
input:focus, select:focus, textarea:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .25), 0 0 0 1px rgba(var(--brand-rgb), .7); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
input[type=file] { background: transparent; padding: 6px 0; }
textarea { resize: vertical; line-height: 1.5; }
label { display: block; font-weight: 500; font-size: 13px; color: var(--ink-2); }
label input, label select { margin-top: 6px; font-weight: 400; }
label.check, .toggle { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; color: var(--ink); font-size: 14px; }
label.check input, .toggle input { margin: 0; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
label.inline input { margin: 0; width: auto; }
.sel-soft { width: auto; font-size: 13px; padding: 6px 30px 6px 12px; border-radius: 980px; }
.right { float: right; }

/* Interruptor tipo iOS */
input.switch, .field.bool input[type=checkbox], .row-switch input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 31px; padding: 0; margin: 0; flex: none;
  background: var(--field); position: relative; cursor: pointer; transition: background .25s; border: 0; box-shadow: none;
}
input.switch::after, .field.bool input[type=checkbox]::after, .row-switch input[type=checkbox]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .25s var(--ease);
}
input.switch:checked, .field.bool input[type=checkbox]:checked, .row-switch input[type=checkbox]:checked { background: var(--green); }
input.switch:checked::after, .field.bool input[type=checkbox]:checked::after, .row-switch input[type=checkbox]:checked::after { transform: translateX(20px); }
input.switch.sm { width: 38px; height: 23px; }
input.switch.sm::after { width: 19px; height: 19px; }
input.switch.sm:checked::after { transform: translateX(15px); }
input.switch:focus { box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .25); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.field.full { grid-column: 1 / -1; }
.field > label { margin-bottom: 6px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.field.bool label.check { font-weight: 500; }
.req { color: var(--red); }
.help { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.form-actions { margin-top: 26px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--sep-2); padding-top: 18px; }
.img-current { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.stack .btn { align-self: flex-start; }
.row-btns { display: flex; gap: 6px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.inline-form label { font-weight: 500; }
.inline-form .grow { flex: 1; min-width: 180px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.toolbar .filters { margin: 0; }
.filters input[type=search] { width: 240px; border-radius: 980px; padding: 7px 14px; font-size: 14px; }
.filters select { width: auto; max-width: 230px; font-size: 13px; padding: 6px 30px 6px 13px; border-radius: 980px; }
.filters input[type=date] { width: auto; font-size: 13px; padding: 6px 10px; border-radius: 980px; }
.bulk-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.bulk-bar select { width: auto; font-size: 13px; padding: 6px 30px 6px 12px; border-radius: 980px; }

/* Lista agrupada estilo iOS (formularios en hojas) */
.form-list { background: var(--surface-2); border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--sep-2); margin: 12px 0; }
.row-input, .row-switch {
  display: flex; align-items: center; gap: 12px; padding: 7px 14px; border-bottom: 1px solid var(--sep-2); font-size: 14px; color: var(--ink); margin: 0; min-height: 46px;
}
.row-input:last-child, .row-switch:last-child { border-bottom: 0; }
.row-input > span:first-child, .row-switch > span:first-child { width: 150px; flex: none; color: var(--ink-2); font-weight: 500; display: flex; gap: 8px; align-items: center; }
.row-input > span:first-child .ico { color: var(--muted); }
.row-switch > span:first-child { width: auto; flex: 1; }
.row-input input, .row-input select { margin: 0; background: transparent; padding: 6px 0; border-radius: 6px; flex: 1; }
.row-input select { padding-right: 28px; }
.row-input input:focus, .row-input select:focus { box-shadow: none; background: transparent; }
.pair { display: flex; align-items: center; gap: 6px; flex: 1; }
.pair input { flex: 1; }
.pair i { color: var(--muted); font-style: normal; }

/* Barra de cambio de estado */
.status-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 18px; }
.status-bar > b { font-size: 13px; color: var(--muted); font-weight: 600; }
.status-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 0; border-radius: 980px; padding: 6px 13px; font: 600 12.5px var(--font); cursor: pointer;
  background: color-mix(in srgb, var(--c, var(--gray)) 14%, transparent); color: color-mix(in srgb, var(--c, var(--gray)) 85%, var(--ink)); transition: transform .12s, filter .15s; }
.chip:hover { filter: brightness(.95); } .chip:active { transform: scale(.96); }
.status-more { width: 100%; }
.status-more summary { cursor: pointer; color: var(--blue); font-size: 13px; font-weight: 500; margin-bottom: 10px; list-style: none; }
.status-more summary::-webkit-details-marker { display: none; }

/* ===================================================================== Detalle */
.dl { display: grid; grid-template-columns: 200px 1fr; gap: 0; margin: 0; }
.dl dt, .dl dd { padding: 10px 0; border-bottom: 1px solid var(--sep-2); margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { word-break: break-word; }
.dl dt:nth-last-child(2), .dl dd:last-child { border-bottom: 0; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 10px 0; border-top: 1px solid var(--sep-2); }
.feed li:first-child { border-top: 0; }
.feed p { margin: 4px 0 0; }
.pre { white-space: normal; }
.versions { list-style: none; margin: 0; padding: 0; }
.versions li { border-radius: 12px; padding: 12px; margin-top: 10px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--sep-2); }
.versions li.v-aprobada { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--green) 55%, transparent); }
.versions li.v-rechazada { opacity: .7; }
.v-h { display: flex; gap: 8px; align-items: center; }
.v-h b { font-size: 15px; }
.versions p { margin: 6px 0 0; }
.feedback { background: var(--field); padding: 7px 10px; border-radius: 9px; font-size: 13px; }

/* ===================================================================== KPIs / Dashboard */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpis.small { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi {
  background: var(--surface); border-radius: var(--r-l); padding: 16px 18px; box-shadow: var(--sh-2); color: var(--ink); display: block;
  position: relative; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s;
}
a.kpi:hover { opacity: 1; transform: translateY(-2px); box-shadow: var(--sh-3); }
.kpi b { display: block; font-size: 30px; line-height: 1.1; letter-spacing: -.03em; font-weight: 700; }
.kpis.small .kpi { box-shadow: none; background: var(--surface-2); box-shadow: 0 0 0 1px var(--sep-2); padding: 12px 14px; }
.kpis.small .kpi b { font-size: 22px; }
.kpi span { color: var(--muted); font-size: 12.5px; display: block; margin-top: 4px; line-height: 1.35; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--k, transparent); }
.kpi.k-green { --k: var(--green); } .kpi.k-amber { --k: var(--amber); } .kpi.k-red { --k: var(--red); } .kpi.k-brand { --k: var(--brand); }
.kpi.k-red b { color: var(--red); }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.hero .greet { font-size: 15px; color: var(--muted); margin: 0 0 4px; font-weight: 500; }

/* Agenda (dashboard) */
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: grid; grid-template-columns: 50px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--sep-2); }
.agenda li:first-child { border-top: 0; }
.agenda small { display: block; }
.ag-date { text-align: center; border-radius: 12px; padding: 5px 0; line-height: 1.05; background: var(--surface-2); box-shadow: 0 0 0 1px var(--sep-2); }
.ag-date b { font-size: 19px; display: block; letter-spacing: -.02em; }
.ag-date small { font-size: 10.5px; color: var(--red); text-transform: uppercase; font-weight: 700; }

/* ===================================================================== Hoja modal / popover / ⌘K */
.modal-bg {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, 0); transition: background .25s; backdrop-filter: blur(0);
}
.modal-bg.in { background: rgba(0, 0, 0, .32); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet {
  width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: var(--r-xl);
  background: var(--surface); box-shadow: var(--sh-3); transform: translateY(24px) scale(.97); opacity: 0;
  transition: transform .38s var(--ease), opacity .2s;
}
.sheet.wide { width: min(720px, 100%); }
.modal-bg.in .sheet { transform: none; opacity: 1; }
.sheet-h { display: flex; align-items: center; padding: 16px 18px 6px 22px; }
.sheet-h h3 { margin: 0; flex: 1; font-size: 17px; }
.sheet-b { padding: 6px 22px 10px; overflow-y: auto; }
.sheet-f { display: flex; gap: 8px; align-items: center; padding: 14px 18px 18px; border-top: 1px solid var(--sep-2); }
.sheet-f:empty { display: none; }
.sheet-errors p { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; color: var(--red); font-weight: 500; }
.qc-title { font-size: 22px; font-weight: 600; background: transparent; padding: 6px 0 8px; border-radius: 0; border-bottom: 2px solid var(--sep); letter-spacing: -.02em; }
.qc-title:focus { box-shadow: none; background: transparent; border-bottom-color: var(--brand); }
.qc .seg { margin: 14px 0 2px; }
.qc-warn p { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; color: var(--amber); font-weight: 500; }
.qc-warn p.bad { color: var(--red); }
.qc-eq-h { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 8px; gap: 8px; flex-wrap: wrap; }
.qc-eq-h b { display: inline-flex; gap: 6px; align-items: center; }
.qc-eq, .equip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 280px; overflow-y: auto; padding: 2px; }
.equip-grid { max-height: none; margin: 10px 0 16px; }
.eq-cat, .equip-cat { grid-column: 1 / -1; font-size: 11.5px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-top: 6px; letter-spacing: .03em; }
label.eq, label.equip {
  display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; cursor: pointer; font-weight: 400; color: var(--ink);
  background: var(--surface-2); box-shadow: 0 0 0 1px var(--sep-2); transition: box-shadow .15s, background .15s; flex-wrap: nowrap;
}
label.eq:hover, label.equip:hover { box-shadow: 0 0 0 1px var(--sep); }
label.eq:has(input:checked), label.equip:has(input:checked) { box-shadow: 0 0 0 2px var(--brand); background: rgba(var(--brand-rgb), .08); }
label.eq input, label.equip input { margin: 0; }
label.eq img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; flex: none; }
.eq-ph { width: 34px; height: 34px; border-radius: 8px; background: var(--field); display: grid; place-items: center; color: var(--muted); flex: none; }
label.eq span, label.equip span { min-width: 0; font-size: 13px; line-height: 1.3; }
label.eq small, label.equip small { display: block; color: var(--muted); font-size: 11.5px; }
label.eq.busy, label.equip.busy { opacity: .5; cursor: not-allowed; }
label.eq.busy small, label.equip.busy small { color: var(--red); }
details.reserve { margin-top: 12px; }
details.reserve summary { cursor: pointer; font-weight: 600; color: var(--blue); list-style: none; }

.popover {
  position: fixed; z-index: 120; width: 330px; border-radius: 16px; background: var(--glass);
  backdrop-filter: saturate(180%) blur(28px); -webkit-backdrop-filter: saturate(180%) blur(28px);
  box-shadow: var(--sh-3); border: 1px solid var(--sep); opacity: 0; transform: scale(.96); transition: opacity .15s, transform .22s var(--ease);
}
.popover.in { opacity: 1; transform: none; }
.pop-h { display: flex; gap: 12px; align-items: flex-start; padding: 16px 12px 8px 16px; }
.pop-h h4 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.pop-h p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.pop-h > div { flex: 1; }
.sq { width: 14px; height: 14px; border-radius: 4px; background: var(--c); flex: none; margin-top: 4px; }
.pop-b { padding: 4px 16px 10px; }
.pop-r { display: flex; gap: 10px; align-items: center; padding: 5px 0; font-size: 13.5px; }
.pop-r.top { align-items: flex-start; }
.pop-r .ico { color: var(--muted); width: 17px; height: 17px; }
.pop-f { display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--sep-2); }

.cmdk { position: fixed; inset: 0; z-index: 180; background: rgba(0, 0, 0, 0); display: flex; justify-content: center; padding-top: 12vh; transition: background .2s; }
.cmdk.in { background: rgba(0, 0, 0, .25); }
.cmdk-box {
  width: min(640px, 92vw); height: fit-content; max-height: 66vh; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden;
  background: var(--glass); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--sh-3); border: 1px solid var(--sep); transform: scale(.97); opacity: 0; transition: transform .25s var(--ease), opacity .15s;
}
.cmdk.in .cmdk-box { transform: none; opacity: 1; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--sep); }
.cmdk-in .ico { width: 21px; height: 21px; color: var(--muted); }
.cmdk-in input { background: transparent; font-size: 19px; padding: 4px 0; border-radius: 0; }
.cmdk-in input:focus { box-shadow: none; background: transparent; }
.cmdk-list { overflow-y: auto; padding: 6px; }
.cmdk-g { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 10px 12px 4px; }
.cmdk-it { display: flex; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 10px; color: var(--ink); }
.cmdk-it .ico { color: var(--muted); }
.cmdk-it span { min-width: 0; }
.cmdk-it b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-it small { display: block; color: var(--muted); font-size: 12px; }
.cmdk-it.on, .cmdk-it:hover { background: var(--blue); color: #fff; opacity: 1; }
.cmdk-it.on .ico, .cmdk-it.on small, .cmdk-it:hover .ico, .cmdk-it:hover small { color: rgba(255, 255, 255, .85); }
.cmdk-empty { padding: 30px; text-align: center; color: var(--muted); }

/* ===================================================================== Calendario (tipo Google) */
.content:has(.gcal) { max-width: none; padding: 0; }
.gcal { display: grid; grid-template-columns: 264px minmax(0, 1fr); height: calc(100vh - 52px); }
.gcal-side { padding: 18px 16px; overflow-y: auto; border-right: 1px solid var(--sep-2); }
.create-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 22px 0 16px; border-radius: 16px; border: 0; cursor: pointer;
  background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 4px 10px rgba(0, 0, 0, .06); font: 600 14px var(--font); color: var(--ink);
  transition: box-shadow .2s, transform .12s; margin-bottom: 18px;
}
.create-btn .ico { width: 24px; height: 24px; color: var(--brand); stroke-width: 2.4; }
.create-btn:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, .14), 0 8px 20px rgba(0, 0, 0, .08); }
.create-btn:active { transform: scale(.98); }
.gcal-sec { margin-top: 20px; }
.gcal-sec h4 { margin: 0 0 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.gcal-sec select { margin-bottom: 8px; width: 100%; }
.kbd-help { line-height: 2; }
.layer { display: flex; align-items: center; gap: 10px; padding: 6px 4px; font-size: 14px; color: var(--ink); cursor: pointer; border-radius: 8px; font-weight: 500; }
.layer:hover { background: var(--hover); }
.layer input { display: none; }
.layer .sw { width: 18px; height: 18px; border-radius: 5px; box-shadow: inset 0 0 0 2px var(--c); position: relative; transition: background .15s; }
.layer input:checked + .sw { background: var(--c); }
.layer input:checked + .sw::after { content: ""; position: absolute; left: 6px; top: 2px; width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.mini-h { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 6px 6px; font-size: 14px; }
.mini-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; text-align: center; }
.mini-dn { font-size: 10.5px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.mini-d { position: relative; border: 0; background: none; font: 500 12px var(--font); color: var(--ink); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; margin: 0 auto; }
.mini-d:hover { background: var(--hover); }
.mini-d.out { color: var(--faint); }
.mini-d.inr { background: rgba(var(--brand-rgb), .12); border-radius: 0; width: 100%; }
.mini-d.today { color: #fff; background: var(--brand); border-radius: 50%; width: 30px; font-weight: 700; }
.mini-d.sel:not(.today) { box-shadow: inset 0 0 0 1.5px var(--brand); border-radius: 50%; width: 30px; font-weight: 700; }
.mini-d i { position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--brand); }
.mini-d.today i { background: #fff; }

.gcal-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.gcal-bar { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--sep-2); flex-wrap: wrap; }
.nav-arrows { display: flex; }
.gcal-title { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-left: 6px; }
.gcal-meta { font-size: 13px; }
.gcal-bar .seg { margin-left: auto; }
.gcal-body { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; transition: opacity .15s; }
.gcal-body.busy { opacity: .6; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.free { font-size: 10.5px; font-weight: 700; color: var(--green); text-transform: uppercase; letter-spacing: .03em; }

/* Eventos comunes */
.ev { cursor: pointer; user-select: none; -webkit-user-select: none; }
.ev.dim { opacity: .45; text-decoration: line-through; }
.ev.chip {
  display: flex; align-items: center; gap: 5px; font-size: 12px; line-height: 1.35; padding: 2px 7px; border-radius: 6px; color: var(--ink);
  white-space: nowrap; overflow: hidden; margin-bottom: 2px; transition: background .12s;
}
.ev.chip span { overflow: hidden; text-overflow: ellipsis; }
.ev.chip:hover { background: var(--hover); }
.ev.chip.t-lev { background: color-mix(in srgb, var(--c) 18%, transparent); color: color-mix(in srgb, var(--c) 70%, var(--ink)); font-weight: 500; }
.ev.chip.t-lev b { font-weight: 700; }
.ev.chip .dot-s { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.ev.chip .ico { width: 13px; height: 13px; color: var(--amber); }
.ev.chip.dragging { opacity: .4; }
.more { border: 0; background: none; font: 600 11.5px var(--font); color: var(--muted); padding: 1px 7px; cursor: pointer; border-radius: 6px; text-align: left; }
.more:hover { background: var(--hover); color: var(--ink); }

/* Mes */
.mo { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.mo-h { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--sep-2); }
.mo-h div { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; text-align: center; padding: 8px 0 6px; }
.mo-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); flex: 1; min-height: 560px; }
.mo-c { border-right: 1px solid var(--sep-2); border-bottom: 1px solid var(--sep-2); padding: 4px 5px; min-width: 0; overflow: hidden; cursor: pointer; transition: background .12s; }
.mo-c:nth-child(7n) { border-right: 0; }
.mo-c:hover { background: color-mix(in srgb, var(--hover) 60%, transparent); }
.mo-c.wk { background: color-mix(in srgb, var(--field) 25%, transparent); }
.mo-c.out .mo-n .num { color: var(--faint); }
.mo-c.drop { background: rgba(var(--brand-rgb), .14); }
.mo-n { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 4px; }
.mo-n .num { font-size: 12.5px; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.mo-n .num:hover { background: var(--field); }
.mo-c.today .num { background: var(--brand); color: #fff; }
.mo-c.past .mo-n .num { color: var(--muted); }
.mo-c.today.past .num { color: #fff; }

/* Semana / Día */
.wk { display: flex; flex-direction: column; flex: 1; min-height: 0; --gut: 58px; }
.wk-head, .wk-all, .wk-grid { display: grid; grid-template-columns: var(--gut) repeat(var(--n), minmax(0, 1fr)); }
.wk-head { padding-top: 8px; }
.wk-dh { text-align: center; padding-bottom: 6px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.wk-dh .dn { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.wk-dh .dd { font-size: 24px; font-weight: 500; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; letter-spacing: -.02em; }
.wk-dh .dd:hover { background: var(--hover); }
.wk-dh.today .dn { color: var(--brand); }
.wk-dh.today .dd { background: var(--brand); color: #fff; font-weight: 600; }
.wk-all { border-bottom: 1px solid var(--sep); }
.wk-all .gut { font-size: 10px; color: var(--muted); text-align: right; padding: 4px 8px 0 0; line-height: 1.15; }
.wk-ad { border-left: 1px solid var(--sep-2); padding: 3px; min-height: 30px; cursor: pointer; }
.wk-ad.drop { background: rgba(var(--brand-rgb), .14); }
.wk-body { flex: 1; overflow-y: auto; position: relative; }
.wk-grid { position: relative; }
.hours .hr { height: 48px; position: relative; }
.hours .hr span { position: absolute; top: -7px; right: 8px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wk-col {
  position: relative; border-left: 1px solid var(--sep-2); height: calc(48px * 24); cursor: cell;
  background-image: linear-gradient(to bottom, var(--sep-2) 1px, transparent 1px); background-size: 100% 48px;
}
.wk-col.wkend { background-color: color-mix(in srgb, var(--field) 22%, transparent); }
.ev.blk {
  position: absolute; border-radius: 7px; padding: 4px 7px; overflow: hidden; font-size: 12px; line-height: 1.3; z-index: 2;
  background: color-mix(in srgb, var(--c) 20%, var(--surface)); color: color-mix(in srgb, var(--c) 65%, var(--ink));
  border-left: 3.5px solid var(--c); box-shadow: 0 0 0 1px var(--surface); transition: box-shadow .15s;
}
.ev.blk.editable { cursor: grab; }
.ev.blk:hover { box-shadow: 0 0 0 1px var(--surface), 0 4px 12px rgba(0, 0, 0, .12); z-index: 3; }
.ev.blk.dragging { box-shadow: 0 10px 28px rgba(0, 0, 0, .25); z-index: 10; cursor: grabbing; opacity: .95; }
.ev.blk.ghost { background: rgba(var(--brand-rgb), .85); color: #fff; border-left-color: var(--brand); box-shadow: 0 6px 20px rgba(0, 0, 0, .2); left: 1px; width: calc(100% - 4px); z-index: 10; }
.blk-t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk-m { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.ev.blk.short .blk-m:last-of-type { display: none; }
.rsz { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.wk-col .now { position: absolute; left: -5px; right: 0; height: 2px; background: var(--red); z-index: 5; pointer-events: none; }
.wk-col .now::before { content: ""; position: absolute; left: 0; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

/* Agenda */
.agenda-v { overflow-y: auto; padding: 8px 20px 40px; }
.ag-day { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sep-2); }
.ag-d b { font-size: 26px; font-weight: 500; letter-spacing: -.02em; display: block; line-height: 1; }
.ag-d span { font-size: 12px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.ag-day.today .ag-d b { color: var(--brand); }
.ag-list { display: flex; flex-direction: column; gap: 2px; }
.ag-row { display: grid; grid-template-columns: 14px 120px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; }
.ag-row:hover { background: var(--hover); }
.ag-time { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ag-t b { font-weight: 600; display: block; }
.ag-t small, .ag-eq { color: var(--muted); font-size: 12.5px; }

/* ===================================================================== Login */
.login-body {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1000px 520px at 15% -10%, rgba(var(--brand-rgb), .16), transparent 60%), radial-gradient(800px 480px at 100% 110%, rgba(var(--brand-rgb), .10), transparent 60%), var(--bg);
}
.login { width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px; padding: 36px 32px; border-radius: 26px; background: var(--glass);
  backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px); box-shadow: var(--sh-3); border: 1px solid var(--sep); }
.login-brand { text-align: center; padding-bottom: 6px; }
.login-brand img { width: 230px; max-width: 80%; height: auto; }
.login-brand p { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.login label input { margin-top: 6px; padding: 12px 14px; }

/* ===================================================================== Paginación */
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 18px 0; color: var(--muted); font-size: 13px; }

/* ===================================================================== Responsivo */
@media (max-width: 1180px) { .show-grid, .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 980px) {
  .gcal { grid-template-columns: 1fr; height: calc(100dvh - 52px); }
  .fab { display: grid !important; }
  .gcal-side { display: none; }
  .mo-g { min-height: 480px; }
  .ag-row { grid-template-columns: 14px 90px 1fr; } .ag-eq { grid-column: 3; }
}
@media (max-width: 860px) {
  .side { position: fixed; left: 0; transform: translateX(-105%); transition: transform .3s var(--ease); }
  .side.open { transform: none; box-shadow: var(--sh-3); }
  body.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 25; }
  .icon-btn.burger { display: inline-grid; }
  .top { padding: 0 12px; }
  .top-title { opacity: 1; }
  .top-logo { display: block; }
  .content { padding: 18px 14px 50px; }
  h1 { font-size: 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; } .dl dt { padding-bottom: 0; border: 0; } .dl dd { padding-top: 2px; }
  .gcal-bar { padding: 10px 12px; } .gcal-title { font-size: 18px; } .gcal-bar .seg { margin-left: 0; width: 100%; } .gcal-bar .seg button { flex: 1; justify-content: center; }
  .wk { --gut: 44px; }
  .row-input > span:first-child { width: 110px; }
  .toasts { left: 12px; right: 12px; align-items: stretch; }
}
@media print {
  .side, .top, .filters, .actions, .status-bar, .stack, .inline-form, details, .toasts { display: none !important; }
  .content { padding: 0; } .card { box-shadow: none; border: 1px solid #ddd; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.person, .acc-link { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 500; }
.person small { display: block; font-size: 11.5px; }
.person span { line-height: 1.2; }
.act-d { margin: 3px 0 0 32px; }
.feed.history .avatar { vertical-align: middle; margin-right: 4px; }

.fab {
  display: none; position: fixed; right: 18px; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 40; width: 58px; height: 58px; border-radius: 18px; border: 0;
  place-items: center; background: var(--brand); color: #fff; box-shadow: 0 8px 24px rgba(var(--brand-rgb), .45), 0 2px 6px rgba(0,0,0,.15); cursor: pointer;
}
.fab .ico { width: 26px; height: 26px; stroke-width: 2.4; }
.toast.warn { color: var(--ink); font-weight: 500; }


/* =====================================================================
   v1.2 · componentes nuevos
   ===================================================================== */
.hide-sm {} .ok-t { color: var(--green); }
.more-link { display: block; text-align: center; padding: 10px 0 0; font-weight: 500; font-size: 13px; }
.empty-state.small { padding: 22px 10px; }
.empty-state.small .ico { width: 28px; height: 28px; }
h1 small { font-size: 16px; }
.kpi b small { font-size: 16px; color: var(--muted); font-weight: 600; }
.grp-h { font-size: 19px; margin: 26px 0 12px; }
.grp-h small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 2px; }

/* Colores (swatches) */
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 5px; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); vertical-align: middle; }
.swatch.lg { width: 22px; height: 22px; border-radius: 7px; }
.color-in { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.color-in input[type=color] { width: 44px; height: 38px; padding: 3px; border-radius: 10px; cursor: pointer; flex: none; }
.color-in input[type=text] { width: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.form-section { grid-column: 1 / -1; padding-top: 18px; margin-top: 6px; border-top: 1px solid var(--sep-2); }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-section h3 { margin: 0; font-size: 19px; }
.form-section p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* Semáforo de fechas */
.legend-sema { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-left: auto; }
.legend-sema span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.lg.late { background: color-mix(in srgb, var(--red) 18%, var(--surface)); box-shadow: inset 3px 0 0 var(--red); }
.lg.due-today { background: color-mix(in srgb, var(--amber) 22%, var(--surface)); box-shadow: inset 3px 0 0 var(--amber); }
.lg.due-soon { background: color-mix(in srgb, #FFCC00 22%, var(--surface)); box-shadow: inset 3px 0 0 #FFCC00; }

/* ================= Hoja de parrilla (tipo Excel) ================= */
.sheet-wrap { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-2); overflow: hidden; display: flex; flex-direction: column; }
.sheet-scroll { overflow: auto; max-height: calc(100vh - 290px); min-height: 360px; }
table.xl { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1480px; table-layout: fixed; font-size: 13px; }
.xl col.c-n { width: 40px; } .xl col.c-dia { width: 82px; } .xl col.c-fecha { width: 92px; } .xl col.c-cuenta { width: 160px; }
.xl col.c-tema { width: 330px; } .xl col.c-tipo { width: 104px; } .xl col.c-sec { width: 120px; } .xl col.c-copy { width: 112px; }
.xl col.c-status { width: 132px; } .xl col.c-hist { width: 150px; } .xl col.c-hst { width: 108px; } .xl col.c-resp { width: 140px; } .xl col.c-arch { width: 64px; }
.xl thead th { position: sticky; z-index: 3; background: var(--surface-2); font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--ink-2);
  text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--sep); border-right: 1px solid var(--sep-2); white-space: nowrap; top: 34px; }
.xl thead tr.xl-title th { top: 0; height: 34px; font-size: 13px; letter-spacing: -.01em; text-transform: none; font-weight: 700; color: #fff; background: var(--brand); border: 0; padding: 0 12px; }
.xl td { border-bottom: 1px solid var(--sep-2); border-right: 1px solid var(--sep-2); padding: 0; height: 34px; vertical-align: middle; background: var(--surface); transition: background .2s; }
.xl td.xn { color: var(--faint); font-size: 11px; text-align: center; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.xl td.xd { padding: 0 8px; color: var(--muted); text-transform: capitalize; }
.xl td.xf { padding: 0 8px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.xl td.xc { padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xl td.xc a { color: var(--ink-2); font-weight: 500; display: inline-flex; align-items: center; }
.xl td.xa { text-align: center; white-space: nowrap; }
.xl tr.wkstart td { border-top: 2px solid var(--sep); }
.xl tr.wkend td:not(.xn) { background: color-mix(in srgb, var(--field) 28%, var(--surface)); }
.xl tr.today td.xd, .xl tr.today td.xf { color: var(--brand); font-weight: 700; }
.xl tr.late td:not(.xn) { background: color-mix(in srgb, var(--red) 9%, var(--surface)); }
.xl tr.late td.xn { box-shadow: inset 3px 0 0 var(--red); color: var(--red); }
.xl tr.due-today td:not(.xn) { background: color-mix(in srgb, var(--amber) 12%, var(--surface)); }
.xl tr.due-today td.xn { box-shadow: inset 3px 0 0 var(--amber); }
.xl tr.due-soon td:not(.xn) { background: color-mix(in srgb, #FFCC00 10%, var(--surface)); }
.xl tr.due-soon td.xn { box-shadow: inset 3px 0 0 #FFCC00; }
.xl tr.selrow td.xn { background: rgba(var(--brand-rgb), .14); color: var(--brand); }
.xl td.cell input, .xl td.cell select {
  width: 100%; height: 33px; border: 0; border-radius: 0; background: transparent; padding: 0 8px; font: 13px var(--font); color: var(--ink); box-shadow: none; margin: 0;
}
.xl td.cell select { padding-right: 22px; background-position: right 6px center; background-size: 10px; cursor: pointer; }
.xl td.cell input::placeholder { color: var(--faint); }
.xl td.cell.sel { box-shadow: inset 0 0 0 2px var(--brand); position: relative; z-index: 1; }
.xl td.cell input:focus, .xl td.cell select:focus { box-shadow: none; background: rgba(var(--brand-rgb), .05); outline: none; }
.xl td.cell.saving { background-image: linear-gradient(90deg, transparent, rgba(var(--brand-rgb), .18), transparent); background-size: 200% 100%; animation: shimmer 1s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.xl td.cell.saved { background: color-mix(in srgb, var(--green) 16%, var(--surface)) !important; }
.xl td.cell.error { background: color-mix(in srgb, var(--red) 18%, var(--surface)) !important; }
.xl select.st { font-weight: 600; }
.xl select.st-gray { color: var(--gray); } .xl select.st-green { color: var(--green); } .xl select.st-amber { color: var(--amber); }
.xl select.st-red { color: var(--red); } .xl select.st-blue { color: var(--blue); } .xl select.st-violet { color: var(--violet); } .xl select.st-teal { color: var(--teal); }
.xl select.st-none { color: var(--faint); }
.xl td.cell:has(select.st-green) { background: color-mix(in srgb, var(--green) 8%, transparent); }
.xl td.cell:has(select.st-violet) { background: color-mix(in srgb, var(--violet) 8%, transparent); }
.xl td.cell:has(select.st-amber) { background: color-mix(in srgb, var(--amber) 10%, transparent); }
.xl td.cell:has(select.st-red) { background: color-mix(in srgb, var(--red) 10%, transparent); }
.xl td.cell:has(select.st-teal) { background: color-mix(in srgb, var(--teal) 9%, transparent); }
.xl td.cell:has(select.st-blue) { background: color-mix(in srgb, var(--blue) 8%, transparent); }
.xs-hint { font-size: 10.5px; }
.xl-tabs { display: flex; align-items: center; gap: 2px; padding: 6px 10px; border-top: 1px solid var(--sep); background: var(--surface-2); overflow-x: auto; }
.xl-tabs a { padding: 6px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 13px; white-space: nowrap; display: inline-flex; gap: 5px; align-items: center; }
.xl-tabs a:hover { background: var(--hover); opacity: 1; }
.xl-tabs a.on { background: var(--surface); color: var(--brand); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.xl-tabs a.cur:not(.on) { color: var(--brand); }
.xl-tabs a small { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.xl-tabs .xl-y { padding: 0 6px; font-size: 13px; }
.xl-tabs .xl-yr { padding: 6px; }

/* Ciclo de la parrilla */
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.flow-step { display: flex; gap: 10px; align-items: center; background: var(--surface); border-radius: 14px; padding: 12px; box-shadow: var(--sh-2); flex-wrap: wrap; }
.flow-step > div { flex: 1; min-width: 0; }
.flow-step b { display: block; font-size: 13.5px; }
.flow-step small { color: var(--muted); font-size: 12px; }
.fs-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--field); color: var(--muted); flex: none; }
.fs-dot .ico { width: 16px; height: 16px; }
.flow-step.done .fs-dot { background: var(--green); color: #fff; }
.flow-step.fs-now .fs-dot { background: var(--brand); color: #fff; }
.flow-step.fs-now { box-shadow: 0 0 0 2px rgba(var(--brand-rgb), .4); }

/* ================= Campana de alertas ================= */
.bell { position: relative; }
.bell .bdg { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.bell.urgent .bdg { background: var(--red); }
.bell.urgent .ico { animation: ring 2.4s ease-in-out infinite; transform-origin: top center; }
@keyframes ring { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(14deg); } 88% { transform: rotate(-12deg); } 92% { transform: rotate(8deg); } 96% { transform: rotate(-4deg); } }
.notif-menu { width: 380px; max-width: calc(100vw - 24px); padding: 8px; }
.nm-h { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 8px; }
.nm-empty { padding: 14px 8px; margin: 0; }
.menu a.nm-it { display: grid; grid-template-columns: 8px 1fr; gap: 10px; align-items: start; padding: 9px 8px; border-radius: 10px; }
.nm-it i { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--blue); }
.nm-it.nv-danger i { background: var(--red); } .nm-it.nv-warn i { background: var(--amber); }
.nm-it.read { opacity: .55; } .nm-it.read i { background: var(--faint); }
.nm-it b { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; }
.nm-it small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.menu a.nm-it:hover small { color: rgba(255,255,255,.85); }
.menu a.nm-all { justify-content: center; color: var(--blue); font-weight: 600; font-size: 13px; margin-top: 4px; border-top: 1px solid var(--sep-2); border-radius: 0 0 8px 8px; }
.toast b { font-weight: 600; } .toast small { color: var(--muted); }
a.toast { color: var(--ink); }

.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--sep-2); }
.notif-list.compact li { padding: 10px 0; }
.notif-list li:last-child { border-bottom: 0; }
.notif-list li.read { opacity: .55; }
.notif-list form { margin: 0; }
.n-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.nv-danger .n-ico, .n-ico.nv-danger { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.nv-warn .n-ico, .n-ico.nv-warn { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.n-b { flex: 1; min-width: 0; color: var(--ink); }
.n-b b { display: block; font-weight: 600; }
.n-b span { display: block; color: var(--muted); font-size: 13px; }
.rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.rule { margin: 0; padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: opacity .2s; }
.rule.off { opacity: .55; }
.rule-h { display: flex; gap: 12px; align-items: flex-start; }
.rule-h > div { flex: 1; }
.rule-h b { display: block; }
.rule-h small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; margin-top: 2px; }
.rule-b { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.rule-b label { font-size: 12px; color: var(--muted); font-weight: 500; }
.rule-b label select { margin-top: 4px; font-size: 13px; padding: 6px 28px 6px 10px; }
.rule-b label.toggle { grid-column: 1 / -1; color: var(--ink-2); font-size: 13px; }
.num-in { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); margin-top: 4px; }
.num-in input { width: 64px; padding: 6px 8px; text-align: center; font-size: 14px; margin: 0; }
table.plazos td { white-space: nowrap; }

/* ================= Clientes ================= */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.ccard { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-2); padding: 18px; color: var(--ink); display: flex; flex-direction: column; gap: 6px; transition: transform .2s var(--ease), box-shadow .2s; }
.ccard:hover { opacity: 1; transform: translateY(-2px); box-shadow: var(--sh-3); }
.ccard.off { opacity: .55; }
.cc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.cc-logo { width: 54px; height: 54px; border-radius: 14px; object-fit: contain; background: var(--surface-2); box-shadow: 0 0 0 1px var(--sep-2); }
.cc-logo.ini, .fh-ini { display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 19px; background: linear-gradient(145deg, hsl(var(--h) 55% 58%), hsl(calc(var(--h) + 25) 55% 44%)); box-shadow: none; }
.cc-name { font-size: 16px; letter-spacing: -.015em; }
.cc-sub { color: var(--muted); font-size: 13px; }
.cc-bar { margin-top: 8px; } .cc-bar small { color: var(--muted); font-size: 12px; }
.cc-foot { display: flex; align-items: center; gap: 5px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--sep-2); }
.ficha-hero { display: flex; gap: 20px; align-items: flex-end; margin-bottom: 22px; flex-wrap: wrap; }
.fh-logo img, .fh-ini { width: 96px; height: 96px; border-radius: 24px; object-fit: contain; background: var(--surface); box-shadow: var(--sh-2); display: block; }
.fh-ini { font-size: 34px; }
.fh-main { flex: 1; min-width: 240px; }
.fh-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.avatar.xs { width: 18px; height: 18px; font-size: 8px; }
.ficha-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.fcard { margin: 0; }
.fcard.wide { grid-column: 1 / -1; }
.fcard h3 { display: flex; align-items: center; gap: 8px; }
.fcard h3 .ico { color: var(--brand); }
.fl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 0; }
.fi dt { font-size: 12px; color: var(--muted); }
.fi dd { margin: 2px 0 0; font-weight: 500; word-break: break-word; }
.brand-row { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: start; }
.brand-row .fl { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
.brand-logo-box { aspect-ratio: 1; border-radius: 18px; background: repeating-conic-gradient(var(--field) 0 25%, transparent 0 50%) 50% / 16px 16px; display: grid; place-items: center; padding: 14px; box-shadow: 0 0 0 1px var(--sep-2); }
.brand-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.palette { display: flex; gap: 12px; flex-wrap: wrap; }
.pal { width: 120px; border-radius: 14px; overflow: hidden; background: var(--surface-2); box-shadow: 0 0 0 1px var(--sep-2); }
.pal span { display: block; height: 72px; }
.pal b { display: block; font-size: 12px; padding: 8px 10px 0; }
.pal code { display: block; font-size: 12px; padding: 0 10px 8px; color: var(--muted); }
.brief { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bq { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; box-shadow: 0 0 0 1px var(--sep-2); }
.bq h4 { margin: 0 0 4px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.bq p { margin: 0; }
.bq.si { box-shadow: inset 3px 0 0 var(--green), 0 0 0 1px var(--sep-2); }
.bq.no { box-shadow: inset 3px 0 0 var(--red), 0 0 0 1px var(--sep-2); }

/* ================= Inventario ================= */
.egrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.ecard { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-2); overflow: hidden; color: var(--ink); display: flex; flex-direction: column; transition: transform .2s var(--ease), box-shadow .2s; }
.ecard:hover { opacity: 1; transform: translateY(-2px); box-shadow: var(--sh-3); }
.ecard.off { opacity: .5; }
.ec-img { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(180deg, var(--surface-2), var(--bg2)); display: grid; place-items: center; color: var(--faint); }
.ec-img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.ec-img .ico { width: 44px; height: 44px; stroke-width: 1.2; }
.ec-id { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.72); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; letter-spacing: .03em; }
.ec-b { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.ec-b b { font-size: 15px; }
.ec-f { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.ec-out { color: var(--blue); font-weight: 500; }
.ec-b .ico { width: 13px; height: 13px; vertical-align: -2px; }
.inv-ficha { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-2); overflow: hidden; margin-bottom: 20px; }
.inv-h { display: flex; gap: 14px; align-items: center; padding: 16px 22px; background: linear-gradient(135deg, var(--brand-dark), color-mix(in srgb, var(--brand) 55%, var(--brand-dark))); color: #fff; flex-wrap: wrap; }
.inv-h > div:first-child { flex: 1; }
.inv-h b { display: block; font-size: 19px; letter-spacing: -.01em; }
.inv-h span { font-size: 12px; opacity: .8; text-transform: uppercase; letter-spacing: .06em; }
.inv-id { background: rgba(255,255,255,.14); border-radius: 12px; padding: 6px 14px; text-align: center; }
.inv-id small { display: block; font-size: 10.5px; opacity: .8; text-transform: uppercase; letter-spacing: .05em; }
.inv-id b { font-size: 16px; }
.inv-b { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; padding: 22px; }
.inv-dl { display: grid; grid-template-columns: 130px 1fr; margin: 0; align-content: start; }
.inv-dl dt, .inv-dl dd { padding: 9px 0; border-bottom: 1px solid var(--sep-2); margin: 0; }
.inv-dl dt { color: var(--muted); font-size: 13px; }
.inv-dl dd { font-weight: 500; }
.inv-photo { grid-row: span 1; }
.inv-photo img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 16px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--sep-2); }
.inv-ph { aspect-ratio: 1; border-radius: 16px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--sep-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); }
.inv-ph .ico { width: 42px; height: 42px; stroke-width: 1.2; }
.inv-full { grid-column: 1 / -1; display: grid; grid-template-columns: 130px 1fr; padding-top: 4px; }
.inv-full dt { color: var(--muted); font-size: 13px; } .inv-full dd { margin: 0; font-weight: 500; }

/* ================= Dashboard ================= */
.att { display: flex; flex-direction: column; }
.att h3 { display: flex; align-items: center; gap: 10px; }
.att-list { display: flex; flex-direction: column; }
.att-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 24px; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 12px; color: var(--ink); }
.att-row:hover { background: var(--hover); opacity: 1; }
.att-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.att-row.late .att-ico { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.att-row.soon .att-ico { background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--amber); }
.att-ico .ico { width: 16px; height: 16px; }
.att-t { min-width: 0; }
.att-t b { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-t small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-n { font-size: 12px; text-align: right; color: var(--muted); }
.att-row.late .att-n { color: var(--red); font-weight: 500; }
.att-n em { display: inline-block; margin-left: 6px; font-style: normal; font-weight: 700; background: var(--red); color: #fff; border-radius: 6px; padding: 0 6px; }
.today-list { display: flex; flex-direction: column; }
.td-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--sep-2); color: var(--ink); }
.td-row:last-child { border-bottom: 0; }
.td-row b { display: block; font-weight: 500; }
.td-row small { color: var(--muted); font-size: 12px; }
.ag-date.is-today { background: var(--brand); color: #fff; box-shadow: none; }
.ag-date.is-today small { color: #fff; }
.agenda small .ico { width: 13px; height: 13px; vertical-align: -2px; }
.sem-list { display: flex; flex-direction: column; }
.sem-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--sep-2); color: var(--ink); }
.sem-row:last-child { border-bottom: 0; }
.sem-row:hover { background: var(--hover); opacity: 1; }
.sem-row .dot { width: 9px; height: 9px; flex: none; }
.sem-n { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sem-n small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.sem-bar { width: 150px; flex: none; } .sem-bar small { font-size: 11px; color: var(--muted); }
.sem-stats { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
table.ciclo td { white-space: nowrap; }

/* ================= Calendario de publicaciones ================= */
.mode-seg { margin-right: 6px; }
.mode-seg button { font-weight: 600; }
.ev.chip.t-pub { background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--ink); border-left: 3px solid var(--c); border-radius: 5px; gap: 6px; }
.ev.chip.t-pub .dot-s.acc { background: var(--c); }
.ev.chip.t-pub .dot-s.acc.c-blue { --c: var(--blue); } .ev.chip.t-pub .dot-s.acc.c-green { --c: var(--green); } .ev.chip.t-pub .dot-s.acc.c-amber { --c: var(--amber); }
.ev.chip.t-pub .dot-s.acc.c-red { --c: var(--red); } .ev.chip.t-pub .dot-s.acc.c-violet { --c: var(--violet); } .ev.chip.t-pub .dot-s.acc.c-teal { --c: var(--teal); }
.ev.chip.t-pub .dot-s.acc.c-pink { --c: var(--pink); } .ev.chip.t-pub .dot-s.acc.c-gray { --c: var(--gray); }
.ev.chip.t-pub b { font-weight: 600; }
.ev.chip.t-pub em { margin-left: auto; font-style: normal; font-size: 10.5px; color: var(--muted); flex: none; }
.ev.chip.late { box-shadow: inset 0 0 0 1.5px var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.st-legend { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.st-legend span { display: flex; align-items: center; gap: 4px; }
.cols { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); flex: 1; min-height: 0; overflow-y: auto; }
.col-d { border-right: 1px solid var(--sep-2); display: flex; flex-direction: column; min-width: 0; }
.col-d:last-child { border-right: 0; }
.col-d.wkend { background: color-mix(in srgb, var(--field) 22%, transparent); }
.col-h { display: flex; flex-direction: column; align-items: center; padding: 10px 0 8px; border-bottom: 1px solid var(--sep-2); position: sticky; top: 0; background: var(--bg); z-index: 1; }
.col-h .dn { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.col-h .dd { font-size: 24px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.col-h small { font-size: 11px; color: var(--muted); min-height: 14px; }
.col-d.today .col-h .dd { background: var(--brand); color: #fff; font-weight: 600; }
.col-b { flex: 1; padding: 6px; border: 0 !important; overflow: visible; min-height: 420px; }
.col-b .ev.chip { white-space: normal; align-items: flex-start; padding: 5px 7px; }
.add-here { width: 100%; border: 1px dashed var(--sep); background: transparent; color: var(--muted); border-radius: 8px; padding: 6px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.col-d:hover .add-here { opacity: 1; }
.pop-menu { display: flex; flex-direction: column; padding: 6px; }
.pop-menu a, .pop-menu button { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; color: var(--ink); background: none; border: 0; font: 500 13.5px var(--font); text-align: left; cursor: pointer; }
.pop-menu a:hover, .pop-menu button:hover { background: var(--blue); color: #fff; opacity: 1; }
.pop-menu .danger { color: var(--red); }
.popover.narrow { width: 290px; }

/* ================= Responsivo ================= */
@media (max-width: 1180px) {
  .flow { grid-template-columns: 1fr 1fr; }
  .inv-b { grid-template-columns: 1fr; } .inv-photo { order: -1; max-width: 340px; }
}
@media (max-width: 860px) {
  .hide-sm { display: none; }
  .ficha-grid, .brief, .fl, .brand-row, .brand-row .fl { grid-template-columns: 1fr; }
  .rules { grid-template-columns: 1fr; }
  .rule-b { grid-template-columns: 1fr; }
  .legend-sema { margin-left: 0; }
  .sheet-scroll { max-height: calc(100vh - 230px); }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi b { font-size: 24px; }
  .att-row { grid-template-columns: 30px minmax(0, 1fr) 24px; }
  .att-n { grid-column: 2; text-align: left; }
  .sem-bar { width: 96px; } .sem-stats { display: none; }
  .page-h .actions, .hero .actions { width: 100%; }
  .flow { grid-template-columns: 1fr; }
  .cgrid, .egrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .gcal-bar .mode-seg { width: 100%; } .gcal-bar .mode-seg button { flex: 1; justify-content: center; }
  .cols { grid-template-columns: 1fr; } .col-b { min-height: 0; }
  .inv-dl, .inv-full { grid-template-columns: 110px 1fr; }
  .filters input[type=search] { width: 100%; }
  .toolbar { gap: 10px; }
}
.fh-logo .fh-ini { background: linear-gradient(145deg, hsl(var(--h) 55% 58%), hsl(calc(var(--h) + 25) 55% 44%)); color: #fff; display: grid; place-items: center; }
.gcal.mode-pub .mo-g { grid-template-rows: repeat(6, minmax(128px, auto)); }
.gcal.mode-pub .mo-c { overflow: visible; }
.gcal.mode-pub .gcal-body { overflow-y: auto; }
.grid2 > *, .ficha-grid > *, .show-grid > *, .kpis > * { min-width: 0; }
.fi dd, .fi dt { overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .sem-row .pill { flex: none; }
}
.menu, .popover, .cmdk-box, .toast { background: color-mix(in srgb, var(--surface) 94%, transparent); }
@media (prefers-color-scheme: dark) { .menu, .popover, .cmdk-box, .toast { background: color-mix(in srgb, var(--surface-2) 96%, transparent); } }
.hint { display: block; } .hint .ico { margin-right: 4px; }

/* =====================================================================
   v1.3 · órdenes de salida, quién va, retroalimentación, IA, brief
   ===================================================================== */
.seg.wrap { flex-wrap: wrap; }
.seg-radio.sm label span { padding: 3px 10px; font-size: 12px; }
.check-in .seg-radio label:has(input[value=danado]:checked) span { background: color-mix(in srgb, var(--amber) 22%, var(--surface)); }
.check-in .seg-radio label:has(input[value=faltante]:checked) span { background: color-mix(in srgb, var(--red) 22%, var(--surface)); }
.check-in td { vertical-align: middle; }
.check-in select, .check-in input { min-width: 120px; }

/* Casillas tipo chip (campos multi: redes publicadas, áreas…) */
.multi { display: flex; flex-wrap: wrap; gap: 6px; }
.mchip { display: inline-flex; cursor: pointer; }
.mchip input { position: absolute; opacity: 0; pointer-events: none; }
.mchip span { padding: 5px 12px; border-radius: 980px; background: var(--field); font-size: 13px; font-weight: 500; transition: background .15s, color .15s; user-select: none; }
.mchip:hover span { background: color-mix(in srgb, var(--field) 70%, var(--ink) 8%); }
.mchip input:checked + span { background: var(--brand); color: #fff; }
.mchip input:focus-visible + span { outline: 2px solid rgba(var(--brand-rgb), .45); outline-offset: 1px; }
.row-input.col { flex-direction: column; align-items: stretch; gap: 8px; }

/* Formulario de orden de salida: selección de equipo */
.eq-pick { display: grid; gap: 6px; max-height: 460px; overflow-y: auto; padding: 2px; }
.eqrow { display: grid; grid-template-columns: auto 34px 1fr minmax(160px, 38%); gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r); background: var(--surface-2); box-shadow: 0 0 0 1px var(--sep-2); cursor: pointer; }
.eqrow:has(input[type=checkbox]:checked) { box-shadow: 0 0 0 2px var(--brand); background: rgba(var(--brand-rgb), .06); }
.eqrow img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.eqrow.busy { opacity: .5; cursor: not-allowed; }
.eqrow.busy small { color: var(--red); }
.eqr-t { min-width: 0; font-size: 13.5px; line-height: 1.3; }
.eqr-t small { display: block; color: var(--muted); font-size: 12px; }
.eqr-acc { font-size: 12.5px !important; }
.eq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.eq-list li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--sep-2); }
.eq-list li:last-child { border-bottom: 0; }
.eq-list img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; flex: none; }
.eq-list small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 640px) { .eqrow { grid-template-columns: auto 34px 1fr; } .eqr-acc { grid-column: 2 / -1; } }

.action-card { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-left: 4px solid var(--brand); }
.action-card h3 { margin: 0 0 2px; }
.action-card p { margin: 0; }
.flow-step.warn-step .fs-dot { background: var(--amber); color: #fff; }
.ord-row { display: inline-flex; gap: 10px; align-items: center; padding: 6px 10px; border-radius: var(--r); background: var(--surface-2); box-shadow: 0 0 0 1px var(--sep-2); color: var(--ink); }
.ord-row:hover { background: var(--hover); opacity: 1; }
.folio { white-space: nowrap; font: 600 12px ui-monospace, "SF Mono", Menlo, monospace; color: var(--brand); background: rgba(var(--brand-rgb), .1); padding: 3px 7px; border-radius: 6px; flex: none; }

/* ¿Quién va? */
.people { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; }
.people li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--sep-2); }
.people li > span:nth-child(2) { flex: 1; min-width: 0; }
.people li small { display: block; color: var(--muted); font-size: 12px; }
.people .ph { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.people form { margin: 0; }
.qc-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; max-height: 220px; overflow-y: auto; padding: 2px; }
.qp { display: flex; gap: 6px; align-items: center; padding: 5px 6px; border-radius: var(--r); background: var(--surface-2); box-shadow: 0 0 0 1px var(--sep-2); }
.qp:has(input:checked) { box-shadow: 0 0 0 2px var(--brand); }
.qp .mchip { flex: 1; min-width: 0; }
.qp .mchip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.qp select { width: 140px; font-size: 12px; padding: 4px 6px; }
.qp:not(:has(input:checked)) select, .qp:not(:has(input:checked)) .hrs { opacity: .35; }
.hrs { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12px; }
.hr-in { width: 52px !important; padding: 4px 6px !important; font-size: 12.5px !important; text-align: right; }

/* Retroalimentación */
.retro.done { border-left: 4px solid var(--green); }
.retro-row { align-items: flex-start; }
.retro-row > a { flex: 1; min-width: 0; color: var(--ink); }
.retro-row > a small { display: block; }
.retro-q { color: var(--ink-2) !important; font-style: italic; margin-top: 3px; }
.bar.red span { background: var(--red); } .bar.amber span { background: var(--amber); } .bar.green span { background: var(--green); }

/* IA y licencias */
.plat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 18px; }
.plat { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-2); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; color: var(--ink); }
.plat:hover { opacity: 1; box-shadow: var(--sh-2), 0 6px 18px rgba(0, 0, 0, .06); }
.plat-h { display: flex; gap: 10px; align-items: center; }
.plat-h b { flex: 1; min-width: 0; }
.plat-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand), #6a5cff); flex: none; }
.plat-ic.t-software { background: linear-gradient(135deg, #34C759, #30B0C7); }
.plat-ic.t-recursos { background: linear-gradient(135deg, #FF9500, #FF2D55); }
.plat-n b { font-size: 24px; letter-spacing: -.02em; }
.plat-n span { color: var(--muted); font-size: 12.5px; margin-left: 4px; }
.plat-f { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12.5px; }

/* Brief dentro de la pieza y de la hoja */
.brief-mini { border-left: 4px solid var(--brand); }
.fl.one { grid-template-columns: 1fr; }
.fi.no-t dd { color: var(--red); }
.copyable { cursor: copy; padding: 2px 6px; border-radius: 6px; background: var(--field); word-break: break-all; }
.copyable:hover { background: rgba(var(--brand-rgb), .14); }
.brief-hint { font-size: 12.5px; background: rgba(var(--brand-rgb), .07); border-radius: var(--r); padding: 10px 12px; margin-bottom: 14px; display: grid; gap: 3px; }
.th-h { font-weight: 500; opacity: .7; font-size: 10.5px; }
td.tema-c { position: relative; }
td.tema-c input { padding-right: 30px !important; }
.idea-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer; font-size: 13px; padding: 2px 4px; border-radius: 6px; opacity: .25; filter: grayscale(1); }
.idea-btn.has { opacity: 1; filter: none; }
tr:hover .idea-btn, .idea-btn:focus-visible { opacity: 1; }
.idea-btn:hover { background: rgba(var(--brand-rgb), .14); }
.hrs-real { display: flex; flex-wrap: wrap; gap: 8px; }
.hr-row { display: inline-flex !important; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--r); background: var(--surface-2); box-shadow: 0 0 0 1px var(--sep-2); font-weight: 500; }
.hr-row input { width: 70px; padding: 5px 8px; text-align: right; }
.plat-h > div { flex: 1; min-width: 0; }
.plat-h small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plat > div:has(.bar) .bar, .plat .bar { width: 100%; }
/* Solicitudes internas */
.sol-h { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); }
.sol-cols { margin-bottom: 0; }
.sol-more { margin-top: 12px; }
.sol-more summary { cursor: pointer; color: var(--brand); font-weight: 500; font-size: 13px; }
.action-card.late { border-left-color: var(--red); }
.stack { display: grid; gap: 8px; }
.td-row.fx { display: flex; gap: 10px; }
.td-row.fx > span:not(.folio):not(.pill) { flex: 1; min-width: 0; }
.td-row.fx small { display: block; }
.td-row.fx .pill { flex: none; }

/* Revisiones de inventario */
.inv-tipos { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.inv-tipo { display: block; cursor: pointer; }
.inv-tipo input { position: absolute; opacity: 0; pointer-events: none; }
.inv-tipo > span { display: block; height: 100%; padding: 14px 16px; border-radius: var(--r-l); background: var(--surface-2); box-shadow: 0 0 0 1px var(--sep); transition: box-shadow .15s, background .15s; }
.inv-tipo input:checked + span { box-shadow: 0 0 0 2px var(--brand); background: rgba(var(--brand-rgb), .06); }
.inv-tipo b { font-size: 15px; }
.inv-tipo ul, .inv-guia ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.inv-guia summary { cursor: pointer; }
.inv-kpis .kpi b { font-size: 26px; }
.inv-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; }
.inv-list { padding: 8px 16px; }
.inv-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--sep-2); border-left: 3px solid transparent; transition: background .2s, opacity .2s; }
.inv-row:last-child { border-bottom: 0; }
.inv-row.saving { opacity: .55; }
.inv-row.r-ok { border-left-color: var(--green); }
.inv-row.r-danado { border-left-color: var(--amber); background: color-mix(in srgb, var(--amber) 7%, transparent); }
.inv-row.r-falta { border-left-color: var(--red); background: color-mix(in srgb, var(--red) 6%, transparent); }
.inv-row.r-fuera { border-left-color: var(--blue); opacity: .8; }
.inv-ph { width: 44px; height: 44px; border-radius: 10px; background: var(--field); display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.inv-ph img { width: 100%; height: 100%; object-fit: cover; }
.inv-t { min-width: 0; font-size: 14px; line-height: 1.35; }
.inv-t small { display: block; color: var(--muted); font-size: 12px; }
.inv-ctrl { display: grid; gap: 6px; justify-items: end; }
.inv-ctrl.ro { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.inv-res button[data-r=ok].on { background: var(--green); color: #fff; }
.inv-res button[data-r=danado].on { background: var(--amber); color: #fff; }
.inv-res button[data-r=falta].on { background: var(--red); color: #fff; }
.inv-more { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.inv-more select { width: auto; padding: 4px 8px; font-size: 12.5px; }
.inv-more input[data-c=nota] { width: 200px; padding: 5px 8px; font-size: 12.5px; }
.inv-row.r-pendiente .inv-more, .inv-row.r-ok .inv-more { opacity: .6; }
.inv-row:hover .inv-more { opacity: 1; }
.inv-close .form-actions { align-items: center; }
a.inv-id { color: inherit; }
a.inv-id:hover { opacity: .85; }
@media (max-width: 760px) {
  .inv-row { grid-template-columns: 40px minmax(0, 1fr); }
  .inv-ctrl { grid-column: 1 / -1; justify-items: stretch; }
  .inv-res { display: flex; } .inv-res button { flex: 1; justify-content: center; padding: 9px 6px; }
  .inv-more { justify-content: flex-start; } .inv-more input[data-c=nota] { flex: 1; width: auto; min-width: 140px; }
  .inv-list { padding: 4px 10px; }
}
.ni { font-style: normal; }
