/* PPQ design system — B&W print-shop identity, migrated from the PrintPilot handoff (2026-07-20).
   Paper ground, near-black ink accent, Inter (UI) + JetBrains Mono (numbers/IDs/prices/kickers).
   Currency stays USD $ — this file changes visuals only, no logic. */
:root {
  /* ---- Design tokens (verbatim from the spec's token table) ---- */
  --paper: #F6F6F4;
  --paper-2: #ECECEA;
  --card: #FFFFFF;
  --card-2: #FAFAF9;
  --ink: #141413;
  --ink-2: #5B5B58;
  --ink-3: #6B6B66;
  --line: #E6E6E3;
  --line-2: #D7D7D3;
  --indigo: #161615;
  --indigo-2: #000000;
  --indigo-tint: #EDEDEA;
  --indigo-ink: #161615;
  --green: #2F6A3E; --green-tint: #E2ECE3;
  --red: #9E3B30; --red-tint: #F0E1DE;
  --amber: #8A6410; --amber-tint: #F0EAD9;
  --blue: #3A5566; --blue-tint: #E6EAEC;

  --r: 10px; --r-lg: 16px; --r-sm: 7px;
  --sh-sm: 0 1px 2px rgba(60,45,20,.06);
  --sh: 0 2px 8px rgba(60,45,20,.08), 0 1px 2px rgba(60,45,20,.05);
  --sh-lg: 0 12px 30px rgba(50,38,18,.14), 0 3px 8px rgba(50,38,18,.08);

  /* ---- Back-compat aliases: existing templates/CSS reference these names ---- */
  --bg: var(--paper);
  --surface: var(--card);
  --surface-subtle: var(--card-2);
  --surface-muted: var(--paper-2);
  --border: var(--line);
  --border-strong: var(--line-2);
  --ink-muted: var(--ink-2);
  --ink-subtle: var(--ink-3);
  --accent: var(--indigo);
  --accent-hover: var(--indigo-2);
  --accent-soft: var(--indigo-tint);
  --success: var(--green); --success-bg: var(--green-tint); --success-border: var(--green-tint);
  --warning: var(--amber); --warning-bg: var(--amber-tint); --warning-border: var(--amber-tint);
  --danger: var(--red);   --danger-bg: var(--red-tint);   --danger-border: var(--red-tint);
  --info: var(--blue);    --info-bg: var(--blue-tint);    --info-border: var(--blue-tint);
  --radius-sm: var(--r-sm); --radius: var(--r); --radius-md: var(--r); --radius-lg: var(--r-lg);
  --shadow-xs: var(--sh-sm); --shadow-sm: var(--sh); --shadow: var(--sh-lg);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { background: var(--paper); color: var(--ink); }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.4px; line-height: 1.22; margin: 0; }
h1 { font-size: 1.4rem; }
a { color: inherit; text-decoration: none; }
.mono { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; }
.kicker {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-3);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
::selection { background: var(--indigo-tint); }

/* ---- Layout: 236px sidebar + fluid content on paper ground ---- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex-shrink: 0; background: var(--card-2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 0 .75rem;
}
.sidebar .brand { padding: 1.25rem 1rem .5rem; text-align: center; }
.sidebar .brand img { width: 100%; height: auto; max-width: 150px; }
.sidebar .brand .subtitle {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-2); margin-top: .35rem;
}
.nav { flex: 1; padding-top: .5rem; display: flex; flex-direction: column; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .75rem; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 13.5px; font-weight: 500; transition: color .15s var(--ease), background .15s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--card); }
.nav a.active { background: var(--indigo-tint); color: var(--indigo-ink); font-weight: 700; }
.nav a svg { width: 15px; height: 15px; color: var(--ink-3); flex-shrink: 0; }
.nav a.active svg { color: var(--indigo-ink); }
.nav .group-label {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); padding: 1rem .75rem .25rem;
}
.sidebar .userbox { padding: .75rem .5rem; display: flex; align-items: center; gap: .6rem; border-top: 1px solid var(--line); margin-top: auto; }
.sidebar .avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--indigo-tint); color: var(--indigo-ink);
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.sidebar .userbox .who { min-width: 0; flex: 1; }
.sidebar .userbox .who .n { font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .userbox .who .e { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .userbox a.logout { color: var(--ink-3); padding: .35rem; border-radius: var(--r-sm); }
.sidebar .userbox a.logout:hover { color: var(--red); background: var(--card); }

.content { flex: 1; min-width: 0; background: var(--paper); }
/* Content fills the available width (data dashboard); padding grows on large screens so it breathes. */
.page { padding: 1.5rem 1.75rem; }
@media (min-width: 1600px) { .page { padding: 2rem 3rem; } }
.page-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.page-head .spacer { margin-left: auto; }

