:root {
  --ink: #111;
  --muted: #6d6d68;
  --line: #deded8;
  --paper: #fff;
  --canvas: #f5f5f1;
  --soft: #ecece6;
  --green: #166534;
  --green-bg: #ecfdf3;
  --amber: #8a4b08;
  --amber-bg: #fff8e7;
  --red: #a21d1d;
  --red-bg: #fff0f0;
  --radius: 14px;
  --shadow: 0 14px 40px rgba(0, 0, 0, .055);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
small { color: var(--muted); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 42px); line-height: 1.05; letter-spacing: -.045em; }
h2 { margin-bottom: 6px; font-size: 22px; letter-spacing: -.025em; }
h3 { margin-bottom: 5px; }
p { color: var(--muted); }
code, .mono { font-family: "SFMono-Regular", Consolas, monospace; letter-spacing: .02em; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; z-index: 50; inset: 0 auto 0 0; display: flex; flex-direction: column;
  width: 244px; padding: 24px 16px 18px; color: #fff; background: #111;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 0 10px 26px; }
.brand strong { font-size: 17px; letter-spacing: .12em; }
.brand small { color: #92928d; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.brand-logo {
  display: block; height: auto; width: 168px; flex: 0 0 auto;
  padding: 8px 10px; background: #fff; border-radius: 8px;
}
.brand-logo.large { width: 240px; padding: 14px 18px; border-radius: 12px; }
.main-nav { display: flex; flex-direction: column; gap: 4px; }
.main-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px;
  color: #aaa; font-size: 13px; font-weight: 600; transition: .15s ease;
}
.main-nav a span { display: inline-grid; place-items: center; width: 22px; font-size: 18px; }
.main-nav a:hover, .main-nav a.active { color: #fff; background: #292927; }
.sidebar-rule { margin-top: auto; padding: 14px; border: 1px solid #363633; border-radius: 9px; }
.sidebar-rule strong { display: block; margin-bottom: 4px; color: #f2d483; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.sidebar-rule span { color: #d2d2cc; font-size: 12px; }
.user-panel { display: flex; align-items: center; gap: 9px; margin-top: 14px; padding: 14px 5px 0; border-top: 1px solid #2d2d2a; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #111; background: #eee; font-weight: 800; }
.user-panel > div { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.user-panel strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.user-panel small { color: #777; font-size: 9px; }
.user-panel form, .user-panel button { margin: 0; }
.user-panel button { border: 0; color: #888; background: none; cursor: pointer; }
.main-area { width: calc(100% - 244px); margin-left: 244px; }
.topbar {
  position: sticky; z-index: 30; top: 0; display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 36px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.93); backdrop-filter: blur(12px);
}
.connection-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.connection-status span { width: 7px; height: 7px; border-radius: 50%; background: #20a458; box-shadow: 0 0 0 4px #e1f6e9; }
.top-action { font-size: 12px; font-weight: 800; }
.menu-toggle { display: none; border: 0; background: none; font-size: 24px; }
.content { max-width: 1460px; margin: 0 auto; padding: 38px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header p { margin-bottom: 0; }
.eyebrow { margin-bottom: 9px; color: #777770; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 7px; font-weight: 750; font-size: 12px; cursor: pointer; transition: .15s;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(0,0,0,.08); }
.button:disabled { opacity: .35; transform: none; box-shadow: none; cursor: not-allowed; }
.button.primary { border-color: #111; color: #fff; background: #111; }
.button.dark { border-color: #333; color: #fff; background: #30302d; }
.button.secondary { color: #111; background: #fff; }
.button.danger { border-color: #b3261e; color: #fff; background: #b3261e; }
.button.ghost { border-color: transparent; color: #555; background: transparent; }
.button.wide { width: 100%; }
.button-row, .label-actions, .integration-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.alert { margin-bottom: 20px; padding: 13px 16px; border: 1px solid; border-radius: 9px; font-size: 13px; font-weight: 650; }
.alert.error { color: var(--red); border-color: #efb8b8; background: var(--red-bg); }
.alert.warning { color: var(--amber); border-color: #edd39c; background: var(--amber-bg); }
.alert.success { color: var(--green); border-color: #acd9bc; background: var(--green-bg); }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.panel-header h2, .panel-header p { margin-bottom: 0; }
.panel-header a { font-size: 12px; font-weight: 800; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-grid article { min-height: 132px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.stat-grid span, .stat-grid small { display: block; }
.stat-grid span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.stat-grid strong { display: block; margin: 8px 0 2px; font-size: 35px; letter-spacing: -.04em; }
.stat-grid .danger-stat { border-color: #e9b2b2; background: #fff7f7; }
.stat-grid .danger-stat strong { color: var(--red); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; }
.quick-guide { padding: 24px; color: #fff; background: #1a1a18; }
.quick-guide .eyebrow, .quick-guide p, .quick-guide small { color: #96968e; }
.quick-guide ol { display: flex; flex-direction: column; gap: 0; margin: 22px 0 0; padding: 0; list-style: none; }
.quick-guide li { position: relative; display: flex; gap: 13px; padding: 0 0 22px; }
.quick-guide li:not(:last-child)::after { position: absolute; top: 28px; bottom: 4px; left: 13px; width: 1px; background: #45453f; content: ""; }
.quick-guide li > span { z-index: 1; display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid #585850; border-radius: 50%; color: #ddd; background: #1a1a18; font-size: 10px; }
.quick-guide li div { display: flex; flex-direction: column; }
.quick-guide li strong { font-size: 12px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 15px; color: #777; background: #fafaf8; font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .09em; white-space: nowrap; }
td { padding: 14px 15px; border-top: 1px solid #ecece7; color: #555; font-size: 12px; vertical-align: top; }
td strong { color: #161616; }
td small { display: block; }
tr[data-href] { cursor: pointer; }
tbody tr:hover { background: #fafaf7; }
.center { text-align: center; }
.muted { color: var(--muted); }
.table-action { color: #111; font-weight: 800; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border: 1px solid #ddd; border-radius: 99px; font-size: 8px; font-weight: 850; letter-spacing: .05em; }
.badge.large { min-height: 30px; padding: 0 12px; font-size: 10px; }
.badge.registered, .badge.labels_generated { color: var(--green); border-color: #b8dec5; background: var(--green-bg); }
.badge.corrected { color: var(--amber); border-color: #ead19d; background: var(--amber-bg); }
.badge.cancelled { color: var(--red); border-color: #efbcbc; background: var(--red-bg); }
.badge.neutral { color: #555; background: #f3f3ef; }
.badge.planned { color: #555; border-color: #ddd; background: #f3f3ef; }
.badge.prepared, .badge.shipped { color: var(--amber); border-color: #ead19d; background: var(--amber-bg); }
.badge.delivered { color: var(--green); border-color: #b8dec5; background: var(--green-bg); }
.badge.complaint { color: var(--red); border-color: #efbcbc; background: var(--red-bg); }
.sync-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #aaa; }
.sync-dot.synced { background: #1a9b52; }
.sync-dot.pending { background: #d2921e; }
.sync-dot.error { background: #c62b2b; }

.filter-bar { display: grid; grid-template-columns: 1.3fr 1.2fr 1fr 1fr 1.2fr auto; gap: 10px; align-items: end; margin-bottom: 16px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.filter-bar.compact { grid-template-columns: minmax(200px, 340px) auto; justify-content: start; }
label { display: flex; flex-direction: column; gap: 6px; color: #4f4f4a; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .055em; }
input, textarea, select {
  width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #d9d9d2; border-radius: 6px;
  color: #181818; outline: none; background: #fff; font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0;
}
textarea { min-height: 78px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #555; box-shadow: 0 0 0 3px #ededeb; }
label > small { font-weight: 500; text-transform: none; letter-spacing: 0; }
.checkbox { flex-direction: row; align-items: flex-start; gap: 9px; font-weight: 600; line-height: 1.45; text-transform: none; letter-spacing: 0; }
.checkbox input, .inline-check input { width: auto; min-height: 0; margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid .span-2 { grid-column: span 2; }
.form-panel { padding: 24px; }
.form-panel form { display: flex; flex-direction: column; gap: 13px; margin-top: 20px; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; }
.grow { flex: 1; }

.breadcrumb { display: flex; gap: 9px; margin-bottom: 18px; color: var(--muted); font-size: 11px; }
.breadcrumb a { color: #111; font-weight: 800; }
.registry-lock { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; padding: 16px 19px; border: 1px solid #a8d7b8; border-radius: 11px; background: var(--green-bg); }
.registry-lock > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; background: var(--green); font-weight: 900; }
.registry-lock p, .registry-lock strong { margin: 0; color: var(--green); }
.registry-lock p { opacity: .8; font-size: 12px; }
.registry-lock.blocked-lock { border-color: #e4b1b1; background: var(--red-bg); }
.registry-lock.blocked-lock > span { background: var(--red); }
.registry-lock.blocked-lock p, .registry-lock.blocked-lock strong { color: var(--red); }
.manual-status-form { display: flex; align-items: end; gap: 10px; max-width: 520px; margin: -12px 0 20px; }
.manual-status-form label { flex: 1; }
.disabled-panel { opacity: .7; }
.reprint-banner { display: flex; flex-direction: column; margin-bottom: 18px; padding: 16px 18px; border-left: 4px solid #d58b12; background: var(--amber-bg); color: var(--amber); }
.reprint-banner span { font-size: 12px; }
.pallet-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.pallet-summary { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.pallet-summary.stale-card { border: 2px solid #d3962e; }
.pallet-summary > header { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.pallet-summary > header > div { display: flex; align-items: center; gap: 10px; }
.pallet-number { display: grid; place-items: center; width: 45px; height: 34px; border-radius: 5px; color: #fff; background: #151515; font-weight: 900; }
.sscc-block { display: flex; flex-direction: column; gap: 4px; padding: 17px 18px; background: #f6f6f2; }
.sscc-block small { font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.sscc-block strong { font-family: Consolas, monospace; font-size: 17px; letter-spacing: .07em; }
.pallet-summary ul { margin: 0; padding: 0 18px; list-style: none; }
.pallet-summary li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid #eee; font-size: 11px; }
.pallet-summary li div { display: flex; min-width: 0; flex-direction: column; }
.pallet-summary li strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pallet-summary li > span { white-space: nowrap; }
.pallet-summary > footer { display: flex; gap: 16px; padding: 13px 18px; color: var(--muted); font-size: 10px; }
.pallet-summary > footer strong { margin-left: auto; color: var(--amber); }
.action-panel { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin: 20px 0; padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.action-panel h2, .action-panel p { margin-bottom: 0; }
.label-actions form { display: flex; align-items: center; gap: 7px; }
.inline-check { display: flex; flex-direction: row; align-items: center; gap: 4px; font-size: 9px; font-weight: 650; text-transform: none; letter-spacing: 0; }
.file-list { display: flex; flex-direction: column; }
.file-list > a { display: flex; align-items: center; gap: 13px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.file-list > a:last-child { border: 0; }
.file-list a > div { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.file-list a > div strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list a > b { font-size: 9px; }
.file-list .obsolete { opacity: .48; }
.file-list .obsolete > b { color: var(--red); }
.file-icon { display: grid; place-items: center; width: 38px; height: 45px; border-radius: 4px; color: #fff; background: #1c1c1b; font-size: 9px; font-weight: 900; }
.admin-details { margin: 20px 0; padding: 18px 22px; }
.admin-details summary { font-weight: 800; cursor: pointer; }
.admin-details form { margin-top: 18px; }
.danger-details { border-color: #e4b8b8; }
.danger-details summary { color: var(--red); }
.danger-details form { display: flex; align-items: end; gap: 10px; }
.danger-details form label { flex: 1; }
.empty-inline { padding: 35px; color: var(--muted); text-align: center; }
.correction-grid { grid-template-columns: 1fr; }
.correction-items { padding: 6px 18px 16px; }
.correction-items > div { display: grid; grid-template-columns: 1fr 140px 140px 140px; gap: 12px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--line); }
.correction-items > div > label:first-child span { display: flex; flex-direction: column; color: #111; font-size: 12px; text-transform: none; letter-spacing: 0; }

.assistant-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.assistant-chat { position: sticky; top: 88px; padding: 22px; border-radius: var(--radius); color: #fff; background: #171715; }
.assistant-avatar { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #555; border-radius: 50%; font-size: 10px; font-weight: 900; }
.chat-bubble { position: relative; margin: 15px 0 24px; padding: 16px; border-radius: 3px 12px 12px 12px; background: #2a2a27; }
.chat-bubble strong { font-size: 12px; }
.chat-bubble p { margin: 7px 0 0; color: #aaa; font-size: 11px; }
.import-report-form { display: flex; flex-direction: column; gap: 10px; margin: -8px 0 22px; padding: 14px; border: 1px solid #3e3e39; border-radius: 8px; background: #22221f; }
.import-report-form > strong { color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.import-report-form label { color: #bdbdb5; font-size: 8px; }
.import-report-form input { min-height: 36px; border-color: #4a4a44; color: #fff; background: #151513; font-size: 11px; }
.import-report-form small { color: #99998f; font-size: 9px; line-height: 1.45; }
.import-report-form .button.secondary { min-height: 36px; color: #111; border-color: #f4f4ef; background: #f4f4ef; }
.process-rail > div { display: flex; gap: 10px; min-height: 56px; opacity: .45; }
.process-rail > div.active { opacity: 1; }
.process-rail > div > span { display: grid; place-items: center; flex: 0 0 25px; height: 25px; border: 1px solid #777; border-radius: 50%; font-size: 9px; }
.process-rail p { display: flex; flex-direction: column; margin: 2px 0 0; }
.process-rail strong { color: #fff; font-size: 11px; }
.process-rail small { font-size: 9px; }
.rule-note { margin-top: 15px; padding: 14px; border: 1px solid #4b4328; border-radius: 8px; background: #272417; }
.rule-note strong { color: #edd584; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.rule-note p { margin: 5px 0 0; color: #aaa077; font-size: 10px; }
.shipment-form { display: flex; flex-direction: column; gap: 14px; }
.form-section, .bulk-entry, .validation-panel, .submit-bar { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.form-section > header { display: flex; align-items: center; gap: 12px; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.form-section > header > span { color: #aaa; font-family: Consolas, monospace; font-size: 11px; }
.form-section > header div { flex: 1; }
.form-section > header h2, .form-section > header p { margin: 0; }
.form-section > header p { font-size: 11px; }
.form-section > .form-grid { padding: 22px; }
.bulk-entry { padding: 20px; border-style: dashed; background: #f8f8f4; }
.bulk-entry > div { display: flex; gap: 12px; }
.bulk-entry h3, .bulk-entry p { margin: 0; }
.bulk-entry p { font-size: 11px; }
.bulk-entry textarea { margin: 14px 0 10px; min-height: 105px; background: #fff; }
.spark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; color: #fff; background: #111; }
.pallet-editors { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.pallet-editor { overflow: hidden; border: 1px solid #d7d7d0; border-radius: 10px; background: #fcfcfa; }
.pallet-editor > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; color: #fff; background: #252522; }
.pallet-editor > header > div { display: flex; align-items: center; gap: 9px; }
.pallet-editor > header strong { font-size: 12px; }
.pallet-editor > header select { width: auto; min-height: 32px; border-color: #555; color: #fff; background: #333; font-size: 10px; }
.pallet-editor .remove { border: 0; color: #aaa; background: none; cursor: pointer; }
.pallet-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; padding: 14px; border-bottom: 1px solid var(--line); }
.product-items { padding: 0 14px 14px; }
.product-item { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-items: end; padding: 14px 0; border-bottom: 1px solid var(--line); }
.product-item .field-manufacturer, .product-item .field-name { grid-column: span 2; }
.product-item:last-child { border: 0; }
.product-item label { font-size: 8px; }
.product-item input { min-width: 0; }
.product-item .partial-carton span { display: flex; align-items: center; gap: 6px; min-height: 16px; color: #333; font-size: 10px; text-transform: none; letter-spacing: 0; }
.product-item .partial-carton input[type="checkbox"] { width: auto; min-height: 0; margin: 0; }
.product-item .remove { width: 32px; height: 38px; border: 0; border-radius: 5px; color: var(--red); background: var(--red-bg); cursor: pointer; }
.add-product { margin: 0 14px 14px; min-height: 34px; }
.validation-panel { overflow: hidden; }
.validation-empty { display: flex; align-items: center; gap: 14px; padding: 21px; }
.validation-empty > span { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid #bbb; border-radius: 50%; }
.validation-empty p, .validation-empty strong { margin: 0; }
.validation-results header { padding: 18px 20px; color: var(--green); background: var(--green-bg); }
.validation-results.has-errors header { color: var(--red); background: var(--red-bg); }
.validation-results ul { margin: 0; padding: 10px 20px 18px; list-style: none; }
.validation-results li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.validation-results li.error { color: var(--red); }
.validation-results li.warning { color: var(--amber); }
.planned-sscc { margin-top: 10px; color: #365b40; font-size: 10px; line-height: 1.5; }
.planned-sscc strong { display: block; color: #214c2c; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.submit-bar { position: sticky; z-index: 10; bottom: 12px; display: flex; align-items: center; gap: 10px; padding: 14px 16px; box-shadow: 0 14px 50px rgba(0,0,0,.14); }
.submit-bar > div { display: flex; flex: 1; align-items: center; gap: 9px; }
.submit-bar p { display: flex; flex-direction: column; margin: 0; }
.submit-bar p strong { color: #111; font-size: 11px; }
.submit-bar p small { font-size: 9px; }
.lock-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #eee; }
.draft-indicator { color: var(--muted); font-size: 10px; font-weight: 700; }
.draft-indicator i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #25a45d; }

.settings-nav { position: sticky; z-index: 20; top: 64px; display: flex; gap: 3px; overflow: auto; margin: -10px 0 25px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.95); }
.settings-nav a { padding: 8px 12px; border-radius: 5px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.settings-nav a:hover { background: #eee; }
.settings-section { display: grid; grid-template-columns: 245px minmax(0, 760px); gap: 22px; margin-bottom: 38px; scroll-margin-top: 130px; }
.settings-section > header { padding-top: 15px; }
.settings-section > .panel.form-grid, .settings-section > form.panel { padding: 22px; }
.settings-section .split-layout, .settings-section > .integration-actions, .settings-section > form.hidden { grid-column: 2; }
.info-box { padding: 13px 15px; border-left: 3px solid #333; color: #555; background: #f1f1ed; font-size: 11px; }
.integration-actions { margin-top: -10px; padding: 16px; }
.google-setup { grid-column: 2; display: flex; flex-direction: column; gap: 14px; }
.google-recommended { position: relative; padding: 24px; border-color: #b7d9c2; background: #fbfffc; }
.recommended-badge { display: inline-flex; margin-bottom: 12px; padding: 5px 8px; border-radius: 99px; color: var(--green); background: var(--green-bg); font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.google-recommended > p { max-width: 650px; }
.setup-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; padding: 0; list-style: none; }
.setup-list li { display: flex; gap: 10px; padding: 12px; border: 1px solid #e1e9e2; border-radius: 8px; background: #fff; }
.setup-list li > span { display: grid; place-items: center; flex: 0 0 26px; height: 26px; border-radius: 50%; color: #fff; background: #111; font-size: 9px; font-weight: 900; }
.setup-list li div { display: flex; flex-direction: column; }
.setup-list li strong { font-size: 11px; }
.setup-list li small { font-size: 9px; }
.google-config-form { padding: 22px; }
.secret-input { display: flex; gap: 8px; }
.secret-input input { flex: 1; font-family: Consolas, monospace; }
.secret-input .button { flex: 0 0 auto; }
.connector-status { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #f7f7f4; font-size: 11px; text-transform: none; letter-spacing: 0; }
.connector-status i { width: 8px; height: 8px; border-radius: 50%; background: #aaa; }
.connector-status.connected { color: var(--green); border-color: #b7d9c2; background: var(--green-bg); }
.connector-status.connected i { background: #1a9b52; }
.google-actions { margin-top: 0; }
.oauth-advanced { padding: 18px 22px; }
.oauth-advanced summary { font-weight: 800; cursor: pointer; }
.oauth-advanced > form { margin-top: 20px; }
.oauth-advanced .integration-actions { margin: 12px 0 0; padding: 0; }
.hidden { display: none !important; }
.rules-editor { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.rules-editor label { flex-direction: row; align-items: center; }
.rules-editor label span { display: grid; place-items: center; flex: 0 0 27px; height: 27px; border-radius: 50%; color: #fff; background: #222; font-size: 9px; }
.update-panel { grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 21px; }
.update-panel p { margin: 3px 0 0; }
.inline-user-form { display: flex; align-items: center; gap: 7px; }
.inline-user-form select { min-width: 125px; min-height: 34px; padding: 5px 7px; font-size: 10px; }

.guest-body, .installer-body { min-height: 100vh; background: #f1f1ed; }
.login-shell { display: grid; grid-template-columns: 1.1fr .9fr; min-height: 100vh; }
.login-brand { display: flex; flex-direction: column; justify-content: center; padding: clamp(45px, 9vw, 130px); color: #fff; background: #151513; }
.login-brand .brand-logo { margin-bottom: 65px; }
.login-brand h1 { max-width: 680px; font-size: clamp(44px, 6.5vw, 86px); }
.login-brand > p:not(.eyebrow) { max-width: 560px; color: #92928b; font-size: 16px; }
.login-rule { display: grid; grid-template-columns: 32px 1fr 32px 1fr; gap: 12px; align-items: center; margin-top: 45px; padding-top: 22px; border-top: 1px solid #383834; }
.login-rule span { display: grid; place-items: center; height: 32px; border: 1px solid #555; border-radius: 50%; font-size: 9px; }
.login-rule strong { font-size: 12px; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(38px, 8vw, 120px); background: #fff; }
.login-card h2 { font-size: 34px; }
.login-card form { display: flex; flex-direction: column; gap: 17px; margin: 30px 0 22px; }
.privacy-note { line-height: 1.6; }

.installer-shell { max-width: 920px; margin: 0 auto; padding: 42px 20px 80px; }
.installer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.installer-brand .brand-logo { width: 168px; }
.installer-brand > div { display: flex; flex-direction: column; }
.installer-brand strong { letter-spacing: .07em; }
.installer-card { padding: clamp(24px, 5vw, 48px); border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.installer-card .lead { max-width: 620px; }
.install-steps { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 18px; }
.install-step { position: relative; display: flex; align-items: center; flex-direction: column; gap: 7px; color: #aaa; }
.install-step::before { position: absolute; z-index: -1; top: 14px; left: -50%; width: 100%; height: 1px; background: #d5d5cf; content: ""; }
.install-step:first-child::before { display: none; }
.install-step span { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid #ccc; border-radius: 50%; background: #f1f1ed; font-size: 10px; font-weight: 900; }
.install-step small { font-size: 8px; font-weight: 800; text-transform: uppercase; }
.install-step.active, .install-step.done { color: #111; }
.install-step.active span, .install-step.done span { border-color: #111; color: #fff; background: #111; }
.requirement-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 24px 0; }
.requirement { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; }
.requirement > div { display: flex; flex-direction: column; }
.requirement strong { font-size: 11px; }
.requirement small { font-size: 10px; }
.check { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 900; }
.check.ok { background: var(--green); }
.check.bad { background: var(--red); }
.check.warn { color: #111; background: #e5b53a; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0; }
.radio-card { flex-direction: row; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 8px; text-transform: none; letter-spacing: 0; cursor: pointer; }
.radio-card input { width: auto; min-height: 0; }
.radio-card span { display: flex; flex-direction: column; }
.summary-list { margin: 23px 0; border-top: 1px solid var(--line); }
.summary-list > div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.summary-list span { color: var(--muted); }
.status-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 20px; border-radius: 50%; color: #fff; background: var(--green); font-size: 22px; }
.empty-state { max-width: 600px; margin: 10vh auto; padding: 50px; text-align: center; }
.empty-state > strong { display: block; font-size: 80px; letter-spacing: -.08em; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .split-layout { grid-template-columns: 1fr; }
  .assistant-layout { grid-template-columns: 250px minmax(0,1fr); }
  .product-item { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .settings-section { grid-template-columns: 190px minmax(0,1fr); }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: none; }
  .main-area { width: 100%; margin-left: 0; }
  .menu-toggle { display: block; }
  .topbar { padding: 0 18px; }
  .content { padding: 24px 17px; }
  .page-header, .action-panel { align-items: stretch; flex-direction: column; }
  .manual-status-form { align-items: stretch; flex-direction: column; max-width: none; }
  .assistant-layout { grid-template-columns: 1fr; }
  .assistant-chat { position: static; }
  .process-rail { display: none; }
  .pallet-summary-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .settings-section { display: block; }
  .google-setup { display: flex; }
  .settings-section > header { margin-bottom: 12px; }
  .settings-section .split-layout { display: grid; }
  .settings-nav { top: 64px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 42vh; padding: 45px 32px; }
  .login-brand .brand-logo { margin-bottom: 30px; }
  .login-card { padding: 45px 32px; }
}
@media (max-width: 560px) {
  .stat-grid, .form-grid, .requirement-list, .radio-cards { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .top-action { display: none; }
  .filter-bar { grid-template-columns: 1fr; }
  .pallet-meta { grid-template-columns: 1fr; }
  .product-item { grid-template-columns: 1fr 1fr; }
  .product-item .field-manufacturer, .product-item .field-name { grid-column: span 2; }
  .submit-bar { align-items: stretch; flex-direction: column; position: static; }
  .correction-items > div { grid-template-columns: 1fr 1fr; }
  .correction-items > div > label:first-child { grid-column: span 2; }
  .install-steps small { display: none; }
  .setup-list { grid-template-columns: 1fr; }
  .secret-input { flex-direction: column; }
  .installer-card { padding: 23px; }
}

@media print {
  .sidebar, .topbar, .page-header .button, .filter-bar, .settings-nav { display: none !important; }
  .main-area { width: 100%; margin: 0; }
  .content { max-width: none; padding: 0; }
  .panel, .pallet-summary { break-inside: avoid; box-shadow: none; }
}
