@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/InterVariable.woff2") format("woff2");
}

:root {
  --brand-name: "Dashboard";
  --brand-kicker: "Operator console";
  /* First Cut gas blue — logo + site accent. Ring only: focus + active-nav tint. */
  --ring: #0092bf;
  --background: #ffffff;
  --pane: #ffffff;
  --foreground: #000000;
  --card: #f6f6f6;
  --secondary: #ededed;
  --muted: #737373;
  --border: #e2e2e2;
  --sidebar: #f6f6f6;
  --sidebar-border: #e2e2e2;
  --primary: #000000;
  --primary-fg: #ffffff;
  --hover: rgba(0, 0, 0, .045);
  --active: rgba(0, 0, 0, .075);
  --ok: #2d9f6f;
  --warn: #d4a017;
  --bad: #c45c5c;
  --radius: 10px;
  --font: Inter, ui-sans-serif, system-ui, sans-serif;
}

.dark {
  --background: #090909;
  --pane: #0c0c0c;
  --foreground: #ffffff;
  --card: #141414;
  --secondary: #1c1c1c;
  --muted: #999999;
  --border: #262626;
  --sidebar: #141414;
  --sidebar-border: #1a1a1a;
  --primary: #ffffff;
  --primary-fg: #0c0c0c;
  --hover: rgba(255, 255, 255, .06);
  --active: rgba(255, 255, 255, .1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  font-family: var(--font);
  background: var(--background);
  color: var(--foreground);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

.gate {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: var(--sidebar);
}
.gate-card {
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 36px 32px 28px;
  background: var(--pane);
  border: 1px solid var(--border);
  border-top: 2px solid var(--ring); /* the cut edge */
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .08);
}
.gate-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border-radius: 12px;
}
.gate-kicker {
  margin: 0 0 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.gate-card h1 {
  margin: 0 0 6px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.gate-sub {
  margin: 0 0 22px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.gate-form { display: flex; flex-direction: column; gap: 12px; }
.gate-ms {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}
.gate-ms:hover { background: var(--hover); }
.gate-ms:disabled { color: var(--muted); cursor: default; }
.gate-ms:disabled:hover { background: var(--background); }
.gate-ms svg { width: 18px; height: 18px; flex-shrink: 0; }
.gate-status {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.app { display: flex; height: 100%; }
aside {
  width: 232px;
  flex-shrink: 0;
  min-height: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  padding: 8px 10px 12px;
  overflow: hidden;
  transition: width .15s ease;
}
.nav-toggle {
  align-self: flex-end;
  width: 28px;
  height: 28px;
  margin: 0 2px 4px;
  border: 0;
  background: none;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.nav-toggle svg { width: 16px; height: 16px; }
.nav-toggle:hover { color: var(--foreground); background: var(--hover); }
aside.nav-off {
  width: 52px;
  padding: 8px 6px 12px;
}
aside.nav-off .nav-toggle { align-self: center; margin-inline: auto; }
aside.nav-off .nav-toggle svg { transform: rotate(180deg); }
aside.nav-off .nav-label,
aside.nav-off [data-brand-name],
aside.nav-off .nav-text,
aside.nav-off #who-side { display: none; }
aside.nav-off .brand { justify-content: center; padding: 4px 0 12px; }
aside.nav-off .nav-item { justify-content: center; padding: 0; }
aside.nav-off .user { justify-content: center; padding: 0; }
aside.nav-off .prefs {
  left: calc(100% + 8px);
  right: auto;
  bottom: 0;
  width: 220px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 18px;
  font-weight: 560;
  letter-spacing: -0.03em;
  font-size: 15px;
  white-space: nowrap;
}
.mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: block;
  flex-shrink: 0;
  overflow: hidden;
  color: var(--foreground);
}
.mark svg { display: block; width: 100%; height: 100%; }
/* First Cut coin: gas-blue face, white flame, kerf cut. Same in both themes. */
.mark-face { fill: var(--ring); }
.mark-flame { fill: #ffffff; }
.mark-kerf {
  stroke: var(--ring);
  stroke-width: 2.4;
}

nav { display: flex; flex-direction: column; gap: 2px; }
.nav-foot { flex-shrink: 0; margin-bottom: 4px; }
.nav-label {
  padding: 16px 10px 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.nav-item:hover { background: var(--hover); color: var(--foreground); }
.nav-item.on {
  background: color-mix(in srgb, var(--ring) 12%, transparent);
  color: var(--foreground);
  font-weight: 500;
}
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .85; }

.grow { flex: 1; }
.user-wrap { position: relative; flex-shrink: 0; }
.user {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 36px;
  padding: 0 8px;
  border: 0;
  background: none;
  border-radius: 8px;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}
.user:hover, .user[aria-expanded="true"] { background: var(--hover); color: var(--foreground); }
.user #who-side {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--secondary);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--foreground);
  flex-shrink: 0;
}
.prefs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  background: var(--pane);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
  padding: 6px;
  z-index: 20;
}
.prefs-who {
  padding: 6px 10px 4px;
}
.prefs-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prefs-mail {
  margin-top: 1px;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prefs-k {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.prefs-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 6px 6px;
}
.prefs-field span {
  width: 36px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted);
}
.prefs-field input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
}
.prefs-field input:focus { outline: none; border-color: var(--foreground); }
.prefs-seg {
  display: flex;
  gap: 4px;
  padding: 0 6px 8px;
}
.prefs-seg button {
  flex: 1;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--muted);
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.prefs-seg button.on {
  background: var(--foreground);
  color: var(--background);
  border-color: var(--foreground);
}
.prefs-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 0;
  background: none;
  border-radius: 6px;
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.prefs-item:hover { background: var(--hover); }
.prefs-status {
  padding: 4px 10px 8px;
  font-size: 11px;
  color: var(--muted);
}

main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--background);
  position: relative;
}
.chip {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--foreground);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.chip.primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}
.view { display: none; flex: 1; min-height: 0; }
.view.on { display: flex; flex-direction: column; }

