* {
  box-sizing: border-box;
}

:root {
  --bg: #050806;
  --panel: #0b0f0e;
  --paper: #f4f1e9;
  --muted: #a8b0ab;
  --cyan: #49caec;
  --green: #66d69a;
  --gold: #d9b56f;
  --line: rgba(255,255,255,.12);
  --danger: #ff7474;
  --warning: #f1bf66;
  --radius: 28px;
  --shadow: 0 30px 90px rgba(0,0,0,.42);

  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  --doc-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --doc-gold: #b08640;
  --doc-ink: #1c2320;
  --doc-muted: #6f7671;
  --doc-line: #e4e0d5;
  --doc-cream: #fffdf8;
  --doc-pad: clamp(26px, 5vw, 56px);
}

*::selection {
  background: rgba(73,202,236,.32);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 78% 18%, rgba(102,214,154,.12), transparent 28%),
    radial-gradient(circle at 16% 0%, rgba(73,202,236,.10), transparent 26%),
    linear-gradient(135deg, #090a06 0%, #10130f 42%, #06110f 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

a {
  color: inherit;
}

.shell {
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 18px 0;
  background: rgba(8, 9, 6, .86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.logo-shell {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(73, 202, 236, .42);
  background:
    radial-gradient(circle at 52% 46%, rgba(73,202,236,.16), transparent 46%),
    linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.018));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 0 18px rgba(73,202,236,.10),
    0 0 34px rgba(102,214,154,.055);
}

.logo-shell img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  opacity: 1;
  filter:
    brightness(1.18)
    saturate(1.18)
    drop-shadow(0 0 7px rgba(73,202,236,.50))
    drop-shadow(0 0 18px rgba(102,214,154,.16));
}

.brand-word {
  letter-spacing: .30em;
  font-size: 15px;
  font-weight: 900;
  color: var(--paper);
}

.brand-sub {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill,
.button,
button {
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.055);
  color: var(--paper);
  border-radius: 999px;
  padding: 12px 17px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: .18s ease;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 12px 30px rgba(0,0,0,.18);
}

.pill:hover,
.button:hover,
button:hover {
  transform: translateY(-1px);
  border-color: rgba(73,202,236,.55);
  background: rgba(73,202,236,.09);
}

.button.primary,
button.primary {
  color: #06100f;
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), var(--green));
}

.button.gold,
button.gold {
  border-color: rgba(217,181,111,.50);
  color: var(--gold);
}

.hero {
  padding: 70px 0 34px;
}

.hero-inner {
  max-width: 930px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-weight: 900;
  font-size: 12px;
}

.kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px rgba(102,214,154,.55);
}

h1 {
  margin: 22px 0 18px;
  max-width: 880px;
  font-size: clamp(44px, 7vw, 92px);
  line-height: .93;
  letter-spacing: -.06em;
}

h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -.03em;
}

.lead {
  max-width: 760px;
  color: rgba(244,241,233,.72);
  line-height: 1.75;
  font-size: 18px;
}

.card {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.068), rgba(255,255,255,.028));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-card {
  position: relative;
  margin: 34px 0 84px;
  max-width: 950px;
  padding: clamp(22px, 4vw, 42px);
}

.form-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(circle at top left, rgba(73,202,236,.14), transparent 34%),
    radial-gradient(circle at bottom right, rgba(102,214,154,.12), transparent 36%);
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.step-badge {
  white-space: nowrap;
  border: 1px solid rgba(73,202,236,.30);
  background: rgba(73,202,236,.10);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--cyan);
  font-weight: 900;
  font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  font-weight: 850;
  font-size: 14px;
}

small {
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  outline: none;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(5, 9, 8, .72);
  color: var(--paper);
  border-radius: 16px;
  padding: 14px 15px;
  font: inherit;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(73,202,236,.78);
  box-shadow: 0 0 0 4px rgba(73,202,236,.12);
}

.checkbox-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(5, 9, 8, .46);
  border: 1px solid rgba(255,255,255,.11);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 730;
  line-height: 1.4;
}

.check input {
  width: auto;
  margin-top: 3px;
}

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.notice {
  color: rgba(244,241,233,.66);
  line-height: 1.55;
  max-width: 580px;
}

.result {
  display: none;
  margin-top: 20px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(102,214,154,.12);
  border: 1px solid rgba(102,214,154,.32);
}

.result.error {
  background: rgba(255,116,116,.12);
  border-color: rgba(255,116,116,.32);
}

.success-wrap {
  min-height: calc(100vh - 92px);
  display: grid;
  place-items: center;
  padding: 46px 0;
}

.success-card {
  max-width: 760px;
  padding: clamp(26px, 5vw, 48px);
  text-align: center;
}

.success-logo {
  margin: 0 auto 20px;
}

.ref-box {
  width: fit-content;
  margin: 22px auto;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(73,202,236,.10);
  border: 1px solid rgba(73,202,236,.28);
  color: var(--cyan);
  font-weight: 900;
}

.admin-layout {
  display: grid;
  grid-template-columns: 305px minmax(0, 1fr);
  gap: 18px;
  padding: 34px 0 54px;
}

.panel {
  padding: 22px;
}

.stat {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  margin-bottom: 12px;
}

.stat b {
  color: var(--cyan);
  font-size: 28px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  align-items: center;
}

.toolbar input,
.toolbar select {
  max-width: 330px;
}

.table-wrap {
  overflow: auto;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.10);
}

table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
  background: rgba(5, 9, 8, .45);
}

th,
td {
  padding: 13px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255,255,255,.09);
}

th {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(5,9,8,.72);
}

tr:hover td {
  background: rgba(73,202,236,.045);
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 900;
  font-size: 12px;
  background: rgba(73,202,236,.12);
  color: var(--cyan);
  white-space: nowrap;
}

.status.approved {
  background: rgba(102,214,154,.14);
  color: var(--green);
}

.status.needs_info {
  background: rgba(217,181,111,.16);
  color: var(--gold);
}

.status.rejected {
  background: rgba(255,116,116,.16);
  color: var(--danger);
}

.status.archived {
  background: rgba(255,255,255,.10);
  color: var(--muted);
}

.duplicate {
  color: var(--warning);
  font-weight: 900;
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,.62);
}

.modal.open {
  display: flex;
}

.modal-inner {
  max-width: 940px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  padding: 24px;
}

.details-grid {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 10px 16px;
  margin: 18px 0;
}

.details-grid b {
  color: var(--gold);
}

.client-actions {
  border-top: 1px solid rgba(255,255,255,.10);
  padding-top: 18px;
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 28px, 1220px);
  }

  .grid,
  .admin-layout,
  .stat-row,
  .checkbox-list {
    grid-template-columns: 1fr;
  }

  .nav,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-footer {
    align-items: stretch;
  }

  button,
  .button {
    width: 100%;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   IMARO CLIENT OPS — UI POLISH V6
   Paste at bottom of styles.css
   ========================================================= */

/* smoother overall rendering */
html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* make header feel more premium */
.site-header {
  background:
    linear-gradient(180deg, rgba(5, 8, 6, .94), rgba(5, 8, 6, .78));
  box-shadow:
    0 12px 34px rgba(0,0,0,.28),
    inset 0 -1px 0 rgba(255,255,255,.045);
}

.nav {
  min-height: 54px;
}

/* logo: closer to main website */
.logo-shell {
  transition:
    transform .22s ease,
    border-color .22s ease,
    box-shadow .22s ease;
}

.brand:hover .logo-shell {
  transform: translateY(-1px) scale(1.035);
  border-color: rgba(73,202,236,.68);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    0 0 22px rgba(73,202,236,.20),
    0 0 44px rgba(102,214,154,.10);
}

.brand-word {
  text-shadow: 0 0 16px rgba(244,241,233,.08);
}

/* hero: less plain, more executive */
.hero {
  position: relative;
  padding: 86px 0 44px;
}

.hero::after {
  content: "";
  position: absolute;
  left: -8%;
  bottom: 8px;
  width: 54%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(73,202,236,.32), transparent);
  opacity: .75;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero h1 {
  max-width: 820px;
  text-wrap: balance;
  filter: drop-shadow(0 18px 34px rgba(0,0,0,.26));
}

.hero .lead {
  max-width: 710px;
}

/* form card: more app-like, less sheet-like */
.form-card {
  margin-top: 22px;
  backdrop-filter: blur(18px);
  background:
    linear-gradient(180deg, rgba(255,255,255,.082), rgba(255,255,255,.030)),
    radial-gradient(circle at 12% 0%, rgba(73,202,236,.11), transparent 36%),
    radial-gradient(circle at 100% 18%, rgba(102,214,154,.09), transparent 36%);
  border-color: rgba(255,255,255,.15);
}

.form-card:hover {
  border-color: rgba(73,202,236,.24);
}

/* section title refinement */
.section-title {
  align-items: center;
}

.section-title h2 {
  font-size: clamp(28px, 3vw, 38px);
}

.step-badge {
  color: var(--cyan);
  background:
    linear-gradient(135deg, rgba(73,202,236,.15), rgba(102,214,154,.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

/* fields: softer, more mature */
.field {
  position: relative;
}

label {
  color: rgba(244,241,233,.92);
}

input,
textarea,
select {
  min-height: 52px;
  background:
    linear-gradient(180deg, rgba(3,8,8,.82), rgba(3,8,8,.66));
  border-color: rgba(255,255,255,.11);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 14px 28px rgba(0,0,0,.16);
  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    transform .18s ease,
    background .18s ease;
}

textarea {
  min-height: 150px;
}

input:hover,
textarea:hover,
select:hover {
  border-color: rgba(255,255,255,.20);
}

input:focus,
textarea:focus,
select:focus {
  transform: translateY(-1px);
  background:
    linear-gradient(180deg, rgba(3,10,10,.92), rgba(3,10,10,.72));
}

/* checkbox block */
.checkbox-list {
  background:
    linear-gradient(180deg, rgba(3,8,8,.62), rgba(3,8,8,.42));
  border-color: rgba(255,255,255,.12);
}

.check {
  padding: 10px 12px;
  border-radius: 14px;
  transition:
    background .18s ease,
    transform .18s ease,
    border-color .18s ease;
}

.check:hover {
  background: rgba(73,202,236,.075);
  transform: translateX(2px);
}

.check input {
  accent-color: var(--cyan);
}

/* button polish */
button.primary,
.button.primary {
  position: relative;
  overflow: hidden;
  box-shadow:
    0 14px 38px rgba(73,202,236,.16),
    inset 0 1px 0 rgba(255,255,255,.28);
}

button.primary::before,
.button.primary::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-110%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,.42),
    transparent
  );
  transition: transform .55s ease;
}

button.primary:hover::before,
.button.primary:hover::before {
  transform: translateX(110%);
}

.pill {
  background:
    linear-gradient(180deg, rgba(255,255,255,.070), rgba(255,255,255,.035));
}

.pill.gold {
  border-color: rgba(217,181,111,.42);
  color: var(--paper);
}

.pill.gold:hover {
  color: var(--gold);
  border-color: rgba(217,181,111,.68);
}

/* subtle reveal animation */
.hero-inner,
.form-card {
  opacity: 0;
  transform: translateY(18px);
  animation: imaroFadeUp .75s cubic-bezier(.2,.75,.2,1) forwards;
}

.form-card {
  animation-delay: .12s;
}

@keyframes imaroFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* animated grid glow */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--mx, 72%) var(--my, 18%), rgba(73,202,236,.085), transparent 26%);
  opacity: .8;
  transition: opacity .3s ease;
}

