:root {
  color-scheme: light;
  --ink: #18302a;
  --muted: #687770;
  --green: #173f35;
  --green-2: #246252;
  --green-soft: #e8f0ed;
  --paper: #ffffff;
  --ground: #f3f5f3;
  --line: #dce3df;
  --amber: #d99623;
  --amber-soft: #fff4dc;
  --red: #a63f3f;
  --red-soft: #fdecec;
  --blue-soft: #e9f1f7;
  --shadow: 0 12px 34px rgba(24, 48, 42, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--ground); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.45rem, 2vw, 1.9rem); letter-spacing: -0.035em; }
h2 { margin-bottom: .35rem; font-size: 1.25rem; letter-spacing: -.02em; }
h3 { margin-bottom: .3rem; font-size: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }

.topbar {
  position: sticky; z-index: 20; top: 0; display: grid;
  grid-template-columns: minmax(245px, 1fr) auto minmax(245px, 1fr);
  align-items: center; gap: 1.25rem; min-height: 72px; padding: 0 1.5rem;
  color: white; background: var(--green); box-shadow: 0 2px 14px rgba(12, 36, 29, .16);
}
.brand { display: inline-flex; align-items: center; gap: .7rem; width: fit-content; color: white; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.65); border-radius: 10px; font-size: .76rem; font-weight: 800; letter-spacing: .03em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .98rem; }
.brand small { margin-top: .12rem; color: #bcd0c9; font-size: .72rem; }
.main-nav { display: flex; align-items: center; gap: .25rem; padding: .24rem; border-radius: 10px; background: rgba(255,255,255,.08); }
.nav-button { border: 0; border-radius: 8px; padding: .55rem .95rem; color: #c8d9d3; background: transparent; cursor: pointer; }
.nav-button.active { color: var(--green); background: white; font-weight: 700; }
.top-actions { display: flex; justify-content: flex-end; align-items: center; gap: .75rem; }
.demo-badge { padding: .3rem .55rem; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; color: #d8e4e0; font-size: .72rem; }

.button { display: inline-flex; justify-content: center; align-items: center; min-height: 40px; padding: .62rem 1rem; border: 1px solid transparent; border-radius: 9px; font-weight: 700; cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--green-2); }
.topbar .button-primary { color: var(--green); background: #f4c968; }
.button-secondary { border-color: var(--line); background: white; }
.button-danger { color: var(--red); border-color: #edc9c9; background: var(--red-soft); }
.button-small { min-height: 34px; padding: .45rem .7rem; font-size: .78rem; }

.app-layout { display: grid; grid-template-columns: minmax(330px, 400px) 1fr; min-height: calc(100vh - 72px); }
.orders-page, .workspace-page { min-height: calc(100vh - 72px); }
.orders-page { max-width: 1280px; margin: 0 auto; padding: 1.5rem clamp(1rem,4vw,3rem) 3rem; }
.orders-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); }
.orders-page .filters { grid-template-columns: minmax(220px,1fr) minmax(190px,260px); }
.orders-page .orders-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; padding: 0 1.35rem 1.35rem; border-top: 0; }
.orders-page .order-row { border: 1px solid var(--line); border-radius: 11px; }
.workspace-page { max-width: 1380px; margin: 0 auto; }
.inbox { display: flex; flex-direction: column; min-height: calc(100vh - 72px); border-right: 1px solid var(--line); background: var(--paper); }
.inbox-heading { display: flex; justify-content: space-between; align-items: center; padding: 1.55rem 1.35rem .9rem; }
.eyebrow { margin-bottom: .25rem; color: var(--green-2); font-size: .69rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.count-badge { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 .45rem; border-radius: 10px; color: var(--green-2); background: var(--green-soft); font-weight: 800; }
.filters { display: grid; gap: .55rem; padding: 0 1.35rem 1rem; }
input, select, textarea { width: 100%; border: 1px solid #cfd9d4; border-radius: 9px; padding: .68rem .75rem; color: var(--ink); background: white; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(36,98,82,.12); }
textarea { resize: vertical; line-height: 1.5; }
.orders-list { flex: 1; overflow-y: auto; border-top: 1px solid var(--line); }
.order-card { display: grid; grid-template-columns: 1fr auto; gap: .5rem .75rem; width: 100%; padding: 1rem 1.35rem; border: 0; border-bottom: 1px solid var(--line); text-align: left; background: white; cursor: pointer; }
.order-card:hover { background: #f8faf9; }
.order-card.active { box-shadow: inset 4px 0 var(--green-2); background: var(--green-soft); }
.order-card strong { font-size: .93rem; }
.order-card time { color: var(--muted); font-size: .72rem; }
.order-card .phone { color: var(--muted); font-size: .78rem; }
.order-card .preview { grid-column: 1 / -1; overflow: hidden; margin: .12rem 0; color: #52615b; font-size: .79rem; text-overflow: ellipsis; white-space: nowrap; }
.order-meta { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.status-pill { display: inline-flex; align-items: center; width: fit-content; padding: .28rem .52rem; border-radius: 999px; color: var(--green-2); background: var(--green-soft); font-size: .68rem; font-weight: 800; }
.status-pill[data-status="În clarificare"] { color: #8a5c0f; background: var(--amber-soft); }
.status-pill[data-status="Ofertă trimisă"], .status-pill[data-status="Programată"] { color: #315f7c; background: var(--blue-soft); }
.status-pill[data-status="Anulată"] { color: var(--red); background: var(--red-soft); }
.status-pill[data-status="Finalizată"] { color: #4d5a55; background: #e8ebe9; }
.completeness-mini { color: var(--muted); font-size: .7rem; font-weight: 700; }
.inbox-footer { padding: .85rem 1.35rem; border-top: 1px solid var(--line); }
.text-button { padding: 0; border: 0; color: var(--muted); background: none; font-size: .75rem; cursor: pointer; }
.text-button:hover { color: var(--green-2); text-decoration: underline; }

.detail { min-width: 0; padding: 1.6rem clamp(1rem, 3vw, 2.5rem) 3rem; }
.detail-empty { display: grid; place-items: center; min-height: 60vh; color: var(--muted); text-align: center; }
.detail-empty div { max-width: 380px; }
.detail-empty .empty-icon { display: block; margin-bottom: .75rem; font-size: 2.5rem; }
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; }
.client-line { margin: .35rem 0 0; color: var(--muted); font-size: .85rem; }
.status-control { min-width: 205px; }
.status-control label { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .7rem; font-weight: 700; }
.summary-grid { display: grid; grid-template-columns: minmax(250px,.8fr) 1.2fr; gap: 1rem; margin-bottom: 1rem; }
.panel { border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: 0 5px 20px rgba(24,48,42,.035); }
.panel-body { padding: 1.05rem; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .9rem 1.05rem; border-bottom: 1px solid var(--line); }
.panel-heading h2, .panel-heading h3 { margin: 0; }
.progress-head { display: flex; justify-content: space-between; margin-bottom: .65rem; font-size: .8rem; }
.progress-head strong { font-size: 1rem; }
.progress-track { overflow: hidden; height: 9px; border-radius: 99px; background: #e7ece9; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--green-2); }
.missing-list { margin: .8rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.ready-note { margin: .8rem 0 0; color: var(--green-2); font-size: .78rem; font-weight: 700; }
.order-facts { display: grid; grid-template-columns: repeat(2,1fr); gap: .75rem; }
.fact { padding: .72rem; border-radius: 9px; background: #f7f9f8; }
.fact span { display: block; margin-bottom: .2rem; color: var(--muted); font-size: .67rem; text-transform: uppercase; }
.fact strong { font-size: .82rem; }
.alert-panel { margin-bottom: 1rem; border-color: #efce91; background: #fffaf0; }
.alert-panel .panel-heading { border-color: #f1ddb7; }
.pending-change { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .8rem; padding: .85rem 1.05rem; border-top: 1px solid #f1ddb7; }
.pending-change:first-child { border-top: 0; }
.pending-change p { margin: 0; font-size: .8rem; }
.pending-change small { color: var(--muted); }
.pending-actions { display: flex; gap: .35rem; }
.items-section { margin-bottom: 1rem; }
.items-grid { display: grid; gap: .75rem; padding: .85rem; }
.item-card { padding: .95rem; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.item-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: .75rem; }
.item-top p { margin: .18rem 0 0; color: var(--muted); font-size: .72rem; }
.spec-grid { display: grid; grid-template-columns: repeat(5,minmax(90px,1fr)); gap: .55rem; }
.spec { min-width: 0; }
.spec span { display: block; color: var(--muted); font-size: .62rem; text-transform: uppercase; }
.spec strong { display: block; overflow-wrap: anywhere; margin-top: .15rem; font-size: .76rem; }
.spec .missing { color: #9b6b1c; font-weight: 600; }
.conversation { overflow: hidden; }
.messages { display: grid; gap: .85rem; padding: 1.1rem; background: #f7f9f8; }
.message-row { display: flex; flex-direction: column; align-items: flex-start; }
.message-row.outbound { align-items: flex-end; }
.message-bubble { max-width: min(78%,690px); padding: .72rem .85rem; border: 1px solid var(--line); border-radius: 5px 13px 13px 13px; background: white; font-size: .82rem; line-height: 1.5; white-space: pre-wrap; }
.message-row.outbound .message-bubble { color: #12362c; border-color: #c9ddd5; border-radius: 13px 5px 13px 13px; background: #e4f0eb; }
.message-meta { margin-top: .25rem; color: var(--muted); font-size: .64rem; }
.suggestion { max-width: min(88%,760px); margin-top: .45rem; padding: .75rem; border: 1px dashed #d9ac59; border-radius: 10px; background: var(--amber-soft); }
.suggestion-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: .42rem; color: #795015; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.suggestion p { margin: 0; font-size: .79rem; line-height: 1.5; }
.suggestion-actions { display: flex; gap: .4rem; margin-top: .65rem; }

.catalog-page { max-width: 1400px; margin: 0 auto; padding: 2rem clamp(1rem,4vw,3rem) 4rem; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: 1.4rem; }
.page-heading > div:first-child { max-width: 680px; }
.page-heading p:last-child { margin: .45rem 0 0; color: var(--muted); line-height: 1.55; }
.catalog-stats { display: flex; gap: .6rem; }
.catalog-context { margin-top: .65rem !important; padding: .65rem .8rem; border-left: 3px solid var(--green-2); border-radius: 0 8px 8px 0; background: var(--green-soft); color: var(--green-2) !important; font-size: .82rem; }
.stat-card { min-width: 105px; padding: .8rem; border: 1px solid var(--line); border-radius: 11px; text-align: center; background: white; }
.stat-card strong, .stat-card span { display: block; }
.stat-card strong { font-size: 1.25rem; }
.stat-card span { margin-top: .15rem; color: var(--muted); font-size: .67rem; }
.catalog-toolbar { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.catalog-filters { display: grid; grid-template-columns: minmax(260px,1fr) 220px; gap: .7rem; flex: 1; }
.catalog-actions { display: flex; gap: .55rem; }
.catalog-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .8rem; }
.catalog-card { display: grid; grid-template-columns: 1fr auto; gap: .65rem; align-items: start; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: white; }
.catalog-card.inactive { opacity: .62; }
.catalog-card h3 { margin: 0; }
.catalog-card p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.catalog-card .catalog-source { color: var(--green-2); }
.catalog-tag { display: inline-block; margin-top: .35rem; padding: .22rem .42rem; border-radius: 6px; color: var(--green-2); background: var(--green-soft); font-size: .62rem; font-weight: 800; }
.switch { position: relative; display: inline-flex; width: 42px; height: 24px; }
.switch input { width: 1px; height: 1px; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #ccd4d0; cursor: pointer; transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + span { background: var(--green-2); }
.switch input:checked + span::after { transform: translateX(18px); }

.modal { width: min(620px,calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow-y: auto; overscroll-behavior: contain; padding: 0; border: 0; border-radius: 15px; color: var(--ink); box-shadow: 0 24px 70px rgba(9,29,23,.28); }
.modal::backdrop { background: rgba(14,31,26,.58); backdrop-filter: blur(2px); }
.modal form, .modal > div:not(.modal-heading), .modal > p { margin: 0; }
.modal form { display: grid; gap: .85rem; padding: 1.25rem; }
.modal-small { padding: 1.25rem; }
.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.modal-heading h2 { margin: 0; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 1.35rem; cursor: pointer; }
.modal label { display: grid; gap: .35rem; color: #3e5049; font-size: .76rem; font-weight: 700; }
.optional { color: var(--muted); font-weight: 400; }
.form-note { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.field-requirement { margin-left: .22rem; color: var(--muted); font-size: .65rem; font-weight: 500; }
.field-requirement.required-mark, .required-mark { color: #a4372f; font-weight: 900; }
.form-error { margin: 0; padding: .68rem .75rem; border: 1px solid #e4aca7; border-radius: 8px; color: #8f2119; background: var(--red-soft); font-size: .76rem; font-weight: 700; }
.form-error[hidden] { display: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: .55rem; padding-top: .3rem; }
.delete-summary { margin: .9rem 0 .35rem; padding: .7rem .8rem; border: 1px solid #edc9c9; border-radius: 9px; color: var(--red); background: var(--red-soft); font-weight: 800; }
.decision-grid { display: grid; gap: .65rem; margin-top: 1rem; }
.decision-card { padding: 1rem; border: 1px solid var(--line); border-radius: 10px; text-align: left; background: white; cursor: pointer; }
.decision-card:hover { border-color: var(--green-2); background: var(--green-soft); }
.decision-card strong, .decision-card span { display: block; }
.decision-card span { margin-top: .3rem; color: var(--muted); font-size: .75rem; }
.form-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .7rem; }
.toast { position: fixed; z-index: 100; right: 1.25rem; bottom: 1.25rem; max-width: 360px; padding: .8rem 1rem; border-radius: 10px; color: white; background: var(--green); box-shadow: var(--shadow); font-size: .78rem; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.empty-state { padding: 2.2rem 1rem; color: var(--muted); text-align: center; font-size: .82rem; }

/* Application components */
.order-row {
  display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: .7rem;
  width: 100%; padding: 1rem 1.1rem; border: 0; border-bottom: 1px solid var(--line);
  text-align: left; background: white; cursor: pointer;
}
.order-row:hover { background: #f8faf9; }
.order-row.selected { box-shadow: inset 4px 0 var(--green-2); background: var(--green-soft); }
.order-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: white; background: var(--green-2); font-size: .7rem; font-weight: 800; }
.order-copy { display: grid; min-width: 0; gap: .22rem; }
.order-copy > span { display: flex; align-items: baseline; gap: .42rem; }
.order-copy strong { font-size: .83rem; }
.order-copy small { color: var(--muted); font-size: .65rem; }
.order-copy em { overflow: hidden; color: #52615b; font-size: .72rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.order-side { display: flex; flex-direction: column; align-items: flex-end; gap: .28rem; }
.status { padding: .25rem .42rem; border-radius: 999px; color: var(--green-2); background: var(--green-soft); font-size: .59rem; font-weight: 800; white-space: nowrap; }
.status.clarifying { color: #8a5c0f; background: var(--amber-soft); }
.status.quoted, .status.scheduled { color: #315f7c; background: var(--blue-soft); }
.status.cancelled { color: var(--red); background: var(--red-soft); }
.status.completed { color: #4d5a55; background: #e8ebe9; }
.reply-dot { color: #9a6616; font-size: .57rem; text-transform: uppercase; }
.mini-progress { overflow: hidden; width: 48px; height: 4px; border-radius: 99px; background: #dfe6e2; }
.mini-progress i { display: block; height: 100%; background: var(--green-2); }
.order-side small { color: var(--muted); font-size: .57rem; }
.empty { display: grid; gap: .25rem; padding: 2rem 1rem; color: var(--muted); text-align: center; font-size: .76rem; }
.empty.large { place-content: center; min-height: 65vh; }
.empty strong { color: var(--ink); }

.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.detail-head p { margin: .35rem 0 0; color: var(--muted); font-size: .8rem; }
.head-actions { display: flex; align-items: flex-end; gap: .55rem; }
.head-actions label { display: grid; gap: .25rem; color: var(--muted); font-size: .65rem; font-weight: 700; }
.head-actions select { min-width: 195px; padding: .55rem .65rem; }
.secondary, .small-primary, .text-btn, .item-edit, .item-delete {
  border: 0; border-radius: 8px; cursor: pointer; font-weight: 700;
}
.secondary { min-height: 39px; padding: .55rem .75rem; border: 1px solid var(--line); background: white; font-size: .75rem; }
.small-primary { padding: .48rem .65rem; color: white; background: var(--green-2); font-size: .69rem; }
.text-btn { padding: .4rem .25rem; color: var(--green-2); background: transparent; font-size: .69rem; }
.count { padding: .3rem .5rem; border-radius: 7px; color: var(--green-2); background: var(--green-soft); font-size: .66rem; font-weight: 800; }
.count.warning { color: #855910; background: var(--amber-soft); }

.completion-card {
  display: grid; grid-template-columns: 74px minmax(0,1fr) auto; align-items: center; gap: 1rem;
  margin-bottom: 1rem; padding: 1rem 1.15rem; border: 1px solid var(--line); border-left: 4px solid var(--green-2);
  border-radius: 13px; background: white; box-shadow: 0 5px 20px rgba(24,48,42,.035);
}
.completion-card h2 { margin: 0; }
.completion-card p { margin: .3rem 0 0; color: var(--muted); font-size: .75rem; }
.progress-ring {
  display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%;
  background: radial-gradient(closest-side,white 78%,transparent 80% 99%), conic-gradient(var(--green-2) calc(var(--p)*1%),#e2e8e5 0);
}
.progress-ring strong { font-size: .87rem; }
.general-facts { display: flex; gap: .65rem; }
.general-facts span { min-width: 100px; padding-left: .65rem; border-left: 1px solid var(--line); font-size: .73rem; }
.general-facts b { display: block; margin-bottom: .15rem; color: var(--muted); font-size: .58rem; text-transform: uppercase; }

.section { margin-bottom: 1rem; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 5px 20px rgba(24,48,42,.035); }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .9rem 1.05rem; border-bottom: 1px solid var(--line); }
.section-title h2 { margin: 0; }
.section-help { margin: .28rem 0 0; color: #795015; font-size: .69rem; font-weight: 600; }
.alert-section { border-color: #efce91; background: #fffaf0; }
.alert-section .section-title { border-color: #f1ddb7; }
.alert-section .section-title > div:last-child { display: flex; align-items: center; justify-content: flex-end; gap: .55rem; flex-wrap: wrap; }
.change { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .8rem 1rem; border-top: 1px solid #f1ddb7; }
.change:first-of-type { border-top: 0; }
.change > div:first-child { display: grid; gap: .2rem; font-size: .75rem; }
.change > div:first-child span { display: flex; align-items: center; gap: .45rem; }
.change del { color: #9a6464; }
.change i { color: var(--muted); font-style: normal; }
.change > div:last-child { display: flex; gap: .4rem; }
.unassigned-change { background: #fff7e7; }
.unassigned-change small { color: #795015; font-size: .64rem; }
.danger-text { color: var(--red); }

.item-card dl { display: grid; grid-template-columns: repeat(4,1fr); gap: .5rem; margin: .65rem 0; }
.item-card dl div { min-width: 0; }
.item-card dt { color: var(--muted); font-size: .57rem; text-transform: uppercase; }
.item-card dd { overflow-wrap: anywhere; margin: .15rem 0 0; font-size: .72rem; font-weight: 700; }
.item-number { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; color: white; background: var(--green); font-size: .72rem; font-weight: 800; }
.item-score { margin-left: auto; padding: .28rem .45rem; border-radius: 7px; color: #8a5c0f; background: var(--amber-soft); font-size: .65rem; font-weight: 800; }
.item-score.ok { color: var(--green-2); background: var(--green-soft); }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; margin: .45rem 0; }
.chips span { padding: .25rem .42rem; border-radius: 6px; color: #315f7c; background: var(--blue-soft); font-size: .62rem; }
.accessories-block { margin: .65rem 0; padding: .58rem .65rem; border: 1px solid #cbdde8; border-radius: 8px; background: #f4f9fc; }
.accessories-block > b { color: #315f7c; font-size: .63rem; text-transform: uppercase; }
.accessories-block .chips { margin-bottom: 0; }
.missing, .complete-line { margin-top: .55rem; padding: .52rem .6rem; border-radius: 7px; font-size: .67rem; }
.missing { color: #825713; background: var(--amber-soft); }
.complete-line { color: var(--green-2); background: var(--green-soft); font-weight: 700; }
.item-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .6rem; }
.item-edit, .item-delete { padding: .42rem .55rem; border: 1px solid var(--line); background: white; font-size: .66rem; }
.item-delete { color: var(--red); border-color: #e8c5c5; background: var(--red-soft); }

.timeline { display: grid; gap: .9rem; padding: 1rem; background: #f7f9f8; }
.message { display: flex; flex-direction: column; align-items: flex-start; }
.message.outgoing { align-items: flex-end; }
.bubble { max-width: min(78%,690px); padding: .72rem .85rem; border: 1px solid var(--line); border-radius: 5px 13px 13px 13px; background: white; }
.outgoing .bubble { color: #12362c; border-color: #c9ddd5; border-radius: 13px 5px 13px 13px; background: #e4f0eb; }
.bubble > span { color: var(--muted); font-size: .55rem; font-weight: 800; letter-spacing: .06em; }
.bubble p { margin: .3rem 0; font-size: .76rem; line-height: 1.5; white-space: pre-wrap; }
.bubble time { color: var(--muted); font-size: .58rem; }
.message .suggestion { align-self: flex-start; }
.suggestion > div { display: flex; justify-content: space-between; gap: .8rem; color: #795015; font-size: .58rem; font-weight: 800; }
.suggestion > div small { font-weight: 500; text-transform: none; }
.suggestion footer { display: flex; gap: .4rem; margin-top: .55rem; }

.catalog-stats > b { font-size: 1.2rem; }
.catalog-card > div:first-child { display: flex; justify-content: space-between; gap: .5rem; grid-column: 1 / -1; }
.catalog-card > div:first-child > span { color: var(--green-2); font-size: .61rem; font-weight: 800; text-transform: uppercase; }
.catalog-card.off { opacity: .62; }
.catalog-card .switch i { position: absolute; inset: 0; border-radius: 99px; background: #ccd4d0; cursor: pointer; transition: .2s; }
.catalog-card .switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.catalog-card .switch input:checked + i { background: var(--green-2); }
.catalog-card .switch input:checked + i::after { transform: translateX(18px); }
.catalog-card footer { grid-column: 1 / -1; padding-top: .55rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .64rem; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid .checkbox-line { display: flex; grid-column: 1 / -1; align-items: center; gap: .55rem; }
.form-grid .checkbox-line input { width: 18px; height: 18px; }
.accessory-editor { margin: 0; padding: .75rem; border: 1px solid var(--line); border-radius: 9px; }
.accessory-editor legend { padding: 0 .3rem; color: #3e5049; font-size: .76rem; font-weight: 800; }
.accessory-checks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem .75rem; }
.accessory-checks label { display: flex; align-items: center; gap: .42rem; font-weight: 600; }
.accessory-checks input { width: 16px; height: 16px; margin: 0; }

@media (max-width: 1000px) {
  .spec-grid { grid-template-columns: repeat(3,1fr); }
  .catalog-grid { grid-template-columns: repeat(2,1fr); }
  .catalog-toolbar { align-items: stretch; flex-direction: column; }
  .catalog-actions { justify-content: flex-end; }
}
@media (max-width: 800px) {
  .topbar { position: relative; grid-template-columns: 1fr auto; gap: .65rem; padding: .75rem 1rem; }
  .main-nav { grid-row: 2; grid-column: 1 / -1; justify-content: center; }
  .top-actions .demo-badge { display: none; }
  .app-layout { display: block; }
  .inbox { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .orders-list { max-height: 390px; }
  .orders-page .filters, .orders-page .orders-list { grid-template-columns: 1fr; }
  .orders-page .orders-list { max-height: none; }
  .detail { padding: 1.25rem 1rem 3rem; }
  .summary-grid { grid-template-columns: 1fr; }
  .catalog-page { padding-top: 1.35rem; }
  .orders-page .orders-list { grid-template-columns: 1fr; }
  .page-heading { display: block; }
  .catalog-stats { margin-top: 1rem; }
  .detail-head, .head-actions { flex-wrap: wrap; }
  .completion-card { grid-template-columns: 66px 1fr; }
  .general-facts { grid-column: 1 / -1; }
}
@media (max-width: 580px) {
  .brand strong { font-size: .85rem; }
  .brand small { display: none; }
  .topbar .button-primary { padding: .55rem .7rem; font-size: .75rem; }
  .detail-header { display: block; }
  .status-control { margin-top: .85rem; }
  .spec-grid { grid-template-columns: repeat(2,1fr); }
  .order-facts { grid-template-columns: 1fr; }
  .pending-change { grid-template-columns: 1fr; }
  .catalog-toolbar { grid-template-columns: 1fr; }
  .catalog-filters { grid-template-columns: 1fr; width: 100%; }
  .catalog-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .catalog-filters { grid-template-columns: 1fr; }
  .catalog-actions { align-items: stretch; flex-direction: column; }
  .catalog-grid { grid-template-columns: 1fr; }
  .catalog-stats { display: grid; grid-template-columns: repeat(2,1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .accessory-checks { grid-template-columns: 1fr; }
  .message-bubble, .suggestion { max-width: 94%; }
  .head-actions { align-items: stretch; flex-direction: column; width: 100%; }
  .head-actions select { min-width: 0; }
  .completion-card { grid-template-columns: 58px 1fr; }
  .progress-ring { width: 54px; height: 54px; }
  .item-card dl { grid-template-columns: repeat(2,1fr); }
  .change { align-items: flex-start; flex-direction: column; }
  .bubble, .suggestion { max-width: 94%; }
}