.empty {
  margin: auto;
  text-align: center;
  padding: 48px 24px;
  max-width: 28rem;
}
.empty h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 560;
  letter-spacing: -0.04em;
}
.empty p { margin: 0; color: var(--muted); font-size: 14px; }

.window-chrome {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px 0;
  flex-shrink: 0;
}
.window-chrome h1 {
  font-size: 18px;
  font-weight: 560;
  letter-spacing: -0.03em;
  margin: 4px 0 0;
}
.help-launch {
  width: 32px;
  height: 32px;
  margin-top: 2px;
  border: 0;
  background: none;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  flex-shrink: 0;
}
.help-launch svg { width: 18px; height: 18px; }
.help-launch:hover,
.help-launch.on,
.help-launch[aria-expanded="true"] {
  background: var(--hover);
  color: var(--foreground);
}
.pad { padding: 12px 28px 28px; overflow: auto; flex: 1; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head .sub { margin-bottom: 0; max-width: 52rem; }
.page-actions { display: flex; gap: 8px; flex-shrink: 0; padding-top: 6px; }
h2 { font-size: 18px; font-weight: 560; letter-spacing: -0.03em; margin: 4px 0 4px; }
h3 { font-size: 13px; font-weight: 560; letter-spacing: -0.02em; margin: 22px 0 8px; }
.sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 16px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.grid.five { grid-template-columns: repeat(5, 1fr); }
.grid.two, .analytics-split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 18px; }
.analytics-split .hint { margin: 0 0 8px; }
.analytics-chart-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--secondary);
  padding: 16px 16px 8px;
  margin-bottom: 18px;
}
.analytics-chart-head h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 560;
}
.analytics-chart-head .hint { margin: 0 0 12px; }
.analytics-chart { overflow-x: auto; }
.analytics-chart-svg {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
  max-height: 380px;
}
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis-line { stroke: var(--border); stroke-width: 1.25; }
.chart-axis {
  fill: var(--muted);
  font-size: 10px;
  font-family: inherit;
}
.chart-label {
  fill: var(--foreground);
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
}
.chart-sub {
  fill: var(--muted);
  font-size: 10px;
  font-family: inherit;
}
.chart-margin {
  fill: var(--foreground);
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
}
.chart-bar { opacity: 0.92; }
.chart-bar:hover { opacity: 1; }
.kpi {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--card);
}
.kpi .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi .v { font-size: 22px; font-weight: 560; letter-spacing: -0.03em; margin-top: 6px; }
.kpi .s { font-size: 13px; color: var(--muted); margin-top: 4px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.off { background: var(--muted); }
.dot.bad { background: var(--bad); }

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
td { padding: 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
td.num, th.num { font-variant-numeric: tabular-nums; }
tr:hover td { background: var(--hover); }

.pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--secondary);
  color: var(--foreground);
}
.pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); }