/* admin dashboard polish too */
.admin-layout .card {
  backdrop-filter: blur(18px);
}

.stat {
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease;
}

.stat:hover {
  transform: translateY(-2px);
  border-color: rgba(73,202,236,.24);
  background: rgba(255,255,255,.07);
}

.table-wrap {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* modal feels more like an app */
.modal-inner {
  backdrop-filter: blur(18px);
  border-color: rgba(73,202,236,.22);
}

/* mobile tightening */
@media (max-width: 820px) {
  .hero {
    padding: 54px 0 28px;
  }

  h1 {
    font-size: clamp(40px, 13vw, 62px);
  }

  .form-card {
    margin-bottom: 52px;
  }

  .section-title {
    gap: 12px;
  }
}

/* respect people who disable motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .hero-inner,
  .form-card {
    opacity: 1;
    transform: none;
  }
}

/* =========================================================
   IMARO CLIENT OPS — FORM UI FIX V7
   Paste at very bottom of styles.css
   ========================================================= */

.hero {
  padding: 64px 0 30px;
}

.form-card {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  padding: clamp(28px, 4vw, 48px);
  background:
    linear-gradient(180deg, rgba(244,241,233,.078), rgba(244,241,233,.030)),
    radial-gradient(circle at 10% 0%, rgba(73,202,236,.13), transparent 34%),
    radial-gradient(circle at 100% 12%, rgba(102,214,154,.10), transparent 36%),
    rgba(8, 13, 12, .76);
  border: 1px solid rgba(244,241,233,.14);
  box-shadow:
    0 34px 100px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.06);
}

.section-title {
  padding-bottom: 22px;
  margin-bottom: 30px;
  align-items: center;
}

.section-title h2 {
  color: var(--paper);
  max-width: 680px;
}

.step-badge {
  padding: 9px 14px;
  font-size: 12px;
  border-color: rgba(73,202,236,.42);
  background:
    linear-gradient(135deg, rgba(73,202,236,.16), rgba(102,214,154,.08));
}

.grid {
  gap: 24px 22px;
}

.field {
  gap: 9px;
}

label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
  color: rgba(244,241,233,.86);
}

input,
textarea,
select {
  min-height: 56px;
  border-radius: 18px;
  padding: 15px 16px;
  color: var(--paper);
  background:
    linear-gradient(180deg, rgba(8,14,13,.94), rgba(5,9,8,.82));
  border: 1px solid rgba(244,241,233,.14);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.055),
    inset 0 -1px 0 rgba(0,0,0,.28),
    0 12px 28px rgba(0,0,0,.18);
}

input::placeholder,
textarea::placeholder {
  color: rgba(244,241,233,.34);
}

input:hover,
textarea:hover,
select:hover {
  border-color: rgba(244,241,233,.25);
  background:
    linear-gradient(180deg, rgba(10,18,17,.98), rgba(6,12,11,.88));
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(73,202,236,.78);
  box-shadow:
    0 0 0 4px rgba(73,202,236,.10),
    0 0 28px rgba(73,202,236,.10),
    inset 0 1px 0 rgba(255,255,255,.07);
  transform: none;
}

select {
  color-scheme: dark;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(244,241,233,.82) 50%),
    linear-gradient(135deg, rgba(244,241,233,.82) 50%, transparent 50%),
    linear-gradient(180deg, rgba(8,14,13,.94), rgba(5,9,8,.82));
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 16px) 50%,
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
  padding-right: 48px;
}

select option {
  background: #08100f;
  color: #f4f1e9;
}

small {
  color: rgba(244,241,233,.50);
  font-size: 13px;
}

.checkbox-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 16px;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(7,13,12,.76), rgba(5,9,8,.62));
  border: 1px solid rgba(244,241,233,.11);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.045);
}

.check {
  min-height: 46px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid rgba(244,241,233,.075);
  background: rgba(255,255,255,.025);
}

.check:hover {
  border-color: rgba(73,202,236,.26);
  background: rgba(73,202,236,.07);
}

.check input {
  width: 16px;
  height: 16px;
  min-height: unset;
  box-shadow: none;
}

textarea {
  min-height: 150px;
  line-height: 1.55;
}

.form-footer {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(244,241,233,.09);
}

button.primary {
  min-width: 174px;
  min-height: 52px;
  font-size: 14px;
}

.site-header {
  padding: 15px 0;
}

.nav-actions .pill {
  padding: 11px 18px;
  border-color: rgba(217,181,111,.38);
}

@media (max-width: 820px) {
  .form-card {
    padding: 24px 18px;
  }

  .checkbox-list {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 46px 0 24px;
  }
}

/* =========================================================
   IMARO CLIENT OPS — SELECT / DROPDOWN POLISH V8
   Paste at very bottom of styles.css
   ========================================================= */

/* Closed select field: premium rounded app field */
select {
  cursor: pointer;
  color-scheme: dark;
  appearance: none;
  -webkit-appearance: none;

  border-radius: 20px;
  border: 1px solid rgba(73,202,236,.32);

  background:
    linear-gradient(45deg, transparent 50%, rgba(73,202,236,.95) 50%),
    linear-gradient(135deg, rgba(73,202,236,.95) 50%, transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(73,202,236,.14), transparent 32%),
    linear-gradient(180deg, rgba(8,16,15,.98), rgba(3,8,8,.90));

  background-position:
    calc(100% - 24px) 50%,
    calc(100% - 17px) 50%,
    100% 0,
    0 0;

  background-size:
    7px 7px,
    7px 7px,
    120px 100%,
    100% 100%;

  background-repeat: no-repeat;
  padding-right: 54px;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.07),
    inset 0 -1px 0 rgba(0,0,0,.34),
    0 14px 30px rgba(0,0,0,.20);
}

/* Hover: subtle lift */
select:hover {
  border-color: rgba(73,202,236,.52);
  background:
    linear-gradient(45deg, transparent 50%, rgba(102,214,154,.95) 50%),
    linear-gradient(135deg, rgba(102,214,154,.95) 50%, transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(102,214,154,.13), transparent 32%),
    linear-gradient(180deg, rgba(10,20,18,.98), rgba(4,10,9,.92));

  background-position:
    calc(100% - 24px) 50%,
    calc(100% - 17px) 50%,
    100% 0,
    0 0;

  background-size:
    7px 7px,
    7px 7px,
    120px 100%,
    100% 100%;

  background-repeat: no-repeat;
}

/* Focus: make dropdown feel attached to the field */
select:focus {
  border-color: rgba(73,202,236,.90);
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;

  box-shadow:
    0 0 0 4px rgba(73,202,236,.12),
    0 0 30px rgba(73,202,236,.16),
    inset 0 1px 0 rgba(255,255,255,.08);
}

/* Options: works in some browsers, improves Chrome enough */
select option {
  background: #06100f;
  color: #f4f1e9;
  padding: 14px 16px;
}

/* First placeholder option */
select option[value=""] {
  color: rgba(244,241,233,.58);
}

/* Give select fields a clearer container feeling */
.field:has(select) {
  position: relative;
}

/* Small glow behind active select field */
.field:has(select:focus)::after {
  content: "";
  position: absolute;
  inset: 26px -4px -4px -4px;
  border-radius: 24px;
  pointer-events: none;
  background: radial-gradient(circle at 80% 40%, rgba(73,202,236,.12), transparent 42%);
  z-index: -1;
}

/* Make native dropdown less harsh where supported */
select::-ms-expand {
  display: none;
}

/* =========================================================
   IMARO ADMIN WORKFLOW UPGRADE V1
   Paste at very bottom of styles.css
   ========================================================= */

.admin-layout {
  align-items: start;
}

.admin-layout > .card {
  background:
    linear-gradient(180deg, rgba(244,241,233,.070), rgba(244,241,233,.026)),
    radial-gradient(circle at top right, rgba(73,202,236,.10), transparent 34%),
    rgba(8, 13, 12, .78);
  border-color: rgba(244,241,233,.13);
}

.admin-layout aside.card {
  position: sticky;
  top: 104px;
}

.stat {
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  opacity: .22;
}

.stat span {
  color: rgba(244,241,233,.72);
  font-size: 14px;
}

.stat b {
  letter-spacing: -.04em;
}

.stat-row .stat {
  min-height: 96px;
}

.toolbar {
  padding: 14px;
  border: 1px solid rgba(244,241,233,.09);
  border-radius: 22px;
  background: rgba(5, 9, 8, .38);
}

.toolbar input,
.toolbar select {
  min-height: 54px;
}

.table-wrap {
  background: rgba(3, 7, 7, .50);
  box-shadow:
    0 22px 60px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.045);
}

table {
  min-width: 1120px;
}

th {
  padding-top: 16px;
  padding-bottom: 16px;
}

td {
  padding-top: 15px;
  padding-bottom: 15px;
}

td strong {
  color: var(--paper);
}

.status {
  text-transform: capitalize;
}

.status.new {
  background: rgba(73,202,236,.12);
  color: var(--cyan);
}

.empty-state {
  padding: 34px;
  text-align: center;
  color: rgba(244,241,233,.62);
}

.empty-state strong {
  display: block;
  color: var(--paper);
  font-size: 20px;
  margin-bottom: 8px;
}

.admin-error {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,116,116,.10);
  border: 1px solid rgba(255,116,116,.24);
  color: #ffd4d4;
}

.admin-error button {
  margin-top: 12px;
}

.open {
  min-width: 82px;
  padding: 9px 13px;
}

.modal-inner {
  background:
    linear-gradient(180deg, rgba(244,241,233,.075), rgba(244,241,233,.030)),
    radial-gradient(circle at top left, rgba(73,202,236,.10), transparent 34%),
    rgba(8,13,12,.90);
}

.details-grid {
  padding: 18px;
  border-radius: 20px;
  background: rgba(5,9,8,.44);
  border: 1px solid rgba(244,241,233,.09);
}

.details-grid b {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.details-grid span {
  color: rgba(244,241,233,.82);
  line-height: 1.55;
  word-break: break-word;
}

.workflow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.workflow-actions button {
  min-width: 130px;
}

.workflow-actions .approve {
  border-color: rgba(102,214,154,.44);
  color: var(--green);
}

.workflow-actions .needs {
  border-color: rgba(217,181,111,.44);
  color: var(--gold);
}

.workflow-actions .reject {
  border-color: rgba(255,116,116,.44);
  color: #ffaaaa;
}

.workflow-actions .archive {
  color: var(--muted);
}

.client-actions {
  margin-top: 18px;
}

#internalNote {
  flex: 1;
  min-width: 260px;
}

