:root {
  --ink: #214f70;
  --ink-soft: #2f678d;
  --paper: #f5fafd;
  --surface: #ffffff;
  --surface-soft: #eaf4f9;
  --line: #d6e7f0;
  --muted: #5e7482;
  --gold: #318bc4;
  --gold-dark: #1c6699;
  --gold-soft: #e5f4fd;
  --success: #216c4a;
  --success-soft: #e1f1e9;
  --danger: #a7433e;
  --danger-soft: #f7e7e5;
  --blue: #318bc4;
  --blue-soft: #e5f4fd;
  --shadow: 0 18px 50px rgba(33, 79, 112, .09);
  --radius: 12px;
  --font: "Sen", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: 3px solid #216bba; outline-offset: 3px; }

.eyebrow,
.step-label,
.nav-caption {
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.login-screen {
  min-height: 100vh;
  padding: 28px clamp(22px, 4vw, 64px) 48px;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 15%, rgba(255,255,255,.11), transparent 28rem),
    var(--blue);
  color: white;
}
.login-screen::after {
  position: fixed;
  right: -12vw;
  bottom: -38vw;
  width: 70vw;
  height: 70vw;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
}
.login-brand img { width: 122px; height: auto; }
.login-brand span {
  padding-left: 18px;
  border-left: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.62);
  font-size: 14px;
  font-weight: 600;
}
.login-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 540px);
  gap: clamp(60px, 10vw, 160px);
  align-items: center;
  max-width: 1320px;
  min-height: calc(100vh - 130px);
  margin: 0 auto;
  padding: 50px 0;
}
.login-intro { max-width: 650px; }
.login-intro .eyebrow { color: #d8f2ff; }
.login-intro h1 {
  max-width: 620px;
  margin: 18px 0 24px;
  font-size: clamp(44px, 5.2vw, 76px);
  line-height: .99;
  letter-spacing: -.055em;
}
.login-intro > p {
  max-width: 560px;
  margin: 0;
  color: rgba(255,255,255,.68);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.55;
}
.login-note {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 480px;
  margin-top: 46px;
  padding: 20px 22px;
  border-left: 3px solid #a9ddf7;
  background: rgba(255,255,255,.05);
}
.login-note strong { font-size: 16px; }
.login-note span { color: rgba(255,255,255,.58); font-size: 14px; }
.login-card {
  min-height: 550px;
  padding: clamp(28px, 3.5vw, 48px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  background: #fbfcfc;
  box-shadow: 0 35px 90px rgba(0,0,0,.35);
  color: var(--ink);
}
.login-card h2 {
  margin: 10px 0 28px;
  font-size: 30px;
  letter-spacing: -.035em;
}
.login-areas { display: grid; gap: 12px; }
.login-area {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  gap: 15px;
  align-items: center;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  cursor: pointer;
  text-align: left;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.login-area:hover,
.login-area:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 10px 26px rgba(31,29,20,.08);
  outline: none;
  transform: translateY(-2px);
}
.area-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 900;
}
.login-area span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.login-area strong { font-size: 17px; }
.login-area small { overflow: hidden; color: var(--muted); font-size: 14px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.login-area b { color: var(--gold-dark); font-size: 22px; }
.password-step { padding-top: 2px; }
.text-button,
.back-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
.text-button:hover,
.back-button:hover { color: var(--ink); }
.password-step > .step-label { display: block; margin-top: 32px; }
.selected-area {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 14px 0 34px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}
.selected-area > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.selected-area small { color: var(--muted); }
.selected-area strong { font-size: 19px; }
.password-step > label,
.customer-form label,
.focused-card > label,
.quote-search-box label,
.quality-controls label {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 750;
}
.password-control { position: relative; }
.password-control input,
.customer-form input,
.focused-card input,
.quote-search-box input,
.quality-controls select,
.inline-search input,
.hero-search input,
.chat-composer textarea {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.password-control input:focus,
.customer-form input:focus,
.focused-card input:focus,
.quote-search-box input:focus,
.quality-controls select:focus,
.inline-search input:focus,
.hero-search input:focus,
.chat-composer textarea:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(49,139,196,.18);
}
.password-control input { padding-right: 60px; }
.password-control button {
  position: absolute;
  top: 6px;
  right: 6px;
  bottom: 6px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}
.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  transition: transform .15s, opacity .15s, background .15s;
}
.primary-button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
}
.primary-button:hover { background: var(--ink-soft); transform: translateY(-1px); }
.secondary-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}
.secondary-button:hover { border-color: var(--ink); }
.primary-button:disabled,
.secondary-button:disabled { cursor: not-allowed; opacity: .4; transform: none; }
.login-submit { width: 100%; margin-top: 16px; }
.form-message { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 13px; }
.temporary-access {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.app-shell { display: grid; min-height: 100vh; grid-template-columns: 268px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 24px 18px 18px;
  background: var(--ink);
  color: white;
}
.sidebar-brand { display: flex; flex-direction: column; gap: 9px; padding: 3px 8px 30px; }
.sidebar-brand img { width: 126px; height: auto; }
.sidebar-brand span { color: rgba(255,255,255,.48); font-size: 12px; font-weight: 700; }
.nav-caption { margin: 0 10px 10px; color: rgba(255,255,255,.34); }
.area-navigation { display: grid; gap: 8px; }
.area-nav-button {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: rgba(255,255,255,.68);
  cursor: pointer;
  text-align: left;
}
.area-nav-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 9px;
  background: rgba(255,255,255,.08);
  font-family: var(--mono);
  font-weight: 900;
}
.area-nav-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.area-nav-button strong { display: block; color: inherit; font-size: 16px; }
.area-nav-button small { display: block; margin-top: 3px; color: rgba(255,255,255,.52); font-size: 12px; }
.area-nav-button:hover { background: rgba(255,255,255,.06); color: white; }
.area-nav-button.active {
  border-color: rgba(169,221,247,.48);
  background: rgba(169,221,247,.16);
  color: white;
}
.area-nav-button.active .area-nav-icon { background: #d8f2ff; color: var(--ink); }
.sidebar-help {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  color: rgba(255,255,255,.5);
  font-size: 13px;
  line-height: 1.45;
}
.sidebar-help strong { color: white; font-size: 13px; }
.sidebar-help button {
  align-self: flex-start;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d8f2ff;
  cursor: pointer;
  font-weight: 800;
}
.session-card {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 8px;
}
.session-card > span:first-child {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  font-weight: 900;
}
.session-card > span:nth-child(2) { min-width: 0; }
.session-card strong,
.session-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-card strong { font-size: 13px; }
.session-card small { margin-top: 2px; color: rgba(255,255,255,.38); font-size: 11px; }
.session-card button {
  padding: 6px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.55);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.workspace { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(245,243,236,.92);
  backdrop-filter: blur(14px);
}
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.breadcrumb span { color: var(--muted); }
.breadcrumb strong::before { margin-right: 10px; color: #b8b4a9; content: "/"; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.sync-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.quote-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
}
.quote-button span {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--mono);
}
.menu-button { display: none; }
.main-content { max-width: 1500px; min-height: calc(100vh - 74px); padding: clamp(28px, 3.4vw, 50px) clamp(22px, 4vw, 58px) 90px; }

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
  margin-bottom: 22px;
}
.home-hero h1 {
  max-width: 780px;
  margin: 7px 0 11px;
  font-size: clamp(34px, 3.7vw, 50px);
  line-height: 1.06;
  letter-spacing: -.045em;
}
.home-hero p { max-width: 650px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.hero-side-note {
  max-width: 310px;
  padding: 18px 20px;
  border-left: 3px solid var(--gold);
  background: var(--surface-soft);
}
.hero-side-note strong,
.hero-side-note span { display: block; }
.hero-side-note strong { margin-bottom: 5px; }
.hero-side-note span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.data-status {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 16px;
}
.data-status-item {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.62);
}
.data-status-item i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(43,116,80,.1);
}
.data-status-item.historical i {
  background: var(--gold-dark);
  box-shadow: 0 0 0 4px rgba(216,169,21,.13);
}
.data-status-item span,
.data-status-item strong,
.data-status-item small { display: block; min-width: 0; }
.data-status-item strong { font-size: 12px; }
.data-status-item small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.home-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.home-metric { min-width: 0; padding: 22px 24px; border-right: 1px solid var(--line); }
.home-metric:last-child { border-right: 0; }
.home-metric span,
.home-metric strong,
.home-metric small { display: block; }
.home-metric span { color: var(--muted); font-size: 12px; }
.home-metric strong { margin: 7px 0 5px; overflow: hidden; font-size: 27px; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.home-metric small { color: #969289; font-size: 11px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 20px;
}
.section-heading h2 { margin: 5px 0 0; font-size: 28px; letter-spacing: -.035em; }
.section-heading p { max-width: 420px; margin: 0; color: var(--muted); font-size: 14px; }
.task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.home-secondary-status { margin-top: 28px; }
.home-secondary-metrics { margin-top: 0; margin-bottom: 0; }
.task-card {
  position: relative;
  display: flex;
  min-height: 176px;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.task-card:hover { border-color: #b7b1a3; box-shadow: var(--shadow); transform: translateY(-3px); }
.task-card .task-number {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 10px;
  background: var(--gold-soft);
  color: var(--gold-dark);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
}
.task-card h3 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.025em; }
.task-card p { margin: 0 0 16px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.task-card b { margin-top: auto; color: var(--gold-dark); font-size: 15px; }
.task-card.featured { border-color: var(--ink); background: var(--ink); color: white; }
.task-card.featured p { color: rgba(255,255,255,.58); }
.task-card.featured .task-number { background: var(--gold); color: var(--ink); }
.task-card.featured b { color: var(--gold); }
.project-links {
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.project-links-heading strong { display: block; margin-top: 4px; font-size: 14px; }
.project-links-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.project-links-grid button {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  cursor: pointer;
  text-align: left;
}
.project-links-grid button:hover { border-color: var(--gold-dark); }
.project-links-grid span,
.project-links-grid strong,
.project-links-grid small { display: block; min-width: 0; }
.project-links-grid small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.project-links-grid b { flex: 0 0 auto; color: var(--gold-dark); font-size: 12px; }

.tool-view { max-width: 1200px; margin: 0 auto; }
.tool-header { margin-bottom: 28px; }
.tool-header .back-button { display: block; margin-bottom: 34px; }
.tool-header h1 { margin: 7px 0 10px; font-size: clamp(32px, 3.4vw, 46px); letter-spacing: -.04em; }
.tool-header p { max-width: 720px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.tool-header.with-action { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.search-panel,
.panel,
.focused-card,
.quote-search-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.search-panel { padding: 22px; }
.hero-search,
.inline-search { display: flex; gap: 10px; }
.hero-search input { min-height: 58px; font-size: 17px; }
.hero-search .primary-button { min-width: 130px; }
.quick-filters { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.quick-filters button,
.chat-suggestions button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}
.quick-filters button.active { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); }
.results-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 28px 0 13px; }
.results-heading strong { font-size: 14px; }
.pager { display: flex; align-items: center; gap: 8px; }
.pager button {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
.pager button:disabled { cursor: not-allowed; opacity: .35; }
.pager span { min-width: 48px; color: var(--muted); font-family: var(--mono); font-size: 11px; text-align: center; }
.product-results { display: grid; gap: 9px; }
.product-row {
  display: grid;
  grid-template-columns: 88px minmax(200px, 1fr) 100px 130px 130px auto;
  gap: 14px;
  align-items: center;
  min-height: 92px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}
.product-row:hover { border-color: #aaa497; }
.product-code { font-family: var(--mono); font-size: 15px; font-weight: 800; }
.product-code small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.product-code strong { font: inherit; }
.product-description { min-width: 0; }
.product-description strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-description small { display: block; margin-top: 4px; color: var(--muted); }
.quote-search-item > span:first-child small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.2;
  text-transform: uppercase;
}
.data-cell span,
.data-cell strong { display: block; }
.data-cell span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.data-cell strong { margin-top: 3px; font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums; }
.stock-pill {
  display: inline-flex;
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 800;
}
.stock-pill.good { background: var(--success-soft); color: var(--success); }
.stock-pill.low { background: var(--gold-soft); color: #7c5b00; }
.stock-pill.empty { background: var(--danger-soft); color: var(--danger); }
.add-product {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.add-product:hover,
.add-product.added { background: var(--ink); color: white; }
.add-product { min-height: 46px; padding: 0 14px; font-size: 14px; }
.empty-state,
.loading-state {
  padding: 48px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}
.empty-state strong,
.empty-state span { display: block; }
.empty-state strong { margin-bottom: 6px; color: var(--ink); font-size: 17px; }

.quote-tool-header { margin-bottom: 22px; }
.stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 760px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
}
.stepper li { position: relative; display: flex; align-items: center; gap: 10px; color: #9c988d; }
.stepper li::after {
  position: absolute;
  top: 17px;
  right: 14px;
  left: 48px;
  height: 1px;
  background: var(--line);
  content: "";
}
.stepper li:last-child::after { display: none; }
.stepper span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
}
.stepper strong { font-size: 12px; }
.stepper li.active { color: var(--ink); }
.stepper li.active span,
.stepper li.complete span { border-color: var(--gold); background: var(--gold); color: var(--ink); }
.quote-search-box { padding: 22px; }
.quote-search-results { display: grid; gap: 8px; margin: 14px 0 100px; }
.quote-search-item {
  display: grid;
  grid-template-columns: 88px minmax(0,1fr) 120px auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.quote-search-item > span:first-child { font-family: var(--mono); font-size: 12px; font-weight: 800; }
.quote-result-detail { min-width: 0; display: grid; gap: 3px; }
.quote-result-detail strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-result-detail small { color: var(--muted); font-size: 11px; }
.quote-result-price.missing { color: var(--danger); font-size: 11px; font-weight: 750; }
.quote-selection,
.quote-footer {
  position: sticky;
  z-index: 10;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 20px 50px rgba(30,28,22,.16);
  backdrop-filter: blur(12px);
}
.quote-selection > div { display: flex; flex-direction: column; gap: 3px; }
.quote-selection span { color: var(--muted); font-size: 12px; }
.step-explanation { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 18px; }
.step-explanation h2 { margin: 5px 0 0; }
.step-explanation p { max-width: 420px; margin: 0; color: var(--muted); }
.quote-price-notice {
  display: flex;
  gap: 9px;
  align-items: baseline;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #efd7a1;
  border-radius: 10px;
  background: #fff8e7;
  color: #76500a;
  font-size: 13px;
}
.quote-price-notice span { color: #886b31; }
.quote-items { display: grid; gap: 10px; margin-bottom: 100px; }
.quote-item {
  display: grid;
  grid-template-columns: 76px minmax(200px, 1fr) 90px 110px 150px 68px;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}
.quote-item label { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.quote-item input,
.quote-item select {
  width: 100%;
  min-height: 48px;
  margin-top: 5px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.quote-item .quote-code { align-self: center; font-family: var(--mono); font-size: 12px; font-weight: 800; }
.quote-item.needs-price { border-color: #e9c878; background: #fffdf7; }
.quote-item .price-field em { display: block; margin-top: 2px; color: var(--danger); font-size: 9px; font-style: normal; }
.quote-item.needs-price .price-field input { border-color: #d49b22; box-shadow: 0 0 0 3px rgba(212,155,34,.12); }
.remove-quote-item {
  display: inline-flex;
  width: auto;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #e4c5c2;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.quote-running-total { margin-left: auto; text-align: right; }
.quote-running-total span,
.quote-running-total strong { display: block; }
.quote-running-total span { color: var(--muted); font-size: 11px; }
.quote-running-total strong { margin-top: 3px; font-size: 20px; }
.quote-final-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(340px, 1.1fr); gap: 18px; margin-bottom: 90px; }
.customer-form,
.quote-summary { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.customer-form h2,
.quote-summary h2 { margin: 7px 0 24px; }
.customer-form label { margin-top: 17px; }
.quote-summary { background: var(--ink); color: white; }
.quote-summary .eyebrow { color: var(--gold); }
#quote-summary-items { max-height: 300px; margin-bottom: 20px; overflow-y: auto; }
.quote-summary-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
  font-size: 12px;
}
.quote-summary-line span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-total { display: flex; align-items: baseline; justify-content: space-between; padding-top: 14px; }
.summary-total span { color: rgba(255,255,255,.55); font-size: 12px; }
.summary-total strong { color: var(--gold); font-size: 22px; }

.chat-layout {
  display: grid;
  min-height: 600px;
  grid-template-rows: 1fr auto auto auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}
.chat-messages { display: flex; max-height: 480px; flex-direction: column; gap: 13px; padding: 12px; overflow-y: auto; }
.message { max-width: 82%; padding: 14px 16px; border-radius: 14px; background: var(--surface-soft); }
.message.user { align-self: flex-end; background: var(--gold-soft); }
.message > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.message p { margin: 0; line-height: 1.55; white-space: pre-wrap; }
.message-products { display: grid; gap: 6px; margin-top: 12px; }
.message-product { padding: 9px; border-radius: 8px; background: white; font-size: 12px; }
.chat-suggestions { display: flex; gap: 7px; padding: 12px; overflow-x: auto; }
.chat-composer { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
.chat-composer textarea { min-height: 54px; padding-top: 14px; resize: none; }
.token-note { padding: 0 12px 8px; color: var(--muted); }

.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 22px; }
.metric-card { padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.metric-card span,
.metric-card strong,
.metric-card small { display: block; }
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card strong { margin: 9px 0 5px; font-size: 28px; letter-spacing: -.04em; }
.metric-card small { color: #98948a; font-size: 11px; line-height: 1.4; }
.notice-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  margin-bottom: 22px;
  padding: 17px 20px;
  border: 1px solid #e7d69a;
  border-radius: 13px;
  background: #fbf5dc;
}
.notice-card strong { color: #735700; }
.notice-card p { margin: 0; color: #685f43; line-height: 1.5; }
.panel { padding: 22px; }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 23px; }
.panel-heading button {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.simple-list { display: grid; gap: 7px; }
.simple-row {
  width: 100%;
  display: grid;
  grid-template-columns: 90px minmax(180px,1fr) 120px 120px 70px;
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.simple-row:hover { background: var(--blue-soft); }
.simple-row::after { content: "Ver"; color: var(--blue); font-size: 13px; font-weight: 800; text-align: right; }
.simple-row:last-child { border-bottom: 0; }
.simple-row .code { font-family: var(--mono); font-size: 12px; font-weight: 800; }
.simple-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.simple-row span { color: var(--muted); font-size: 12px; }
.focused-card { max-width: 580px; padding: 34px; }
.focused-card > label { margin-top: 14px; font-size: 20px; }
.currency-input { position: relative; margin: 16px 0; }
.currency-input span { position: absolute; top: 50%; left: 17px; color: var(--muted); transform: translateY(-50%); }
.currency-input input { height: 64px; padding-left: 40px; font-family: var(--mono); font-size: 24px; font-weight: 800; }
.warning-box { display: flex; flex-direction: column; gap: 4px; margin: 20px 0; padding: 16px; border-radius: 11px; background: var(--gold-soft); }
.warning-box span { color: #6f5b1e; font-size: 13px; line-height: 1.45; }
.action-result { min-height: 22px; margin-bottom: 0; color: var(--success); font-weight: 700; }
.quality-controls { display: grid; grid-template-columns: minmax(200px,1fr) minmax(240px,1fr) auto; gap: 12px; align-items: end; }
.quality-controls label { grid-column: 1 / -1; margin: 0; }
.quality-controls select { min-height: 48px; padding: 0 12px; }
.list-summary { color: var(--muted); font-size: 13px; }
.management-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
.coverage-list { display: grid; gap: 16px; }
.coverage-row { display: grid; grid-template-columns: 150px 1fr 48px; gap: 12px; align-items: center; font-size: 12px; }
.coverage-track { height: 9px; border-radius: 99px; background: var(--surface-soft); overflow: hidden; }
.coverage-track i { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.coverage-row b { font-family: var(--mono); text-align: right; }
.activity-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.activity-summary article { padding: 18px; border-radius: 12px; background: var(--surface-soft); }
.activity-summary span,
.activity-summary strong { display: block; }
.activity-summary span { color: var(--muted); font-size: 11px; }
.activity-summary strong { margin-top: 6px; font-size: 23px; }
.management-links { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 18px; }
.management-links a { display: flex; min-height: 90px; flex-direction: column; justify-content: space-between; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: white; font-weight: 750; }
.management-links a:hover { border-color: var(--gold-dark); }
.management-links b { color: var(--gold-dark); font-size: 12px; }

.toast-region { position: fixed; top: 18px; right: 18px; z-index: 200; display: grid; gap: 9px; width: min(360px, calc(100vw - 36px)); }
.toast { padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--ink); box-shadow: var(--shadow); color: white; font-size: 13px; animation: toast-in .2s ease both; }
.toast.success { border-color: #3b8562; }
.toast.error { border-color: #a7433e; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.confirm-dialog {
  width: min(460px, calc(100vw - 30px));
  padding: 30px;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 30px 100px rgba(0,0,0,.3);
  text-align: center;
}
.confirm-dialog::backdrop { background: rgba(10,10,8,.65); backdrop-filter: blur(4px); }
.confirm-icon { display: grid; width: 48px; height: 48px; margin: 0 auto 17px; place-items: center; border-radius: 50%; background: var(--gold-soft); color: var(--gold-dark); font-size: 20px; font-weight: 900; }
.confirm-dialog h2 { margin: 0 0 9px; }
.confirm-dialog p { margin: 0 0 24px; color: var(--muted); line-height: 1.5; }
.confirm-dialog > div { display: flex; justify-content: center; gap: 9px; }
.sidebar-backdrop,
.mobile-navigation { display: none; }

@media (max-width: 1180px) {
  .home-metrics,
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .home-metric { border-bottom: 1px solid var(--line); }
  .home-metric:nth-child(2) { border-right: 0; }
  .home-metric:nth-child(3),
  .home-metric:nth-child(4) { border-bottom: 0; }
  .product-row { grid-template-columns: 80px minmax(180px,1fr) 90px 120px auto; }
  .product-row .data-cell.usd { display: none; }
  .quote-item { grid-template-columns: 68px minmax(180px,1fr) 80px 100px 125px 68px; }
}

@media (max-width: 900px) {
  .login-layout { grid-template-columns: 1fr; gap: 46px; padding-top: 70px; }
  .login-intro { max-width: 720px; }
  .login-intro h1 { font-size: clamp(42px, 9vw, 66px); }
  .login-card { min-height: 0; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-105%);
    width: min(290px, 86vw);
    box-shadow: 18px 0 60px rgba(0,0,0,.25);
    transition: transform .22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.45); }
  .sidebar-backdrop.open { display: block; }
  .menu-button { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; }
  .breadcrumb { margin-right: auto; margin-left: 12px; }
  .main-content { padding-bottom: 120px; }
  .home-hero { grid-template-columns: 1fr; }
  .hero-side-note { display: none; }
  .product-row { grid-template-columns: 76px minmax(160px,1fr) 92px auto; }
  .product-row .data-cell.ars { display: none; }
  .quote-final-layout,
  .management-grid { grid-template-columns: 1fr; }
  .mobile-navigation {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 22;
    display: flex;
    justify-content: space-around;
    min-height: 76px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 15px 45px rgba(0,0,0,.14);
    backdrop-filter: blur(12px);
  }
  .mobile-navigation .area-nav-button { display: flex; min-width: 88px; min-height: 60px; flex-direction: column; gap: 4px; justify-content: center; padding: 7px; color: var(--muted); text-align: center; }
  .mobile-navigation .area-nav-icon { width: 32px; height: 32px; margin: auto; background: var(--surface-soft); }
  .mobile-navigation .area-nav-copy { display: block; }
  .mobile-navigation .area-nav-button strong { font-size: 12px; }
  .mobile-navigation .area-nav-button small { display: none; }
  .mobile-navigation .area-nav-button.active { border-color: #e5cc73; background: #fbf4d9; color: var(--ink); }
  .mobile-navigation .area-nav-button.active .area-nav-icon { background: var(--gold); }
}

@media (max-width: 680px) {
  .login-screen { padding: 20px 16px 36px; }
  .login-brand img { width: 104px; }
  .login-brand span { font-size: 12px; }
  .login-layout { gap: 32px; padding: 54px 0 10px; }
  .login-intro h1 { margin-top: 13px; font-size: 42px; }
  .login-intro > p { font-size: 17px; }
  .login-note { display: none; }
  .login-card { padding: 23px 18px; border-radius: 17px; }
  .login-card h2 { font-size: 25px; }
  .login-area { grid-template-columns: 44px 1fr auto; padding: 14px; }
  .login-area small { white-space: normal; }
  .area-icon { width: 42px; height: 42px; }
  .topbar { min-height: 64px; padding: 0 13px; }
  .sync-badge { display: none; }
  .quote-button { min-height: 44px; padding: 0 12px; font-size: 14px; }
  .quote-button span { font-size: 12px; }
  .breadcrumb { gap: 0; }
  .breadcrumb span { display: none; }
  .breadcrumb strong::before { display: none; }
  .main-content { padding: 28px 16px 126px; }
  .home-hero { margin-bottom: 22px; }
  .home-hero h1 { font-size: 38px; }
  .home-hero p { font-size: 16px; }
  .data-status { align-items: stretch; flex-direction: column; }
  .home-metrics { grid-template-columns: 1fr 1fr; margin-bottom: 34px; }
  .home-metric { padding: 16px; }
  .home-metric strong { font-size: 21px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .section-heading h2 { font-size: 25px; }
  .section-heading p { font-size: 13px; }
  .task-grid { grid-template-columns: 1fr; }
  .task-card { min-height: 0; padding: 19px; }
  .task-card .task-number { margin-bottom: 14px; }
  .project-links { padding: 16px; }
  .project-links-grid { grid-template-columns: 1fr; }
  .tool-header { margin-bottom: 22px; }
  .tool-header .back-button { margin-bottom: 25px; }
  .tool-header h1 { font-size: 36px; }
  .quote-tool-header { margin-bottom: 16px; }
  .quote-tool-header .back-button { margin-bottom: 12px; }
  .quote-tool-header .eyebrow,
  .quote-tool-header p { display: none; }
  .quote-tool-header h1 { margin: 0; font-size: 29px; }
  .tool-header.with-action { align-items: flex-start; flex-direction: column; }
  .hero-search,
  .inline-search { flex-direction: column; }
  .hero-search .primary-button { width: 100%; }
  .search-panel,
  .panel,
  .quote-search-box { padding: 15px; }
  .results-heading { align-items: flex-start; flex-direction: column; }
  .product-row {
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    padding: 14px;
  }
  .product-code { grid-column: 1; grid-row: 1; }
  .product-description { grid-column: 1 / -1; grid-row: 2; }
  .product-description strong { white-space: normal; }
  .product-row .data-cell { display: none; }
  .product-row .stock-pill { grid-column: 1; grid-row: 3; }
  .product-row .data-cell.ars { display: block; grid-column: 1; grid-row: 4; }
  .product-row .add-product { grid-column: 2; grid-row: 1 / 5; min-width: 76px; min-height: 50px; font-size: 14px; }
  .stepper { margin-bottom: 16px; }
  .stepper { gap: 8px; }
  .stepper li { align-items: flex-start; flex-direction: column; gap: 5px; }
  .stepper strong { display: block; max-width: 92px; font-size: 13px; line-height: 1.3; }
  .stepper li::after { top: 17px; right: 4px; left: 42px; }
  .quote-search-item { grid-template-columns: 65px minmax(0,1fr) auto; gap: 10px; }
  .quote-search-item .quote-result-price { display: block; grid-column: 2; font-size: 12px; }
  .quote-price-notice { display: grid; gap: 4px; }
  .quote-search-results { margin-bottom: 16px; }
  .quote-selection,
  .quote-footer { padding: 12px; }
  .quote-selection { position: static; margin-top: 16px; }
  .quote-footer { position: static; margin-top: 16px; }
  .quote-selection span { display: none; }
  .quote-footer { flex-wrap: wrap; }
  .quote-running-total { order: -1; width: 100%; text-align: left; }
  .step-explanation { align-items: flex-start; flex-direction: column; gap: 6px; }
  .step-explanation h2 { margin: 2px 0 0; font-size: 23px; }
  .step-explanation p { font-size: 14px; line-height: 1.45; }
  .quote-items { margin-bottom: 0; }
  .quote-item {
    grid-template-columns: 1fr 1fr auto;
    gap: 11px;
  }
  .quote-item .quote-code { grid-column: 1; }
  .quote-item .description-field { grid-column: 1 / -1; grid-row: 2; }
  .quote-item .currency-field { grid-column: 1; grid-row: 3; }
  .quote-item .quantity-field { grid-column: 2; grid-row: 3; }
  .quote-item .price-field { grid-column: 1 / -1; grid-row: 4; }
  .quote-item .remove-quote-item { grid-column: 3; grid-row: 1; }
  .quote-final-layout { margin-bottom: 0; }
  .customer-form,
  .quote-summary { padding: 20px; }
  .chat-layout { min-height: calc(100vh - 240px); padding: 8px; }
  .message { max-width: 94%; }
  .chat-composer { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { padding: 16px; }
  .metric-card strong { font-size: 22px; }
  .notice-card { grid-template-columns: 1fr; }
  .simple-row { grid-template-columns: 70px 1fr auto auto; min-height: 58px; padding-inline: 8px; }
  .simple-row > span:last-child { display: none; }
  .focused-card { padding: 24px 18px; }
  .quality-controls { grid-template-columns: 1fr; }
  .quality-controls label { grid-column: 1; }
  .management-links { grid-template-columns: 1fr; }
  .coverage-row { grid-template-columns: 110px 1fr 42px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
