:root {
  color-scheme: dark;
  --accent: #2563eb;
  --ink: #dce2f8;
  --muted: #c3c6d7;
  --line: #2b3448;
  --surface: #151b2b;
  --canvas: #0c1322;
  --sidebar: #070e1d;
  --raised: #191f2f;
  --raised-high: #232a3a;
  --cyan: #22d3ee;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #fca5a5;
  --violet: #c4b5fd;
  --focus: #93c5fd;
  --body-font: "Instrument Sans", system-ui, sans-serif;
  --title-font: "Red Hat Text", system-ui, sans-serif;
  --mono-font: "Red Hat Mono", ui-monospace, monospace;
  font: 400 14px/1.43 var(--body-font);
  color: var(--ink);
  background: var(--canvas);
  scrollbar-color: #47536b var(--canvas);
  scroll-padding-block: 80px 16px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
::selection { color: #fff; background: #2257c8; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.ct-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  margin: 0;
}

.ct-sr-only, .ct-skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

.ct-skip-link:focus {
  position: fixed;
  z-index: 30;
  inset: 12px auto auto 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
}

.ct-icon {
  display: inline-block;
  flex: none;
  width: 1em;
  height: 1em;
  overflow: hidden;
  font: normal 400 18px/1 "Material Symbols Outlined";
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "opsz" 24;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
}

.ct-sidebar {
  position: sticky;
  top: 0;
  grid-area: 1 / 1 / 3 / 2;
  display: flex;
  flex-direction: column;
  align-self: start;
  min-height: 100vh;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.ct-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
}

.ct-brand-desktop { margin: 4px 8px 28px; }
.ct-brand-mobile { display: none; }

.ct-brand strong, .ct-brand small { display: block; }
.ct-brand strong { font: 700 16px/20px var(--title-font); }
.ct-brand small { color: var(--muted); font-size: 12px; line-height: 16px; }

.ct-monogram {
  display: grid;
  flex: none;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--accent);
}

.ct-nav {
  display: grid;
  gap: 4px;
}

.ct-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.ct-nav-link:hover { color: var(--ink); background: var(--raised); }
.ct-nav-link[aria-current="page"] { color: #fff; background: var(--accent); }
.ct-nav-link[aria-current="page"] .ct-icon { font-variation-settings: "FILL" 1, "opsz" 24; }

.ct-sidebar-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: auto 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
}

.ct-sidebar-note .ct-icon { color: var(--cyan); }

.ct-topbar {
  position: sticky;
  z-index: 4;
  top: 0;
  grid-area: 1 / 2 / 2 / 3;
  display: flex;
  min-height: 69px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--canvas) 95%, transparent);
}