@media (max-width: 900px) {
  .admin-layout aside.card {
    position: static;
  }

  table {
    min-width: 980px;
  }
}

/* =========================================================
   IMARO QUOTE MODULE V1
   ========================================================= */

.workflow-actions .quote-action {
  border-color: rgba(73,202,236,.55);
  color: #06100f;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  box-shadow:
    0 14px 38px rgba(73,202,236,.16),
    inset 0 1px 0 rgba(255,255,255,.26);
}

.workflow-actions .quote-action:hover {
  border-color: transparent;
  color: #06100f;
}

.workflow-actions .quote-action:disabled {
  opacity: .55;
  cursor: wait;
}

/* =========================================================
   IMARO QUOTE EDITOR V1
   ========================================================= */

.quote-editor-modal {
  max-width: 1120px;
}

.quote-editor-top {
  margin-bottom: 20px;
}

.quote-document {
  padding: clamp(22px, 4vw, 34px);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(244,241,233,.075), rgba(244,241,233,.030)),
    radial-gradient(circle at top right, rgba(73,202,236,.10), transparent 36%),
    rgba(5,9,8,.72);
  border: 1px solid rgba(244,241,233,.11);
}

.quote-brand-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(244,241,233,.10);
}

.quote-meta {
  text-align: right;
}

.quote-meta strong {
  display: block;
  color: var(--gold);
  letter-spacing: .18em;
  font-size: 12px;
}

.quote-meta span {
  display: block;
  margin-top: 8px;
  color: var(--paper);
  font-size: 22px;
  font-weight: 900;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0;
}

.quote-box {
  padding: 18px;
  border-radius: 20px;
  background: rgba(5,9,8,.46);
  border: 1px solid rgba(244,241,233,.09);
}

.quote-box strong {
  display: block;
  margin: 7px 0;
  font-size: 20px;
}

.quote-box p {
  margin: 4px 0;
  color: rgba(244,241,233,.72);
}

.quote-label {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 900;
}

.quote-controls {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 14px;
  margin: 24px 0;
}

.quote-lines {
  margin-top: 24px;
}

.quote-lines-head,
.quote-line-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 90px 140px 130px 52px;
  gap: 10px;
  align-items: center;
}

.quote-lines-head {
  padding: 12px 0;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  font-weight: 900;
  border-bottom: 1px solid rgba(244,241,233,.10);
}

.quote-line-row {
  padding: 10px 0;
  border-bottom: 1px solid rgba(244,241,233,.07);
}

.quote-line-row input {
  min-height: 48px;
}

.quote-line-total {
  color: var(--paper);
  text-align: right;
}

.remove-line {
  min-width: unset;
  width: 42px;
  height: 42px;
  padding: 0;
  color: #ffaaaa;
  border-color: rgba(255,116,116,.30);
}

.quote-add-line {
  margin-top: 14px;
  border-color: rgba(73,202,236,.34);
  color: var(--cyan);
}

.quote-notes-total {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  margin-top: 26px;
  align-items: start;
}

.quote-total-box {
  padding: 18px;
  border-radius: 20px;
  background: rgba(5,9,8,.54);
  border: 1px solid rgba(244,241,233,.10);
}

.quote-total-box div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(244,241,233,.08);
}

.quote-total-box div:last-child {
  border-bottom: 0;
}

.quote-total-box span {
  color: rgba(244,241,233,.64);
}

.quote-total-box strong {
  color: var(--paper);
}

.quote-total-box .grand-total {
  margin-top: 8px;
  padding-top: 14px;
  font-size: 22px;
}

.quote-total-box .grand-total strong {
  color: var(--cyan);
}

.quote-footer-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(244,241,233,.10);
}

@media (max-width: 900px) {
  .quote-grid,
  .quote-controls,
  .quote-notes-total {
    grid-template-columns: 1fr;
  }

  .quote-lines-head {
    display: none;
  }

  .quote-line-row {
    grid-template-columns: 1fr;
    padding: 16px 0;
  }

  .quote-line-total {
    text-align: left;
  }
}

/* =========================================================
   IMARO CLIENT QUOTES PANEL
   ========================================================= */

.client-quotes-panel {
  margin: 18px 0;
  padding: 18px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(244,241,233,.060), rgba(244,241,233,.025)),
    rgba(5,9,8,.48);
  border: 1px solid rgba(244,241,233,.10);
}

.client-quotes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.client-quotes-head strong {
  color: var(--paper);
}

.client-quotes-list {
  display: grid;
  gap: 10px;
}

.client-quote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.08);
}

.client-quote-row strong {
  display: block;
  color: var(--paper);
}

.client-quote-row span {
  display: block;
  margin-top: 4px;
  color: rgba(244,241,233,.62);
  font-size: 13px;
}

.open-quote-button {
  border-color: rgba(73,202,236,.45);
  color: var(--cyan);
  white-space: nowrap;
}

.open-quote-button:hover {
  color: #06100f;
  background: linear-gradient(135deg, var(--cyan), var(--green));
}

@media (max-width: 700px) {
  .client-quote-row {
    align-items: stretch;
    flex-direction: column;
  }
}

/* =========================================================
   IMARO CACHE VERSION V10
   The admin page loads styles.css?v=10 to force fresh CSS.
   ========================================================= */



/* =========================================================
   IMARO MASSIVE UPDATE V1 — PREVIEW + INVOICE
   ========================================================= */

.quote-footer-actions .invoice-action,
.open-invoice-button {
  border-color: rgba(217,181,111,.55);
  color: #06100f;
  background: linear-gradient(135deg, var(--gold), var(--green));
  box-shadow:
    0 14px 38px rgba(217,181,111,.14),
    inset 0 1px 0 rgba(255,255,255,.25);
}

.quote-footer-actions .invoice-action:hover,
.open-invoice-button:hover {
  border-color: transparent;
  color: #06100f;
}

.quote-footer-actions button:disabled {
  opacity: .58;
  cursor: wait;
}

.client-invoices-panel {
  border-color: rgba(217,181,111,.18);
}

.client-invoices-panel .kicker {
  color: var(--gold);
}

.print-page {
  min-height: 100vh;
  padding: 34px 0 70px;
  background:
    radial-gradient(circle at 80% 0%, rgba(73,202,236,.10), transparent 28%),
    linear-gradient(135deg, #080d0c, #050806);
}

.print-shell {
  width: min(980px, calc(100% - 36px));
  margin: 0 auto;
}

.print-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.print-document {
  color: var(--doc-ink);
  background: var(--doc-cream);
  border-radius: 18px;
  padding: var(--doc-pad);
  box-shadow: 0 28px 90px rgba(0,0,0,.34);
}

.lh {
  font-family: var(--doc-serif);
  color: var(--doc-ink);
  line-height: 1.5;
}

.lh-rules {
  margin: calc(-1 * var(--doc-pad)) calc(-1 * var(--doc-pad)) 30px;
}

.lh-rule-top {
  display: block;
  height: 4px;
  background: var(--doc-gold);
}

.lh-rule-thin {
  display: block;
  height: 1px;
  margin-top: 3px;
  background: rgba(176,134,64,.42);
}

.lh-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.lh-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lh-cube {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
}

.lh-name {
  font-size: 27px;
  letter-spacing: .01em;
  color: var(--doc-ink);
}

.lh-tag {
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--doc-gold);
  font-weight: 700;
  margin-top: 3px;
}

.lh-from {
  font-family: var(--font-sans);
  text-align: right;
  font-size: 11.5px;
  color: #5a615c;
  line-height: 1.7;
}

.lh-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 30px 0 6px;
}

.lh-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 400;
  letter-spacing: .03em;
  color: var(--doc-ink);
}

.lh-badge {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 3px;
  border: 1px solid;
  white-space: nowrap;
}

.lh-badge.is-neutral { color: #6f7671; border-color: rgba(111,118,113,.5); }
.lh-badge.is-info { color: #1f7f9c; border-color: rgba(31,127,156,.5); }
.lh-badge.is-good { color: #2f8f63; border-color: rgba(47,143,99,.5); }
.lh-badge.is-bad { color: #b23b36; border-color: rgba(178,59,54,.5); }

.lh-goldline {
  height: 2px;
  background: var(--doc-gold);
  margin-bottom: 20px;
}

.lh-refs {
  font-family: var(--font-sans);
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-bottom: 24px;
}

.lh-refs .l {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--doc-muted);
  font-weight: 700;
}

.lh-refs .v {
  font-size: 13px;
  color: var(--doc-ink);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.lh-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 26px;
}

.lh-parties .l {
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--doc-gold);
  font-weight: 700;
  margin-bottom: 7px;
}

.lh-parties strong {
  font-size: 16px;
  font-weight: 700;
}

.lh-parties p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #4c534e;
  line-height: 1.6;
}

.lh-table {
  width: 100%;
  border-collapse: collapse;
  min-width: unset;
  margin-bottom: 6px;
  background: transparent;
}

.lh-table thead th {
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--doc-muted);
  font-weight: 700;
  text-align: left;
  padding: 0 6px 10px;
  background: transparent;
  border-bottom: 2px solid var(--doc-gold);
}

.lh-table tbody tr:hover td {
  background: transparent;
}

.lh-table tbody td {
  padding: 14px 6px;
  font-size: 14px;
  color: var(--doc-ink);
  border-bottom: 1px solid var(--doc-line);
  vertical-align: top;
}

.lh-table .num { text-align: right; }
.lh-table .money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lh-empty { color: var(--doc-muted); font-style: italic; }

.lh-totals {
  width: min(320px, 100%);
  margin: 20px 0 0 auto;
}

.lh-totals .row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 2px;
  font-size: 14px;
}

.lh-totals .row span:first-child { color: #5a615c; }

.lh-totals .grand {
  border-top: 2px solid var(--doc-gold);
  border-bottom: 3px double var(--doc-gold);
  margin-top: 6px;
  padding: 12px 2px;
}

.lh-totals .grand span {
  color: var(--doc-ink);
  font-weight: 700;
}

.lh-totals .grand b {
  color: var(--doc-gold);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.lh-pay {
  font-family: var(--font-sans);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--doc-line);
  font-size: 12.5px;
  color: #4c534e;
  line-height: 1.65;
}

.lh-pay .l {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--doc-muted);
  font-weight: 700;
  margin-bottom: 5px;
}

.lh-thanks {
  text-align: center;
  font-style: italic;
  font-size: 15px;
  color: #5a615c;
  margin: 28px 0 0;
}

