:root {
  --red: #e31e24;
  --red-dark: #b91419;
  --ink: #171717;
  --muted: #6f7178;
  --line: #e7e7ea;
  --surface: #ffffff;
  --soft: #f5f5f6;
  --success: #197a4b;
  --warning: #b56b00;
  --shadow: 0 12px 34px rgba(23, 23, 23, .07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f2f2f3;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: var(--red-dark); text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: #151515; color: white; padding: 26px 18px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; color: white; padding: 0 8px 28px; border-bottom: 1px solid #343434; }
.brand img { width: 96px; height: 42px; object-fit: contain; background: white; padding: 5px; }
.brand span { font-size: 12px; line-height: 1.2; color: #d4d4d4; }
.sidebar nav { display: grid; gap: 6px; margin-top: 24px; }
.sidebar nav a { color: #c9c9cb; padding: 12px 14px; border-radius: 9px; font-weight: 650; font-size: 14px; }
.sidebar nav a:hover, .sidebar nav a.active { color: white; background: #2b2b2d; }
.sidebar nav a.active { box-shadow: inset 3px 0 var(--red); }
.sidebar-note { margin-top: auto; padding: 16px 12px 4px; color: #8f8f93; font-size: 12px; line-height: 1.5; }
.main-content { min-width: 0; }
.topbar { height: 96px; background: white; border-bottom: 1px solid var(--line); padding: 0 34px; display: flex; align-items: center; gap: 18px; }
.topbar > div { flex: 1; }
.topbar h1 { margin: 3px 0 0; font-size: 25px; letter-spacing: -.02em; }
.eyebrow { display: block; color: var(--red); font-weight: 800; letter-spacing: .09em; font-size: 10px; }
.mobile-menu { display: none; border: 0; background: none; font-size: 24px; }
.page-content { padding: 28px 34px 60px; max-width: 1500px; margin: 0 auto; }
.button { appearance: none; border: 1px solid #d8d8dc; background: white; color: #29292c; padding: 10px 15px; border-radius: 8px; font-weight: 750; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.button:hover { border-color: #b7b7bd; }
.button.primary { background: var(--red); border-color: var(--red); color: white; }
.button.primary:hover { background: var(--red-dark); }
.button.ghost { background: transparent; }
.button.small { padding: 7px 11px; font-size: 12px; }
.button.large { padding: 13px 22px; }
.button.full { width: 100%; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px; }
.panel h2 { margin: 4px 0 14px; font-size: 19px; }
.panel p { color: var(--muted); }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 16px; }
.panel-heading h2 { margin-bottom: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card { background: white; border: 1px solid var(--line); border-radius: 13px; padding: 20px; box-shadow: var(--shadow); display: grid; gap: 4px; }
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { font-size: 32px; }
.stat-card small { color: #9a9ba0; }
.stat-card.warning { border-top: 3px solid #ef9b24; }
.two-column { display: grid; grid-template-columns: 1.25fr .75fr; gap: 24px; }
.accent-panel { color: white; background: #222225; border-color: #222225; }
.accent-panel p { color: #bdbdc2; }
.steps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 13px; }
.steps li { display: flex; align-items: center; gap: 12px; color: #e7e7e9; font-size: 13px; }
.steps li span { flex: 0 0 27px; width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; background: var(--red); font-weight: 800; }
.price-list-status { display: flex; gap: 16px; align-items: start; padding: 18px; background: var(--soft); border-radius: 10px; }
.price-list-status p { margin: 5px 0 0; font-size: 13px; }
.status { display: inline-flex; padding: 4px 8px; background: #ededee; border-radius: 999px; font-size: 11px; font-style: normal; white-space: nowrap; }
.status.success { color: var(--success); background: #e7f5ed; }
.empty-state { padding: 32px; border: 1px dashed #cfd0d4; border-radius: 10px; text-align: center; color: var(--muted); }
.empty-state.compact { padding: 20px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 13px 12px; border-bottom: 1px solid #efeff1; vertical-align: top; }
.data-table td small { display: block; margin-top: 3px; color: var(--muted); }
.config-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .65fr); gap: 24px; align-items: start; }
.calculation-card { position: sticky; top: 20px; border-top: 4px solid var(--red); }
.calculation-card h2 { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 19px; word-break: break-word; }
.calculation-list { margin: 24px 0; }
.calculation-list div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.calculation-list dt { color: var(--muted); }
.calculation-list dd { margin: 0; font-weight: 700; }
.calculation-list .total-line { padding-top: 14px; font-size: 16px; }
.privacy-note, .privacy-pill { color: var(--muted); font-size: 11px; }
.privacy-pill { padding: 6px 9px; background: #f3f3f4; border-radius: 999px; }
.step-heading { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.step-heading > span { width: 34px; height: 34px; border-radius: 9px; background: var(--red); color: white; display: grid; place-items: center; font-weight: 850; }
.step-heading h2 { margin: 0; }
.step-heading p { margin: 4px 0 0; font-size: 13px; }
.field { display: grid; gap: 7px; position: relative; }
.field > span { font-size: 12px; font-weight: 750; color: #45454a; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 12px; border: 1px solid #d7d7db; border-radius: 8px; background: white; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(227,30,36,.11); border-color: var(--red); }
.search-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: white; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 18px 42px rgba(0,0,0,.13); max-height: 300px; overflow-y: auto; }
.search-results:empty { display: none; }
.search-result { padding: 11px 13px; cursor: pointer; border-bottom: 1px solid #f0f0f1; }
.search-result:hover { background: #faf1f1; }
.search-result strong, .search-result small { display: block; }
.search-result small { color: var(--muted); margin-top: 2px; }
.selected-product { margin: 18px 0; padding: 15px; border-radius: 9px; background: #f7f7f8; }
.configuration-group { border-top: 1px solid var(--line); padding: 17px 0; }
.configuration-group-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.configuration-group-head small { color: var(--muted); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
#calculation-description { white-space: pre-line; line-height: 1.55; }
.alert { padding: 12px 14px; border-radius: 9px; margin-top: 14px; font-size: 13px; }
.alert.error { color: #94191d; background: #fdebed; border: 1px solid #f5cbd0; }
.alert.success { color: #12643c; background: #e7f5ed; border: 1px solid #c4e6d2; }
.upload-panel { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; border-top: 4px solid var(--red); }
.upload-panel p { margin-bottom: 0; }
.upload-form { display: flex; gap: 12px; align-items: center; }
.form-grid { display: grid; gap: 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .item-description { grid-column: 1 / -1; }
.input-suffix { display: flex; }
.input-suffix input { border-radius: 8px 0 0 8px; }
.input-suffix > span { display: grid; place-items: center; padding: 0 10px; background: #ededee; border: 1px solid #d7d7db; border-left: 0; border-radius: 0 8px 8px 0; color: var(--muted); font-size: 12px; }
.calculated-box { padding: 12px; border-radius: 9px; background: #f4f4f5; display: grid; gap: 4px; }
.calculated-box span { color: var(--muted); font-size: 11px; }
.calculated-box strong { font-size: 19px; }
.quote-items { display: grid; gap: 15px; }
.subsection-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 28px 0 14px; padding-top: 22px; border-top: 1px solid var(--line); }
.subsection-heading h3, .subsection-heading p, .panel-heading p { margin: 0; }
.subsection-heading p, .panel-heading p { color: var(--muted); margin-top: 4px; }
.quote-item-card { border: 1px solid var(--line); border-radius: 11px; padding: 17px; background: #fcfcfc; }
.quote-item-header { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.quote-item-header h3 { margin: 0; font-size: 16px; }
.quote-item-header button { border: 0; background: none; color: var(--red); cursor: pointer; }
.quote-item-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.quote-item-options .item-description { grid-column: 1 / -1; }
.custom-item-fields { display: grid; grid-template-columns: 1.2fr 1.8fr .55fr .9fr; gap: 12px; align-items: end; }
.custom-item-card { border-left: 4px solid var(--red); }
.custom-image-upload { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 14px; align-items: end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.custom-image-preview { min-height: 92px; border: 1px dashed #c9c9ce; border-radius: 9px; display: grid; place-items: center; gap: 7px; padding: 8px; color: var(--muted); font-size: 12px; text-align: center; }
.custom-image-preview img { width: 100%; height: 84px; object-fit: contain; }
.custom-image-preview button { border: 0; background: none; color: var(--red); cursor: pointer; font-size: 12px; }
.form-actions { margin-top: 16px; display: flex; justify-content: flex-end; }
.quote-item-summary { margin-top: 14px; padding: 12px; background: white; border: 1px solid var(--line); border-radius: 8px; display: flex; justify-content: space-between; gap: 15px; }
.quote-item-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; }
.switch-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; }
.switch { width: 42px; height: 24px; border-radius: 20px; background: #c4c4c8; position: relative; transition: .2s; }
.switch::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: white; transition: .2s; }
.switch-row input:checked + .switch { background: var(--red); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.manual-price { margin-top: 16px; max-width: 360px; }
.field small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.sticky-submit { position: sticky; bottom: 14px; background: #202023; color: white; padding: 14px 18px; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 20px; box-shadow: 0 18px 48px rgba(0,0,0,.2); }
.detail-actions { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 18px; }
.detail-actions.compact-actions { margin: 0; }
.button.ghost.light { color: white; border-color: #69696e; }
.meta-list div { display: flex; justify-content: space-between; gap: 15px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; text-align: right; }
.reference-edit { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr; gap: 10px; }
.reference-edit .button { justify-self: start; }
.preline { white-space: pre-line; }
.internal-col { background: #fff8e9; }
.final-price-card { display: flex; justify-content: space-between; align-items: center; border-left: 5px solid var(--red); }
.final-price-card p { margin-bottom: 0; }
.final-amount { font-size: 34px; font-weight: 850; }
.final-amount small { font-size: 15px; color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.stack-form { display: grid; gap: 14px; }
.record-list { display: grid; gap: 0; max-height: 380px; overflow-y: auto; }
.compact-form { padding-bottom: 18px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.panel hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.record-list > div { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.record-list span { color: var(--muted); font-size: 12px; }
.record-list.warnings > div { grid-template-columns: 1fr; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; background: #222; color: white; padding: 12px 16px; border-radius: 9px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 1050px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid.three, .form-grid.four, .quote-item-options, .custom-item-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-column, .config-layout { grid-template-columns: 1fr; }
  .calculation-card { position: static; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: .2s; width: 238px; }
  body.menu-open .sidebar { transform: translateX(0); }
  .mobile-menu { display: block; }
  .topbar { padding: 0 18px; }
  .topbar .button { display: none; }
  .page-content { padding: 20px 16px 50px; }
  .stats-grid, .form-grid.two, .form-grid.three, .form-grid.four, .quote-item-options, .custom-item-fields, .custom-image-upload, .admin-grid { grid-template-columns: 1fr; }
  .subsection-heading { align-items: stretch; flex-direction: column; }
  .upload-panel { grid-template-columns: 1fr; }
  .upload-form, .sticky-submit, .final-price-card { align-items: stretch; flex-direction: column; }
}

