/* Pressupostos Aubert — SPA styles (docs/19 §14).
   Deliberately small and dependency-free, in the same spirit as
   dashboard/static/index.html: one file, no build step, no framework.

   ── Colour ──────────────────────────────────────────────────────────────────
   Every colour in this file is a token, and every token is defined twice: once
   for the light theme and once for the dark one. No rule below names a colour
   literal, so switching themes is switching one attribute on <html> and nothing
   else — no per-component dark-mode patch, and no rule that quietly keeps a
   hard-coded grey when the theme changes (D-128, docs/19 §14.6).

   The palette itself is Aubert's own, read off aubertsa.com and off the logo
   file rather than invented: the corporate blue #0363cd, the graphite #253237
   the site sets its body text in, its offer red #cf2929, and the two ends of the
   gradient in the "A" of the mark (#5aaede → #3b6da0).

   Light is the base — the corporate site is a light site, so that is what
   "Aubert" looks like. Dark exists because this is a tool people keep open all
   day; it is a re-tuning of the same palette, never a second palette.

   The theme lives in `data-theme` on <html>, set before first paint by the inline
   script in index.html. It is always one of "light" or "dark" — the browser
   preference is *resolved* into a value there rather than left to a media query,
   so the toggle and the stylesheet never disagree about what is showing. */

:root,
[data-theme="light"] {
  /* Brand — fixed points, identical in both themes. */
  --brand: #0363cd;
  --brand-deep: #3b6da0;
  --brand-lift: #5aaede;

  /* Surfaces and text. */
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #253237;              /* aubertsa.com's body colour, not a neutral grey */
  --muted: #5c6b75;             /* AA (4.53:1) on a tinted row, not just on bg */
  --line: #dfe4e9;

  /* Interaction. --on-accent is whatever stays legible ON --accent; it is a token
     precisely because the answer flips with the theme. */
  --accent: var(--brand);
  --on-accent: #ffffff;
  --tint: rgba(3, 99, 205, 0.08);        /* accent wash: row hover, status pill */

  /* Status. */
  --good: #146c43;
  --warn: #8a5a00;
  --bad: #cb2525;              /* the site's own red, 4 points down so it clears
                                  AA over --tint (4.51:1); indistinguishable by eye */

  /* Pieces that invert rather than shade. */
  --toast-bg: #253237;
  --toast-ink: #f4f6f8;

  /* The busy overlay's scrim: the ink colour at low alpha, so the veil is the same
     graphite as the text rather than a neutral black. */
  --scrim: rgba(37, 50, 55, 0.42);

  /* The landing wash — the mark's gradient bled to the corners. */
  --wash-lift: rgba(90, 174, 222, 0.22);
  --wash-deep: rgba(59, 109, 160, 0.20);

  --shadow: 0 1px 2px rgba(37, 50, 55, 0.06), 0 8px 24px rgba(37, 50, 55, 0.07);

  /* The wordmark is black ink and would vanish on a dark surface, so each theme
     names its own file. A token, not a media query, so it follows the toggle —
     and because it is a background rather than two <img> elements, the browser
     fetches only the one in use. */
  --logo: url("./aubert-logo.png");

  --radius: 10px;
}

[data-theme="dark"] {
  --bg: #14181c;
  --surface: #1c2126;
  --ink: #e6ebef;
  --muted: #97a5af;
  --line: #2b333a;

  /* #0363cd is too dark to carry white text on a dark surface, so the accent moves
     to the pale end of the mark's gradient — and the text on it goes dark. */
  --accent: var(--brand-lift);
  --on-accent: #12181d;
  --tint: rgba(90, 174, 222, 0.12);

  --good: #6ee7a8;
  --warn: #f5c96b;
  --bad: #ff8f85;

  --toast-bg: #e6ebef;
  --toast-ink: #14181c;

  /* Darker: on a dark page a light-ink scrim would brighten what it is meant to mute. */
  --scrim: rgba(6, 9, 11, 0.62);

  --wash-lift: rgba(90, 174, 222, 0.10);
  --wash-deep: rgba(59, 109, 160, 0.14);

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);

  --logo: url("./aubert-logo-light.png");
}