@media print {
  body {
    background: white !important;
  }

  .site-header,
  .print-actions {
    display: none !important;
  }

  .print-page {
    padding: 0;
    background: white !important;
  }

  .print-shell {
    width: 100%;
  }

  .print-document {
    box-shadow: none;
    border-radius: 0;
    background: white;
  }

  .lh-table tr,
  .lh-totals,
  .lh-pay,
  .lh-thanks {
    page-break-inside: avoid;
  }
}

@media (max-width: 720px) {
  .lh-top,
  .lh-parties,
  .lh-pay {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .lh-from {
    text-align: left;
  }

  .lh-totals {
    width: 100%;
  }
}


/* =========================================================
   IMARO COMPANY SETTINGS V1
   ========================================================= */

.settings-modal {
  max-width: 980px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.settings-grid .full {
  grid-column: 1 / -1;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(244,241,233,.10);
}

.print-company-details {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(17,24,22,.10);
}

.print-company-details p {
  margin: 4px 0;
}

@media (max-width: 820px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   IMARO UI V31 — overview KPIs, toasts, confirm, overdue
   ========================================================= */

.overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.overdue-pill {
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12.5px;
  color: #ffd7d7;
  background: rgba(255,116,116,.14);
  border: 1px solid rgba(255,116,116,.34);
  box-shadow: 0 0 22px rgba(255,116,116,.14);
}

.kpi-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 6px;
  padding: 18px 18px 16px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(244,241,233,.055), rgba(244,241,233,.02)),
    rgba(6, 11, 10, .6);
  border: 1px solid rgba(244,241,233,.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .18s ease, border-color .18s ease;
}

.kpi:hover {
  transform: translateY(-2px);
  border-color: rgba(73,202,236,.34);
}

.kpi span {
  color: rgba(244,241,233,.66);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .10em;
  font-weight: 800;
}

.kpi b {
  font-size: 26px;
  letter-spacing: -.03em;
  color: var(--paper);
  line-height: 1.05;
}

.kpi small {
  color: rgba(244,241,233,.56);
  font-size: 12.5px;
}

.kpi::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: rgba(255,255,255,.12);
}

.kpi-cyan::before { background: linear-gradient(90deg, var(--cyan), transparent); }
.kpi-cyan b { color: var(--cyan); }
.kpi-green::before { background: linear-gradient(90deg, var(--green), transparent); }
.kpi-green b { color: var(--green); }
.kpi-gold::before { background: linear-gradient(90deg, var(--gold), transparent); }
.kpi-gold b { color: var(--gold); }
.kpi-warning::before { background: linear-gradient(90deg, var(--warning), transparent); }
.kpi-warning b { color: var(--warning); }
.kpi-muted::before { background: rgba(255,255,255,.10); }

.kpi-loading { opacity: .45; }
.kpi-loading b { color: rgba(244,241,233,.4); }

.overdue-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #e5484d;
  background: rgba(229,72,77,.14);
  border: 1px solid rgba(229,72,77,.45);
}

.client-quote-row.row-overdue {
  border-color: rgba(229,72,77,.30);
  background: rgba(229,72,77,.05);
}

.toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 40px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border-radius: 15px;
  background: rgba(12, 17, 16, .92);
  border: 1px solid rgba(244,241,233,.14);
  box-shadow: 0 20px 50px rgba(0,0,0,.4);
  backdrop-filter: blur(14px);
  color: var(--paper);
  font-weight: 600;
  font-size: 14px;
  transform: translateX(20px);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2,.9,.3,1), opacity .28s ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(73,202,236,.6);
}

.toast-success .toast-dot { background: var(--green); box-shadow: 0 0 14px rgba(102,214,154,.6); }
.toast-error .toast-dot { background: var(--danger); box-shadow: 0 0 14px rgba(255,116,116,.6); }
.toast-error { border-color: rgba(255,116,116,.34); }

.toast-msg {
  flex: 1 1 auto;
  line-height: 1.4;
}

.toast-x {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  color: rgba(244,241,233,.6);
  background: transparent;
  border: none;
  box-shadow: none;
}

.toast-x:hover {
  color: var(--paper);
  background: rgba(255,255,255,.08);
  transform: none;
  border: none;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,.6);
  opacity: 0;
  transition: opacity .2s ease;
}

.confirm-overlay.show { opacity: 1; }

.confirm-card {
  width: min(440px, 100%);
  padding: 26px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(244,241,233,.075), rgba(244,241,233,.03)),
    rgba(9, 14, 13, .95);
  border: 1px solid rgba(244,241,233,.14);
  box-shadow: 0 40px 100px rgba(0,0,0,.5);
  transform: translateY(10px) scale(.98);
  transition: transform .22s cubic-bezier(.2,.9,.3,1);
}

.confirm-overlay.show .confirm-card {
  transform: translateY(0) scale(1);
}

.confirm-title {
  margin: 0 0 8px;
  font-size: 19px;
}

.confirm-message {
  margin: 0 0 22px;
  color: rgba(244,241,233,.74);
  line-height: 1.55;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

button.danger,
.confirm-ok.danger {
  color: #2a0b0b;
  border-color: transparent;
  background: linear-gradient(135deg, #ff8f8f, var(--danger));
}

@media print {
  .toast-host,
  .confirm-overlay {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .kpi-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .kpi-band {
    grid-template-columns: 1fr;
  }

  .toast-host {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}


/* =========================================================
   IMARO UI V32 — serif + gold signature across app chrome
   Ties the dark tool to the Letterhead documents.
   ========================================================= */

.hero h1,
.success-card h1,
.section-title h2,
#modalTitle,
#quoteModalTitle,
.quote-editor-top h2,
.settings-modal h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -.01em;
}

.hero h1 {
  font-size: clamp(38px, 6vw, 74px);
  line-height: .99;
}

.success-card h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.04;
}

.section-title h2,
#modalTitle,
#quoteModalTitle,
.quote-editor-top h2,
.settings-modal h2 {
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: 0;
}

.section-title {
  border-bottom-color: rgba(217,181,111,.26);
}

.panel > h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: 0;
}

.quote-editor-top .kicker,
.settings-modal .kicker {
  margin-bottom: 4px;
}


/* =========================================================
   IMARO EXECUTIVE LIGHT V33 — corporate re-theme
   Appended last so it re-skins the dark base. The client
   documents (.lh-*, .print-document) stay on cream paper.
   ========================================================= */

:root {
  --paper: #1a201e;
  --muted: #7a827c;
  --cyan: #0e6f5c;
  --green: #157a63;
  --gold: #9c7420;
  --line: #e5e2d9;
  --danger: #a93a35;
  --warning: #9a6516;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(24,32,28,.05), 0 10px 30px rgba(24,32,28,.06);

  --canvas: #f0eee7;
  --surface: #ffffff;
  --surface-2: #f7f5ef;
  --ink: #1a201e;
  --ink-2: #464e49;
  --exline: #e5e2d9;
  --exline-2: #efece4;
  --primary: #0e6f5c;
  --primary-hover: #0b5545;
  --gold-tint: #f4edda;
  --info: #235c9e; --info-bg: #e9f0fa;
  --good: #1a7a4f; --good-bg: #e6f3ec;
  --warn: #9a6516; --warn-bg: #f6ecd8;
  --bad:  #a93a35; --bad-bg:  #fbebe9;
  --header-bg: rgba(250,249,245,.9);
  --line-hover: #cfccc0;
  --placeholder: #a7ada6;
  --scheme: light;
}

:root[data-theme="dark"] {
  --paper: #e8edea;
  --muted: #7c8983;
  --cyan: #2fb094;
  --green: #35b58f;
  --gold: #c99b47;
  --line: #28313a;
  --danger: #e07b76;
  --warning: #d0a24e;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 14px 36px rgba(0,0,0,.46);

  --canvas: #0e1317;
  --surface: #171d23;
  --surface-2: #1b222a;
  --ink: #e8edea;
  --ink-2: #aab4ae;
  --exline: #28313a;
  --exline-2: #212a31;
  --primary: #2fb094;
  --primary-hover: #38c4a5;
  --gold-tint: #2a2213;
  --info: #6aa6e6; --info-bg: #172536;
  --good: #4bc088; --good-bg: #12271d;
  --warn: #d0a24e; --warn-bg: #2a2213;
  --bad:  #e07b76; --bad-bg:  #2c1614;
  --header-bg: rgba(18,23,27,.86);
  --line-hover: #3a4650;
  --placeholder: #6d7a74;
  --scheme: dark;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 84% -6%, color-mix(in srgb, var(--primary) 6%, transparent), transparent 30%),
    var(--canvas);
}
body::before { display: none; }
*::selection { background: color-mix(in srgb, var(--primary) 20%, transparent); }

.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--exline);
  backdrop-filter: blur(12px);
}
.brand-word { color: var(--ink); }
.logo-shell {
  border-radius: 11px;
  border: 1px solid #24403a;
  background: #0b0f0e;
  box-shadow: 0 1px 2px rgba(24,32,28,.12);
}
.logo-shell img { filter: none; }

.pill, .button, button {
  border: 1px solid var(--exline);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 1px rgba(24,32,28,.03);
  border-radius: 9px;
  font-weight: 650;
}
.pill { border-radius: 999px; }
.pill:hover, .button:hover, button:hover {
  transform: none;
  border-color: var(--line-hover);
  background: var(--surface-2);
}
.button.primary, button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(14,111,92,.24);
}
.button.primary:hover, button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.button.gold, button.gold {
  border-color: color-mix(in srgb, var(--gold) 42%, transparent);
  color: var(--gold);
  background: var(--surface);
}
.button.gold:hover, button.gold:hover { background: var(--gold-tint); }

.kicker { color: var(--gold); }
.kicker::before { background: var(--primary); box-shadow: none; }
.lead { color: var(--ink-2); }
h1, h2, h3 { color: var(--ink); }

.card {
  background: var(--surface);
  border: 1px solid var(--exline);
  box-shadow: var(--shadow);
  border-radius: 16px;
}
.form-card::before { display: none; }
.section-title { border-bottom: 1px solid color-mix(in srgb, var(--gold) 28%, transparent); }
.step-badge { background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 30%, transparent); color: var(--good); }
label { color: var(--ink); }
small { color: var(--muted); }
input, textarea, select {
  border: 1px solid var(--exline);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 10px;
}
select { color-scheme: var(--scheme); appearance: auto; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:hover, textarea:hover, select:hover {
  border-color: var(--line-hover);
  background: var(--surface-2);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
  transform: none;
}
.checkbox-list { background: var(--surface-2); border: 1px solid var(--exline); }
.notice { color: var(--muted); }
.result { background: var(--good-bg); border: 1px solid color-mix(in srgb, var(--good) 26%, transparent); }
.result.error { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 26%, transparent); }
.hidden { display: none !important; }

.success-card { background: var(--surface); border: 1px solid var(--exline); }
.ref-box { background: var(--surface-2); border: 1px solid var(--exline); color: var(--ink); }

.admin-layout > .card { background: var(--surface); border-color: var(--exline); }
.stat { background: var(--surface-2); border: 1px solid var(--exline); }
.stat::after { display: none; }
.stat span { color: var(--muted); }
.stat b { color: var(--primary); }

