:root {
  --bg: #0b1020; --panel: #121933; --panel2: #18213f; --line: #253157; --text: #e7ebf7; --muted: #8e9ac0;
  --accent: #6d8bff; --accent-soft: rgba(109,139,255,.15);
  --green: #22c55e; --green-soft: rgba(34,197,94,.14);
  --red: #f05252; --red-soft: rgba(240,82,82,.14);
  --orange: #fb923c; --orange-soft: rgba(251,146,60,.15);
  --yellow: #eab308; --yellow-soft: rgba(234,179,8,.15);
  --blue: #3b9eff; --blue-soft: rgba(59,158,255,.15);
  --purple: #b57bff; --purple-soft: rgba(181,123,255,.15);
  --gray-soft: rgba(142,154,192,.15);
  --radius: 14px; --shadow: 0 8px 30px rgba(0,0,0,.25);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f5fb; --panel: #ffffff; --panel2: #f1f4fb; --line: #e0e5f0; --text: #141a2e; --muted: #647093;
  --accent: #4863f7; --accent-soft: rgba(72,99,247,.10);
  --shadow: 0 6px 24px rgba(20,26,46,.08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pos { color: var(--green); } .neg { color: var(--red); } .warn { color: var(--orange); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.spacer { flex: 1; }
.only-mobile { display: none !important; }
[hidden] { display: none !important; }

/* Layout */
#app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
#sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 10px; z-index: 30; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 12px; }
.brand-logo { font-size: 26px; }
.brand small { display: block; color: var(--muted); font-size: 11px; }
#nav .group { margin-top: 10px; }
#nav .group-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 10px; }
#nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); }
#nav a:hover { background: var(--panel2); }
#nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
#nav a .count { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 7px; font-weight: 600; }
.sidebar-foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 8px; }
#main { min-width: 0; }
#scrim { display: none; }
#topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
#page-title { font-size: 20px; white-space: nowrap; }
.ask { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; max-width: 560px; margin-left: auto; }
.ask input { flex: 1; border: 0; background: transparent; color: var(--text); padding: 9px 0; outline: none; min-width: 0; }
.top-actions { display: flex; gap: 8px; align-items: center; }
#view { padding: 22px 24px 80px; max-width: 1400px; margin: 0 auto; }
.bell { position: relative; }
#bell-count { position: absolute; top: -2px; right: -4px; background: var(--red); color: #fff; font-size: 10px; border-radius: 99px; padding: 0 5px; font-weight: 700; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--panel2); padding: 8px 14px; border-radius: 10px; cursor: pointer; white-space: nowrap; font-weight: 500; }
.btn:hover { filter: brightness(1.12); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-soft { background: var(--red-soft); border-color: transparent; color: var(--red); font-weight: 600; }
.btn.success-soft { background: var(--green-soft); border-color: transparent; color: var(--green); font-weight: 600; }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.btn.xs { padding: 2px 8px; font-size: 11px; border-radius: 7px; }
.icon-btn { background: transparent; border: 0; cursor: pointer; font-size: 18px; padding: 6px; border-radius: 8px; color: var(--text); }
.icon-btn:hover { background: var(--panel2); }
.icon-btn.mic { font-size: 16px; }
body.escuchando .icon-btn.mic { background: var(--red); animation: latido 1.1s infinite; }
@keyframes latido { 0%, 100% { box-shadow: 0 0 0 0 rgba(240,82,82,.6); } 50% { box-shadow: 0 0 0 9px rgba(240,82,82,0); } }
.voz-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 220px; z-index: 40; }
.dropdown-menu.open { display: block; }
.dropdown-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.dropdown-menu button:hover { background: var(--panel2); }

/* Cards & grids */
.section { margin-bottom: 26px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 16px; }
.section-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card h3 { font-size: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card h3 .actions { margin-left: auto; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.kpi .label { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.kpi .value { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.hero { background: linear-gradient(135deg, var(--accent), #8b5cf6); color: #fff; border: 0; }
.kpi.hero .label, .kpi.hero .sub { color: rgba(255,255,255,.85); }
.kpi.hero .value { font-size: 30px; }
.kpi.red { border-left: 4px solid var(--red); } .kpi.green { border-left: 4px solid var(--green); } .kpi.orange { border-left: 4px solid var(--orange); } .kpi.blue { border-left: 4px solid var(--blue); } .kpi.purple { border-left: 4px solid var(--purple); }
.kpi.clickable { cursor: pointer; } .kpi.clickable:hover { border-color: var(--accent); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--gray-soft); color: var(--muted); white-space: nowrap; }
.badge.red { background: var(--red-soft); color: var(--red); } .badge.green { background: var(--green-soft); color: var(--green); }
.badge.orange, .badge.amber { background: var(--orange-soft); color: var(--orange); } .badge.yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge.blue { background: var(--blue-soft); color: var(--blue); } .badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

/* Lists */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.row:last-child { border-bottom: 0; }
.row.clickable { cursor: pointer; border-radius: 8px; } .row.clickable:hover { background: var(--panel2); }
.row .ico { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: var(--panel2); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { color: var(--muted); font-size: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row .amount { font-weight: 700; text-align: right; }
.row .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.day-head { display: flex; justify-content: space-between; padding: 14px 4px 6px; color: var(--muted); font-size: 12px; text-transform: capitalize; font-weight: 600; border-bottom: 1px solid var(--line); }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty .big { font-size: 34px; display: block; margin-bottom: 6px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
td.r, th.r { text-align: right; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--panel2); }
tfoot td { font-weight: 700; }

/* Progress */
.progress { position: relative; height: 8px; background: var(--panel2); border-radius: 99px; overflow: visible; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .3s; }
.progress.ok > span { background: var(--green); } .progress.alerta > span { background: var(--yellow); } .progress.excedido > span { background: var(--red); }
.progress .marker { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--text); opacity: .55; }
.progress.lg { height: 14px; }

/* Tabs & chips */
.tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); padding: 4px; border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs button.active { background: var(--accent); color: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select, .inline-input { background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px 10px; }
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav strong { min-width: 150px; text-align: center; text-transform: capitalize; }

/* Alerts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border-radius: 12px; background: var(--panel2); border-left: 4px solid var(--muted); margin-bottom: 8px; }
.alert .a-ico { font-size: 16px; line-height: 1.3; }
.alert .a-main { flex: 1; min-width: 0; }
.alert .a-title { font-weight: 600; }
.alert .a-detail { font-size: 12px; color: var(--muted); }
.alert.rojo { border-color: var(--red); background: var(--red-soft); }
.alert.naranja { border-color: var(--orange); background: var(--orange-soft); }
.alert.amarillo { border-color: var(--yellow); background: var(--yellow-soft); }
.alert.azul { border-color: var(--blue); background: var(--blue-soft); }
.alert.verde { border-color: var(--green); background: var(--green-soft); }
.alert.morado { border-color: var(--purple); background: var(--purple-soft); }
.alert.agenda { border-color: var(--accent); background: var(--accent-soft); }
.banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); margin-bottom: 18px; flex-wrap: wrap; }
.banner.warn { background: var(--orange-soft); border: 1px solid var(--orange); }
.banner.info { background: var(--accent-soft); border: 1px solid var(--accent); }
.banner.bad { background: var(--red-soft); border: 1px solid var(--red); }
.banner.ok { background: var(--green-soft); border: 1px solid var(--green); }
.banner .b-main { flex: 1; min-width: 200px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 9px 11px; font: inherit; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field input[data-type=money] { font-size: 20px; font-weight: 700; }
.field textarea { min-height: 70px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .hint:empty { display: none; }
.field.invalid input, .field.invalid select { border-color: var(--red); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text) !important; font-weight: 500 !important; padding: 8px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.suggest { display: flex; align-items: center; gap: 8px; background: var(--accent-soft); color: var(--accent); padding: 6px 10px; border-radius: 8px; font-size: 12px; }
.receipt-preview { max-height: 120px; border-radius: 8px; margin-top: 6px; }
.form-section-title { grid-column: 1/-1; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(5,8,20,.6); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal.wide { max-width: 920px; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal-head h3 { font-size: 17px; flex: 1; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }

/* Toast */
#toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--green); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: 360px; animation: fade .2s; }
.toast.error { border-left-color: var(--red); } .toast.warn { border-left-color: var(--orange); } .toast.info { border-left-color: var(--accent); }

/* Charts */
.chart svg { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut-wrap svg text { fill: var(--text); }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.legend .lv { margin-left: auto; font-variant-numeric: tabular-nums; }
.hbar { display: grid; grid-template-columns: minmax(110px, 180px) 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.hbar .track { height: 10px; background: var(--panel2); border-radius: 99px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 99px; }

/* Score */
.score-ring { position: relative; width: 150px; height: 150px; flex: 0 0 150px; }
.score-ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.score-ring .val strong { font-size: 38px; display: block; line-height: 1; }
.score-parts { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 240px; }
.score-part .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }

/* Assistant */
.chat { display: flex; flex-direction: column; gap: 12px; min-height: 300px; }
.msg { max-width: 820px; padding: 12px 16px; border-radius: 16px; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 4px; width: 100%; }
.msg.bot ul, .msg.bot ol { margin: 6px 0; padding-left: 20px; }
.msg.bot li { margin: 3px 0; }
.msg.bot .msg-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chat-input { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 12px 0; background: var(--bg); }
.chat-input input { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); font: inherit; }

/* Morning */
.hello { padding: 26px; border-radius: 20px; background: linear-gradient(135deg, #1e3a8a, #6d28d9 60%, #db2777); color: #fff; margin-bottom: 20px; }
:root[data-theme="light"] .hello { background: linear-gradient(135deg, #4863f7, #8b5cf6 60%, #ec4899); }
.hello h2 { font-size: 30px; letter-spacing: .02em; }
.hello p { margin: 6px 0 0; opacity: .9; }
.hello p:first-of-type { text-transform: capitalize; }
.timeline .t-row { display: flex; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.timeline .t-time { width: 56px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.prio { counter-reset: p; list-style: none; padding: 0; margin: 0; }
.prio li { counter-increment: p; display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.prio li::before { content: counter(p); flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.prio li .p-main { flex: 1; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; }
.cal .dow { text-align: center; font-size: 11px; color: var(--muted); text-transform: uppercase; padding: 4px; }
.cal .day { min-height: 96px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; cursor: pointer; overflow: hidden; }
.cal .day.out { opacity: .4; }
.cal .day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal .day .dn { font-size: 12px; font-weight: 700; }
.cal .ev { font-size: 11px; border-radius: 5px; padding: 1px 5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--accent-soft); color: var(--accent); }
.cal .ev.pay { background: var(--red-soft); color: var(--red); }
.cal .ev.recv { background: var(--blue-soft); color: var(--blue); }
.cal .ev.task { background: var(--purple-soft); color: var(--purple); }
.cal .ev.proj { background: var(--green-soft); color: var(--green); }
.chip.done { background: var(--green-soft); color: var(--green); border-color: transparent; }
tr.fuera { opacity: .55; }
/* Píldora de recordatorios del asistente */
.nudge-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel2);
  color: var(--text); border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.nudge-pill:hover { border-color: var(--accent); }
.nudge-pill .n-txt { color: var(--muted); font-weight: 400; }
.nudge-pill.urgente { background: var(--red-soft); border-color: var(--red); color: var(--red); animation: nudge-latido 2.6s ease-in-out 3; }
.nudge-pill.urgente .n-txt { color: var(--red); opacity: .85; }
@keyframes nudge-latido { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } 50% { box-shadow: 0 0 0 5px rgba(239,68,68,.22); } }
@media (prefers-reduced-motion: reduce) { .nudge-pill.urgente { animation: none; } }
@media (max-width: 900px) { .nudge-pill .n-txt { display: none; } }

.costos-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 6px; }
.costo-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.costo-row:last-child { border-bottom: 0; }
.costo-row:hover { background: var(--panel2); }
.costo-row.sug { background: var(--green-soft); }
.costo-row input { width: 17px; height: 17px; flex: none; }
.costo-row .ico { font-size: 17px; flex: none; }
.costo-row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.costo-row .txt strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.costo-row .meta { color: var(--muted); font-size: 11.5px; }
.costo-row .num { flex: none; font-variant-numeric: tabular-nums; }
.brief { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-top: 12px;
  white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.55;
  max-height: 460px; overflow: auto; user-select: text; }
.week { display: grid; grid-template-columns: repeat(7, minmax(140px,1fr)); gap: 8px; overflow-x: auto; }
.week .col { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 200px; }
.week .col.today { border-color: var(--accent); }
.week .col h4 { font-size: 12px; text-transform: capitalize; margin-bottom: 6px; color: var(--muted); }
.ev-card { background: var(--panel2); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; font-size: 12px; cursor: pointer; border-left: 3px solid var(--accent); }
.ev-card.alta { border-left-color: var(--red); } .ev-card.baja { border-left-color: var(--muted); }
.ev-card.done { opacity: .55; text-decoration: line-through; }

.goal-card .top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.goal-card .emoji { font-size: 28px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13px; margin-top: 10px; }
.kv span:nth-child(odd) { color: var(--muted); }
.kv span:nth-child(even) { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.analysis h4 { font-size: 13px; margin: 14px 0 6px; }
.analysis ul { margin: 0; padding-left: 20px; } .analysis li { margin: 4px 0; }
.cat-editor .cat { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.sub-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--panel2); border-radius: 99px; padding: 3px 4px 3px 10px; margin: 3px; font-size: 12px; }
.sub-chip button { border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.day-strip { display: flex; gap: 6px; flex-wrap: wrap; }
.day-strip .d { width: 44px; text-align: center; padding: 6px 0; border-radius: 10px; background: var(--panel2); font-size: 11px; cursor: pointer; border: 1px solid transparent; }
.day-strip .d b { display: block; font-size: 15px; }
.day-strip .d.cerrado { background: var(--green-soft); color: var(--green); }
.day-strip .d.con_movimientos { background: var(--yellow-soft); color: var(--yellow); }
.day-strip .d.sin_registro { background: var(--red-soft); color: var(--red); }
.day-strip .d.sel { border-color: var(--accent); }

/* Responsive */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .top-actions .btn:not(.ghost) { padding: 8px 10px; } }
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  #sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; }
  body.menu-open #sidebar { transform: none; }
  body.menu-open #scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 25; }
  .only-mobile { display: inline-flex !important; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  #topbar { padding: 10px 16px; flex-wrap: wrap; }
  .ask { order: 5; flex-basis: 100%; max-width: none; }
  .top-actions .btn.danger-soft, .top-actions .btn.success-soft { display: none; }
  #view { padding: 16px 16px 90px; }
  #fab { position: fixed; right: 18px; bottom: 18px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 28px; box-shadow: var(--shadow); z-index: 50; align-items: center; justify-content: center; }
  .form-grid { grid-template-columns: 1fr; }
  .cal .day { min-height: 60px; } .cal .ev { display: none; } .cal .day .dots { display: flex !important; }
  .hbar { grid-template-columns: 100px 1fr auto; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-height: 94vh; border-radius: 18px 18px 0 0; }
}
.cal .day .dots { display: none; gap: 2px; margin-top: 4px; flex-wrap: wrap; }
.cal .day .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

@media print {
  #sidebar, #topbar, #fab, .no-print, .toolbar, .tabs { display: none !important; }
  #app { display: block; } #view { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .card, .kpi { break-inside: avoid; border-color: #ccc; }
}