/* Mobile top bar (hamburger) — hidden on desktop */
.topbar { display: none; align-items: center; gap: .75rem; padding: .6rem 1rem; border-bottom: 1px solid var(--line); background: var(--card-2); }
.topbar-btn { display: inline-flex; padding: .4rem; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--card); color: var(--ink); cursor: pointer; }
.topbar-logo { height: 22px; width: auto; }
.nav-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }

@media (max-width: 860px) {
  .topbar { display: flex; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
    transform: translateX(-100%); transition: transform .2s var(--ease); box-shadow: var(--sh-lg);
  }
  .sidebar.open { transform: none; }
  .page { padding: 1.25rem 1rem; }
}
@media (min-width: 861px) {
  .nav-overlay { display: none !important; }
}

/* Responsive KPI grid + wizard field rows */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 1.25rem; }
.row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.row.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 820px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .row.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .row.cols-3, .row.cols-4 { grid-template-columns: 1fr; }
}

/* ---- Buttons ---- (bare `.btn` is primary, matching the templates) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 700; font-size: 13.5px; padding: .55rem 1rem; border-radius: var(--r);
  border: 1px solid transparent; cursor: pointer; transition: all .15s var(--ease); text-decoration: none;
  background: var(--indigo); color: #fff; box-shadow: var(--sh-sm);
}
.btn:hover { background: var(--indigo-2); box-shadow: var(--sh); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--indigo); color: #fff; }  /* explicit alias */
.btn-secondary, .btn.secondary {
  background: var(--card); color: var(--ink); border-color: var(--line-2); box-shadow: none;
}
.btn-secondary:hover, .btn.secondary:hover { border-color: var(--ink-2); background: var(--card-2); color: var(--ink); }
.btn-sm { padding: .35rem .7rem; font-size: 13px; }

/* ---- Forms ---- */
label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin: .5rem 0 .3rem; }
input, select, textarea {
  width: 100%; padding: .55rem .7rem; font: inherit; font-size: 14px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--card);
  color: var(--ink); transition: all .15s var(--ease); outline: none;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(22,22,21,.1); }
input[type=range] { -webkit-appearance: none; appearance: none; height: 5px; border-radius: 99px; background: var(--paper-2); outline: none; padding: 0; border: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 18px; width: 18px; border-radius: 50%; background: var(--indigo); border: 3px solid #fff; box-shadow: var(--sh-sm); cursor: pointer; }
input[type=checkbox] { width: auto; margin: 0; accent-color: var(--indigo); }

/* ---- Panels / cards ---- */
.panel, .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.15rem; margin-bottom: 1rem; }
.panel-elevated { box-shadow: var(--sh); border-radius: var(--r-lg); }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
th, td { padding: .65rem .8rem; text-align: left; border-bottom: 1px solid var(--line); }
th {
  background: var(--card-2);
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 700;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--card-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Horizontal-scroll safety for wide tables on small viewports */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r); }
.table-wrap > table { margin: 0; }
.nowrap, td.mono, td.num, th.num { white-space: nowrap; }