.fold { margin: 18px 0 0; }
.fold > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 560;
  letter-spacing: -0.02em;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--muted);
  transform-origin: 40% 50%;
}
.fold[open] > summary::before { transform: rotate(90deg); }
.fold-count { color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: .04em; }

.audit { font-size: 13px; margin: 0; padding: 0; }
.audit li {
  list-style: none;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
}
.audit time { color: var(--muted); width: 88px; flex-shrink: 0; font-variant-numeric: tabular-nums; }

.bubble.error {
  max-width: min(560px, 82%);
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--warn) 50%, var(--border));
}

.pending span {
  display: inline-block;
  animation: chat-dot 1.2s infinite;
}
.pending span:nth-child(2) { animation-delay: .15s; }
.pending span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot {
  0%, 80%, 100% { opacity: .25; }
  40% { opacity: 1; }
}

.hidden, [hidden] { display: none !important; }

select, input, textarea {
  font: inherit;
  font-size: 13px;
  color: var(--foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
}
select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--foreground);
}

.routine-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.routine-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.routine-switch {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--secondary);
  border: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
}
.routine-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
}
.routine-toggle input:checked + .routine-switch {
  background: var(--ok);
  border-color: var(--ok);
}
.routine-toggle input:checked + .routine-switch::after {
  left: 18px;
  background: #fff;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 18px;
}
.settings-tabs button {
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--muted);
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.settings-tabs button:hover:not(.on) {
  color: var(--foreground);
}
.settings-tabs button.on {
  background: var(--foreground);
  color: var(--background);
  border-color: var(--foreground);
}
.settings-panel { display: none; }
.settings-panel.on { display: block; }

.check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.check input {
  width: 14px;
  height: 14px;
  accent-color: var(--foreground);
}

.lookup {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}
.lookup input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
}
.lookup .chip { height: 32px; }
.role-select {
  min-width: 108px;
  height: 28px;
  padding: 0 8px;
}

button.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 500;
  color: var(--foreground);
  cursor: pointer;
}
button.linkish:hover { text-decoration: underline; }