/* The form controls the browser draws itself — scrollbars, the date picker, the
   caret — follow this, not the tokens. Without it a dark page keeps a white
   scrollbar and an unreadable native datetime popup. */
:root { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

/* The `hidden` attribute must always win.
   The browser's own rule is `[hidden] { display: none }`, but ANY author rule that
   sets `display` beats it — author styles outrank the UA stylesheet. `.gate` below
   sets `display: grid`, so `gate.hidden = true` set the attribute and changed
   nothing: after logging in, the app rendered underneath a fixed-position overlay
   still showing "Comprobando sesión…". Declaring it once, here, fixes every element
   that uses `hidden` rather than waiting for the next one to bite. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

/* --- brand lockup -------------------------------------------------------- */
/* One rule for both places the mark appears; the width is set per context and the
   height follows the file's own ratio. The image is the --logo token, so the
   black-ink and white-ink files swap with the theme (D-128). The element carries
   role="img" + aria-label in the markup, since a background has no alt text. */
.brandmark {
  display: block;
  aspect-ratio: 440 / 162;
  background: var(--logo) center / contain no-repeat;
}

/* --- landing / login gate (docs/19 §14.6) -------------------------------- */
/* The one page an unauthenticated visitor can reach. It is deliberately almost
   empty: the mark, the tool's name, the session status and a button (D-129). It
   is styled, not informative — anything describing what the tool does or how much
   catalogue is behind it would be describing Aubert's internals to whoever found
   the URL. */
.gate {
  position: fixed;
  inset: 0;
  display: grid;
  /* `minmax(0, 1fr)`, not the implicit `auto`: an auto column is sized by its widest
     content, so on a phone the card set the column wider than the viewport and the
     whole page scrolled sideways. */
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: min-content;
  align-content: center;
  justify-items: center;
  gap: 1.25rem;
  padding: 2rem 1.25rem;
  overflow: auto;
  background:
    /* The mark's own gradient, bled out to the corners at low alpha — brand colour
       without a hero image to ship, cache and keep in sync with the corporate site. */
    radial-gradient(70rem 40rem at 15% -10%, var(--wash-lift), transparent 60%),
    radial-gradient(60rem 40rem at 95% 110%, var(--wash-deep), transparent 60%),
    var(--bg);
}

.gate-card {
  position: relative;
  width: min(26rem, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 2.25rem clamp(1.25rem, 6vw, 2.25rem) 1.75rem;
  text-align: center;
  overflow: hidden;
}

/* The gradient of the "A", laid along the top edge. */
.gate-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-lift), var(--brand), var(--brand-deep));
}

/* The mark is the loudest thing on the page — it is the only element carrying
   Aubert, and at 13rem inside a 30rem card it read as an icon above a form. */
.gate-card .brandmark { width: min(17rem, 78%); margin: 0 auto 1.6rem; }

/* Deliberately quieter than the mark: it names the tool, it does not compete with
   the logo for the top of the page. */
.gate-card h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* The one line that changes: "Comprobando sesión…", "Necesitas iniciar sesión.", or
   a login error. Tinted so it reads as status rather than as more prose. */
.gate-msg {
  /* A pill that hugs its text but still sits on its own line above the button:
     `inline-block` alone let the button ride up beside it. */
  width: fit-content;
  margin: 1.5rem auto 1.25rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: var(--tint);
  color: var(--ink);
  font-size: 0.9rem;
}

button.big {
  padding: 0.65rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 9px;
}


/* --- theme toggle (D-128) ------------------------------------------------- */
/* One control, two places: the header for people who are in, the gate corner for
   people who are not. Both are the same button and share the same handler; which
   glyph shows is decided by the theme attribute, not by JS, so the icon cannot
   drift out of step with the colours. */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 999px;
  color: var(--muted);
  background: none;
  border-color: transparent;
}

