:root {
  --bg: #0A0A0F;
  --surface: #12121A;
  --surface-2: #181824;
  --surface-3: #20202E;
  --border: #262636;
  --border-strong: #34344A;
  --text: #ECECF4;
  --text-2: #A6A6BC;
  --text-3: #6E6E86;
  --cyan: #00D4FF;
  --purple: #7B2FBE;
  --grad: linear-gradient(90deg, #00D4FF, #7B2FBE);
  --good: #3FCF8E;
  --warn: #F2B544;
  --critical: #FF5C6C;
  --info: #58A6FF;
  /* Series por producto — validadas (dataviz validate_palette, modo oscuro, surface #12121A) */
  --p-veiron: #1A9FC4;
  --p-schoolpass: #9A63EA;
  --p-asistpro: #BF7A10;
  --p-otro: #D24F84;
  --p-facturabot: #4B6FE0;
  --p-salespro: #5E9E2E;
  --radius: 12px;
  --font-title: 'Orbitron', 'Arial Black', sans-serif;
  --font-body: 'Rajdhani', 'Segoe UI', Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.86em; }
h1, h2, h3 { margin: 0; font-weight: 700; }
h2 { font-size: 1.15rem; letter-spacing: 0.02em; }
h3 { font-size: 1rem; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none !important; }
.brand-name {
  font-family: var(--font-title); font-weight: 800; letter-spacing: 0.1em; font-size: 0.95rem; white-space: nowrap;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { font-size: 0.78rem; color: var(--text-3); letter-spacing: 0.1em; text-transform: uppercase; }
.brand-lg .brand-name { font-size: 1.45rem; }

/* ---------- Login ---------- */
.login {
  min-height: 100%; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(60% 50% at 20% 10%, rgba(0, 212, 255, 0.12), transparent 70%),
    radial-gradient(50% 50% at 90% 90%, rgba(123, 47, 190, 0.18), transparent 70%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 380px; display: grid; gap: 16px; padding: 32px 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.login-card .brand { margin-bottom: 8px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100%; }
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 14px; gap: 22px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar > .brand { padding: 0 8px; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 600; font-size: 1.02rem; text-decoration: none; position: relative;
}
.nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: linear-gradient(90deg, rgba(0, 212, 255, 0.14), rgba(123, 47, 190, 0.1)); color: var(--text); }
.nav a.active::before {
  content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad);
}
.nav .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; padding: 0 8px; }
.who { font-size: 0.85rem; color: var(--text-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 18px 28px; border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-family: var(--font-title); font-size: 1.1rem; letter-spacing: 0.08em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn.menu-toggle { display: none; }
.view { padding: 24px 28px 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: start; }

@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, 0.7); }
  .btn.menu-toggle { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .view { padding: 16px 16px 40px; }
}

/* ---------- Cards / tiles ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.tile { position: relative; overflow: hidden; }
.tile::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--grad); opacity: 0.8; }
.tile-label { color: var(--text-2); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.tile-value { font-family: var(--font-title); font-size: 1.9rem; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile-foot { color: var(--text-3); font-size: 0.9rem; margin-top: 4px; }
.tile-value.small { font-size: 1.4rem; }

.product-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }

/* ---------- Buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: 0.95rem; padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); cursor: pointer;
  white-space: nowrap; line-height: 1.2;
}
.btn:hover { border-color: var(--cyan); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--grad); border: 0; color: #fff; }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-danger { color: var(--critical); }
.btn-danger:hover { border-color: var(--critical); }
.btn-sm { padding: 5px 10px; font-size: 0.86rem; border-radius: 7px; }
.btn-icon { padding: 6px; }
.btn-block { width: 100%; padding: 11px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

label { display: grid; gap: 5px; font-size: 0.88rem; color: var(--text-2); font-weight: 600; }
input, select, textarea {
  font: inherit; font-size: 0.98rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.form-error { color: var(--critical); margin: 0; font-weight: 600; }
.hint { color: var(--text-3); font-size: 0.88rem; margin: 0; }

/* ---------- Tables ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .search { flex: 1 1 220px; max-width: 360px; position: relative; }
.toolbar .search input { padding-left: 34px; }
.toolbar .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.toolbar select { width: auto; }
.toolbar .count { color: var(--text-3); font-size: 0.9rem; margin-left: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th {
  text-align: left; font-weight: 600; color: var(--text-3); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em;
  padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--text); }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.015); }
td.actions { white-space: nowrap; text-align: right; }
td .sub { color: var(--text-3); font-size: 0.84rem; }
td select { width: auto; padding: 4px 8px; font-size: 0.9rem; }
.empty { text-align: center; color: var(--text-3); padding: 28px 12px; }
tr.clickable { cursor: pointer; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
  border: 1px solid var(--border-strong); color: var(--text-2); background: var(--surface-2); white-space: nowrap;
}
.badge-good { color: var(--good); border-color: rgba(63, 207, 142, 0.35); background: rgba(63, 207, 142, 0.08); }
.badge-warn { color: var(--warn); border-color: rgba(242, 181, 68, 0.35); background: rgba(242, 181, 68, 0.08); }
.badge-critical { color: var(--critical); border-color: rgba(255, 92, 108, 0.35); background: rgba(255, 92, 108, 0.08); }
.badge-info { color: var(--info); border-color: rgba(88, 166, 255, 0.35); background: rgba(88, 166, 255, 0.08); }
.badge-brand { color: var(--cyan); border-color: rgba(0, 212, 255, 0.35); background: rgba(0, 212, 255, 0.08); }
.text-good { color: var(--good); } .text-warn { color: var(--warn); } .text-critical { color: var(--critical); } .muted { color: var(--text-3); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a, .tabs button {
  padding: 10px 14px; color: var(--text-2); font-weight: 600; border: 0; background: none; font: inherit; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; text-decoration: none !important;
}
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs .active { color: var(--text); border-bottom-color: var(--cyan); }

/* ---------- Alerts ---------- */
.alerts { display: grid; gap: 8px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); border-left: 3px solid var(--info); }
.alert.critical { border-left-color: var(--critical); }
.alert.warn { border-left-color: var(--warn); }
.alert .alert-icon { font-weight: 800; width: 18px; text-align: center; }
.alert.critical .alert-icon { color: var(--critical); }
.alert.warn .alert-icon { color: var(--warn); }
.alert.info .alert-icon { color: var(--info); }
.alert .alert-product { margin-left: auto; }
.source-warning { padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(242, 181, 68, 0.4); background: rgba(242, 181, 68, 0.07); color: var(--warn); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4, 4, 8, 0.72); z-index: 100; display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 16px; overflow-y: auto; backdrop-filter: blur(3px);
}
.modal {
  width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); display: flex; flex-direction: column;
}
.modal.wide { max-width: 980px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { flex: 1; }
.modal-body { padding: 18px 20px; display: grid; gap: 16px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Chat ---------- */
.chat-log { max-height: 380px; overflow-y: auto; display: grid; gap: 8px; padding: 4px; }
.msg { padding: 8px 12px; border-radius: 10px; max-width: 85%; white-space: pre-wrap; word-break: break-word; }
.msg.me { background: rgba(0, 212, 255, 0.12); justify-self: end; }
.msg.bot { background: var(--surface-2); justify-self: start; }
.chat-form { display: flex; gap: 8px; }

/* ---------- Lists ---------- */
.list { display: grid; gap: 8px; }
.list-item { padding: 10px 12px; border-radius: 9px; background: var(--surface-2); display: flex; gap: 10px; align-items: flex-start; }
.list-item .grow { flex: 1; min-width: 0; }
.note-text { white-space: pre-wrap; word-break: break-word; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; word-break: break-word; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-weight: 600; }
.toast.error { border-color: var(--critical); color: #ffd4d8; }
.toast.ok { border-color: var(--good); }

/* ---------- Charts ---------- */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis-label { fill: var(--text-3); font-size: 11px; font-family: var(--font-body); }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .baseline { stroke: var(--border-strong); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover { fill: rgba(255, 255, 255, 0.04); }
.chart .empty-bar { fill: none; stroke: var(--border-strong); stroke-dasharray: 3 3; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.88rem; color: var(--text-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; }
.chart-tip {
  position: fixed; z-index: 300; pointer-events: none; background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 8px 10px; font-size: 0.88rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); min-width: 150px;
}
.chart-tip .tip-title { font-weight: 700; margin-bottom: 4px; }
.chart-tip .tip-row { display: flex; gap: 12px; justify-content: space-between; color: var(--text-2); }
.chart-tip .tip-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.bar-track { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; display: flex; gap: 2px; }
.bar-track span { display: block; height: 100%; }

.loading { color: var(--text-3); padding: 24px 0; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--cyan); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -3px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.back-link { display: inline-flex; gap: 6px; align-items: center; color: var(--text-2); font-weight: 600; }

/* ---------- Pipeline de ventas ---------- */
.nav-emoji { width: 20px; text-align: center; font-size: 17px; line-height: 1; flex-shrink: 0; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kanban-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 220px; max-height: calc(100vh - 260px); }
.kanban-col.drop-target { border-color: var(--cyan); background: rgba(0, 212, 255, 0.05); }
.kanban-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--border); }
.kanban-head .kanban-title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.kanban-head .kanban-sub { color: var(--text-3); font-size: 0.85rem; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kanban-cards { padding: 10px; display: grid; gap: 10px; overflow-y: auto; align-content: start; flex: 1; }
.deal {
  background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--deal-color, var(--border-strong));
  border-radius: 10px; padding: 10px 12px; cursor: grab; display: grid; gap: 6px;
}
.deal:hover { border-color: var(--border-strong); border-left-color: var(--deal-color); }
.deal.dragging { opacity: 0.45; }
.deal.stale { box-shadow: inset 0 0 0 1px rgba(242, 181, 68, 0.45); }
.deal-name { font-weight: 700; line-height: 1.25; }
.deal-company { color: var(--text-2); font-size: 0.88rem; }
.deal-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.85rem; }
.deal-mrr { font-weight: 700; font-variant-numeric: tabular-nums; }
.deal-next { font-size: 0.85rem; color: var(--text-2); }
.deal-actions { display: flex; gap: 6px; }
.kanban-empty { color: var(--text-3); font-size: 0.88rem; text-align: center; padding: 16px 4px; border: 1px dashed var(--border); border-radius: 8px; }
.timeline { display: grid; gap: 8px; }
.stage-bars { display: grid; gap: 8px; }
.stage-bar { display: grid; grid-template-columns: 150px 1fr 110px; gap: 10px; align-items: center; font-size: 0.92rem; }
.stage-bar .bar { height: 10px; background: var(--surface-3); border-radius: 5px; overflow: hidden; }
.stage-bar .bar span { display: block; height: 100%; background: var(--cyan); border-radius: 0 5px 5px 0; }
@media (max-width: 600px) { .stage-bar { grid-template-columns: 100px 1fr 80px; } }

/* ---------- Agenda ---------- */
:root {
  /* Color por tipo de actividad. El tipo siempre se muestra también con emoji y
     nombre (8 tipos no caben en una paleta segura para daltonismo). "Otro" va sin
     relleno, con borde punteado. */
  --t-llamada: #1A9FC4;
  --t-reunion: #9A63EA;
  --t-visita: #BF7A10;
  --t-seguimiento: #4B6FE0;
  --t-tecnica: #8A8AA0;
  --t-demo: #D24F84;
  --t-cobro: #5E9E2E;
  --t-otro: #6E6E86;
}
.agenda-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.agenda-bar .agenda-range { font-weight: 700; font-size: 1.05rem; min-width: 0; }
.agenda-bar .spacer { flex: 1; }
.agenda-bar select { width: auto; }
.overdue-banner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(255, 92, 108, 0.45); background: rgba(255, 92, 108, 0.08); color: #ffd4d8; font-weight: 600; }
.cal { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.cal-scroll { overflow-x: auto; }
.cal-head, .cal-body { display: grid; grid-template-columns: 56px repeat(var(--days), minmax(110px, 1fr)); }
.cal-head { border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; z-index: 2; }
.cal-head > div { padding: 8px 6px; text-align: center; font-size: 0.85rem; color: var(--text-2); font-weight: 600; border-left: 1px solid var(--border); }
.cal-head > div:first-child { border-left: 0; }
.cal-head .is-today { color: var(--cyan); }
.cal-head .day-num { display: block; font-family: var(--font-title); font-size: 1.1rem; color: var(--text); }
.cal-head .is-today .day-num { color: var(--cyan); }
.cal-hours { position: relative; }
.cal-hours span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 0.75rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--border); cursor: copy;
  background-image: linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 100% var(--hour-px); }