.toolbar { background: var(--surface-2); border: 1px solid var(--exline); }
.table-wrap { background: var(--surface); border: 1px solid var(--exline); box-shadow: none; }
table { background: var(--surface); }
th { background: var(--surface-2); color: var(--muted); border-bottom: 1px solid var(--exline); }
td { border-bottom: 1px solid var(--exline-2); color: var(--ink-2); }
td strong { color: var(--ink); }
tr:hover td { background: var(--surface-2); }

.status, .status.new { background: var(--info-bg); color: var(--info); }
.status.approved { background: var(--good-bg); color: var(--good); }
.status.needs_info { background: var(--warn-bg); color: var(--warn); }
.status.rejected { background: var(--bad-bg); color: var(--bad); }
.status.archived { background: var(--exline-2); color: var(--muted); }
.duplicate { color: var(--warn); }

.modal { background: rgba(26,32,30,.32); }
.modal-inner { background: var(--surface); border: 1px solid var(--exline); box-shadow: 0 30px 80px rgba(24,32,28,.22); }
.details-grid { background: var(--surface-2); border: 1px solid var(--exline); }
.details-grid b { color: var(--muted); }
.details-grid span { color: var(--ink-2); }
.empty-state { color: var(--muted); }
.empty-state strong { color: var(--ink); }
.admin-error { background: var(--bad-bg); border: 1px solid color-mix(in srgb, var(--bad) 26%, transparent); color: var(--bad); }

.workflow-actions .approve { color: var(--good); background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 32%, transparent); }
.workflow-actions .needs { color: var(--warn); background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 32%, transparent); }
.workflow-actions .reject { color: var(--bad); background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 32%, transparent); }
.workflow-actions .archive { color: var(--muted); background: var(--surface-2); border-color: var(--exline); }
.workflow-actions .quote-action { color: #fff; background: var(--primary); border-color: var(--primary); }

.quote-document { background: var(--surface-2); border: 1px solid var(--exline); border-radius: 16px; }
.quote-brand-row { border-bottom: 1px solid var(--exline); }
.quote-meta strong { color: var(--gold); }
.quote-meta span { color: var(--ink); }
.quote-box { background: var(--surface); border: 1px solid var(--exline); border-radius: 12px; }
.quote-box p { color: var(--ink-2); }
.quote-label { color: var(--gold); }
.quote-lines-head { color: var(--muted); border-bottom: 1px solid var(--exline); }
.quote-line-row { border-bottom: 1px solid var(--exline-2); }
.quote-line-total { color: var(--ink); }
.remove-line { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); background: var(--surface); }
.quote-add-line { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 34%, transparent); background: var(--surface); }
.quote-total-box { background: var(--surface); border: 1px solid var(--exline); border-radius: 12px; }
.quote-total-box div { border-bottom: 1px solid var(--exline-2); }
.quote-total-box span { color: var(--muted); }
.quote-total-box strong { color: var(--ink); }
.quote-total-box .grand-total strong { color: var(--primary); }
.quote-footer-actions { border-top: 1px solid var(--exline); }

.client-quotes-panel { background: var(--surface-2); border: 1px solid var(--exline); border-radius: 14px; }
.client-quotes-head strong { color: var(--ink); }
.client-quote-row { background: var(--surface); border: 1px solid var(--exline); border-radius: 10px; }
.client-quote-row strong { color: var(--ink); }
.client-quote-row span { color: var(--muted); }
.open-quote-button { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, transparent); background: var(--surface); }
.open-quote-button:hover { color: #fff; background: var(--primary); border-color: var(--primary); }
.quote-footer-actions .invoice-action, .open-invoice-button {
  color: #fff; background: var(--gold); border-color: var(--gold); box-shadow: none;
}
.quote-footer-actions .invoice-action:hover, .open-invoice-button:hover { background: #856219; color: #fff; }
.client-invoices-panel { border-color: color-mix(in srgb, var(--gold) 24%, transparent); }

.kpi { background: var(--surface); border: 1px solid var(--exline); box-shadow: 0 1px 2px rgba(24,32,28,.04); }
.kpi:hover { border-color: var(--line-hover); }
.kpi span, .kpi small { color: var(--muted); }
.kpi b { color: var(--ink); }
.kpi::before { background: var(--exline); }
.kpi-cyan::before { background: var(--primary); } .kpi-cyan b { color: var(--primary); }
.kpi-green::before { background: var(--good); } .kpi-green b { color: var(--good); }
.kpi-gold::before { background: var(--gold); } .kpi-gold b { color: var(--gold); }
.kpi-warning::before { background: var(--warn); } .kpi-warning b { color: var(--warn); }
.kpi-muted::before { background: var(--exline); }

.overdue-pill { color: var(--bad); background: var(--bad-bg); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); box-shadow: none; }
.overdue-tag { color: var(--bad); background: var(--bad-bg); border: 1px solid color-mix(in srgb, var(--bad) 34%, transparent); }
.client-quote-row.row-overdue { border-color: color-mix(in srgb, var(--bad) 30%, transparent); background: var(--bad-bg); }

.toast { background: var(--surface); border: 1px solid var(--exline); color: var(--ink); box-shadow: 0 12px 34px rgba(24,32,28,.16); backdrop-filter: none; }
.toast-dot { background: var(--primary); box-shadow: none; }
.toast-success .toast-dot { background: var(--good); box-shadow: none; }
.toast-error .toast-dot { background: var(--bad); box-shadow: none; }
.toast-error { border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.toast-x { color: var(--muted); }
.toast-x:hover { color: var(--ink); background: var(--surface-2); }

.confirm-overlay { background: rgba(26,32,30,.34); }
.confirm-card { background: var(--surface); border: 1px solid var(--exline); box-shadow: 0 30px 80px rgba(24,32,28,.24); }
.confirm-message { color: var(--ink-2); }
button.danger, .confirm-ok.danger { background: var(--bad); border-color: var(--bad); color: #fff; }

.settings-actions { border-top: 1px solid var(--exline); }

.print-page { background: var(--canvas); }


/* =========================================================
   IMARO APP SHELL V34 — corporate rail + topbar + panels
   ========================================================= */

.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  background: #14201d;
  color: #c7d2cc;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.rail-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.rail-tile { width: 36px; height: 36px; border-radius: 9px; background: #0b0f0e; border: 1px solid #24403a; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; }
.rail-tile img { width: 24px; height: 24px; object-fit: contain; }
.rail-wm { font-size: 14px; letter-spacing: .24em; font-weight: 800; color: #eef2f0; line-height: 1; }
.rail-wm small { display: block; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: #7d8c85; font-weight: 600; margin-top: 4px; }

.rail-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.rail-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 11px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: #7d8c85;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}
.rail-item svg { width: 18px; height: 18px; flex: 0 0 auto; }
.rail-item:hover { color: #c7d2cc; background: rgba(255,255,255,.04); transform: none; border: 0; }
.rail-item.active { color: #fff; background: #1f322c; }
.rail-item.active svg { color: #47c9a9; }

.rail-spacer { flex: 1 1 auto; min-height: 16px; }
.rail-acct { display: flex; align-items: center; gap: 10px; padding: 12px 8px; border-top: 1px solid rgba(255,255,255,.08); }
.rail-avatar { width: 32px; height: 32px; border-radius: 8px; background: #24403a; color: #8fe3d0; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.rail-who { font-size: 12.5px; color: #c7d2cc; font-weight: 600; line-height: 1.2; }
.rail-who small { display: block; color: #7d8c85; font-weight: 500; font-size: 11px; margin-top: 2px; }
.rail-token {
  margin-top: 8px;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255,255,255,.12);
  color: #c7d2cc;
  font-size: 12.5px;
  border-radius: 9px;
  padding: 9px;
  box-shadow: none;
}
.rail-token:hover { background: rgba(255,255,255,.05); color: #fff; border-color: rgba(255,255,255,.2); transform: none; }

.app-main { padding: 26px 32px 48px; min-width: 0; }

.app-topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.eyebrow-row { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; flex-wrap: wrap; }
#greeting { font-size: clamp(24px, 3vw, 30px); }
.app-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.app-topbar-actions { display: flex; gap: 10px; align-items: center; }

.panel { background: var(--surface); border: 1px solid var(--exline); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--exline); flex-wrap: wrap; }
.panel-head h2 { font-size: 18px; }
.panel-count { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); border: 1px solid var(--exline); padding: 3px 10px; border-radius: 999px; }
.panel-tools { margin-left: auto; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.search-wrap { position: relative; display: inline-flex; }
.search-wrap input { width: 240px; min-width: 0; max-width: 100%; padding-left: 32px; }
.search-ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.panel-tools .sel { width: 168px; min-width: 0; max-width: 100%; }
@media (max-width: 560px) {
  .search-wrap, .search-wrap input { width: 100%; }
  .panel-tools .sel { flex: 1; }
}
.btn-icon { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; border-radius: 9px; }
.btn-icon svg { width: 17px; height: 17px; }

.clients-panel table { min-width: 680px; }
.clients-panel .table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.clients-panel th { color: var(--muted); background: var(--surface-2); }
.cell-co { color: var(--ink); font-weight: 600; }
.cell-id { color: var(--muted); font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cell-name { color: var(--ink); }
.cell-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cell-muted { color: var(--muted); white-space: nowrap; }
.dupe-tag { color: var(--warn); font-weight: 600; }

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; gap: 6px; padding: 10px 12px; }
  .rail-brand { padding: 4px 8px; }
  .rail-nav { flex-direction: row; margin-top: 0; }
  .rail-item { white-space: nowrap; }
  .rail-spacer, .rail-acct, .rail-token, .rail-theme { display: none; }
  .app-main { padding: 20px 16px 40px; }
  .app-topbar-actions { width: 100%; }
}

/* Theme toggle in rail */
.rail-theme {
  display: flex;
  gap: 3px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  padding: 3px;
  margin-top: 10px;
}
.rail-theme button {
  flex: 1;
  border: 0;
  background: transparent;
  color: #7d8c85;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: none;
}
.rail-theme button:hover { color: #c7d2cc; transform: none; background: transparent; }
.rail-theme button.active,
.rail-theme button.active:hover { background: #1f322c; color: #fff; }

/* Global quote / invoice list views */
.view[hidden] { display: none; }
.list-panel table { min-width: 640px; }
.list-panel .table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.list-panel th { color: var(--muted); background: var(--surface-2); }
.list-panel td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.list-strong { color: var(--ink); font-weight: 600; }
.list-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Invoice payments */
.payments-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--exline); }
.payment-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 11px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--exline); margin-bottom: 8px;
}
.payment-row strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.payment-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.payment-remove { padding: 6px 12px; font-size: 12.5px; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.payment-form { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.payment-form input, .payment-form select { width: auto; min-height: 46px; }
.payment-form #payAmount { width: 150px; }
.payment-form #payMethod { width: 160px; }
.payment-form #payDate { width: 170px; }
@media (max-width: 560px) {
  .payment-form input, .payment-form select { width: 100%; }
}

/* Service catalog */
.catalog-body { padding: 18px; }
.catalog-form {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
  margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--exline);
}
.catalog-form #serviceName { width: 240px; }
.catalog-form #servicePrice { width: 150px; }
.catalog-form #serviceDesc { flex: 1; min-width: 220px; }
.service-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--exline); margin-bottom: 8px;
}
.service-row strong { color: var(--ink); }
.service-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.service-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.service-actions button { padding: 7px 13px; font-size: 12.5px; }
.service-remove { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.line-adders { display: flex; gap: 9px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.catalog-picker { width: auto; min-width: 220px; max-width: 320px; }
@media (max-width: 560px) {
  .catalog-form #serviceName, .catalog-form #servicePrice, .catalog-form #serviceDesc { width: 100%; flex: none; }
  .catalog-picker { width: 100%; max-width: none; }
}

/* Stale-deploy warning banner */
.update-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 12px 20px;
  background: var(--warn-bg); color: var(--warn);
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 34%, transparent);
  font-size: 13.5px;
}
.update-banner strong { color: var(--warn); }
.update-banner code {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  padding: 4px 8px; border-radius: 6px; font-size: 12px; white-space: nowrap;
}

/* Public quote acceptance */
.public-accept {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px; padding: 16px 20px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--exline); box-shadow: var(--shadow);
}
.public-accept:empty { display: none; }
.public-accept.accepted { border-color: color-mix(in srgb, var(--good) 40%, transparent); background: var(--good-bg); }
.public-accept .pa-lead strong { display: block; font-size: 16px; color: var(--ink); }
.public-accept .pa-lead span { display: block; margin-top: 3px; color: var(--muted); font-size: 13.5px; }
.public-accept.accepted .pa-lead strong { color: var(--good); }
.public-accept .pa-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.public-accept .pa-controls input { width: 200px; }
.public-accept .pa-error { flex-basis: 100%; margin: 6px 0 0; color: var(--bad); font-size: 13px; }
.public-accept .pa-bank {
  flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 18px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--exline);
}
.public-accept .pa-bank div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.public-accept .pa-bank span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.public-accept .pa-bank b { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; word-break: break-word; }
@media (max-width: 560px) {
  .public-accept .pa-controls, .public-accept .pa-controls input { width: 100%; }
}

/* Quote decision + e-signature */
.public-accept.decision { flex-direction: column; align-items: stretch; }
.public-accept.declined { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-bg); }
.public-accept.declined .pa-lead strong { color: var(--bad); }
.decision-form { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.decision-choice { display: flex; gap: 10px; }
.dc-btn { flex: 1; padding: 12px; border: 1px solid var(--exline); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; }
.dc-btn:hover { border-color: var(--line-hover); }
.dc-btn.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.df-label { font-size: 13px; font-weight: 650; color: var(--ink); margin-top: 6px; }
.df-label .req { color: var(--muted); font-weight: 500; font-size: 12px; }
.decision-form textarea { min-height: 80px; }
.sig-wrap { position: relative; border: 1px dashed color-mix(in srgb, var(--ink) 24%, transparent); border-radius: 10px; background: #fff; overflow: hidden; }
#sigPad { display: block; width: 100%; height: 170px; touch-action: none; cursor: crosshair; }
.sig-clear { position: absolute; top: 8px; right: 8px; padding: 5px 11px; font-size: 12px; }
.df-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); line-height: 1.5; margin-top: 4px; }
.df-consent input { width: auto; margin-top: 3px; flex: 0 0 auto; }
.df-actions { margin-top: 6px; }
.df-actions .primary { min-width: 180px; }

/* Admin: signed client response record */
.client-response { margin: 4px 0 20px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--exline); background: var(--surface-2); }
.client-response.cr-good { border-color: color-mix(in srgb, var(--good) 34%, transparent); }
.client-response.cr-bad { border-color: color-mix(in srgb, var(--bad) 34%, transparent); }
.cr-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cr-head strong { color: var(--ink); }
.cr-meta { color: var(--muted); font-size: 12.5px; }
.cr-reason { margin: 10px 0 0; color: var(--ink-2); font-style: italic; }
.cr-sig { display: block; margin: 12px 0 0; max-width: 320px; width: 100%; height: auto; background: #fff; border: 1px solid var(--exline); border-radius: 8px; }
.cr-trail { margin-top: 10px; font-size: 11.5px; color: var(--muted); word-break: break-all; }

/* Reports */
.reports-body { padding: 18px; }
.reports-kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.reports-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.reports-grid .report-card:first-child { grid-column: 1 / -1; }
.report-card { background: var(--surface); border: 1px solid var(--exline); border-radius: 14px; padding: 16px 18px; }
.report-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.rev-chart { display: flex; align-items: flex-end; gap: 8px; height: 200px; }
.rev-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; min-width: 0; }
.rev-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.rev-bar { width: 62%; max-width: 44px; background: var(--primary); border-radius: 5px 5px 0 0; min-height: 3px; transition: opacity .15s; }
.rev-bar:hover { opacity: .82; }
.rev-x { font-size: 11px; color: var(--muted); white-space: nowrap; }
.funnel { display: flex; flex-direction: column; gap: 13px; }
.funnel-row { display: grid; grid-template-columns: 76px 1fr 34px; gap: 10px; align-items: center; }
.funnel-label { font-size: 13px; color: var(--ink-2); }
.funnel-track { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.funnel-fill { display: block; height: 100%; background: var(--primary); border-radius: 999px; min-width: 3px; }
.funnel-val { font-size: 13px; font-weight: 700; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.aging { display: flex; flex-direction: column; }
.aging-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--exline-2); font-size: 13.5px; color: var(--ink-2); }
.aging-row:last-child { border-bottom: 0; }
.aging-row strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.aging-row.warn strong { color: var(--warn); }
.aging-row.bad strong { color: var(--bad); }

/* Publish polish — responsiveness */
@media (max-width: 900px) {
  .reports-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .reports-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .app-topbar { flex-direction: column; align-items: stretch; }
  .app-topbar-actions { justify-content: flex-start; }
  .modal { padding: 12px; }
  .modal-inner { padding: 18px; max-height: 92vh; }
  .quote-footer-actions button, .quote-footer-actions .primary { flex: 1 1 auto; }
  .kpi b { font-size: 22px; }
  .details-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .reports-kpis { grid-template-columns: 1fr; }
  .panel-head { align-items: flex-start; }
  .panel-tools { width: 100%; }
  .panel-tools .search-wrap { flex: 1; }
}

/* ── Invoice lock + retainers (v46) ─────────────────────────────────── */
.panel-hint { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; max-width: 70ch; }

/* Locked invoice banner + read-only view */
.lock-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 16px; margin-bottom: 18px; border-radius: 12px;
  background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
}
.lock-banner .lock-ico { font-size: 20px; line-height: 1; }
.lock-banner .lock-copy { flex: 1; min-width: 220px; }
.lock-banner .lock-copy strong { display: block; color: var(--ink); font-size: 15px; }
.lock-banner .lock-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.quote-lines.locked { border-top: 1px solid var(--exline); }
.quote-lines-head.locked-head { grid-template-columns: 2.6fr 0.7fr 1fr 1fr; }
.locked-line {
  display: grid; grid-template-columns: 2.6fr 0.7fr 1fr 1fr; gap: 10px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--exline); color: var(--ink); font-size: 14px;
}
.locked-line .num { text-align: right; }
.locked-line .money { font-variant-numeric: tabular-nums; }
.locked-notes { margin: 0; padding: 8px 0; color: var(--ink); white-space: pre-wrap; }
.lock-action {
  background: transparent; border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent);
  color: var(--bad);
}
.lock-action:hover { background: var(--bad-bg); }