.q-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  margin: 8px 0 14px;
}
.q-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.q-field input,
.q-field select,
.q-field textarea {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--foreground);
  height: 32px;
  padding: 0 10px;
  width: 100%;
}
.q-field textarea { height: auto; padding: 8px 10px; resize: vertical; }
.q-wide { grid-column: 1 / -1; margin: 0 0 8px; }
.q-subtabs { margin-top: -8px; }
.q-apply-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 0 0 12px;
}
.q-apply-bar .q-field { margin: 0; min-width: 220px; }
.q-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: end;
  margin: 0 0 14px;
}
.q-manage {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}
.q-manage .q-field { margin: 0; min-width: 220px; }
.q-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 140px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 4px;
}
.q-menu button {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font: inherit;
  color: var(--foreground);
  cursor: pointer;
}
.q-menu button:hover { background: var(--secondary); }
.q-tpl-group { margin: 0 0 12px; }
.q-tpl-group .linkish.on { font-weight: 600; text-decoration: underline; }
.q-tpl-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--background);
  font-size: 12px;
  line-height: 1.45;
  margin: 0 0 12px;
  max-height: 220px;
  overflow: auto;
}
.q-labor-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px;
  align-items: start;
}
.q-travel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--secondary);
  margin: 0 0 16px;
}
.q-travel h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
}
.q-travel .q-field {
  display: inline-block;
  min-width: 140px;
  margin: 0 12px 8px 0;
}
.q-calc {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--secondary);
}
.q-calc h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
}
.q-calc .q-field { margin-bottom: 8px; }
.q-calc h3 + .q-subtotals { margin-top: 0; }
.q-subtotals { margin: 0 0 12px; }
.q-subtotals div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
}
.q-subtotals dt { color: var(--muted); }
.q-subtotals dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.q-subtotals dd.q-sub-cost { font-weight: 400; color: var(--muted); }
.q-head-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
}
.q-head-bar .hint { margin: 0; }
.q-attach {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: var(--panel, #fff);
}
.q-attach.is-drop {
  border-color: var(--accent, #0092bf);
  background: color-mix(in srgb, var(--accent, #0092bf) 8%, var(--panel, #fff));
}
.q-attach-drop { margin: 0 0 8px; }
.q-list-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}
.q-list-filters .q-field { min-width: 140px; }
.q-attach-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.q-attach h3 { margin: 0; font-size: 14px; }
.q-attach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.q-attach-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.q-attach-list .hint { margin: 0; }
/* Sub-tab chips read as their own section at a glance (Leah 2026-09-01). */
.q-subtabs-row { align-items: center; }
.settings-tabs button.q-sub {
  border-left: 3px solid var(--q-sub, var(--border));
}
.settings-tabs button.q-sub.on {
  background: var(--q-sub, var(--foreground));
  border-color: var(--q-sub, var(--foreground));
  color: #fff;
}
.q-sub-labor { --q-sub: #0092bf; }
.q-sub-materials { --q-sub: #1f8a5c; }
.q-sub-equipment { --q-sub: #b06a10; }
.q-sub-sub { --q-sub: #4a5568; }
.q-sub-concrete { --q-sub: #7a7f88; }
.q-sub-paint { --q-sub: #c0392b; }
.q-sub-fence { --q-sub: #8a7a2f; }
.q-table th.q-tight { width: 5.5rem; }
.q-table td.q-tight { text-align: center; }
.quote-terms input {
  width: 100%;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 8px;
  background: var(--background);
  color: var(--foreground);
  font: inherit;
}
@media (max-width: 960px) {
  .q-labor-wrap { grid-template-columns: 1fr; }
}

.q-task-tabs { margin: 0 0 12px; }
.q-task-tabs button {
  height: 30px;
  border-radius: 8px;
  font-weight: 600;
}
.q-task-id {
  margin-left: 6px;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: .04em;
  opacity: .7;
}
.q-dept-row td {
  background: var(--secondary);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.q-table input,
.q-table select {
  width: 100%;
  height: 28px;
  padding: 0 8px;
  background: var(--background);
}
.q-table td { padding: 6px 8px; vertical-align: middle; }
.q-table .chip { height: 24px; padding: 0 8px; }
.table-search { margin: 0 0 10px; }
.table-search input {
  width: min(32rem, 100%);
  height: 32px;
  padding: 0 10px;
}
.th-sort {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.th-sort:hover { color: var(--foreground); }
th[aria-sort="ascending"] .th-sort,
th[aria-sort="descending"] .th-sort { color: var(--foreground); }

.quote-doc {
  --q-banner: #2a8f9e;
  --q-band: #9fd3dc;
  --q-head: #c5e6eb;
  --q-ink: #1a1a1a;
  --q-line: #cfd8dc;
  background: #ffffff;
  color: var(--q-ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px 22px 28px;
  margin-top: 8px;
  max-width: 54rem;
  font-size: 13px;
}
.quote-letterhead {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}
.quote-brand { display: flex; align-items: center; gap: 10px; }
.quote-flame { width: 44px; height: 44px; flex-shrink: 0; }
.quote-word { font-size: 20px; font-weight: 700; letter-spacing: 0.04em; line-height: 1.1; color: #4a4a4a; }
.quote-trade { font-size: 9px; font-weight: 500; letter-spacing: 0.12em; color: #8a8a8a; margin-top: 2px; }
.quote-addr { text-align: center; font-size: 14px; font-weight: 500; padding-top: 6px; }
.quote-meta { text-align: right; font-size: 12px; }
.quote-meta div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 8px; }
.quote-meta span { color: #333; font-weight: 700; }
.quote-banner {
  background: var(--q-banner);
  color: #fff;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 8px 12px;
}
.quote-desc-box { border: 1px solid var(--q-banner); border-top: 0; padding: 12px 14px 16px; min-height: 72px; }
.quote-desc-k { color: var(--q-banner); font-weight: 700; margin-bottom: 6px; }
.quote-desc { margin: 0; white-space: pre-wrap; }
.quote-estimate {
  display: grid;
  grid-template-columns: 1fr 8.5rem;
  background: var(--q-band);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 10px 0 14px;
}
.quote-estimate span { padding: 10px 14px; }
.quote-estimate strong { display: block; padding: 10px 14px; text-align: right; font-size: 15px; font-weight: 700; }
.quote-sec { margin: 0 0 14px; }
.quote-grid { width: 100%; border-collapse: collapse; }
.quote-grid td, .quote-grid th {
  border: 1px solid var(--q-line);
  padding: 6px 8px;
  vertical-align: top;
  font-size: 12px;
  font-weight: 400;
  text-align: left;
}
.quote-grid col, .quote-grid td:last-child, .quote-grid th:last-child { width: 7.5rem; }
.quote-cols th { background: var(--q-head); color: #1a1a1a; font-weight: 600; text-align: center; }
.quote-subtotal td { font-weight: 700; }
.quote-subtotal td:last-child, .q-amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.quote-terms { margin: 18px 0 0; padding-top: 10px; border-top: 1px solid var(--q-line); }
.quote-terms div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 10px; padding: 3px 0; font-size: 12px; }
.quote-terms dt { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #333; }
.quote-terms dd { margin: 0; }

@media (max-width: 800px) {
  .q-form { grid-template-columns: 1fr; }
  .quote-letterhead { grid-template-columns: 1fr; }
  .quote-addr, .quote-meta { text-align: left; }
  .grid, .grid.four, .grid.five, .grid.two, .analytics-split { grid-template-columns: 1fr; }
}
.help-panel {
  position: absolute;
  top: 56px;
  right: 20px;
  width: min(360px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  z-index: 20;
  background: var(--pane);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.16);
  padding: 12px 14px 16px;
}
.help-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.help-head h2 { margin: 0; }
.help-summary { font-size: 13px; margin: 0 0 12px; }
.help-how { margin: 0 0 12px; padding-left: 18px; font-size: 13px; }
.help-how li { margin: 0 0 6px; }
.help-el { padding: 8px 0; border-bottom: 1px solid var(--border); }
.help-el-k {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.help-el p { margin: 0; font-size: 13px; }

@media print {
  aside, .gate, .page-head, .page-actions, .settings-tabs, .grid, #quoting-hint, .chip, .help-panel, .window-chrome, .no-print, .q-calc { display: none !important; }
  .quote-terms input { border: 0 !important; background: transparent !important; padding: 0 !important; }
  .quote-doc { border: 0; border-radius: 0; max-width: none; margin: 0; padding: 0; }
  main, .pad, .view, .app { overflow: visible; height: auto; }
}
