/* Horas de MatheyBTC — tema claro, letra oscura. Registro denso tipo planilla. */
:root {
  --bg: #ffffff; --fg: #1c232b; --muted: #5a6572; --line: #dfe3e8; --panel: #f6f7f9; --head: #eef1f4;
  --input: #c9d0d7; --ok: #1f7a4d; --warn: #9a5b00; --bad: #b3261e; --accent: #c2600a; --hover: #fbf4ec; --sel: #f8e7d6;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
[hidden] { display: none !important; }
.ing { display: grid; gap: 24px; max-width: 1600px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left)); }
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
h1 { font: 400 28px/1.2 Georgia, "Times New Roman", serif; margin: 0; }
h2 { font-size: 18px; font-weight: 600; margin: 0; }
h3 { font-size: 14px; font-weight: 600; margin: 0; }
.who { font-size: 12px; color: var(--muted); }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 20px; min-width: 0; display: grid; gap: 14px; background: var(--bg); }
.inner { display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--bg); }
.hint { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.45; }

form { display: grid; gap: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; }
label.f { display: grid; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
label.f.wide { grid-column: 1 / -1; }
.inp { font: inherit; color: var(--fg); background: #fff; border: 1px solid var(--input); border-radius: 6px; padding: 6px 8px; min-width: 0; width: 100%; }
textarea.inp { min-height: 48px; resize: vertical; }
.inp:focus-visible, button:focus-visible, tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.switch { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin: 0; display: grid; gap: 14px; min-width: 0; background: var(--panel); }
legend { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 6px; }

.money { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 64px; gap: 8px 10px; align-items: center; }
.money.rep { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.money.hdrow span { font-size: 12px; color: var(--muted); }
#f-lineas { display: grid; gap: 8px; }
@media (max-width: 640px) { .money, .money.rep { grid-template-columns: 1fr 1fr; } .money.hdrow { display: none; } }
.calc { font-variant-numeric: tabular-nums; padding: 7px 8px; border: 1px dashed var(--input); border-radius: 6px; background: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc.strong { font-weight: 600; }

button { font: inherit; font-size: 13px; border-radius: 6px; border: 1px solid var(--input); background: #fff; color: var(--fg); padding: 6px 12px; cursor: pointer; }
button:hover { border-color: var(--muted); }
button:disabled { opacity: .6; cursor: wait; }
button.primary { background: var(--fg); color: #fff; border-color: var(--fg); font-weight: 600; }
button.danger { color: var(--bad); border-color: var(--bad); }
button.link { border: 0; background: none; padding: 6px 4px; color: var(--muted); text-decoration: underline; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.presets span { font-size: 12px; color: var(--muted); }
.msg { margin: 0; font-size: 13px; }
.msg.ok { color: var(--ok); } .msg.bad { color: var(--bad); }

.obs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.obs li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; line-height: 1.45; }
.chip { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; color: var(--muted); background: #fff; }
.chip.warn { color: var(--warn); border-color: #e3c38f; background: #fff8ec; }
.chip.bad { color: var(--bad); border-color: #ecb4b0; background: #fdf1f0; }
.chip.ok { color: var(--ok); border-color: #a9d3bd; background: #eef8f2; }
.when { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }

.tablewrap { overflow: auto; max-height: 75vh; border: 1px solid var(--line); border-radius: 6px; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
thead { position: sticky; top: 0; z-index: 2; }
th { background: var(--head); font-weight: 600; text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr.flt th { padding: 4px 6px; border-bottom: 2px solid var(--input); }
tr.flt input { font: inherit; font-size: 12px; width: 100%; min-width: 70px; padding: 3px 6px; border: 1px solid var(--input); border-radius: 4px; background: #fff; color: var(--fg); }
td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; background: #fff; }
td.n, th.n { text-align: right; white-space: nowrap; }
td.nw { white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--hover); }
tbody tr.sel td { background: var(--sel); }
td .l + .l { border-top: 1px dotted var(--line); margin-top: 2px; padding-top: 2px; }
.count { font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