.theme-toggle:hover:not(:disabled) { color: var(--accent); border-color: var(--line); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; display: block; }

/* Show the destination, not the current state: on the light theme the button
   offers the moon. */
[data-theme="light"] .theme-toggle .icon-sun,
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* On the gate there is no header to sit in. */
.gate .theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--surface);
  border-color: var(--line);
}

/* --- chrome -------------------------------------------------------------- */
header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-wrap: wrap;
}

/* Logo + product name, separated by a hairline: the mark says Aubert, the word
   beside it says which Aubert tool this is. */
header .brand { display: flex; align-items: center; gap: 0.7rem; }
header .brandmark { width: 6.5rem; }
header h1 {
  font-size: 1.05rem;
  margin: 0;
  padding-left: 0.7rem;
  border-left: 1px solid var(--line);
  font-weight: 600;
  letter-spacing: -0.01em;
}
header nav { display: flex; gap: 0.25rem; }
header .who { margin-left: auto; display: flex; align-items: center; gap: 0.75rem;
              color: var(--muted); font-size: 0.85rem; }

main { padding: 1.5rem; max-width: 72rem; margin: 0 auto; }

/* --- controls ------------------------------------------------------------ */
button {
  font: inherit;
  cursor: pointer;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0.4rem 0.9rem;
}

/* --on-accent rather than white: on the dark theme --accent is the pale end of the
   mark's gradient, and white text on it fails contrast. The token already knows. */
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.link { border: none; background: none; color: var(--accent); padding: 0.2rem 0.4rem; }
button.tab.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

button:hover:not(:disabled) { border-color: var(--accent); }
button.primary:hover:not(:disabled),
button.tab.active:hover { filter: brightness(1.07); }
button:focus-visible, #q:focus-visible, #sync-since:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#q:focus, #sync-since:focus { outline: none; border-color: var(--accent); }

#search-form { display: flex; gap: 0.5rem; }

#q {
  flex: 1;
  font: inherit;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}

.toolbar { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }

/* --- paging (D-137) ------------------------------------------------------- */
/* The page-size control sits at the far end of the toolbar: it is a preference, not
   the action, and it should not stand between "Actualizar" and what it says. */
.page-size { margin-left: auto; display: flex; align-items: center; gap: 0.4rem;
             color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

.page-size select {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}
.page-size select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pager { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.75rem; }
.pager .meta { margin: 0; }
.hint, .meta { color: var(--muted); font-size: 0.85rem; }
.hint { margin: 0.5rem 0 0; }
.meta { margin: 0.75rem 0; }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

/* --- result cards -------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 0.75rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.card code { font-size: 0.85rem; color: var(--muted); }
.card .score { font-weight: 600; color: var(--accent); }
.card .desc { margin: 0.4rem 0 0.6rem; }

.card dl { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; margin: 0; font-size: 0.82rem; }
.card dl div { display: flex; gap: 0.3rem; }
.card dt { color: var(--muted); }
.card dd { margin: 0; }

/* --- tables -------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; background: var(--surface);
        border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line); }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--tint); }
td code { font-size: 0.85rem; }

/* `white-space: nowrap` is what keeps this a pill. The two-word labels — "sin
   petición", "3 mensajes" — wrapped inside the narrow status column, and a wrapped
   inline box draws its rounded border in two open-ended halves: the badge read as a
   broken line rather than as one chip. */
.badge { font-size: 0.75rem; padding: 0.1rem 0.5rem; border-radius: 99px;
         border: 1px solid currentColor; white-space: nowrap; }
.badge.good { color: var(--good); }
.badge.warn { color: var(--warn); }
.badge.bad  { color: var(--bad); }

/* --- case-list filters (D-139) -------------------------------------------- */
/* A <details> is the dropdown: open/close, focus and keyboard come from the
   element, and the only thing styled here is what it looks like. The summary is
   a pill so it reads as a control next to the toolbar's link buttons rather than
   as the disclosure triangle the browser would otherwise draw. */
.filter { position: relative; }

.filter > summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.85rem;
  list-style: none;              /* Firefox */
  padding: 0.2rem 0.75rem;
  user-select: none;
}
.filter > summary::-webkit-details-marker { display: none; }
.filter > summary:hover { border-color: var(--accent); }
.filter > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* An active filter is hiding rows, so it says so on the closed control — the count
   is the only thing on screen that explains why the list is shorter than yesterday. */
