:root {
  color-scheme: light;
  --bg: #f8f9fa;
  --ink: #191c1d;
  --muted: #68716d;
  --line: #e1e5e2;
  --line-strong: #c0c8c3;
  --panel: #ffffff;
  --panel-soft: #f3f5f4;
  --accent: #2d5a4c;
  --accent-dark: #134235;
  --accent-soft: #dcefe8;
  --danger: #ba1a1a;
  --ok: #2d5a4c;
  --warn: #b07a2a;
  --shadow: 0 24px 60px -42px rgba(19, 66, 53, 0.35);
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Menlo, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: Manrope, Inter, ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--display);
  letter-spacing: 0;
}

h1 {
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 34px;
  line-height: 1.14;
}

h2 {
  margin-bottom: 0;
  color: var(--accent);
  font-size: 22px;
  line-height: 1.2;
}

.material-symbols-outlined {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Material Symbols Outlined";
  font-size: 20px;
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: 260px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #ffffff;
  padding: 24px 0;
}

.brand-block {
  display: grid;
  gap: 2px;
  padding: 0 24px 28px;
}

.brand-block strong {
  color: var(--accent);
  font-family: var(--display);
  font-size: 19px;
  font-weight: 800;
}

.brand-block span {
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 2px;
}

.nav-item {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-left: 4px solid transparent;
  padding: 0 20px;
  color: #5d6662;
  background: transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.nav-item:hover {
  background: #f5f7f6;
  color: var(--accent);
}

.nav-item.active {
  border-left-color: var(--accent);
  background: #f3f6f4;
  color: var(--accent);
}

.sidebar-bottom {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding: 0 16px;
}

.new-quote-link {
  justify-content: center;
  text-decoration: none;
}

.logout {
  width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-left: 260px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  padding: 0 32px;
  backdrop-filter: blur(16px);
}

.search-shell {
  position: relative;
  width: min(100%, 460px);
}

.search-shell .material-symbols-outlined {
  position: absolute;
  left: 12px;
  top: 50%;
  color: #8a938f;
  transform: translateY(-50%);
}

.search-shell input {
  width: 100%;
  height: 40px;
  padding-left: 42px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #59635f;
}

.profile-dot {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid var(--accent-soft);
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.shell {
  width: min(1180px, calc(100% - 320px));
  margin: 0 32px 0 292px;
  padding: 32px 0 48px;
}

.page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 28px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.dashboard-grid,
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.46fr);
  gap: 24px;
  align-items: start;
}

.lower {
  margin-top: 24px;
}

.side-stack {
  display: grid;
  gap: 20px;
}

.panel,
.status-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.status-panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-heading.compact {
  align-items: center;
  margin-bottom: 14px;
}

.status-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.status-row strong {
  display: block;
  margin-bottom: 2px;
}

.status-row p,
.note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--warn);
  box-shadow: 0 0 0 6px rgba(176, 122, 42, 0.12);
}

.dot.ready {
  background: var(--ok);
  box-shadow: 0 0 0 6px rgba(45, 90, 76, 0.12);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.metric-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.metric-grid span {
  display: block;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 800;
}

.metric-grid small,
label small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--panel);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.button:hover {
  border-color: rgba(45, 90, 76, 0.45);
  background: #f8faf9;
}

.button:active {
  transform: translateY(1px) scale(0.99);
}