/* Retainers list */
.retainer-list { display: flex; flex-direction: column; gap: 12px; }
.retainer-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 18px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--exline); box-shadow: var(--shadow);
}
.retainer-card.is-paused { opacity: 0.72; }
.retainer-main { min-width: 240px; flex: 1; }
.retainer-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.retainer-title strong { font-size: 15.5px; color: var(--ink); }
.retainer-badges { display: inline-flex; gap: 6px; }
.retainer-sub { margin-top: 4px; color: var(--ink); font-size: 13.5px; }
.retainer-meta { margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.retainer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  letter-spacing: .02em;
}
.chip-good { background: var(--good-bg); color: var(--good); }
.chip-info { background: var(--info-bg); color: var(--info); }
.chip-muted { background: color-mix(in srgb, var(--muted) 16%, transparent); color: var(--muted); }

/* Retainer editor form */
.ret-controls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ret-autosend { grid-column: 1 / -1; }
.check-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink); font-size: 14px; }
.check-label input { width: auto; }
.field-hint { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
@media (max-width: 720px) {
  .ret-controls { grid-template-columns: 1fr 1fr; }
  .retainer-actions { width: 100%; }
  .retainer-actions button { flex: 1 1 auto; }
}

/* ── Dashboard overview (v47) ────────────────────────────────────────── */
.dash-attention {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.dash-tile {
  display: flex; flex-direction: column; gap: 3px; text-align: left; cursor: pointer;
  padding: 15px 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--exline); box-shadow: var(--shadow);
  border-left: 3px solid var(--exline); transition: transform .12s ease, box-shadow .12s ease;
}
.dash-tile:hover { transform: translateY(-2px); }
.dash-tile-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.dash-tile-value { font-size: 26px; color: var(--ink); line-height: 1.1; }
.dash-tile-sub { font-size: 12px; color: var(--muted); }
.dash-tile.tone-bad { border-left-color: var(--bad); }
.dash-tile.tone-bad .dash-tile-value { color: var(--bad); }
.dash-tile.tone-warn { border-left-color: var(--warn); }
.dash-tile.tone-info { border-left-color: var(--info); }

.dash-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dash-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  text-align: left; cursor: pointer; padding: 10px 8px; border: none; border-bottom: 1px solid var(--exline);
  background: transparent; border-radius: 8px;
}
.dash-row:hover { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.dash-row:last-child { border-bottom: none; }
.dash-row-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dash-row-main strong { color: var(--ink); font-size: 14px; }
.dash-row-main span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.dash-row-side span { color: var(--muted); font-size: 12px; }
.money.tone-bad { color: var(--bad); }
@media (max-width: 760px) { .dash-lists { grid-template-columns: 1fr; } }

/* Retainer safety cues */
.ghost-warn {
  background: transparent; border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent);
  color: var(--warn);
}
.ghost-warn:hover { background: var(--warn-bg); }
.chip-link { border: none; cursor: pointer; background: var(--info-bg); color: var(--info); }
.chip-link:hover { text-decoration: underline; }