.filter.active > summary { border-color: var(--accent); color: var(--accent); }

.filter-menu {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  left: 0;
  max-height: 20rem;
  min-width: 17rem;
  overflow-y: auto;
  padding: 0.4rem;
  position: absolute;
  top: calc(100% + 0.35rem);
  /* Above the sticky header (5), below the toast (20) and the busy overlay (30):
     a message about what just happened outranks the menu that caused it. */
  z-index: 10;
}

.filter-head {
  align-items: baseline;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.15rem 0.4rem 0.35rem;
}
.filter-head .meta { margin: 0; }

.filter-list { list-style: none; margin: 0; padding: 0; }

.filter-option {
  align-items: baseline;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  gap: 0.5rem;
  padding: 0.25rem 0.4rem;
}
.filter-option:hover { background: var(--tint); }
.filter-option input { accent-color: var(--accent); }
.filter-option > span:first-of-type { flex: 1; }
.filter-tally { margin: 0; }

/* The client column's "(deducido)" marker — never wrapped onto its own line, where
   it would read as a second client rather than as a note about the first. */
.client-note { white-space: nowrap; }

/* --- case detail --------------------------------------------------------- */
#case-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 22rem;
  overflow: auto;
  font: 0.88rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
}

#case-attachments { padding-left: 1.1rem; }
h3 { display: flex; align-items: baseline; gap: 0.75rem; margin-top: 1.75rem; }

/* --- busy overlay (D-130) ------------------------------------------------- */
/* A full-viewport scrim over the whole app while a request that has no useful
   partial state is in flight. It is a *modal* wait, not a decoration: the scrim
   swallows every pointer event, and app.js marks #app `inert` so the keyboard
   cannot tab underneath it either. z-index sits above the toast, so an error
   toast raised as the overlay comes down is still on top. */
.busy {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: var(--scrim);
  backdrop-filter: blur(2px);
}

.busy-box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  max-width: min(26rem, calc(100vw - 2rem));
}

.busy-box p { margin: 0; color: var(--ink); font-size: 0.95rem; }
.busy-box:focus { outline: none; }

.spinner {
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Reduced motion still needs a "something is happening" signal, so the ring
   pulses in place instead of not moving at all. */
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: pulse 1.4s ease-in-out infinite;
    border-color: var(--accent);
  }
  @keyframes pulse { 50% { opacity: 0.25; } }
}

/* --- toast --------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--toast-bg);
  color: var(--toast-ink);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  z-index: 20;
}

/* Case thread: the messages a case (a Gmail thread, D-110) is made of. Shown only
   when there is more than one, so a plain forward stays as uncluttered as before. */
.thread {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.thread li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--line);
}

.thread li:last-child { border-bottom: none; }

.thread li .meta { margin-right: 0.5rem; }

.thread li strong { margin-right: 0.5rem; }

/* Expert notes (D-155): what the forwarder wrote above the forwarded content.
   Accent-edged cards, not thread rows — these are instructions generation obeyed,
   and a reviewer must be able to tell them from the correspondence at a glance. */
.notes {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.notes li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.5rem 0.85rem;
  margin-bottom: 0.5rem;
}

.notes li p {
  margin: 0.25rem 0 0;
  white-space: pre-wrap;
}

/* --- mail sync (D-117) ---------------------------------------------------- */
/* A panel above the case list rather than a separate view: recovering missed mail
   is something you do *to* that list, and the result appears in it. */