/* ---- Pills / badges ---- status map: Borrador→neutral · Enviada→blue · Aceptada→green · Rechazada→red · Vencida→amber */
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 99px; font-size: 11.5px; font-weight: 700; border: 1px solid transparent; }
.pill.draft { background: var(--paper-2); color: var(--ink-2); }
.pill.sent { background: var(--blue-tint); color: var(--blue); }
.pill.accepted { background: var(--green-tint); color: var(--green); }
.pill.rejected { background: var(--red-tint); color: var(--red); }
.pill.expired { background: var(--amber-tint); color: var(--amber); }
.pill.pending { background: var(--amber-tint); color: var(--amber); }
.badge { display: inline-flex; padding: .1rem .45rem; border-radius: var(--r-sm); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; background: var(--indigo-tint); color: var(--indigo-ink); }

/* ---- Stat cards ---- */
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; }
.stat-card .label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.stat-card .value { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: 26px; font-weight: 800; margin-top: 3px; }
.stat-card .value.green { color: var(--green); }
.stat-card .value.amber { color: var(--amber); }
.stat-card .value.red { color: var(--red); }

/* ---- Utilities ---- */
.eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); }
.warn { color: var(--amber); }
.grid2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.25rem; align-items: start; }
.row { display: grid; gap: .6rem; align-items: end; }
.price { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: 1.6rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.price .cur { font-size: .85rem; color: var(--ink-3); font-weight: 600; }
.stat { display: flex; gap: 2rem; align-items: baseline; flex-wrap: wrap; }

/* ---- Auth (login / status) ---- */
body.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-lg); padding: 2rem 2rem 2.25rem; width: 340px; text-align: center;
}
.auth-logo { width: 130px; height: auto; margin: 0 auto .25rem; display: block; }
.auth-sub {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 1.25rem;
}
.auth-card h1 { font-size: 1.15rem; margin: .5rem 0; }
.auth-card label { text-align: left; }
.auth-card form { text-align: left; }

/* ---- Auth: two-column internal login (handoff §1) ---- */
.auth-2col { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; }
.auth-left {
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem 2rem; background: var(--paper);
}
.auth-form-wrap { width: 100%; max-width: 360px; }

.auth-brand-row { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.75rem; }
.auth-brand-logo { height: 30px; width: auto; display: block; }
.auth-brand-divider { width: 1px; height: 18px; background: var(--line-2); flex-shrink: 0; }

.auth-title { font-size: 26px; margin-bottom: .4rem; }
.auth-subtitle { font-size: 14px; color: var(--ink-2); margin: 0 0 1.75rem; }

.auth-form label { font-size: 12.5px; }
.auth-form input[type="email"], .auth-form input[type="text"], .auth-form input[type="password"] {
  padding: 11px 13px;
}