/* ── Dashboard polish (v47) ──────────────────────────────────────────── */
.dash-eyebrow {
  font-size: 12px; text-transform: uppercase; letter-spacing: .09em; font-weight: 700;
  color: var(--muted); margin: 4px 2px 10px;
}
.dash-attention + .dash-eyebrow { margin-top: 22px; }
.dash-tile-top { display: flex; align-items: center; gap: 8px; }
.dash-tile-ico { display: inline-flex; color: var(--muted); }
.dash-tile-ico svg { width: 16px; height: 16px; }
.dash-tile.tone-bad .dash-tile-ico { color: var(--bad); }
.dash-tile.tone-warn .dash-tile-ico { color: var(--warn); }
.dash-tile.tone-info .dash-tile-ico { color: var(--info); }
.dash-tile .dash-tile-label { margin: 0; }
.title-count {
  display: inline-block; min-width: 20px; padding: 1px 7px; margin-left: 6px;
  border-radius: 999px; background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary); font-size: 12px; font-weight: 700; vertical-align: middle;
}

/* ── Onboarding form sections (v48) ──────────────────────────────────── */
.form-section { margin-top: 26px; }
.form-section:first-of-type { margin-top: 22px; }
.form-section-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.form-section-num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 14px; line-height: 1;
}
.form-section-head h3 { margin: 0; font-size: 16px; color: var(--ink); }
.form-section-head p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.form-consent {
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--exline);
}

/* Delete-client sits apart from the status actions to avoid mis-clicks */
.workflow-actions .delete-client { margin-left: auto; }
@media (max-width: 560px) { .workflow-actions .delete-client { margin-left: 0; width: 100%; } }

/* Website prices */
.price-group { margin: 22px 0 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.price-group:first-child { margin-top: 4px; }
.price-head, .price-row { display: grid; grid-template-columns: 1fr 130px 100px; gap: 10px; align-items: center; }
.price-head { font-size: 11.5px; color: var(--muted); padding: 0 14px 4px; }
.price-row { padding: 9px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--exline); margin-bottom: 7px; }
.price-row strong { color: var(--ink); font-weight: 600; }
.price-row input { width: 100%; }
.price-actions { display: flex; gap: 9px; margin-top: 18px; }
@media (max-width: 560px) { .price-head, .price-row { grid-template-columns: 1fr 92px 70px; gap: 7px; } }

#kpiBand[hidden] { display: none; }

/* Wordmark logo as an image (the app's security policy blocks web fonts) */
.wm-img { display: block; height: 30px; width: auto; }
.wm-img.wm-rail { height: 24px; }
.rail-wm .wm-img + small { margin-top: 7px; }
.rail-tile { background: #1d2230; border-color: #2a3042; }
.rail-tile img { width: 28px; height: 28px; }
.wm-img { flex: none; max-width: none; }
.rail-wm { flex: 0 0 auto; }
.wm-img { width: 119px; height: 30px; }
.wm-img.wm-rail { width: 95px; height: 24px; }

/* ==== Theme-aware dropdowns and scrollbars (follow light/dark) ==== */
:root { color-scheme: var(--scheme); }

/* Dropdown list: use the app's own surface and text colours */
select option, select optgroup { background: var(--surface); color: var(--ink); padding: 10px 14px; }
select option[value=""] { color: var(--placeholder); }
select option:checked { background: color-mix(in srgb, var(--primary) 16%, var(--surface)); }

/* Scrollbars: thin, quiet, in the text colour of the theme */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 28%, transparent) transparent; }
@supports not (scrollbar-color: auto) {
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-track { background: transparent; }
  *::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 26%, transparent); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
  *::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--ink) 42%, transparent); background-clip: content-box; }
}

/* Fully styled dropdown where the browser supports it (Chrome / Edge 135+) */
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select::picker-icon { color: var(--muted); transition: transform .2s ease; }
  select:open::picker-icon { transform: rotate(180deg); }
  ::picker(select) {
    background: var(--surface);
    border: 1px solid var(--exline);
    border-radius: 12px;
    padding: 6px;
    margin-top: 6px;
    box-shadow: var(--shadow);
    max-height: 320px;
  }
  select option { border-radius: 8px; }
  select option:hover, select option:focus-visible { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
  select option::checkmark { color: var(--primary); }
}
@supports (appearance: base-select) {
  ::picker(select) { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 28%, transparent) transparent; }
}

/* Wordmark swaps with the theme: dark ink on light, light ink on dark */
.wm-img.wm-on-dark { display: none; }
:root[data-theme="dark"] .wm-img.wm-on-light { display: none; }
:root[data-theme="dark"] .wm-img.wm-on-dark { display: block; }
select { white-space: nowrap; }
@supports (appearance: base-select) {
  select { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; }
}

/* Calmer type scale and richer documents */
h1 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; }
h2 { font-size: clamp(19px, 2.2vw, 24px); line-height: 1.25; }
.hero h1 { font-size: clamp(28px, 4.2vw, 44px); }
.success-card h1 { font-size: clamp(26px, 3.4vw, 34px); }
.section-title h2 { font-size: clamp(20px, 2.2vw, 26px); }
.settings-modal h2 { font-size: 20px; }
.stat b, .kpi b { font-size: 21px; }
#greeting { font-size: clamp(21px, 2.4vw, 26px); }
.dash-tile-value { font-size: 22px; }