.button.primary {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.button.primary:hover {
  background: var(--accent-dark);
}

.button.ghost {
  background: transparent;
}

.button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.button.danger {
  border-color: rgba(186, 26, 26, 0.22);
  color: var(--danger);
  background: rgba(186, 26, 26, 0.06);
}

.button.danger:hover {
  border-color: rgba(186, 26, 26, 0.45);
  background: rgba(186, 26, 26, 0.1);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
}

label span,
.field-title {
  font-size: 13px;
  font-weight: 760;
}

.field-title {
  display: block;
  margin-bottom: 10px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: #fbfcfa;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 90, 76, 0.12);
}

.section-rule {
  height: 1px;
  margin: 22px 0;
  background: var(--line);
}

.toggle-row {
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.codebox {
  min-height: 86px;
  margin: 0 0 12px;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f5f1;
  color: #26302b;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.checklist {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.checklist li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(176, 122, 42, 0.12);
  color: var(--warn);
  font-size: 11px;
  font-weight: 800;
}

.pill.ready {
  background: rgba(45, 90, 76, 0.12);
  color: var(--ok);
}

textarea {
  min-height: 360px;
  resize: vertical;
  padding: 14px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}

.quote-textarea {
  min-height: 120px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
}

.quote-notes {
  margin-top: 16px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.compact-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.custom-event-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

.choice-chip {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfa;
  cursor: pointer;
}

.choice-chip:hover {
  border-color: rgba(45, 90, 76, 0.28);
}

.choice-chip input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.choice-chip span {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
}

.event-detail-list {
  margin-top: 16px;
}

.event-detail-form {
  display: grid;
  gap: 8px;
}

.event-detail-head,
.event-detail-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr);
  gap: 10px;
  align-items: center;
}

.event-detail-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.event-detail-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfa;
}

.event-detail-row strong {
  font-size: 13px;
}

.field-row-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.package-list,
.package-form {
  display: grid;
  gap: 14px;
}

.package-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fbfcfa;
}

.package-card-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(110px, 0.25fr) auto;
  gap: 12px;
  align-items: end;
}

.package-event-head,
.package-event-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(130px, 0.75fr) minmax(150px, 0.8fr);
  gap: 10px;
  align-items: center;
}

.package-event-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.package-event-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.package-event-row strong {
  font-size: 13px;
}

.package-addons {
  display: grid;
  gap: 10px;
}

.queue-list,
.activity-list {
  display: grid;
  gap: 10px;
}

.queue-item,
.activity-item,
.empty {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fbfcfa;
}

.queue-item strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 13px;
}

.queue-item p,
.activity-item p,
.empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.activity-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
}

.activity-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.activity-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.manual-quote-panel,
.setup-panel {
  margin-top: 24px;
}

.quote-result {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.quote-result strong {
  display: block;
  margin-bottom: 6px;
}

.quote-result p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.package-result-list {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.quote-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.workflow-card .switch-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.switch-list div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
  color: #37403c;
  font-size: 13px;
  font-weight: 700;
}

.switch-list strong {
  color: var(--accent);
  font-size: 12px;
}

.hygiene-card {
  background: var(--accent-dark);
  color: #fff;
}

.hygiene-card h2 {
  color: #fff;
}

.hygiene-card > div {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.hygiene-card p {
  margin-bottom: 0;
  color: #bcedda;
  font-size: 13px;
  line-height: 1.5;
}

.banner {
  margin-bottom: 16px;
  border: 1px solid rgba(45, 90, 76, 0.24);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(45, 90, 76, 0.08);
  color: var(--accent-dark);
  font-size: 14px;
}

.banner.error {
  border-color: rgba(186, 26, 26, 0.3);
  background: rgba(186, 26, 26, 0.08);
  color: var(--danger);
}

.login-shell {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  display: grid;
  width: min(100%, 440px);
  gap: 16px;
}

.login-panel h1 {
  margin-bottom: 0;
  font-size: 42px;
}

@media (max-width: 1100px) {
  .dashboard-grid,
  .workspace,
  .page-heading {
    grid-template-columns: 1fr;
  }

  .option-grid,
  .compact-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-sidebar {
    position: static;
    width: auto;
    min-height: auto;
  }

  .topbar {
    margin-left: 0;
  }

  .shell {
    width: min(100% - 28px, 760px);
    margin: 0 auto;
    padding-top: 20px;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0 14px;
  }

  .form-grid,
  .option-grid,
  .compact-options,
  .custom-event-row,
  .event-detail-head,
  .event-detail-row,
  .package-card-head,
  .package-event-head,
  .package-event-row {
    grid-template-columns: 1fr;
  }

  .event-detail-head,
  .package-event-head {
    display: none;
  }

  .panel-heading,
  .activity-item,
  .quote-result {
    display: grid;
  }

  .activity-pills,
  .quote-links {
    justify-content: flex-start;
  }

  .activity-actions {
    justify-items: start;
  }

  .button {
    width: 100%;
  }
}
