/* Digitax Planner — sistema visual
   Marca: Poppins · Naranja Digitax #FC5400 · Turquesa #30D8B4 · Azul #004E9C · Verde #0C7836 · Violeta #AE5AF0
   Neutros: Tinta #141414 · Gris #8C8C8C · Humo #F6F6F4 · Blanco */

:root {
  --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ink: #141414;
  --ground: #F6F6F4;
  --surface: #FFFFFF;
  --surface-2: #FBFBF9;
  --sunken: #F0EFEB;
  --line: #E8E6E0;
  --line-strong: #D5D2CA;
  --text: #141414;
  --text-2: #4E4C47;
  --text-3: #6F6C64;
  --placeholder: #8C8A84;

  --brand: #FC5400;
  --brand-hover: #E64C00;
  --brand-ink: #B23B00;
  --brand-soft: #FFF0E6;
  --brand-ring: rgba(252, 84, 0, .28);

  --rail: #141414;
  --rail-2: #1F1F1E;
  --rail-text: #ECEAE5;
  --rail-muted: #A4A19A;
  --rail-hover: #262624;

  --ok: #0B6B31;        --ok-bg: #E6F4EB;     --ok-dot: #0C7836;
  --done: #0B6B5A;      --done-bg: #E1F6F0;   --done-dot: #1BA88A;
  --review: #6A2BB0;    --review-bg: #F2E9FD; --review-dot: #AE5AF0;
  --sched: #004E9C;     --sched-bg: #E6EEF8;  --sched-dot: #004E9C;
  --late: #B42318;      --late-bg: #FDECEA;   --late-dot: #D92D20;
  --warn: #8A5000;      --warn-bg: #FFF3DB;   --warn-dot: #E09400;
  --pending: #4E4C47;   --pending-bg: #F0EFEB;--pending-dot: #A9A6A0;
  --muted: #6F6C64;     --muted-bg: #F3F2EE;  --muted-dot: #C9C6BF;

  --r-sm: 8px;
  --r: 10px;
  --r-lg: 14px;
  --shadow-1: 0 1px 2px rgba(20, 20, 20, .05);
  --shadow-2: 0 6px 24px -8px rgba(20, 20, 20, .18), 0 2px 6px rgba(20, 20, 20, .06);
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #111110;
    --surface: #1A1A19;
    --surface-2: #1E1E1C;
    --sunken: #232321;
    --line: #2C2B29;
    --line-strong: #3A3936;
    --text: #F1EFEA;
    --text-2: #C4C1BA;
    --text-3: #9C9991;
    --placeholder: #7C7972;
    --brand-ink: #FF8A4C;
    --brand-soft: #2E1A10;
    --rail: #0B0B0A;
    --rail-2: #141413;
    --rail-hover: #1C1C1B;
    --ok: #6FD39A;      --ok-bg: #15281D;
    --done: #63D8BE;    --done-bg: #12261F;
    --review: #CDA4F7;  --review-bg: #251A33;
    --sched: #8DB8EC;   --sched-bg: #13202F;
    --late: #FF8A80;    --late-bg: #331715;
    --warn: #F2C063;    --warn-bg: #2E2410;
    --pending: #C4C1BA; --pending-bg: #262624;
    --muted: #9C9991;   --muted-bg: #222220;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 10px 30px -10px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

/* Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; text-wrap: balance; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
a.link, .prose a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--brand-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.num, time, .tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* Shell ------------------------------------------------------------------ */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh;
  background: var(--rail); color: var(--rail-text);
  display: flex; flex-direction: column; padding: 20px 14px 16px;
}
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.rail-brand img { height: 26px; width: auto; }
.rail-brand span { font-size: 12px; color: var(--rail-muted); font-weight: 500; letter-spacing: .02em; border-left: 1px solid #333; padding-left: 10px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 500; color: var(--rail-muted); letter-spacing: .06em; text-transform: uppercase; padding: 18px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--r);
  color: var(--rail-text); font-weight: 500; font-size: 13.5px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav a svg { width: 19px; height: 19px; color: var(--rail-muted); flex: none; transition: color .15s var(--ease); }
.nav a:hover { background: var(--rail-hover); }
.nav a:hover svg { color: var(--rail-text); }
.nav a[aria-current="page"] { background: var(--rail-2); color: #fff; box-shadow: inset 0 0 0 1px #2A2A28; }
.nav a[aria-current="page"] svg { color: var(--brand); }
.nav .count {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 600;
  background: #2C2C2A; color: var(--rail-text); font-variant-numeric: tabular-nums;
}
.nav .count.hot { background: var(--brand); color: #141414; }
.rail-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid #262624; display: flex; align-items: center; gap: 10px; }
.rail-foot .who { min-width: 0; flex: 1; }
.rail-foot .who b { display: block; font-size: 13px; font-weight: 500; }
.rail-foot .who small { color: var(--rail-muted); font-size: 11.5px; }
.rail-foot button { background: none; border: 0; color: var(--rail-muted); padding: 8px; border-radius: 8px; cursor: pointer; }
.rail-foot button:hover { color: #fff; background: var(--rail-hover); }
.rail-foot svg { width: 18px; height: 18px; }

.main { min-width: 0; padding: 28px 36px 64px; }
.main-inner { max-width: 1240px; margin: 0 auto; }

.topbar { display: none; }
.tabbar { display: none; }

/* Page head -------------------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .lede { color: var(--text-2); margin-top: 6px; font-size: 14px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 6px; align-items: center; color: var(--text-3); font-size: 13px; margin-bottom: 10px; }
.crumbs a:hover { color: var(--text); }
.crumbs svg { width: 14px; height: 14px; }

/* Panels ----------------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { display: flex; align-items: center; gap: 10px; }
.panel-body { padding: 18px 20px; }
.panel + .panel, .stack > * + * { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 12px; }
.section-title h2 { font-size: 15px; }
.section-title .count { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.section-title.late h2 { color: var(--late); }

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font-weight: 500; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease), box-shadow .15s var(--ease);
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #2B2B2A; border-color: #2B2B2A; }
.btn-accent { background: var(--brand); border-color: var(--brand); color: #141414; font-weight: 600; }
.btn-accent:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ok { background: var(--ok-dot); border-color: var(--ok-dot); color: #fff; }
.btn-ok:hover { filter: brightness(.95); background: var(--ok-dot); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--sunken); border-color: transparent; }
.btn-danger { color: var(--late); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn-xs { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn-xs svg { width: 15px; height: 15px; }
.btn-icon { width: 34px; padding: 0; }
@media (prefers-color-scheme: dark) {
  .btn-primary { background: #F1EFEA; border-color: #F1EFEA; color: #141414; }
  .btn-primary:hover { background: #fff; border-color: #fff; }
}

/* Forms ------------------------------------------------------------------ */
.form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field .hint { font-size: 12.5px; color: var(--text-3); }
.field .error { font-size: 12.5px; color: var(--late); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236F6C64'%3E%3Cpath fill-rule='evenodd' d='M5.2 7.2a.75.75 0 0 1 1.06.04L10 11.1l3.74-3.86a.75.75 0 1 1 1.08 1.04l-4.28 4.42a.75.75 0 0 1-1.08 0L5.16 8.28a.75.75 0 0 1 .04-1.06Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--late); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); margin: 0; }
.chips-input { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-input label { cursor: pointer; }
.chips-input input { position: absolute; opacity: 0; pointer-events: none; }
.chips-input span {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: all .15s var(--ease);
}
.chips-input input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips-input input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-ring); }
@media (prefers-color-scheme: dark) { .chips-input input:checked + span { background: #F1EFEA; border-color: #F1EFEA; color: #141414; } }
input[type="file"].input { padding: 7px 10px; height: auto; }
input[type="file"]::file-selector-button { border: 1px solid var(--line-strong); background: var(--sunken); border-radius: 7px; padding: 4px 10px; margin-right: 10px; font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; }

/* Filters ---------------------------------------------------------------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .select, .filters .input { height: 34px; width: auto; min-width: 140px; font-size: 13px; border-radius: 9px; background-color: var(--surface); }
.filters .reset { font-size: 13px; color: var(--text-3); padding: 0 6px; }
.filters .reset:hover { color: var(--text); }
.seg { display: inline-flex; padding: 3px; background: var(--sunken); border-radius: 10px; gap: 2px; }
.seg a { padding: 5px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.seg a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* Pills, chips, dots, avatars --------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 8px;
  border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--pending-bg); color: var(--pending);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pending-dot); }
.pill.plain::before { display: none; }
.tone-ok { background: var(--ok-bg); color: var(--ok); } .tone-ok::before { background: var(--ok-dot); }
.tone-done { background: var(--done-bg); color: var(--done); } .tone-done::before { background: var(--done-dot); }
.tone-review { background: var(--review-bg); color: var(--review); } .tone-review::before { background: var(--review-dot); }
.tone-scheduled { background: var(--sched-bg); color: var(--sched); } .tone-scheduled::before { background: var(--sched-dot); }
.tone-late { background: var(--late-bg); color: var(--late); } .tone-late::before { background: var(--late-dot); }
.tone-warn { background: var(--warn-bg); color: var(--warn); } .tone-warn::before { background: var(--warn-dot); }
.tone-pending { background: var(--pending-bg); color: var(--pending); } .tone-pending::before { background: var(--pending-dot); }
.tone-muted { background: var(--muted-bg); color: var(--muted); } .tone-muted::before { background: var(--muted-dot); }

.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--sunken); color: var(--text-2); white-space: nowrap; }
.tag svg { width: 13px; height: 13px; }
.tag.brand { background: var(--brand-soft); color: var(--brand-ink); }
.tag.late { background: var(--late-bg); color: var(--late); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }

.acct { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; min-width: 0; }
.acct .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c, var(--brand)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--brand)) 18%, transparent); }
.acct-mark {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center;
  font-weight: 600; font-size: 15px; color: #fff; background: var(--c, var(--brand));
}

.avatar {
  --c: #8C8C8C;
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; letter-spacing: .02em;
  background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: color-mix(in srgb, var(--c) 80%, var(--text));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent);
}
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.none { --c: #A9A6A0; }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }

/* Bubbles: la semana de cada cuenta como las burbujas del isotipo ---------- */
.bubbles { display: inline-flex; align-items: center; gap: 10px; }
.bday { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.bday .stack { display: inline-flex; flex-direction: column-reverse; gap: 3px; align-items: center; min-height: 12px; }
.bday .lbl { font-size: 10.5px; color: var(--text-3); font-weight: 500; text-transform: lowercase; line-height: 1; }
.bday.today .lbl { color: var(--brand-ink); font-weight: 600; }
.b { width: 11px; height: 11px; border-radius: 50%; display: block; flex: none; }
.b.done { background: var(--ok-dot); }
.b.done-late { background: var(--warn-dot); }
.b.late { background: var(--late-dot); }
.b.scheduled { background: transparent; box-shadow: inset 0 0 0 2px var(--sched-dot); position: relative; }
.b.scheduled::after { content: ""; position: absolute; inset: 3.5px; border-radius: 50%; background: var(--sched-dot); }
.b.pending { box-shadow: inset 0 0 0 2px var(--pending-dot); }
.b.flex { box-shadow: none; border: 1.5px dashed var(--pending-dot); }
.b.none { width: 4px; height: 4px; background: var(--line-strong); margin: 3.5px; }
.bubbles.lg .b { width: 14px; height: 14px; }
.bubbles.lg .b.scheduled::after { inset: 4.5px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Week strip (panel inicial) --------------------------------------------- */
.week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.week a {
  display: grid; gap: 10px; padding: 14px 16px 16px; border-right: 1px solid var(--line);
  transition: background .15s var(--ease);
}
.week a:last-child { border-right: 0; }
.week a:hover { background: var(--surface-2); }
.week a[aria-current="true"] { background: var(--brand-soft); }
.week .wd { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.week .wd b { font-size: 13px; font-weight: 600; text-transform: capitalize; }
.week .wd span { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.week .today b { color: var(--brand-ink); }
.week .dots { display: flex; flex-wrap: wrap; gap: 4px; min-height: 14px; }

/* Stats ------------------------------------------------------------------ */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 2px; }
.stat .v { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .k { font-size: 12.5px; color: var(--text-3); }
.stat.late .v { color: var(--late); }
.stat.brand .v { color: var(--brand-ink); }
a.stat:hover { border-color: var(--line-strong); }

/* Task list -------------------------------------------------------------- */
.tasks { list-style: none; margin: 0; padding: 0; }
.task {
  display: grid; grid-template-columns: 58px minmax(150px, 1.1fr) minmax(0, 1.8fr) 34px 118px auto;
  align-items: center; gap: 14px; padding: 11px 16px; border-bottom: 1px solid var(--line);
  transition: background .12s var(--ease);
}
.task:last-child { border-bottom: 0; }
.task:hover { background: var(--surface-2); }
.task .when { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.task .when small { display: block; font-weight: 400; font-size: 11.5px; color: var(--text-3); }
.task .what { min-width: 0; }
.task .what a { font-weight: 500; }
.task .what a:hover { text-decoration: underline; text-underline-offset: 3px; }
.task .what .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; color: var(--text-3); font-size: 12.5px; align-items: center; }
.task .go { display: flex; gap: 6px; justify-content: flex-end; }
.task.is-late .when { color: var(--late); }
.task.is-done .what a { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.task form { display: inline; }

/* Tables ----------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .r { text-align: right; }
.table a.row-link { font-weight: 500; }
.table a.row-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Tabs ------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 12px; font-size: 13.5px; font-weight: 500; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--brand); }
.tabs .n { font-size: 11.5px; background: var(--sunken); color: var(--text-2); padding: 1px 7px; border-radius: 999px; font-variant-numeric: tabular-nums; }

/* Definition list --------------------------------------------------------- */
.dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 16px; font-size: 13.5px; margin: 0; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; min-width: 0; }

/* Timeline --------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.timeline li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
.timeline .agent { --c: #FC5400; }
.timeline .body { font-size: 13.5px; }
.timeline .body b { font-weight: 600; }
.timeline .body time { color: var(--text-3); font-size: 12px; margin-left: 4px; }
.timeline .quote { margin-top: 6px; padding: 10px 12px; background: var(--sunken); border-radius: var(--r); white-space: pre-line; color: var(--text); }

/* Media ------------------------------------------------------------------ */
.pub { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: start; }
.pub .thumb { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--sunken); }
.pub .thumb-empty { width: 72px; height: 72px; border-radius: 10px; background: var(--sunken); display: grid; place-items: center; color: var(--text-3); }
.pub .thumb-empty svg { width: 22px; height: 22px; }
.pub p { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.files { display: grid; gap: 8px; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); font-size: 13px; }
.file svg { width: 18px; height: 18px; color: var(--text-3); }
.file img.preview { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }

/* Callouts ---------------------------------------------------------------- */
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--sunken); color: var(--text-2); font-size: 13.5px; }
.note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.late { background: var(--late-bg); color: var(--late); }
.note.ok { background: var(--ok-bg); color: var(--ok); }
.note.brand { background: var(--brand-soft); color: var(--brand-ink); }
.note b { font-weight: 600; }

/* Empty states ------------------------------------------------------------ */
.empty { padding: 36px 24px; text-align: center; display: grid; gap: 6px; justify-items: center; }
.empty .bubbles-art { display: flex; gap: 5px; align-items: flex-end; margin-bottom: 8px; }
.empty .bubbles-art i { display: block; border-radius: 50%; }
.empty h3 { font-size: 15px; }
.empty p { color: var(--text-3); max-width: 46ch; font-size: 13.5px; }

/* Calendar --------------------------------------------------------------- */
.cal { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, .55fr)); border-top: 1px solid var(--line); }
.cal .dow { padding: 10px 12px; font-size: 12px; font-weight: 500; color: var(--text-3); border-bottom: 1px solid var(--line); text-transform: capitalize; }
.cal .day { min-height: 128px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.out { background: var(--surface-2); }
.cal .day.out .n { color: var(--placeholder); }
.cal .day.weekend { background: var(--surface-2); }
.cal .n { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 4px; }
.cal .day.today .n span { background: var(--brand); color: #141414; border-radius: 999px; padding: 1px 8px; }
.cal .sd { font-size: 11.5px; font-weight: 500; color: var(--review); background: var(--review-bg); border-radius: 6px; padding: 2px 6px; }
.chip {
  display: flex; align-items: center; gap: 6px; padding: 3px 7px; border-radius: 7px;
  font-size: 12px; line-height: 1.35; min-width: 0;
  background: color-mix(in srgb, var(--c) 9%, var(--surface)); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
  transition: border-color .12s var(--ease), background .12s var(--ease);
}
.chip:hover { border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.chip .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chip .s { margin-left: auto; flex: none; display: inline-flex; }
.chip .s svg { width: 13px; height: 13px; }
.chip.done { background: var(--surface-2); color: var(--text-3); border-color: var(--line); }
.chip.done .t { text-decoration: line-through; text-decoration-color: var(--line-strong); }
.chip.done .s { color: var(--ok-dot); }
.chip.late { background: var(--late-bg); border-color: color-mix(in srgb, var(--late-dot) 35%, transparent); color: var(--late); }
.chip.flex { border-style: dashed; }
.chip.sched .s { color: var(--sched-dot); }
.cal .more { font-size: 11.5px; color: var(--text-3); padding: 2px 6px; }
.agenda { display: none; }

/* Compliance matrix ------------------------------------------------------- */
.matrix td.cell { text-align: center; padding: 8px 6px; }
.matrix .rate { display: inline-grid; gap: 2px; justify-items: center; }
.matrix .rate .pct { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ok-dot); border-radius: 999px; }
.bar.warn > i { background: var(--warn-dot); }
.bar.late > i { background: var(--late-dot); }

/* Rules editor ------------------------------------------------------------ */
.rule { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); position: relative; }
.rule-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rule-head b { font-size: 13.5px; }
.rules-list { display: grid; gap: 10px; }
.rule-line { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.rule-line .desc { flex: 1; min-width: 220px; font-weight: 500; }

/* Flash ------------------------------------------------------------------ */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 60; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: var(--ink); color: #fff; box-shadow: var(--shadow-2); font-size: 13.5px;
  animation: toast-in .25s var(--ease) both;
}
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: #6FD39A; }
.toast.error svg { color: #FF8A80; }
.toast button { margin-left: auto; background: none; border: 0; color: #BDBAB3; cursor: pointer; padding: 0 2px; font-size: 18px; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-color-scheme: dark) { .toast { background: #F1EFEA; color: #141414; } .toast svg { color: var(--ok-dot); } .toast button { color: #6F6C64; } }

/* Disclosure (formularios en línea) --------------------------------------- */
details.inline { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
details.inline > summary { list-style: none; cursor: pointer; padding: 10px 14px; font-weight: 500; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
details.inline > summary::-webkit-details-marker { display: none; }
details.inline > summary svg { width: 17px; height: 17px; color: var(--text-3); }
details.inline > summary .chev { margin-left: auto; transition: transform .2s var(--ease); }
details.inline[open] > summary .chev { transform: rotate(180deg); }
details.inline > .inner { padding: 4px 14px 14px; display: grid; gap: 12px; }
.actions-col { display: grid; gap: 10px; }

/* Login ------------------------------------------------------------------ */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); background: var(--surface); }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 88px); }
.auth-form .box { width: 100%; max-width: 380px; display: grid; gap: 22px; }
.auth-form .logo { height: 34px; width: auto; }
.auth-art { background: var(--ink); color: #fff; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; }
.auth-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-art .quote { position: relative; max-width: 420px; display: grid; gap: 14px; }
.auth-art .quote h2 { font-size: 26px; line-height: 1.25; font-weight: 600; }
.auth-art .quote p { color: #BDBAB3; font-size: 14px; }
.auth-art .row { display: flex; gap: 18px; color: #BDBAB3; font-size: 12.5px; flex-wrap: wrap; }
.auth-art .row span { display: inline-flex; align-items: center; gap: 7px; }

/* Action landing (enlaces de WhatsApp) ----------------------------------- */
.landing { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.landing .card { width: 100%; max-width: 440px; display: grid; gap: 18px; }
.landing .logo { height: 26px; width: auto; justify-self: center; }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1100px) {
  .grid-side { grid-template-columns: minmax(0, 1fr); }
  .task { grid-template-columns: 54px minmax(120px, 1fr) minmax(0, 1.5fr) 30px auto; }
  .task .status-col { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .main { padding: 16px 16px 96px; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 40; padding: 12px 16px; margin: -16px -16px 16px;
    background: color-mix(in srgb, var(--ground) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .topbar img { height: 22px; width: auto; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; font-size: 10.5px; font-weight: 500; color: var(--text-3); position: relative; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--text); }
  .tabbar a[aria-current="page"] svg { color: var(--brand); }
  .tabbar .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; border-radius: 999px; background: var(--brand); color: #141414; font-size: 10px; font-weight: 600; display: grid; place-items: center; padding: 0 4px; }
  h1 { font-size: 21px; }
  .page-head { margin-bottom: 18px; align-items: flex-start; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .week { grid-template-columns: repeat(5, minmax(64px, 1fr)); overflow-x: auto; }
  .week a { padding: 12px 10px; }
  .task { grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "when what go" "when acct go"; gap: 2px 12px; padding: 12px 14px; }
  .task .when { grid-area: when; align-self: start; padding-top: 2px; }
  .task .what { grid-area: what; }
  .task .acct-col { grid-area: acct; font-size: 12.5px; }
  .task .who-col, .task .status-col { display: none; }
  .task .go { grid-area: go; flex-direction: column; align-self: center; }
  .cal-wrap { display: none; }
  .agenda { display: grid; gap: 14px; }
  .agenda .aday h3 { font-size: 13px; text-transform: capitalize; margin-bottom: 8px; color: var(--text-2); }
  .agenda .aday.today h3 { color: var(--brand-ink); }
  .agenda .chips { display: grid; gap: 6px; }
  .agenda .chip { padding: 8px 10px; font-size: 13px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dt { margin-top: 10px; }
  .filters .select, .filters .input { min-width: 0; flex: 1 1 140px; }
  .panel-head { padding: 14px 16px; }
  .panel-body { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Menú del celular (avatar en la barra superior) -------------------------- */
.menu-mobile { position: relative; }
.menu-mobile > summary { list-style: none; cursor: pointer; }
.menu-mobile > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 8px; display: grid; gap: 2px; box-shadow: var(--shadow-2); z-index: 50; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; font-size: 14px; background: none; border: 0; cursor: pointer; color: var(--text); }
.menu-pop a:hover, .menu-pop button:hover { background: var(--sunken); }
.menu-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; }

/* Ajustes tras la revisión visual ------------------------------------------ */
.bubbles { align-items: flex-end; }
.bday { justify-content: flex-end; }
.auth-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,20,20,0) 35%, rgba(20,20,20,.86) 72%, #141414 100%); pointer-events: none; }
.auth-art .quote { z-index: 1; }
.auth-form .logo { height: 44px; }
.day-group { margin-top: 10px; }
.day-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 8px 2px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.day-group > summary::-webkit-details-marker { display: none; }
.day-group > summary .count { font-weight: 400; color: var(--text-3); font-size: 12.5px; }
.day-group > summary .chev { width: 16px; height: 16px; color: var(--text-3); transition: transform .2s var(--ease); margin-left: auto; }
.day-group[open] > summary .chev { transform: rotate(180deg); }
.day-group > summary .mini { display: inline-flex; gap: 3px; margin-left: 6px; }
.rail-foot .who small a { color: var(--rail-muted); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 1100px) {
  .grid-side > aside, .grid-side > .actions-col { order: -1; }
}
@media (max-width: 860px) {
  .week .wd { flex-direction: column; align-items: flex-start; gap: 0; }
  .week .wd b { font-size: 12.5px; }
}
.rail-foot .who small { display: block; }
.cal .sd { overflow-wrap: anywhere; line-height: 1.3; }
.file-pick { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-pick input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-pick input[type="file"]:focus-visible + label { box-shadow: 0 0 0 3px var(--brand-ring); }
.file-pick .file-names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