.lh-name { font-size: 21px; }
.lh-title { font-size: 24px; letter-spacing: .04em; }
.lh-refs .v { font-size: 12.5px; font-weight: 600; }
.lh-parties strong { font-size: 14.5px; }
.lh-table tbody td { font-size: 13px; }
.lh-totals .grand b { font-size: 16.5px; }
.lh-from { font-size: 11px; }
.lh-pay { font-size: 12.5px; }
.lh-foot {
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid rgba(176,134,64,.35);
  font-family: var(--font-sans);
  font-size: 10.5px;
  line-height: 1.7;
  letter-spacing: .04em;
  text-align: center;
  color: #6b726d;
}
.lh-sign, .lh-stamp { font-family: var(--font-sans); margin-top: 20px; }
.lh-sign {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px;
  border: 1px solid rgba(47,143,99,.45);
  border-left-width: 4px;
  border-radius: 4px;
  background: rgba(47,143,99,.06);
}
.lh-sign .l { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #2f8f63; font-weight: 700; }
.lh-sign b { font-size: 14px; color: var(--doc-ink); }
.lh-sign span { font-size: 11.5px; color: #5a615c; }
.lh-stamp {
  display: inline-block;
  padding: 4px 16px;
  border: 2px solid #2f8f63;
  border-radius: 4px;
  color: #2f8f63;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .24em;
  text-transform: uppercase;
  transform: rotate(-4deg);
}
@media print { .lh-stamp { transform: none; } }
.lh-foot:empty { display: none; }
.lh-totals .row.sched { font-size: 12px; color: #5a615c; }

/* Smooth navigation and pipeline */
html { scroll-behavior: smooth; }
@keyframes ptFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalCardIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.view:not([hidden]) { animation: ptFade .22s ease both; }
.modal.open { animation: modalIn .18s ease both; }
.modal.open > .card, .modal.open .modal-inner { animation: modalCardIn .22s ease both; }
button, .button, .pill, .rail-item, .pt-btn, .pt-navlink { transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .12s ease; }
button:active:not(:disabled) { transform: translateY(1px); }
.next-step { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .view:not([hidden]), .modal.open, .modal.open > .card, .modal.open .modal-inner { animation: none; }
}

.money-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 14px; }
.money-summary > div { background: var(--surface-2, #f4f2ec); border: 1px solid var(--exline, #e3e1db); border-radius: 12px; padding: 10px 12px; }
.money-summary span { display: block; font-size: 12px; color: var(--muted, #6b6b6b); margin-bottom: 4px; }
.money-summary strong { font-size: 16px; }
.money-summary .tone-good { color: var(--good, #1f7a52); }
.money-summary .tone-bad { color: var(--bad, #b3261e); }
@media (max-width: 560px) { .money-summary { grid-template-columns: 1fr; } }

.activity-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 0; max-height: 320px; overflow: auto; }
.activity-list li { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--exline, #e3e1db); font-size: 14px; }
.activity-list li:first-child { border-top: 0; }
.activity-list small { display: block; color: var(--muted, #6b6b6b); font-size: 12px; margin-top: 2px; }
.activity-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: var(--muted, #9aa09c); }
.activity-payment .activity-dot, .activity-quote_accepted .activity-dot { background: var(--good, #1f7a52); }
.activity-quote_rejected .activity-dot, .activity-invoice_reminder .activity-dot { background: var(--bad, #b3261e); }

/* =========================================================
   GLASS SIDE NAV — floating, minimisable, hover pop-ups
   ========================================================= */
html { --rail-open: 252px; --rail-min: 92px; }
.app-shell { grid-template-columns: var(--rail-open) minmax(0, 1fr); transition: grid-template-columns .32s cubic-bezier(.2,.8,.2,1); }
html[data-rail="min"] .app-shell { grid-template-columns: var(--rail-min) minmax(0, 1fr); }

/* soft colour behind the glass so the blur has something to refract */
.app-shell::before {
  display: none; content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(520px 380px at 2% 12%, color-mix(in srgb, var(--primary) 26%, transparent), transparent 70%),
    radial-gradient(460px 420px at 6% 92%, rgba(255, 138, 76, .16), transparent 70%);
}

.rail {
  position: sticky; top: 12px; height: calc(100vh - 24px); margin: 12px 0 12px 12px;
  border-radius: 24px; padding: 16px 12px; gap: 4px; overflow: visible;
  background: linear-gradient(165deg, rgba(24, 34, 31, .93), rgba(11, 17, 15, .90));
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, .13);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 0 0 1px rgba(255, 255, 255, .02);
  z-index: 30;
}
@media (max-height: 720px) { .rail { overflow-y: auto; } }

.rail-brand { position: relative; padding: 2px 4px 16px; gap: 10px; }
.rail-tile { border-radius: 12px; background: rgba(0, 0, 0, .35); border-color: rgba(255, 255, 255, .12); }
.rail-wm { flex: 1 1 auto; min-width: 0; white-space: nowrap; }
.rail-collapse {
  flex: 0 0 auto; width: 30px; height: 30px; padding: 0; display: grid; place-items: center; cursor: pointer;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: #aebbb5; box-shadow: none;
  transition: background .2s, color .2s, transform .3s;
}
.rail-collapse:hover { background: rgba(255, 255, 255, .14); color: #fff; transform: scale(1.06); }
.rail-collapse svg { width: 16px; height: 16px; transition: transform .3s; }

.rail-item {
  position: relative; border-radius: 14px; padding: 11px 13px; color: #9fb0a9;
  transition: background .2s, color .2s, transform .2s, box-shadow .25s;
}
.rail-item:hover { background: rgba(255, 255, 255, .09); color: #fff; transform: translateX(3px); }
.rail-item.active {
  color: #fff; background: linear-gradient(135deg, rgba(47, 176, 148, .34), rgba(47, 176, 148, .12));
  box-shadow: 0 8px 22px -10px rgba(47, 176, 148, .75), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.rail-item.active::before {
  content: ""; position: absolute; left: -12px; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0;
  background: #47c9a9; box-shadow: 0 0 12px #47c9a9;
}
.rail-item .lbl, .rail-token .lbl, .rail-theme .lbl { white-space: nowrap; overflow: hidden; transition: opacity .2s, max-width .3s; max-width: 160px; }

.rail-acct { border-top-color: rgba(255, 255, 255, .1); padding: 12px 6px; }
.rail-avatar { border-radius: 12px; background: linear-gradient(135deg, #2c5a4f, #1d3b33); }
.rail-theme { background: rgba(0, 0, 0, .22); border-color: rgba(255, 255, 255, .1); }
.rail-theme button { display: flex; align-items: center; justify-content: center; gap: 6px; }
.rail-theme button svg { width: 15px; height: 15px; flex: 0 0 auto; }
.rail-theme button.active, .rail-theme button.active:hover { background: rgba(255, 255, 255, .16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); }
.rail-token { display: flex; align-items: center; justify-content: center; gap: 8px; position: relative; border-radius: 14px; background: rgba(255, 255, 255, .05); }
.rail-token svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* ---------- minimised: icon rail ---------- */
html[data-rail="min"] .rail { padding: 16px 10px; align-items: stretch; }
html[data-rail="min"] .rail-brand { flex-direction: column; align-items: center; gap: 10px; padding-bottom: 14px; }
html[data-rail="min"] .rail-wm, html[data-rail="min"] .rail-who { display: none; }
html[data-rail="min"] .rail-collapse svg { transform: rotate(180deg); }
html[data-rail="min"] .rail-item, html[data-rail="min"] .rail-token { justify-content: center; padding: 12px 0; gap: 0; }
html[data-rail="min"] .rail-item:hover { transform: scale(1.08); }
html[data-rail="min"] .rail-item .lbl, html[data-rail="min"] .rail-token .lbl { max-width: 0; opacity: 0; }
html[data-rail="min"] .rail-item.active::before { left: -10px; }
html[data-rail="min"] .rail-acct { justify-content: center; }
html[data-rail="min"] .rail-theme { flex-direction: column; border-radius: 16px; }
html[data-rail="min"] .rail-theme button { padding: 8px 0; border-radius: 12px; gap: 0; }
html[data-rail="min"] .rail-theme .lbl { max-width: 0; opacity: 0; }

/* hover pop-up labels in minimised mode */
html[data-rail="min"] .rail-item::after, html[data-rail="min"] .rail-token::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 16px); top: 50%;
  transform: translate(-6px, -50%) scale(.92); transform-origin: left center; opacity: 0; pointer-events: none;
  padding: 7px 12px; border-radius: 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: #fff;
  background: rgba(20, 32, 29, .82); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .5);
  transition: opacity .18s, transform .22s cubic-bezier(.2,.9,.3,1.3);
}
html[data-rail="min"] .rail-item:hover::after, html[data-rail="min"] .rail-item:focus-visible::after,
html[data-rail="min"] .rail-token:hover::after { opacity: 1; transform: translate(0, -50%) scale(1); }
.rail-item:focus-visible, .rail-collapse:focus-visible, .rail-token:focus-visible { outline: 2px solid #47c9a9; outline-offset: 2px; }

/* light theme: keep the glass dark but a touch lighter so it feels airy */
:root:not([data-theme="dark"]) .rail { box-shadow: 0 24px 60px -22px rgba(20, 40, 34, .55), inset 0 1px 0 rgba(255, 255, 255, .12); }

@media (max-width: 860px) {
  .app-shell, html[data-rail="min"] .app-shell { grid-template-columns: 1fr; }
  .app-shell::before { display: none; }
  .rail { position: static; height: auto; margin: 8px; border-radius: 18px; flex-direction: row; align-items: center; overflow-x: auto; padding: 8px 10px; }
  .rail-brand, html[data-rail="min"] .rail-brand { flex-direction: row; padding: 2px 6px; }
  .rail-collapse, .rail-item.active::before { display: none; }
  .rail-wm, html[data-rail="min"] .rail-wm { display: block; }
  .rail-item, html[data-rail="min"] .rail-item { width: auto; justify-content: flex-start; gap: 9px; padding: 10px 12px; }
  .rail-item .lbl, html[data-rail="min"] .rail-item .lbl { max-width: 160px; opacity: 1; }
  html[data-rail="min"] .rail-item::after { display: none; }
  .rail-item:hover, html[data-rail="min"] .rail-item:hover { transform: none; }
}

/* =========================================================
   MODERN CONTENT POLISH — matches the glass nav
   ========================================================= */
.app-main { padding: 28px 36px 56px; }
.panel, .client-quotes-panel, .kpi, .success-card, .confirm-card {
  border-radius: 20px;
  border-color: color-mix(in srgb, var(--exline) 80%, transparent);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 14px 34px -22px rgba(20, 40, 34, .35);
}
:root[data-theme="dark"] .panel, :root[data-theme="dark"] .client-quotes-panel, :root[data-theme="dark"] .kpi {
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 14px 34px -20px rgba(0,0,0,.6);
}
.kpi { transition: transform .2s, box-shadow .2s; }
.kpi:hover { transform: translateY(-2px); }
.client-quote-row { border-radius: 14px; transition: transform .18s, box-shadow .18s, border-color .18s; }
.client-quote-row:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--primary) 40%, var(--exline)); }
.panel-head { padding: 18px 22px; }
.panel th { font-size: 11px; letter-spacing: .09em; }
.panel td { padding-top: 14px; padding-bottom: 14px; }
tr { transition: background .15s; }
input, select, textarea { border-radius: 12px; }
.button, button { border-radius: 12px; }
.button.primary, button.primary { box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--primary) 80%, transparent); }
.modal-inner { border-radius: 24px; }
.modal { -webkit-backdrop-filter: blur(8px) saturate(120%); backdrop-filter: blur(8px) saturate(120%); }
.toast { border-radius: 16px; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.status { border-radius: 999px; }

.client-status-box { border-top: 1px solid var(--exline, rgba(255,255,255,.10)); padding-top: 18px; margin-top: 18px; }

/* checkboxes & radios: never inherit the text-input look */
input[type="checkbox"], input[type="radio"] {
  appearance: auto; -webkit-appearance: auto;
  width: 18px; height: 18px; min-width: 18px; min-height: 0; max-height: 18px; padding: 0; margin: 2px 0 0;
  border: 0; border-radius: 0; background: none; box-shadow: none; outline: none;
  flex: 0 0 auto; accent-color: var(--primary, #0e6f5c); cursor: pointer;
}
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--primary, #0e6f5c); outline-offset: 2px; }
.df-consent input[type="checkbox"] { margin-top: 3px; }

.email-dialog { width: min(520px, calc(100vw - 32px)); text-align: left; }
.email-dialog .ed-label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
.email-dialog .ed-opt { font-weight: 400; color: var(--muted, #6b6b6b); }
.email-dialog input[type="email"], .email-dialog textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; font: inherit; font-weight: 400; }
.email-dialog textarea { min-height: 110px; resize: vertical; padding: 12px; }

/* Close / back link on public quote + invoice pages */
.site-header .nav { display: flex; align-items: center; justify-content: space-between; }
.pub-back { font-weight: 600; font-size: 14px; text-decoration: none; color: var(--primary); padding: 10px 16px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); }

/* PDF / print: no decorative glow, grid or dark background on documents */
@media print {
  html, body { background: #fff !important; }
  body::before, body::after { display: none !important; content: none !important; }
  .public-accept { box-shadow: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.exp-del { margin-left: 10px; padding: 4px 10px; font-size: 12px; min-height: 0; border-radius: 8px; color: #a8453d; background: transparent; border: 1px solid currentColor; }
#moneyView .settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
#moneyView .field.full { grid-column: 1 / -1; }

.upd-form { display: grid; gap: 10px; margin: 8px 0 14px; }
.upd-form textarea { min-height: 72px; }
.upd-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.upd-del { padding: 4px 10px; font-size: 12px; min-height: 0; border-radius: 8px; color: #a8453d; background: transparent; border: 1px solid currentColor; }

.pt-staffbar { margin: 0 0 18px; padding: 10px 14px; border-radius: 12px; background: #1d2a26; color: #e9efe9; font-size: 13px; font-weight: 600; }

/* Phones: list tables become stacked cards so nothing is hidden off-screen */
@media (max-width: 700px) {
  .clients-panel table, .list-panel table { min-width: 0; width: 100%; }
  .clients-panel thead, .list-panel thead { display: none; }
  .clients-panel table, .clients-panel tbody, .list-panel table, .list-panel tbody { display: block; }
  .clients-panel tr, .list-panel tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 14px 16px; border-bottom: 1px solid var(--exline-2); }
  .clients-panel td, .list-panel td { display: block; border: 0; padding: 0; background: transparent; }
  .clients-panel tr:hover td, .list-panel tr:hover td { background: transparent; }
  .clients-panel td:nth-child(-n+3), .list-panel td:nth-child(-n+2) { flex: 1 1 100%; }
  .clients-panel td:last-child, .list-panel td:last-child { margin-left: auto; }
  .list-panel td.num { text-align: left; }
  .panel-tools .search-wrap { flex: 1 1 100%; }
  .panel-tools .search-wrap input { width: 100%; }
  .panel-tools .sel { flex: 1 1 0; width: auto; }
}

/* Contracts */
.ct-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ct-actions button { padding: 6px 12px; font-size: 12.5px; }
.contract-text { white-space: pre-wrap; line-height: 1.7; color: #1a201e; font-size: 14.5px; margin: 18px 0; }

/* Client-reported payments */
.report-box { margin-top: 12px; }
.report-form { flex-wrap: wrap; gap: 8px; }
.report-form input { min-height: 46px; width: auto; flex: 1 1 140px; }
.report-form button { flex: 0 0 auto; }
.report-list { margin: 4px 0 10px 18px; color: var(--muted); font-size: 13.5px; }
.rep-ok, .rep-no { padding: 6px 12px; font-size: 12.5px; }
@media print { .report-box { display: none !important; } }

/* Editors on phones: grid items must be allowed to shrink so nothing is cut off */
.quote-controls .field, .ret-controls .field, .quote-notes-total .field { min-width: 0; }
.quote-controls input:not([type="checkbox"]), .quote-controls select, .quote-controls textarea { min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box; }
.quote-controls .check-label input { width: auto; }
.quote-controls input[type="date"] { -webkit-appearance: none; appearance: none; min-height: 48px; }
@media (max-width: 720px) {
  .ret-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .quote-document { min-width: 0; max-width: 100%; box-sizing: border-box; }
}
@media (max-width: 560px) {
  .ret-controls { grid-template-columns: minmax(0, 1fr); }
  .ret-controls .ret-autosend { grid-column: auto; }
}