.sync {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

#sync-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#sync-form label { font-size: 0.9rem; }

#sync-since {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

button:disabled { opacity: 0.55; cursor: default; }

.sync-items { list-style: none; margin: 0; padding: 0; }

.sync-items li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.sync-items li:last-child { border-bottom: none; }

/* The subject is the only part worth truncating: the rest is short and fixed. Keyed
   on the class, not on :last-child — a failed row carries a trailing detail span, so
   last-child would clip the error message and let the long subject widen the row, i.e.
   truncate the wrong thing on exactly the rows that need it. */
.sync-items li .subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Budget options accordion (D-131) ------------------------------------- *
 * Every colour below is a token: a literal here would stay light when the theme
 * flips, which is the rule §14.6 sets for anything styled after it.            */

.disclosure-cell { width: 2rem; }

.budget .disclosure {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius);
}
.budget .disclosure:hover { background: var(--tint); color: var(--ink); }

/* The chosen row, marked on the row rather than only on the cell, so the eye finds
   it while scanning the Concepto column rather than the Descripción one. */
.budget tr.picked > td { background: var(--tint); }

/* Scoped to the budget table, and that scoping is load-bearing. As a bare `.badge`
   this rule out-ordered the status pill above (same specificity, later in the file)
   and repainted every state chip in Correos with an accent background — while
   `.badge.good/.warn/.bad` kept setting the *text* colour. Green on brand blue is
   1.13:1. A filled badge and an outlined one cannot share a class name at the top
   level of this stylesheet. */
.budget .badge {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius);
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  vertical-align: middle;
  white-space: nowrap;
}

.options-list { list-style: none; margin: 0.25rem 0 0; padding: 0; }
.options-list li { margin: 0 0 0.25rem; }

.budget .option {
  align-items: baseline;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  text-align: left;
  width: 100%;
}
.budget .option:hover { border-color: var(--accent); background: var(--tint); }

/* The one already applied. Not disabled: clicking it is how you confirm it is the
   one, and disabling would make the current choice the only thing you cannot point
   at deliberately. */
.budget .option.current {
  border-color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent);
}
.budget .option code { color: var(--muted); flex: 0 0 auto; }

.budget .restore { margin-top: 0.4rem; font-size: 0.8rem; }

/* The whole row is the disclosure (D-131). The arrow is left as a marker: it is
   aria-hidden and untabbable, because the row itself carries role/tabindex and two
   focusable controls for one action is a keyboard trap of the boring kind. */
.budget tr.expandable { cursor: pointer; }
.budget tr.expandable:hover > td { background: var(--tint); }
.budget tr.expandable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
/* The options panel is not a click target for the row toggle; make that visible. */
.budget tr.options > td { cursor: default; }

/* --- Prices and totals (D-135) -------------------------------------------- */

/* Money and counts are right-aligned and tabular so digits line up down a column;
   comparing two prices should not require reading them. */
.budget th.num, .budget td.num, .budget-totals td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* "(supuesto)" / "(deducido del correo)" — quiet, because it qualifies the number
   rather than competing with it, but present, because a 1 nobody asked for and a 1
   the customer wrote are different facts. */
.qty-note { font-size: 0.75rem; white-space: nowrap; }

.budget .option-price {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--muted);
}

.budget-totals {
  margin: 0.75rem 0 0 auto;
  border-collapse: collapse;
  min-width: 16rem;
}
.budget-totals th {
  text-align: left;
  font-weight: 400;
  color: var(--muted);
  padding: 0.25rem 1rem 0.25rem 0;
}
.budget-totals td { padding: 0.25rem 0; }
.budget-totals tr.grand th,
.budget-totals tr.grand td {
  border-top: 1px solid var(--line);
  padding-top: 0.45rem;
  font-weight: 600;
  color: var(--ink);
  font-size: 1.05rem;
}
.totals-note { text-align: right; margin-top: 0.35rem; }