.auth-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: .9rem 0 1.25rem; }
.auth-remember {
  display: flex; align-items: center; gap: .4rem; margin: 0;
  font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink);
}
.auth-remember input[type="checkbox"] { width: auto; }
.auth-link { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.auth-link:hover { color: var(--ink); text-decoration: underline; }

.auth-submit { width: 100%; padding: 12px; margin-top: .25rem; }

.auth-footer { margin-top: 1.75rem; font-size: 13px; color: var(--ink-2); text-align: center; }
.auth-footer a { font-weight: 700; color: var(--ink); text-decoration: underline; }

.auth-right {
  position: relative; overflow: hidden; background: var(--indigo);
  display: flex; align-items: flex-end;
}
.auth-right::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.7) 1px, transparent 1px);
  background-size: 20px 20px; opacity: .1;
}
.auth-promo { position: relative; padding: 3rem 3rem 3.5rem; max-width: 460px; }
.auth-promo-kicker { color: rgba(255,255,255,.65); margin-bottom: .9rem; }
.auth-promo-title { font-size: 30px; font-weight: 800; color: #fff; letter-spacing: -.4px; margin: 0 0 .75rem; line-height: 1.2; }
.auth-promo-text { font-size: 14px; color: rgba(255,255,255,.85); margin: 0; line-height: 1.5; }

@media (max-width: 860px) {
  .auth-2col { grid-template-columns: 1fr; }
  .auth-right { display: none; }
}

/* ---- Flash messages ---- */
.flash { padding: .55rem .75rem; border-radius: var(--r); font-size: .85rem; margin-bottom: .75rem; border: 1px solid transparent; }
.flash.error, .flash.danger { background: var(--red-tint); color: var(--red); border-color: var(--red-tint); }
.flash.success { background: var(--green-tint); color: var(--green); border-color: var(--green-tint); }
.flash.warning { background: var(--amber-tint); color: var(--amber); border-color: var(--amber-tint); }
.flash.info { background: var(--blue-tint); color: var(--blue); border-color: var(--blue-tint); }

/* ---- CRUD list actions / form layout ---- */
.actions { display: flex; gap: .4rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.field { margin-bottom: .3rem; }
.field .errorlist { color: var(--red); font-size: .78rem; list-style: none; padding: 0; margin: .2rem 0 0; }
.field.checkbox { display: flex; align-items: center; gap: .45rem; }
.field.checkbox label { margin: 0; order: 2; text-transform: none; font-size: .9rem; color: var(--ink); letter-spacing: 0; }
/* ---- Config hub (handoff §7): icon-tile cards, grouped by section ---- */
.config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.config-tile {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; transition: all .15s var(--ease);
}
.config-tile:hover { border-color: var(--ink); box-shadow: var(--sh); }
.icon-tile {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r); background: var(--indigo-tint); color: var(--ink);
  margin-bottom: .75rem;
}
.icon-tile svg { width: 20px; height: 20px; display: block; }
.config-tile-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.config-tile-desc { font-size: 12.5px; color: var(--ink-2); margin-top: .25rem; }

/* ---- Quote wizard (handoff §3): header, 1fr/380px grid, numbered sections, sticky live panel ---- */
.wizard-header { display: flex; align-items: center; gap: 1rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.wizard-header .back-btn { padding: .5rem; flex-shrink: 0; }
.wizard-header .back-btn svg { width: 16px; height: 16px; display: block; }
.wizard-header .titles { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.wizard-header .titles h1 { font-size: 22px; }
.wizard-header .spacer { margin-left: auto; flex-shrink: 0; display: flex; gap: .5rem; }

.wizard-grid { display: grid; grid-template-columns: 1fr 380px; gap: 1.75rem; align-items: start; }
.wizard-left { display: flex; flex-direction: column; gap: 1.5rem; }
.wizard-section { display: flex; flex-direction: column; gap: .6rem; }
.wizard-section-label { letter-spacing: .1em; }

.wizard-line-card { position: relative; }
.wizard-line-card + .wizard-line-card { margin-top: .9rem; }
.wizard-line-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .2rem; }

.wizard-right { position: sticky; top: 1.5rem; }

/* Slider fields: track/thumb come from the base input[type=range] rule (A1); this adds the live mono readout */
.slider-field { margin: .7rem 0 .3rem; }
.slider-row { display: flex; align-items: center; gap: 1rem; }
.slider-row input[type="range"] { flex: 1; }
.slider-row input[type="number"] { width: 92px; flex: 0 0 92px; }
.slider-value { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-weight: 800; flex-shrink: 0; text-align: right; min-width: 3.4em; }
.slider-value.qty { font-size: 22px; }
.slider-value.margin { font-size: 20px; }

/* Live breakdown panel */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; animation: livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(47,106,62,.35); } 50% { opacity: .55; box-shadow: 0 0 0 3px rgba(47,106,62,0); } }
.breakdown-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.breakdown-row { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .6rem; font-size: 13px; }
.breakdown-row table td { font-size: 13px; padding: .35rem .5rem; }
.breakdown-total-band {
  background: var(--indigo); color: #fff; border-radius: var(--r); padding: .9rem 1rem;
  margin-top: 1rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
}
.breakdown-total-band .t-label { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.breakdown-total-band .t-sub { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: 11px; opacity: .7; margin-top: .2rem; }
.breakdown-total-band .t-value { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: 24px; font-weight: 800; text-align: right; }

@media (max-width: 980px) {
  .wizard-grid { grid-template-columns: 1fr; }
  .wizard-right { position: static; }
}

/* ---- Quote detail (handoff §4): 1fr/320px grid, cost breakdown, client card, history timeline ---- */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
.detail-card-title { font-size: 15px; font-weight: 700; margin-bottom: .75rem; }

.breakdown-line + .breakdown-line { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.breakdown-line-label { font-size: 12px; color: var(--ink-3); margin-bottom: .35rem; }
.breakdown-component-row { display: flex; justify-content: space-between; gap: .75rem; font-size: 13px; padding: .25rem 0; }
.breakdown-total-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: .75rem;
  border-top: 2px solid var(--ink); margin-top: .9rem; padding-top: .75rem;
  font-size: 15px; font-weight: 800;
}

/* Avatar tile: 44px mono avatar, radius 11px, indigo-tint bg (customer/client identity chip) */
.avatar-tile {
  width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0;
  background: var(--indigo-tint); color: var(--indigo-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}

/* Historial timeline: connecting line + dots, filled ink = current, line-2 = prior */
.timeline { display: flex; flex-direction: column; }
.timeline-item { position: relative; padding-left: 1.1rem; padding-bottom: 1rem; border-left: 2px solid var(--line); margin-left: 3px; }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-dot { position: absolute; left: -6px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--line-2); }
.timeline-dot.done { background: var(--ink); border-color: var(--ink); }
.timeline-title { font-size: 13px; font-weight: 600; }
.timeline-time { font-size: 11px; color: var(--ink-3); margin-top: .15rem; }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
}

