:root {
  --ink: #17231f;
  --muted: #64726c;
  --line: #dbe3df;
  --paper: #f5f7f4;
  --white: #fff;
  --green: #1f6f5c;
  --green-dark: #173f35;
  --green-soft: #e4f1ec;
  --sand: #e7cfa1;
  --warning: #a86412;
  --danger: #a73c3c;
  --shadow: 0 12px 35px rgba(25, 55, 46, .09);
  --radius: 18px;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Segoe UI", Arial, sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 15%, #315d50 0, var(--green-dark) 45%, #0e2922 100%); }
.auth-card { width: min(470px, 96vw); padding: 32px; border-radius: 20px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-brand strong, .auth-brand span { display: block; }
.auth-brand span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.auth-form { display: grid; gap: 15px; }
.auth-form h1 { margin: 2px 0 0; font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.auth-form > p { margin: -6px 0 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.auth-form .button { margin-top: 4px; }
.auth-status { min-height: 18px; margin: 14px 0 0; color: var(--danger); font-size: 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 255px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 26px 18px 20px; color: #eaf4f0; background: var(--green-dark); z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 27px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--sand); color: var(--green-dark); font-weight: 800; letter-spacing: .04em; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 15px; }
.brand span { margin-top: 3px; color: #a9c1b8; font-size: 12px; }
.nav { display: grid; gap: 5px; margin-top: 24px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 13px; border: 0; border-radius: 11px; color: #c7d9d2; background: transparent; cursor: pointer; text-align: left; transition: .18s ease; }
.nav-item > span { width: 21px; color: #8eb0a4; font-size: 17px; text-align: center; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-item.active > span { color: var(--sand); }
.badge { margin-left: auto; min-width: 21px; height: 21px; display: grid; place-items: center; border-radius: 20px; background: #d89c42; color: #173f35; font-size: 11px; }
.local-note { margin-top: auto; display: flex; gap: 10px; padding: 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.05); }
.local-note i, .server-status i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #79d29c; box-shadow: 0 0 0 4px rgba(121,210,156,.12); }
.local-note i { margin-top: 5px; }
.local-note strong, .local-note span { display: block; }
.local-note strong { font-size: 12px; }
.local-note span { margin-top: 4px; color: #9fb7ae; font-size: 11px; line-height: 1.35; }

.main { min-width: 0; }
.topbar { height: 91px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 38px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.8); backdrop-filter: blur(12px); }
.topbar p { margin: 0 0 2px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.server-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.current-user-name { max-width: 150px; overflow: hidden; color: var(--green-dark); font-size: 11px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 22px; }

.page { display: none; padding: 34px 38px 55px; max-width: 1500px; margin: 0 auto; }
.page.active { display: block; animation: page-in .22s ease; }
@keyframes page-in { from { opacity: 0; transform: translateY(3px); } }
.hero { min-height: 225px; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 35px 38px; border-radius: 22px; color: #fff; background: linear-gradient(110deg, #173f35 0%, #235f50 58%, #356f60 100%); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.hero::after { content: ""; position: absolute; width: 360px; height: 360px; right: -80px; top: -170px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018); }
.hero > * { position: relative; z-index: 1; }
.hero-kicker, .label { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.hero-kicker { color: var(--sand); }
.hero h2 { margin: 12px 0 10px; font-family: Georgia, serif; font-size: clamp(31px, 4vw, 46px); font-weight: 400; line-height: 1.02; }
.hero p { max-width: 575px; margin: 0; color: #c8d9d3; line-height: 1.55; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-weight: 650; text-decoration: none; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--green); box-shadow: 0 8px 22px rgba(31,111,92,.18); }
.button.primary:hover { background: #175947; }
.button.secondary { color: var(--green-dark); border-color: var(--line); background: #fff; }
.button.light { color: var(--green-dark); background: var(--sand); white-space: nowrap; }
.button.compact { min-height: 38px; padding: 0 14px; font-size: 13px; }
.button.danger { color: #fff; background: #a44b4b; }
.button.danger:hover { background: #873b3b; }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.link-button { padding: 0; border: 0; color: var(--green); background: transparent; cursor: pointer; font-weight: 650; }

.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin: 20px 0; }
.network-access { margin-top: 16px; padding: 14px 18px; border: 1px solid #c8ded5; border-radius: 14px; background: #edf7f3; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.network-access div { display: grid; gap: 3px; }
.network-access span { color: var(--muted); font-size: 13px; }
.network-access a { color: var(--green); font-weight: 800; text-decoration: none; white-space: nowrap; }
.stat-card { min-width: 0; padding: 19px 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.stat-card span { display: block; color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; margin: 8px 0 3px; font-family: Georgia, serif; font-size: 29px; font-weight: 500; }
.stat-card small { color: #8a9691; font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, .85fr); gap: 20px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 4px 16px rgba(35,60,52,.035); }
.panel-head { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel h3 { margin: 5px 0 0; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.import-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 14px 22px; border-bottom: 1px solid #edf1ef; }
.import-row:last-child { border-bottom: 0; }
.file-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 800; }
.import-row strong, .import-row span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-row strong { font-size: 13px; }
.import-row span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.status-pill { padding: 5px 9px; border-radius: 20px; color: #2c725e; background: #e5f4ee; font-size: 10px; font-weight: 700; }
.status-pill.warning { color: var(--warning); background: #fff1d8; }
.category-list { padding: 10px 22px 16px; }
.category-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding: 11px 0; border-bottom: 1px solid #edf1ef; font-size: 13px; }
.category-item:last-child { border: 0; }
.category-item b { color: var(--green); }

.section-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 23px; }
.section-intro h2 { margin: 8px 0 6px; font-family: Georgia, serif; font-size: 34px; font-weight: 500; }
.section-intro p { margin: 0; color: var(--muted); }
.section-intro.split { align-items: center; }
.import-panel { padding: 24px; margin-bottom: 20px; }
.drop-zone { min-height: 230px; display: grid; place-items: center; align-content: center; gap: 9px; border: 1.5px dashed #9fb7ae; border-radius: 15px; color: var(--muted); background: #f8fbf9; cursor: pointer; text-align: center; transition: .18s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--green); background: var(--green-soft); }
.drop-zone input { display: none; }
.drop-zone strong { color: var(--ink); }
.drop-zone small { font-size: 12px; }
.upload-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; color: var(--green); background: var(--green-soft); font-size: 27px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }
label > span { display: block; margin-bottom: 8px; color: #4f5e58; font-size: 12px; font-weight: 700; }
label em { color: #929e99; font-style: normal; font-weight: 400; }
input { width: 100%; height: 45px; padding: 0 13px; border: 1px solid #cad5d0; border-radius: 10px; outline: 0; color: var(--ink); background: #fff; }
textarea { width: 100%; min-height: 95px; padding: 11px 13px; border: 1px solid #cad5d0; border-radius: 10px; outline: 0; color: var(--ink); background: #fff; font: inherit; resize: vertical; }
input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,111,92,.1); }
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.password-eye { position: absolute; right: 5px; top: 50%; width: 38px; height: 35px; padding: 0; border: 0; border-radius: 8px; color: #718079; background: transparent; cursor: pointer; font-size: 17px; line-height: 1; transform: translateY(-50%); filter: grayscale(1); opacity: .7; }
.password-eye:hover, .password-eye.visible { color: var(--green); background: var(--green-soft); opacity: 1; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.5; }
.steps { display: grid; grid-template-columns: repeat(4,1fr); padding: 23px; }
.steps > div { position: relative; display: grid; grid-template-columns: 34px minmax(0,1fr); column-gap: 11px; padding: 0 18px; border-right: 1px solid var(--line); }
.steps > div:first-child { padding-left: 0; }
.steps > div:last-child { padding-right: 0; border-right: 0; }
.steps b { grid-row: span 2; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: var(--green-soft); }
.steps strong { font-size: 13px; }
.steps span { margin-top: 4px; color: var(--muted); font-size: 11px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.search { position: relative; flex: 1; }
.search span { position: absolute; left: 14px; top: 50%; transform: translateY(-52%); color: #82908a; font-size: 20px; }
.search input { padding-left: 42px; }
.suggestion-list { position: absolute; left: 0; right: 0; top: calc(100% + 5px); max-height: 360px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 14px 35px rgba(20,48,39,.16); z-index: 35; }
.suggestion-item { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; color: var(--ink); background: transparent; cursor: pointer; text-align: left; }
.suggestion-item:hover, .suggestion-item.active { background: var(--green-soft); }
.suggestion-item strong, .suggestion-item span, .suggestion-item small { display: block; }
.suggestion-item strong { font-size: 13px; }
.suggestion-item span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.suggestion-item small { margin-top: 4px; color: #7c5c24; font-size: 10px; }
.table-panel { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 12px 15px; color: #62716b; background: #f3f6f4; font-size: 10px; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 13px 15px; border-top: 1px solid #e8eeeb; vertical-align: top; }
.data-table tr:hover td { background: #fafcfb; }
.money { color: var(--green-dark); font-weight: 750; white-space: nowrap; }
.subtext { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.product-comment { display: block; width: fit-content; max-width: 420px; margin-top: 6px; padding: 4px 7px; border-left: 2px solid var(--sand); border-radius: 0 5px 5px 0; color: #705925 !important; background: #fff8e8; font-size: 10px !important; line-height: 1.35; white-space: pre-wrap; }
.manufacturer-name { display: block; color: #0b1511; font-family: Arial, sans-serif; font-size: 11px; font-weight: 700; line-height: 1.25; white-space: nowrap; }
.product-comment-cell { min-width: 220px; }
.product-comment-cell .product-comment { margin-top: 0; }
.list-state { color: var(--muted); }
.empty-state { padding: 54px 24px; color: var(--muted); text-align: center; }

.manufacturer-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.manual-manufacturer-form { display: grid; gap: 16px; margin-bottom: 18px; padding: 24px; }
.manual-manufacturer-form .form-grid { margin-top: 0; }
.manual-manufacturer-form > label { display: block; }
.manufacturer-card { display: flex; flex-direction: column; min-height: 245px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 4px 15px rgba(25,55,46,.035); cursor: pointer; transition: .18s ease; }
.manufacturer-card:hover { transform: translateY(-2px); border-color: #a8bdb4; box-shadow: var(--shadow); }
.manufacturer-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.factory-mark { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 12px; color: var(--green); background: var(--green-soft); font-weight: 800; }
.verify-mark { color: #38906f; font-size: 12px; }
.manufacturer-card h3 { margin: 18px 0 8px; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.address { min-height: 42px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.manufacturer-metrics { display: flex; gap: 22px; margin-top: auto; padding-top: 18px; border-top: 1px solid #e8eeeb; }
.manufacturer-metrics strong, .manufacturer-metrics span { display: block; }
.manufacturer-metrics strong { font-size: 17px; }
.manufacturer-metrics span { margin-top: 3px; color: var(--muted); font-size: 10px; }

.compare-grid { display: grid; gap: 15px; }
.compare-card { border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; }
.compare-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 20px; background: #f8faf9; }
.compare-title h3 { margin: 0; font-family: Georgia, serif; font-size: 19px; }
.compare-title span { color: var(--muted); font-size: 11px; }
.compare-title > div:last-child { display: grid; justify-items: end; gap: 7px; text-align: right; }
.offer-row { display: grid; grid-template-columns: minmax(220px,1.3fr) minmax(220px,1fr) 130px 115px; gap: 14px; align-items: center; padding: 15px 20px; border-top: 1px solid #e8eeeb; }
.offer-row.best { border-left: 4px solid var(--green); background: #f7fbf9; }
.offer-row strong, .offer-row span { display: block; }
.offer-row span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.best-label { color: var(--green); font-size: 10px; font-weight: 800; text-transform: uppercase; }

.price-rule { margin-bottom: 16px; padding: 14px 18px; border: 1px solid #c7ddd4; border-radius: 12px; color: var(--green-dark); background: var(--green-soft); font-size: 13px; }
.selection-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.selection-bar > div { display: flex; flex-wrap: wrap; gap: 7px; }
.selection-bar strong { color: var(--green-dark); font-size: 13px; }
.row-select { width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; }
.select-column { width: 68px; }
.review-list { display: grid; gap: 12px; }
.review-card { display: grid; grid-template-columns: minmax(260px,1fr) minmax(280px,.7fr) 170px; gap: 18px; align-items: center; padding: 18px 20px; border: 1px solid #ecd7b8; border-radius: 14px; background: #fffdf8; }
.review-card h3 { margin: 0 0 6px; font-size: 14px; }
.review-card p { margin: 0; color: var(--muted); font-size: 11px; }
.review-description { min-width: 0; overflow-wrap: anywhere; }
.confidence { color: var(--warning); font-weight: 700; }
.review-price-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.review-price-form label { min-width: 0; }
.review-price-form input { height: 38px; }
.review-actions { display: grid; gap: 7px; }
.settings-panel { max-width: 780px; padding: 24px; }
.settings-panel > label { display: block; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(13,31,25,.25); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; width: min(680px, 94vw); height: 100vh; padding: 34px; background: #fff; box-shadow: -20px 0 50px rgba(18,39,32,.16); z-index: 50; transform: translateX(105%); transition: .25s ease; overflow: auto; }
.drawer.open { transform: translateX(0); }
.drawer-close { position: absolute; right: 22px; top: 18px; width: 36px; height: 36px; border: 0; border-radius: 9px; background: #edf2ef; cursor: pointer; font-size: 23px; }
.drawer h2 { margin: 8px 45px 8px 0; font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.drawer-meta { display: grid; gap: 9px; margin: 22px 0; padding: 18px; border-radius: 13px; background: #f5f8f6; }
.drawer-meta span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.drawer-meta a { color: var(--green); font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.manufacturer-warning { display: block; white-space: normal; line-height: 1.4; }
.company-edit-form { display: grid; gap: 13px; margin: -8px 0 20px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.compact-grid { margin-top: 0; gap: 10px; }
.inline-actions { display: flex; justify-content: flex-end; gap: 8px; }
.manufacturer-comment { margin: 18px 0; padding: 15px 17px; border-left: 3px solid var(--sand); border-radius: 0 10px 10px 0; background: #fffaf0; }
.manufacturer-comment p { margin: 7px 0 0; color: #5a655f; font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
.drawer-category { margin-top: 22px; }
.drawer-category h3 { font-size: 15px; }
.drawer-category-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.manual-product-form { display: grid; gap: 11px; margin: 12px 0 16px; padding: 16px; border: 1px solid #c7ddd4; border-radius: 12px; background: var(--green-soft); }
.manual-product-form .form-grid { margin-top: 0; gap: 10px; }
.manual-product-form input { height: 40px; }
.manual-product-form textarea { min-height: 70px; }
.manual-badge { display: inline-block; margin-top: 5px; padding: 3px 6px; border-radius: 5px; color: var(--green-dark) !important; background: var(--green-soft); font-size: 9px !important; font-weight: 750; }
.drawer-products { max-height: 450px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.drawer-product { display: grid; grid-template-columns: minmax(0,1fr) 190px; gap: 14px; padding: 12px 14px; border-bottom: 1px solid #e8eeeb; font-size: 12px; }
.drawer-product:last-child { border: 0; }
.drawer-product span { color: var(--muted); }
.drawer-product-price { text-align: right; }
.drawer-product-price .link-button { display: block; margin: 5px 0 0 auto; font-size: 10px; }
.inline-price-editor { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; padding: 12px; border-radius: 10px; background: var(--green-soft); }
.inline-price-editor input { height: 38px; }
.history-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 22px; background: rgba(13,31,25,.4); }
#history-modal { z-index: 90; }
.history-card { position: relative; width: min(900px, 96vw); max-height: 88vh; overflow: auto; padding: 28px; border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(13,31,25,.25); }
.history-card h2 { margin: 7px 45px 5px 0; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.history-summary { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0; }
.history-summary span { padding: 7px 10px; border-radius: 8px; color: var(--green-dark); background: var(--green-soft); font-size: 11px; font-weight: 700; }
.history-source { display: inline-block; padding: 3px 7px; border-radius: 6px; color: var(--green-dark); background: var(--green-soft); font-size: 9px; font-weight: 750; }
.history-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.history-actions .link-button { font-size: 10px; }
.product-link { padding: 0; border: 0; color: var(--ink); background: transparent; cursor: pointer; font: inherit; font-weight: 750; text-align: left; }
.product-link:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.product-card-modal { width: min(820px, 96vw); }
.product-card-form { display: grid; gap: 13px; margin-top: 20px; }
.product-card-form .form-grid { margin-top: 0; gap: 12px; }
.product-card-offers { margin-top: 22px; }
.product-card-offer { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 14px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); font-size: 12px; }
.product-card-offer span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.offer-select { display: flex; align-items: center; gap: 6px; min-width: 76px; padding: 7px 8px; border: 1px solid transparent; border-radius: 8px; opacity: .58; }
.offer-select.scope-active { border-color: var(--green); background: var(--green-soft); opacity: 1; }
.offer-select input { width: 16px; height: 16px; margin: 0; }
.offer-price-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 6px; }
.product-offer-editor { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
.product-offer-editor .inline-actions { grid-column: 1 / -1; }
.product-edit-scope { display: grid; gap: 8px; margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.product-edit-scope legend { padding: 0 7px; font-size: 12px; font-weight: 750; }
.product-edit-scope label { display: flex; align-items: flex-start; gap: 9px; }
.product-edit-scope input { width: 16px; height: 16px; margin-top: 2px; }
.product-edit-scope label span { font-size: 12px; }
.product-edit-scope small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.download-check-price { margin-top: 6px; }
.inline-download { display: inline-block; margin-left: 7px; color: var(--green); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.analytics-picker { display: grid; gap: 13px; padding: 20px; overflow: visible; }
.analytics-picker label > span { font-size: 13px; }
.analytics-picker-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.analytics-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.analytics-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 9px 7px 11px; border-radius: 9px; color: var(--green-dark); background: var(--green-soft); font-size: 11px; font-weight: 750; }
.analytics-chip button { width: 19px; height: 19px; padding: 0; border: 0; border-radius: 50%; color: var(--green-dark); background: rgba(31,111,92,.12); cursor: pointer; line-height: 17px; }
.analytics-stats { grid-template-columns: repeat(4, 1fr); }
.analytics-chart-grid, .analytics-bottom-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(360px,.65fr); gap: 16px; margin: 16px 0; }
.analytics-bottom-grid { grid-template-columns: 1fr 1fr; }
.analytics-panel { overflow: hidden; }
.analytics-note { margin: -8px 22px 5px; color: var(--muted); font-size: 11px; }
.chart-container { min-height: 330px; padding: 14px 20px 18px; }
.trend-svg { display: block; width: 100%; height: auto; overflow: visible; }
.trend-svg text { fill: var(--muted); font-size: 10px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 7px 15px; margin-top: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 50%; }
.bar-chart { display: grid; gap: 15px; min-height: 300px; align-content: start; padding: 22px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, .9fr) minmax(100px, 1fr) auto; gap: 10px; align-items: center; }
.bar-row strong, .bar-row span { display: block; }
.bar-row strong { font-size: 11px; }
.bar-row span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.bar-row b { color: var(--green-dark); font-size: 11px; white-space: nowrap; }
.bar-track { height: 10px; overflow: hidden; border-radius: 5px; background: #e9efec; }
.bar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #60a88f); }
.analytics-table-panel { margin-top: 16px; }
.analytics-best td { background: #f4faf7; }
.analytics-site { color: var(--green); font-weight: 700; }
.analytics-list { max-height: 430px; overflow: auto; }
.analytics-list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px; border-top: 1px solid var(--line); }
.analytics-list-row:first-child { border-top: 0; }
.analytics-list-row strong, .analytics-list-row span { display: block; }
.analytics-list-row strong { font-size: 12px; }
.analytics-list-row span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.analytics-list-row > b { font-size: 13px; white-space: nowrap; }
.change-up { color: var(--danger); }
.change-down { color: var(--green); }
.ai-analysis-panel { margin-top: 16px; padding: 24px; border-color: #b8d3c9; background: linear-gradient(135deg, #fff 0%, #f2faf6 100%); }
.ai-panel-head, .ai-panel-head > div { display: flex; align-items: center; gap: 13px; }
.ai-panel-head { justify-content: space-between; }
.ai-panel-head h3 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 21px; font-weight: 500; }
.ai-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(135deg, #4285f4, #9b72cb 55%, #d96570); font-size: 22px; font-weight: 800; }
.ai-analysis-panel > p { max-width: 850px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.ai-analysis-panel .status-pill.connected { color: var(--green-dark); background: var(--green-soft); }
.ai-result { margin: 18px 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ai-answer { color: #33413c; font-size: 13px; line-height: 1.65; }
.ai-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.ai-sources strong { width: 100%; font-size: 11px; }
.ai-sources a { padding: 5px 8px; border-radius: 6px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 750; }
.ai-loading { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.ai-loading i { width: 19px; height: 19px; border: 2px solid #c8d8d2; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.settings-separator { margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--line); }
.settings-separator h3 { margin: 5px 0 7px; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.settings-panel a { color: var(--green); font-weight: 750; }
.access-create-form, .access-users-panel, .access-audit-panel { margin-bottom: 18px; }
.access-form-body { display: grid; gap: 16px; padding: 22px; }
.access-form-body .form-grid { margin-top: 0; }
.permission-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.permission-grid label { display: flex; align-items: flex-start; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfb; cursor: pointer; }
.permission-grid input { flex: 0 0 auto; width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--green); }
.permission-grid span, .permission-grid strong, .permission-grid small { display: block; }
.permission-grid strong { font-size: 11px; }
.permission-grid small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
#users-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; padding: 18px; }
.access-user-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.access-user-head, .access-user-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.access-user-head strong, .access-user-head span { display: block; }
.access-user-head > div > strong { font-size: 14px; }
.access-user-head > div > span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.access-user-card > label { display: block; }
.access-user-card input { height: 39px; }
.compact-permissions { grid-template-columns: repeat(2, minmax(0,1fr)); }
.compact-permissions label { padding: 8px; }
.access-audit-panel { overflow: hidden; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 420px; padding: 14px 18px; border-radius: 11px; color: #fff; background: var(--green-dark); box-shadow: var(--shadow); z-index: 100; font-size: 13px; }
.toast.error { background: #8d3535; }
.hidden { display: none !important; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .manufacturer-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .offer-row { grid-template-columns: 1fr 1fr 110px; }
  .offer-row > :last-child { display: none; }
  .analytics-chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); width: 260px; transition: .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: block; }
  .topbar { height: 78px; padding: 0 18px; justify-content: flex-start; }
  .top-actions { margin-left: auto; }
  .server-status, .top-actions .button { display: none; }
  .page { padding: 24px 18px 42px; }
  .hero { align-items: flex-start; flex-direction: column; padding: 28px; }
  .network-access { align-items: flex-start; flex-direction: column; }
  .network-access a { white-space: normal; overflow-wrap: anywhere; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .manufacturer-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; gap: 20px; }
  .steps > div { border: 0; padding: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .offer-row { grid-template-columns: 1fr; }
  .offer-row > :nth-child(2), .offer-row > :last-child { display: none; }
  .review-card { grid-template-columns: 1fr; }
  .review-actions { grid-template-columns: repeat(3,1fr); }
  .analytics-stats { grid-template-columns: repeat(2, 1fr); }
  .analytics-bottom-grid { grid-template-columns: 1fr; }
  #users-list { grid-template-columns: 1fr; }
  .permission-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 15px; }
  .section-intro.split, .form-footer { align-items: stretch; flex-direction: column; }
  .toolbar { flex-direction: column; }
  .selection-bar { align-items: stretch; flex-direction: column; }
  .steps { grid-template-columns: 1fr; }
  .review-price-form, .review-actions { grid-template-columns: 1fr; }
  .review-card { padding: 16px; }
  .inline-price-editor { grid-template-columns: 1fr; }
  .product-card-offer { grid-template-columns: 1fr; }
  .offer-price-actions { align-items: flex-start; }
  .product-offer-editor, .product-offer-editor .inline-actions { grid-column: 1; }
  .analytics-picker-footer { align-items: flex-start; flex-direction: column; }
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .permission-grid { grid-template-columns: 1fr; }
  .access-user-footer { align-items: stretch; flex-direction: column; }
}
