/* KitLog design system: one font, one accent, generous whitespace. */
:root {
  --ink: #1a2b32; --muted: #5b6f78; --line: #dfe7ea; --bg: #ffffff;
  --wash: #f4f8f7; --accent: #147d64; --accent-dark: #0e5c4a;
  --warn-bg: #fff7e6; --warn-ink: #7a5200; --danger: #b3392e; --ok: #147d64;
  --radius: 10px;
}
* { box-sizing: border-box; }
/* The `hidden` attribute must beat display rules like .inline (same specificity)
   so toggled price/CTA variants actually hide. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.55;
  display: flex; flex-direction: column; min-height: 100vh; }
main.container { flex: 1 0 auto; }
.footer { flex-shrink: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* width:100% + min-width:0 — as a flex item of body with auto side margins,
   the container would otherwise size to fit-content, letting wide data tables
   force the layout wider than the viewport on phones. */
.container { width: 100%; max-width: 1000px; min-width: 0; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

/* Nav */
.nav { display: flex; align-items: center; gap: 1.1rem; padding: .8rem 1.25rem; border-bottom: 1px solid var(--line);
  flex-wrap: wrap; }
.nav a { color: var(--ink); font-size: .95rem; }
.nav a.brand { font-weight: 700; font-size: 1.05rem; display: inline-flex; align-items: center; gap: .45rem; }
.brand-mark { width: 1.4em; height: 1.4em; vertical-align: -.3em; border-radius: 5px; }
.footer .brand-mark { width: 1.15em; height: 1.15em; }
.nav .spacer { flex: 1; }
.inline { display: inline; }
.linklike { background: none; border: none; color: var(--ink); cursor: pointer; font: inherit; padding: 0; }
.linklike:hover { text-decoration: underline; }

/* Company account dropdown (native <details>, no JS) */
details.account-menu { position: relative; }
details.account-menu summary { cursor: pointer; list-style: none; color: var(--ink); font-size: .95rem; }
details.account-menu summary::-webkit-details-marker { display: none; }
details.account-menu[open] summary { color: var(--accent-dark); font-weight: 600; }
.account-menu-panel { position: absolute; right: 0; top: 100%; margin-top: .5rem; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem;
  box-shadow: 0 10px 28px rgba(0,0,0,.14); min-width: 200px; z-index: 20; }
.account-menu-panel .account-name { font-weight: 600; }
.account-menu-panel .account-number { color: var(--muted); font-size: .85rem; margin: .15rem 0 .8rem; }

/* Banners & messages */
.banner { padding: .55rem 1.25rem; font-size: .92rem; }
.banner-warn { background: var(--warn-bg); color: var(--warn-ink); }
.banner-impersonate { background: #ffe9e6; color: var(--danger); font-weight: 600; }
.messages { max-width: 1000px; margin: .8rem auto 0; padding: 0 1.25rem; }
.msg { padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: .5rem; font-size: .93rem; }
.msg-success { background: #e7f5f0; color: var(--accent-dark); }
.msg-error { background: #fdeceb; color: var(--danger); }
.msg-info { background: var(--wash); color: var(--muted); }

/* Buttons — micro-interactions: gentle lift + shadow on hover, snap back on press */
.btn { display: inline-block; padding: .55rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: .95rem; cursor: pointer; font-family: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease; }
.btn:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(20,125,100,.16); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-danger { color: var(--danger); border-color: #eccfcc; }
.btn-danger:hover { border-color: var(--danger); box-shadow: 0 4px 14px rgba(179,57,46,.14); }
.btn-sm { padding: .3rem .7rem; font-size: .85rem; }

/* Hero + marketing */
.hero { text-align: center; padding: 3.5rem 0 2.5rem;
  background: radial-gradient(1100px 480px at 85% -15%, rgba(20,125,100,.09), transparent 60%),
              radial-gradient(800px 380px at -10% 115%, rgba(20,125,100,.05), transparent 55%); }
.hero h1 { font-size: 2.6rem; margin: 0 0 .6rem; letter-spacing: -.02em; }
.hero p.sub { font-size: 1.2rem; color: var(--muted); max-width: 640px; margin: 0 auto 1.6rem; }
.hero .cta-note { font-size: .88rem; color: var(--muted); margin-top: .6rem; }
/* Two-column hero (text + product mockup) used on the homepage */
.hero.hero-split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; align-items: center;
  text-align: left; }
/* min-width:0 — grid items otherwise refuse to shrink below the mockup's
   nowrap text (min-content), overflowing the viewport on phones. */
.hero.hero-split > div { min-width: 0; }
.hero.hero-split p.sub { margin: 0 0 1.6rem; }
@media (max-width: 880px) {
  .hero.hero-split { grid-template-columns: 1fr; text-align: center; }
  .hero.hero-split p.sub { margin: 0 auto 1.6rem; }
  /* width:100% matters: with auto margins alone the item shrink-to-fits and
     floors at the mockup's nowrap min-content, overflowing small screens. */
  .hero-vis { width: 100%; max-width: 460px; margin: 0 auto; }
}
.section { padding: 2.2rem 0; border-top: 1px solid var(--line); }
.section h2 { font-size: 1.5rem; margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; background: #fff;
  transition: box-shadow .2s ease, transform .2s ease; }
.cards .card:hover { box-shadow: 0 8px 24px rgba(26,43,50,.08); transform: translateY(-2px); }
.card.washed { background: var(--wash); border: none; }
.quote { font-style: italic; color: var(--muted); }
.price-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem;
  transition: box-shadow .2s ease, transform .2s ease; }
.price-card:hover { box-shadow: 0 10px 28px rgba(26,43,50,.10); transform: translateY(-2px); }
.price-card.featured { border: 2px solid var(--accent); }

/* Dashboard mockup in the hero — pure HTML/CSS so it's always crisp, always
   current-brand, and costs no image bytes. Decorative only (aria-hidden). */
.app-mock { border: 1px solid var(--line); border-radius: 12px; background: #fff;
  box-shadow: 0 24px 60px rgba(26,43,50,.16), 0 4px 14px rgba(26,43,50,.07);
  overflow: hidden; font-size: .78rem; pointer-events: none; user-select: none; }
.mock-bar { display: flex; align-items: center; gap: .35rem; padding: .5rem .7rem;
  background: var(--wash); border-bottom: 1px solid var(--line); }
.mock-bar i { width: .55rem; height: .55rem; border-radius: 50%; background: var(--line); }
.mock-bar em { font-style: normal; color: var(--muted); font-size: .7rem; margin-left: .5rem;
  background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: .1rem .6rem; }
.mock-body { padding: .9rem 1rem 1rem; }
.mock-title { font-weight: 700; margin-bottom: .5rem; display: flex; align-items: center; gap: .5rem; }
.mock-att { display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem;
  border: 1px solid var(--line); border-left: 3px solid transparent; }
.mock-att:first-of-type { border-radius: 8px 8px 0 0; }
.mock-att + .mock-att { border-top: none; border-radius: 0 0 8px 8px; }
.mock-att.urgent { border-left-color: var(--danger); background: #fdf6f5; }
.mock-att.warn { border-left-color: var(--warn-ink); }
.mock-att .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-btn { border: 1px solid var(--line); border-radius: 7px; padding: .18rem .5rem;
  white-space: nowrap; color: var(--ink); background: #fff; }
.mock-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .8rem; }
.mock-stats div { border: 1px solid var(--line); border-radius: 8px; padding: .45rem .55rem; }
.mock-stats b { display: block; font-size: 1.05rem; }
.mock-stats small { color: var(--muted); }
.price { font-size: 2rem; font-weight: 700; }
.price small { font-size: 1rem; font-weight: 400; color: var(--muted); }
/* Monthly/Annual segmented toggle — swaps the headline price in place so the
   annual total is visible without a Stripe round-trip. */
.interval-toggle { display: inline-flex; align-items: center; gap: .15rem; margin: 0 0 1.4rem;
  padding: .22rem; border: 1px solid var(--line); border-radius: 99px; background: #fff; }
.interval-toggle button { border: none; background: none; font: inherit; cursor: pointer;
  padding: .4rem .95rem; border-radius: 99px; color: var(--muted); white-space: nowrap; }
.interval-toggle button.active { background: var(--accent); color: #fff; }
.interval-toggle .save { font-size: .82rem; opacity: .85; }
.price-sub { margin-top: .3rem; min-height: 1.2em; }
.faq dt { font-weight: 600; margin-top: 1rem; }
.faq dd { margin: .25rem 0 0; color: var(--muted); }
.steps { counter-reset: step; padding-left: 0; }
.steps li { list-style: none; margin-bottom: .9rem; padding-left: 2.4rem; position: relative; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0;
  width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; }

/* App */
.crumbs { font-size: .84rem; color: var(--muted); margin: -.4rem 0 .9rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent-dark); }
.page-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.page-head .spacer { flex: 1; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.stat .num { font-size: 1.9rem; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: .9rem; }
a.stat-link { display: block; color: inherit; text-decoration: none; transition: border-color .12s, transform .12s; cursor: pointer; }
a.stat-link:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
a.stat-link:hover .lbl { color: var(--accent-dark); }
table.list { width: 100%; border-collapse: collapse; font-size: .94rem; }
table.list th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); border-bottom: 2px solid var(--line); padding: .5rem .6rem; }
table.list td { border-bottom: 1px solid var(--line); padding: .55rem .6rem; vertical-align: top; }
table.list tr:hover td { background: var(--wash); }
.pill { display: inline-block; padding: .1rem .6rem; border-radius: 99px; font-size: .8rem; background: var(--wash); color: var(--muted); }
.pill-assigned { background: #e8f0fb; color: #1f4e96; }
.pill-available { background: #e7f5f0; color: var(--accent-dark); }
.pill-repair { background: var(--warn-bg); color: var(--warn-ink); }
.pill-retired, .pill-left { background: #eee; color: #666; }
.pill-overdue, .pill-leaving { background: #fdeceb; color: var(--danger); }
.filters { display: flex; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filters input, .filters select { padding: .45rem .6rem; }
.empty { border: 2px dashed var(--line); border-radius: var(--radius); padding: 2.5rem; text-align: center; color: var(--muted); }
.empty h2 { color: var(--ink); }

/* Dashboard attention queue */
.attention-head { display: flex; align-items: center; gap: .7rem; margin: 0 0 .7rem; }
.attention-head h2 { margin: 0; font-size: 1.3rem; }
.attention { list-style: none; padding: 0; margin: 0 0 1.6rem;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.attention li { display: flex; align-items: center; gap: .8rem; padding: .75rem .9rem;
  border-bottom: 1px solid var(--line); border-left: 4px solid transparent; }
.attention li:last-child { border-bottom: none; }
.attention .att-icon { font-size: 1.1rem; line-height: 1; flex: none; width: 1.4rem; text-align: center; }
.attention .att-text { flex: 1; min-width: 0; }
.attention .btn { flex: none; }
.att-urgent { border-left-color: var(--danger); background: #fdf6f5; }
.att-warn { border-left-color: var(--warn-ink); }
.att-info { border-left-color: var(--accent); }
.attention-clear { border: 1px solid var(--line); border-radius: var(--radius); background: var(--wash);
  padding: 1rem 1.1rem; margin: 0 0 1.6rem; color: var(--accent-dark); }
@media (max-width: 640px) {
  .attention li { flex-wrap: wrap; }
  .attention .att-text { flex-basis: calc(100% - 2.2rem); }
  .attention .btn { margin-left: 2.2rem; }
}

/* Holding dialog (native <dialog>, no JS framework) */
dialog.holding-dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem;
  max-width: 360px; width: 90vw; box-shadow: 0 12px 32px rgba(0,0,0,.14); }
dialog.holding-dialog::backdrop { background: rgba(20,30,34,.35); }
dialog.holding-dialog h3 { margin: 0 0 .8rem; font-size: 1.05rem; }
dialog.holding-dialog ul { list-style: none; padding: 0; margin: 0 0 1rem; }
dialog.holding-dialog li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
dialog.holding-dialog li:last-child { border-bottom: none; }

/* Forms */
form.stack .field { margin: 0 0 1.05rem; max-width: 460px; }
form.stack label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
form.stack .req { color: var(--danger); font-weight: 400; }
form.stack input, form.stack select, form.stack textarea { width: 100%; padding: .6rem .75rem;
  border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; transition: border-color .12s, box-shadow .12s; }
form.stack input:focus, form.stack select:focus, form.stack textarea:focus { outline: none;
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,110,80,.12); }
form.stack textarea { min-height: 4.5rem; resize: vertical; }
form.stack input[type="checkbox"], form.stack input[type="radio"] { width: auto; }
form.stack .field-help, form.stack .helptext { display: block; font-size: .82rem; color: var(--muted); margin-top: .3rem; }
form.stack .field-err { font-size: .84rem; color: var(--danger); margin-top: .3rem; }
form.stack .field.has-error input, form.stack .field.has-error select, form.stack .field.has-error textarea { border-color: var(--danger); }
form.stack .form-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.3rem; }
/* Legacy as_p fallback (any form still using it) */
form.stack > p { margin: 0 0 1rem; max-width: 460px; }
.errorlist { color: var(--danger); font-size: .88rem; margin: .2rem 0; padding-left: 1rem; }
.auth-box { max-width: 420px; margin: 2rem auto; }

/* Labels print sheet */
.label-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6mm; }
.label { border: 1px dashed #bbb; border-radius: 6px; padding: 4mm; display: flex; gap: 4mm; align-items: center;
  break-inside: avoid; }
.label img { width: 22mm; height: 22mm; }
.label .tag { font-weight: 700; font-size: 12pt; }
.label .name { font-size: 9pt; color: #333; }
@media print {
  .nav, .footer, .messages, .banner, .no-print { display: none !important; }
  .container { max-width: none; padding: 0; }
  .label { border-style: solid; border-color: #ddd; }
  @page { size: A4; margin: 10mm; }
}

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--wash); font-size: .9rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; padding: 1.6rem 1.25rem; }
.footer a { color: var(--muted); }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.9rem; }
  .label-grid { grid-template-columns: repeat(2, 1fr); }
  /* Wide data tables scroll inside themselves instead of stretching the
     page — otherwise phones zoom the whole layout out to fit the table.
     body overflow-x is clipped so overflowing content can never expand
     the layout viewport; the tables stay swipeable via their own scroll. */
  html, body { overflow-x: clip; }
  table.list { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.list th, table.list td { white-space: nowrap; }
  table.list td small { white-space: normal; }  /* long notes may wrap */
  .page-head { flex-wrap: wrap; gap: .4rem; }
}