.ct-search {
  display: flex;
  width: min(448px, 100%);
  min-width: 0;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.ct-search:focus-within { border-color: var(--focus); }
.ct-search button {
  display: grid;
  flex: none;
  width: 36px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.ct-search button:hover { color: var(--ink); }
.ct-search input {
  flex: 1;
  min-width: 0;
  padding: 6px 12px 6px 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: 500 13px/20px var(--body-font);
}

.ct-search input:focus { outline: none; }
.ct-search input::placeholder { color: var(--muted); opacity: 1; }

.ct-topbar-meta { display: flex; flex: none; align-items: center; gap: 12px; }
.ct-topbar-meta .ct-profile { width: auto; max-width: 170px; min-height: 36px; }
.ct-topbar-meta:has(.ct-profile:not([hidden])) .ct-demo { display: none; }
.ct-topbar-date, .ct-demo, .ct-sample {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface);
  font-weight: 600;
  font-size: 12px;
}

.ct-topbar-date .ct-icon { color: var(--cyan); font-size: 16px; }
.ct-demo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.ct-main {
  grid-area: 2 / 2 / 3 / 3;
  width: 100%;
  max-width: 1440px;
  min-width: 0;
  margin-inline: auto;
  padding: 24px;
}

.ct-page { display: grid; gap: 24px; min-width: 0; }
.ct-page-header, .ct-panel-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ct-page-header h1 {
  margin: 0;
  font: 700 24px/30px var(--title-font);
  letter-spacing: -0.25px;
}

.ct-page-header p, .ct-panel-header p { margin: 2px 0 0; color: var(--muted); }
.ct-page-header h1:focus, .ct-panel-header h2:focus, .ct-main:focus { outline: none; }
.ct-page-header h1:focus-visible, .ct-panel-header h2:focus-visible, .ct-main:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.ct-button {
  display: inline-flex;
  flex: none;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: 600 13px/20px var(--body-font);
  text-decoration: none;
  cursor: pointer;
}

.ct-button .ct-icon { font-size: 16px; }
.ct-button-primary { color: #fff; background: var(--accent); }
.ct-button-primary:hover { background: #1d4ed8; }
.ct-button-secondary { border-color: var(--line); color: var(--ink); background: var(--raised); }
.ct-button-secondary:hover { background: var(--raised-high); }
.ct-button:disabled { opacity: .55; cursor: not-allowed; }

.ct-dashboard-warning {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid #763d49;
  border-radius: 12px;
  color: #fecdd3;
  background: #321b2b;
}

.ct-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

.ct-metric {
  --metric-tone: var(--cyan);
  --metric-background: #192d55;
  position: relative;
  display: grid;
  grid-template-areas: "label" "note" "count";
  align-content: start;
  min-width: 0;
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.ct-metric-alert { --metric-tone: var(--red); --metric-background: #412630; }
.ct-metric-stock { --metric-tone: var(--amber); --metric-background: #42361f; }
.ct-metric-won { --metric-tone: var(--green); --metric-background: #133936; }
.ct-metric dt {
  grid-area: label;
  padding-right: 42px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.ct-metric dd { grid-area: count; margin: 8px 0 0; font: 700 22px/26px var(--title-font); }
.ct-metric dd.ct-metric-note { grid-area: note; margin: 0; color: var(--muted); font: 400 12px/16px var(--body-font); }
.ct-metric-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--metric-tone);
  background: var(--metric-background);
  line-height: 36px;
  text-align: center;
}

.ct-overview {
  display: grid;
  gap: 16px;
}

.ct-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.ct-panel-header { margin-bottom: 16px; }
.ct-panel-header h2 { margin: 0; font: 700 20px/26px var(--title-font); letter-spacing: -0.25px; }
.ct-panel-header p { font-size: 12px; line-height: 16px; }
.ct-automation-list { list-style: none; padding: 0; margin: 0; }
.ct-automation-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.ct-automation-list small { grid-column: 1 / -1; color: var(--muted); }
.ct-automation-date { color: var(--muted); }
.ct-automation-error { color: var(--red); }
.ct-automation-section { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
.ct-automation-section h3, .ct-stock-task h4 { margin: 0 0 8px; }
.ct-automation-section summary { cursor: pointer; font-weight: 700; }
.ct-automation-section p { margin: 8px 0; }
.ct-automation-form { display: grid; justify-items: start; gap: 10px; max-width: 55ch; margin: 12px 0; }
.ct-automation-form .ct-kb-field, .ct-wa-preview { width: 100%; min-width: 0; }
.ct-automation-form .ct-kb-input { width: 100%; min-height: 44px; }
.ct-automation-form button:disabled { opacity: .65; cursor: default; }
.ct-wa-preview {
  margin: 0;
  padding: 12px;
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.ct-stock-task { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
#ct-demo-code-list dd { margin: 0 0 8px; overflow-wrap: anywhere; }
.ct-chart-panel { min-height: 324px; }
.ct-chart { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); margin: 24px 0 0; }
.ct-chart-axis {
  display: grid;
  grid-template-rows: repeat(4, 1fr) auto;
  align-items: start;
  margin: 0 0 27px;
  color: var(--muted);
  font: 500 10px/14px var(--mono-font);
}

.ct-chart-days {
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ct-chart-day { display: grid; gap: 8px; min-width: 0; text-align: center; }
.ct-chart-column { position: relative; display: grid; justify-items: center; height: 192px; }
.ct-chart-bar { position: absolute; bottom: 0; width: min(50%, 28px); height: var(--bar-height); border-radius: 5px 5px 0 0; background: linear-gradient(#22d3ee, #2563eb); }
.ct-chart-number { position: absolute; bottom: calc(var(--bar-height) + 2px); color: var(--ink); font: 600 11px/14px var(--mono-font); }
.ct-chart-zero .ct-chart-number { color: var(--muted); }
.ct-chart-day time { color: var(--muted); font-size: 11px; line-height: 18px; white-space: nowrap; }
.ct-chart-day:first-child time { color: var(--cyan); font-weight: 700; }
.ct-chart-grid {
  position: absolute;
  inset: 0 0 26px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
  pointer-events: none;
}

.ct-chart-grid span { border-top: 1px dashed var(--line); }
.ct-chart-grid span:last-child { border-top-style: solid; }

.ct-stage-list { margin: 0; }
.ct-stage-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.ct-stage-list dt { color: var(--muted); }
.ct-stage-list dd { margin: 0; font: 600 13px/18px var(--mono-font); }
.ct-stage-list .ct-stage-total { padding: 15px 0 0; border-bottom: 0; }
.ct-stage-total dt { color: var(--ink); font-weight: 700; }
.ct-stage-total dd { color: var(--cyan); font-size: 20px; }

.ct-offer-list, .ct-table-scroll {
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--raised);
}

.ct-offer-list { overflow: visible; }
.ct-offer-heading, .ct-offer > summary {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(115px, .9fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.ct-offer-heading { border-radius: 11px 11px 0 0; color: var(--muted); background: var(--raised-high); font-size: 12px; font-weight: 600; }
.ct-offer-heading span:last-child { text-align: right; }
.ct-offer { border-top: 1px solid var(--line); }
.ct-offer > summary { min-height: 48px; list-style: none; cursor: pointer; }
.ct-offer > summary::-webkit-details-marker { display: none; }
.ct-offer > summary:hover, .ct-offer[open] > summary { background: var(--raised-high); }
.ct-offer > summary:focus-visible { position: relative; z-index: 1; outline-offset: -3px; }
.ct-offer:last-child:not([open]) > summary { border-radius: 0 0 11px 11px; }
.ct-offer-name { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.ct-offer-total { justify-self: end; text-align: right; overflow-wrap: anywhere; }
.ct-offer-money { font: 600 13px/18px var(--mono-font); font-variant-numeric: tabular-nums; }
.ct-offer-note { color: var(--muted); font-size: 12px; }
.ct-offer-incomplete { color: var(--amber); }
.ct-offer-chevron { justify-self: end; color: var(--muted); }
.ct-offer[open] .ct-offer-chevron { transform: rotate(180deg); }
.ct-offer-items { display: grid; gap: 10px; min-width: 0; padding: 0 16px 16px; background: var(--raised-high); }
.ct-offer:last-child .ct-offer-items { border-radius: 0 0 11px 11px; }
.ct-offer-items .ct-empty { padding: 12px 0 0; }
.ct-offer-items .ct-empty, .ct-offer-items > p { margin: 0; }
.ct-item-table { min-width: 570px; }
.ct-item-table th:nth-child(4) { min-width: 86px; }

.ct-empty { margin: 0; padding: 16px; color: var(--muted); }
.ct-status {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  color: #d3d9f4;
  background: #30394f;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.ct-status-approved, .ct-status-sent { color: #6ee7b7; background: #0b3e35; }
.ct-status-pending, .ct-status-stock { color: #fcd34d; background: #473316; }
.ct-status-declined { color: #fca5a5; background: #49232b; }
.ct-status-new { color: #bfdbfe; background: #1c3464; }
.ct-status-spec { color: var(--violet); background: #342759; }

.ct-table { width: 100%; border-collapse: collapse; text-align: left; }
.ct-records-panel .ct-table { min-width: 570px; }
.ct-scroll-hint { display: none; }
.ct-table th, .ct-table td { padding: 11px 14px; overflow-wrap: anywhere; }
.ct-table th { font-weight: 600; }
.ct-table thead th { color: var(--muted); background: var(--raised-high); font-size: 12px; }
.ct-table tbody tr { border-top: 1px solid var(--line); }
.ct-table td { color: var(--muted); }
.ct-table .ct-numeric { text-align: right; white-space: nowrap; }
.ct-table td.ct-numeric { color: var(--ink); font: 600 13px/18px var(--mono-font); }
.ct-filter, .ct-automation-form .ct-kb-field { display: grid; flex: none; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.ct-filter select, .ct-profile { min-height: 36px; }
.ct-filter select, .ct-profile, .ct-automation-form .ct-kb-input { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--raised); font: 600 13px/20px var(--body-font); }

@media (min-width: 1024px) {
  .ct-overview { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
}

@media (min-width: 1280px) {
  .ct-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  :root { scroll-padding-block: 72px 76px; }
  .ct-shell { display: block; }
  .ct-sidebar { display: contents; }
  .ct-topbar {
    min-height: 61px;
    padding: 10px 16px;
    background: var(--sidebar);
  }

  .ct-brand-desktop, .ct-sidebar-note, .ct-search, .ct-topbar-date { display: none; }
  .ct-brand-mobile { display: flex; }
  .ct-monogram { width: 32px; height: 32px; }
  .ct-main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  .ct-page { gap: 16px; }
  .ct-page-header { gap: 8px; }
  .ct-page-header h1 { font-size: 28px; line-height: 34px; }
  .ct-page-header p { font-size: 12px; line-height: 16px; }
  .ct-button { padding-inline: 10px; }
  .ct-page-header .ct-button { min-height: 40px; font-size: 12px; }

  .ct-nav {
    position: fixed;
    z-index: 4;
    right: 0;
    bottom: 0;
    left: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 3px 4px calc(3px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--sidebar);
  }

  .ct-nav-link {
    min-height: 53px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    font-size: 11px;
    line-height: 14px;
  }

  .ct-nav-link .ct-icon { font-size: 20px; }
  .ct-nav-link[aria-current="page"] { color: var(--cyan); background: transparent; }
  .ct-nav-link:focus-visible { outline-offset: -2px; }
  .ct-metrics { gap: 8px; }
  .ct-metric { min-height: 112px; padding: 14px; grid-template-areas: "label" "count" "note"; }
  .ct-metric dt { padding: 38px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; line-height: 16px; }
  .ct-metric-icon { top: 14px; right: auto; left: 14px; width: 32px; height: 32px; line-height: 32px; }
  .ct-metric dd { margin-top: 2px; font-size: 20px; line-height: 24px; }
  .ct-metric dd.ct-metric-note { display: none; }
  .ct-panel { padding: 16px; }
  .ct-panel-header { margin-bottom: 12px; }
  .ct-panel-header h2 { font-size: 16px; line-height: 22px; }
  .ct-topbar-meta .ct-profile { max-width: 128px; }
  .ct-automation-list li { grid-template-columns: minmax(0, 1fr); }
  .ct-chart-panel { min-height: 192px; }
  .ct-chart { margin-top: 16px; }
  .ct-chart-column { height: 92px; }
  .ct-chart-day time { font-size: 10px; }
  .ct-chart-days { gap: 1px; }

  .ct-offer-list { border: 0; border-radius: 0; background: transparent; }
  .ct-offer-heading { display: none; }
  .ct-offer + .ct-offer { margin-top: 6px; }
  .ct-offer { border: 1px solid var(--line); border-radius: 12px; background: var(--raised); }
  .ct-offer > summary {
    grid-template-columns: minmax(0, 1fr) minmax(90px, auto) 16px;
    grid-template-areas: "customer value arrow" "status value arrow";
    gap: 4px 8px;
    padding: 10px;
    border-radius: 11px;
  }

  .ct-offer:last-child:not([open]) > summary { border-radius: 11px; }
  .ct-offer[open] > summary { border-radius: 11px 11px 0 0; }
  .ct-offer-name { grid-area: customer; }
  .ct-offer-status { grid-area: status; }
  .ct-offer-total { grid-area: value; max-width: 110px; }
  .ct-offer-chevron { grid-area: arrow; }
  .ct-offer-items { padding: 0 10px 10px; border-radius: 0 0 11px 11px; }
  .ct-records-panel .ct-panel-header { flex-wrap: wrap; }
  .ct-scroll-hint { display: block; margin: 0 0 8px; color: var(--muted); font-size: 12px; }
  .ct-records-panel .ct-table :is(th, td):last-child {
    position: sticky;
    right: 0;
    border-left: 1px solid var(--line);
    background: var(--raised);
  }
  .ct-records-panel .ct-table thead th:last-child { background: var(--raised-high); }
  #hr .ct-table { table-layout: fixed; }
  #hr .ct-table thead th:first-child { width: 132px; }
  #hr .ct-table thead th:nth-child(2) { width: 60px; }
  #hr .ct-table thead th:last-child { width: 124px; }
}

@media (max-width: 359px) {
  .ct-metric { padding-inline: 10px; }
  .ct-metric-icon { left: 10px; }
  .ct-panel { padding: 12px; }
  .ct-chart-day time { font-size: 9px; }
  .ct-chart-number { font-size: 10px; }
}