/* ---- Customer directory (handoff §5): responsive card grid ---- */
.customer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.customer-card {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; transition: all .15s var(--ease);
}
.customer-card:hover { border-color: var(--ink); box-shadow: var(--sh); }
.customer-card-head { display: flex; align-items: center; gap: .75rem; }
.customer-card-info { min-width: 0; flex: 1; }
.customer-card-name { font-size: 15px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-card-contact { font-size: 12px; color: var(--ink-2); margin-top: .15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-card-footer { display: flex; gap: 1.5rem; margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--line); }
.customer-stat-label { font-size: 11px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.customer-stat-value { font-size: 17px; font-weight: 700; margin-top: .15rem; }
.customer-stat-value.green { color: var(--green); }

/* ---- Usuarios (handoff §8): 32px round mono avatar + name in the Usuario cell ---- */
.user-cell { display: flex; align-items: center; gap: .65rem; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--indigo-tint); color: var(--indigo-ink);
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-name { font-weight: 600; }

/* ---- Accessibility: keyboard focus + reduced motion ---- */
a:focus-visible, button:focus-visible, .btn:focus-visible,
.nav a:focus-visible, .config-tile:focus-visible, .customer-card:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--indigo); outline-offset: 2px; border-radius: var(--r-sm);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .live-dot { animation: none; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.status-icon { color: var(--ink-2); margin-bottom: .25rem; }
.status-icon svg { width: 34px; height: 34px; }

/* ---- HTMX loading feedback ---- */
.htmx-indicator { opacity: 0; transition: opacity .15s var(--ease); }
.htmx-request.htmx-indicator, .htmx-request .htmx-indicator { opacity: 1; }
.breakdown-indicator { position: absolute; top: -1.35rem; right: 0; color: var(--ink-3); }
#breakdown { transition: opacity .15s var(--ease); }
#breakdown.htmx-request { opacity: .6; }

/* Whole-row navigation (single-link rows only) */
tbody tr.clickable { position: relative; cursor: pointer; }
tr.clickable a.row-stretch::after { content: ""; position: absolute; inset: 0; }

/* ---- Small shared utilities ---- */
.form-hint { font-size: .78rem; color: var(--ink-2); margin-top: .15rem; }
.inline-form { display: inline; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.page-head h1 { margin: 0; }

/* Hex color field: native swatch synced with an editable hex text input (core.forms.HexColorWidget) */
.hexfield { display: inline-flex; align-items: center; gap: .4rem; width: 100%; }
.hexfield-swatch { width: 40px; height: 36px; flex-shrink: 0; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--card); cursor: pointer; }
.hexfield-text { flex: 1; min-width: 0; text-transform: uppercase; }