.cal-col.is-today { background-color: rgba(0, 212, 255, 0.035); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--critical); z-index: 3; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--critical); }
.act {
  position: absolute; border-radius: 7px; padding: 3px 6px; font-size: 0.8rem; line-height: 1.2; overflow: hidden; cursor: pointer; z-index: 1;
  background: color-mix(in srgb, var(--act-color) 26%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--act-color) 70%, transparent);
  border-left: 3px solid var(--act-color); color: var(--text);
}
.act:hover { z-index: 4; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }
.act .act-time { color: var(--text-2); font-variant-numeric: tabular-nums; }
.act .act-title { font-weight: 700; }
.act.type-otro, .act-chip.type-otro { background: var(--surface-2); border-style: dashed; }
.act.is-done { opacity: 0.5; }
.act.is-done .act-title, .act.is-cancelled .act-title { text-decoration: line-through; }
.act.is-cancelled { opacity: 0.4; border-style: dashed; }
.act.is-overdue { outline: 2px solid var(--critical); outline-offset: -1px; }
.act-chip { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  background: color-mix(in srgb, var(--act-color) 16%, var(--surface-2)); border: 1px solid var(--border); border-left: 4px solid var(--act-color); }
.act-chip.is-overdue { border-color: rgba(255, 92, 108, 0.6); border-left-color: var(--critical); }
.act-chip.is-done { opacity: 0.55; }
.act-chip.is-done .act-title, .act-chip.is-cancelled .act-title { text-decoration: line-through; }
.act-chip .act-time { font-variant-numeric: tabular-nums; color: var(--text-2); min-width: 92px; font-size: 0.9rem; }
.act-chip .grow { flex: 1; min-width: 0; }
.act-chip .act-title { font-weight: 700; }
.agenda-day-group { display: grid; gap: 8px; }
.agenda-day-group h3 { margin-top: 8px; }
.agenda-day-group h3.is-today { color: var(--cyan); }
.type-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-2); }
.type-legend span { display: inline-flex; gap: 6px; align-items: center; }
.type-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--act-color); display: inline-block; }
/* En pantallas angostas el chip de actividad baja producto/estado a otro renglón. */
.act-chip { flex-wrap: wrap; min-width: 0; }
.act-chip .grow { flex: 1 1 160px; }
.act-chip .badge { max-width: 100%; }
.agenda-bar select { max-width: 100%; }
@media (max-width: 600px) {
  .act-chip .act-time { min-width: 0; flex-basis: 100%; }
}
