:root {
  --green: #183d24;
  --green-2: #285a35;
  --gold: #dca52b;
  --cream: #f8f3e8;
  --paper: #fffdf8;
  --ink: #172019;
  --muted: #6c756e;
  --line: #dfe3dc;
  --danger: #a33b31;
  --shadow: 0 18px 60px rgba(21, 47, 29, .14);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 36px;
  min-height: 76px;
  padding: 10px clamp(18px, 5vw, 76px);
  border-bottom: 1px solid rgba(24, 61, 36, .1);
  background: rgba(255, 253, 248, .92);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand-mark {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  color: var(--green);
  background: var(--gold);
  font-size: 25px;
}
.brand strong { display: block; font-family: Georgia, serif; letter-spacing: .03em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
nav { display: flex; gap: 24px; font-size: 14px; }
nav a:hover { color: var(--green-2); }
.header-minimum {
  display: flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 6px 12px;
  border: 1px solid rgba(220,165,43,.4); border-radius: 11px;
  color: var(--green); background: #fff9ea;
  white-space: nowrap;
}
.header-minimum small { color: #8b6918; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.header-minimum strong { font-size: 13px; }
.header-minimum.ready { color: white; border-color: var(--green); background: var(--green); }
.header-minimum.ready small { color: rgba(255,255,255,.72); }
.header-actions { display: flex; gap: 8px; }
.payment-help-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 14px; color: var(--green); border: 1px solid rgba(24,61,36,.18); background: #f5f1e5; font-size: 12px; font-weight: 800; white-space: nowrap; }
.payment-help-button b { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 7px; color: white; background: var(--green); font-size: 13px; }
.header-clear-cart { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 13px; color: var(--danger); border: 1px solid rgba(163,59,49,.2); background: #fff0ed; font-size: 12px; font-weight: 700; }
.header-clear-cart b { font-size: 17px; line-height: 1; }

button, .primary-button, .secondary-button {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, opacity .15s ease;
}
button:hover:not(:disabled), .primary-button:hover, .secondary-button:hover { transform: translateY(-1px); }
.primary-button, .secondary-button, .ghost-button, .cart-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  font-weight: 700;
}
.primary-button, .cart-button { color: white; background: var(--green); }
.secondary-button { color: var(--green); border: 1px solid var(--green); background: transparent; }
.ghost-button { color: var(--green); background: var(--cream); }
.cart-button span {
  display: grid; place-items: center;
  min-width: 24px; height: 24px;
  margin-left: 9px; padding: 0 6px;
  border-radius: 99px;
  color: var(--green); background: var(--gold);
}
.wide { width: 100%; }
button:disabled { cursor: not-allowed; opacity: .42; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 500px;
  background:
    radial-gradient(circle at 88% 24%, rgba(220, 165, 43, .18) 0 7%, transparent 7.2%),
    radial-gradient(circle at 91% 36%, rgba(24, 61, 36, .08) 0 15%, transparent 15.2%),
    linear-gradient(120deg, var(--cream), #fffdf8 72%);
}
.hero::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -230px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(24, 61, 36, .13);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(24, 61, 36, .025), 0 0 0 140px rgba(220, 165, 43, .035);
}
.hero-content { position: relative; z-index: 1; max-width: 1180px; padding: clamp(52px, 5.5vw, 82px) clamp(26px, 8vw, 138px); }
.eyebrow { margin-bottom: 14px; color: #9a6c05; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2 { margin: 0; color: var(--green); font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { max-width: 900px; font-size: clamp(46px, 5.2vw, 76px); line-height: .98; }
.hero p { max-width: 700px; margin: 20px 0; color: #4f5b52; font-size: 18px; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 30px; color: var(--muted); font-size: 13px; }
.hero-facts strong { display: block; color: var(--green); font-family: Georgia, serif; font-size: 22px; }
.terms-strip {
  position: relative;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
  padding: 22px clamp(18px, 5vw, 76px);
  color: white;
  background:
    radial-gradient(circle at 8% 20%, rgba(220,165,43,.15), transparent 20%),
    linear-gradient(180deg, #f4eddf, #fbf8f0);
}
.terms-strip div {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  padding: 70px 24px 24px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 19px;
  background: linear-gradient(145deg, #1b4a2a, #102f1b 78%);
  box-shadow: 0 14px 34px rgba(18,55,31,.13), inset 0 1px rgba(255,255,255,.08);
  transition: transform .2s ease, box-shadow .2s ease;
}
.terms-strip div:hover { transform: translateY(-4px); box-shadow: 0 20px 42px rgba(18,55,31,.2), inset 0 1px rgba(255,255,255,.1); }
.terms-strip div::before {
  position: absolute; left: 22px; top: 20px;
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid rgba(220,165,43,.55); border-radius: 11px;
  color: var(--gold); background: rgba(220,165,43,.09);
  font-family: Georgia, serif; font-size: 21px;
}
.terms-strip div:nth-child(1)::before { content: "↑"; }
.terms-strip div:nth-child(2)::before { content: "▣"; }
.terms-strip div:nth-child(3)::before { content: "₽"; }
.terms-strip div:nth-child(4)::before { content: "✓"; }
.terms-strip div::after {
  content: ""; position: absolute; right: -45px; bottom: -60px;
  width: 145px; height: 145px; border: 1px solid rgba(220,165,43,.12); border-radius: 50%;
  box-shadow: 0 0 0 25px rgba(220,165,43,.025);
}
.terms-strip span {
  position: absolute; right: 20px; top: 22px;
  color: rgba(255,255,255,.32);
  font-family: Georgia, serif; font-size: 26px; line-height: 1;
}
.terms-strip strong, .terms-strip small { display: block; }
.terms-strip strong { position: relative; z-index: 1; font-family: Georgia, serif; font-size: 19px; font-weight: 500; }
.terms-strip small { position: relative; z-index: 1; margin-top: 9px; color: rgba(255,255,255,.68); line-height: 1.45; }

.catalog-section { padding: 90px clamp(18px, 5vw, 76px) 110px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.section-heading h2, .contact-section h2 { font-size: clamp(38px, 4vw, 58px); }
.order-progress { width: min(390px, 100%); color: var(--muted); font-size: 13px; }
.progress-track { height: 7px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: var(--line); }
#progressBar { width: 0; height: 100%; border-radius: inherit; background: var(--gold); transition: width .25s ease; }
.filters { display: flex; gap: 8px; margin-bottom: 34px; overflow-x: auto; padding-bottom: 4px; }
.filter-button { white-space: nowrap; padding: 11px 16px; color: var(--green); background: var(--cream); }
.filter-button.active { color: white; background: var(--green); }
.catalog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }

.product-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  transition: transform .2s ease, box-shadow .2s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.product-card.stock-warning { border: 2px solid #e3b62f; box-shadow: 0 0 0 4px rgba(227,182,47,.12); }
.product-card.stock-critical { border: 2px solid #c64a40; box-shadow: 0 0 0 4px rgba(198,74,64,.12); }
.product-image { position: relative; height: 270px; overflow: hidden; background-color: #eee; background-repeat: no-repeat; }
.product-image::after { content: ""; position: absolute; inset: auto 0 0; height: 30%; background: linear-gradient(transparent, rgba(0,0,0,.2)); }
.segment-chip, .stock-chip {
  position: absolute; z-index: 2; top: 12px;
  padding: 7px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 800;
}
.segment-chip { left: 12px; color: var(--green); background: rgba(255,253,248,.92); }
.stock-chip { right: 12px; color: white; background: rgba(24,61,36,.9); }
.stock-chip.out { background: rgba(125, 38, 30, .92); }
.stock-chip.stock-warning { color: #3d2b00; background: rgba(237,190,49,.96); }
.stock-chip.stock-critical { color: white; background: rgba(177,52,43,.96); }
.product-body { padding: 18px; }
.product-body h3 { margin: 0 0 5px; color: var(--green); font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.specs { display: flex; gap: 14px; color: var(--muted); font-size: 12px; }
.price-tiers { display: grid; gap: 5px; margin: 16px 0; padding: 12px; border-radius: 12px; background: var(--cream); }
.price-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.price-row strong { color: var(--green); font-size: 13px; }
.price-row.current { color: var(--ink); font-weight: 700; }
.price-row.current strong { color: #9a6c05; }
.fixed-price-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0; padding: 13px 14px; border: 1px solid rgba(220,165,43,.28); border-radius: 12px; background: #fff8e8; }
.fixed-price-card span { color: var(--muted); font-size: 12px; font-weight: 700; }
.fixed-price-card strong { color: #8b650d; font-size: 15px; }
.qty-control { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 8px; }
.qty-control button { height: 42px; color: var(--green); background: var(--cream); font-size: 22px; }
.qty-value { text-align: center; }
.qty-value strong, .qty-value small { display: block; }
.qty-value small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.sold-out { padding: 12px; border-radius: 10px; color: var(--danger); background: #fff0ed; text-align: center; font-weight: 700; }

.contact-section {
  display: flex; align-items: end; justify-content: space-between; gap: 30px;
  padding: 80px clamp(18px, 7vw, 110px);
  color: white; background: #112c1a;
}
.contact-section h2 { color: white; }
.contact-section p { color: rgba(255,255,255,.65); }
.contact-links { display: flex; gap: 10px; }
.contact-links a { padding: 14px 22px; border: 1px solid rgba(255,255,255,.3); border-radius: 12px; }

.cart-drawer, .modal {
  position: fixed;
  z-index: 50;
  visibility: hidden;
  opacity: 0;
  background: var(--paper);
  transition: .22s ease;
}
.cart-drawer {
  top: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column;
  width: min(500px, 100%);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable;
  transform: translateX(100%);
  box-shadow: -20px 0 70px rgba(0,0,0,.16);
}
.cart-drawer.open { visibility: visible; opacity: 1; transform: none; }
.cart-drawer > .drawer-header { position: sticky; z-index: 4; top: 0; flex: 0 0 auto; background: var(--paper); }
.modal {
  top: 50%; left: 50%;
  width: min(1040px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  transform: translate(-50%, -46%) scale(.98);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.modal.open { visibility: visible; opacity: 1; transform: translate(-50%, -50%) scale(1); }
.modal-backdrop { position: fixed; z-index: 40; inset: 0; visibility: hidden; opacity: 0; background: rgba(8,24,13,.55); backdrop-filter: blur(4px); transition: .2s; }
.modal-backdrop.open { visibility: visible; opacity: 1; }
.receipt-help-overlay { position: fixed; z-index: 110; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: 20px; background: rgba(8,24,13,.64); backdrop-filter: blur(6px); }
.receipt-help-overlay[hidden] { display: none; }
.receipt-help-card { position: relative; width: min(760px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 24px; border: 1px solid rgba(24,61,36,.12); border-radius: 22px; background: #fffdf8; box-shadow: 0 25px 80px rgba(0,0,0,.25); }
.receipt-help-close { position: absolute; z-index: 2; top: 14px; right: 14px; display: grid; width: 38px; height: 38px; place-items: center; padding: 0; color: var(--green); background: var(--cream); font-size: 23px; }
.receipt-help-heading { display: flex; align-items: center; gap: 13px; padding-right: 42px; }
.receipt-help-heading > span { display: grid; flex: 0 0 auto; width: 45px; height: 45px; place-items: center; border-radius: 14px; color: var(--green); background: var(--gold); font-size: 22px; font-weight: 900; }
.receipt-help-heading small { color: #a06c00; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.receipt-help-heading h2 { margin: 3px 0 0; color: var(--green); font-size: 29px; }
.receipt-help-message { margin: 18px 0; padding: 13px 15px; border-left: 4px solid #c43f36; border-radius: 0 12px 12px 0; color: #a32620; background: #fff0ed; font-weight: 650; line-height: 1.5; }
.receipt-help-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.receipt-option { display: grid; grid-template-columns: minmax(0, 1fr) 118px; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.receipt-option small { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.receipt-option h3 { margin: 2px 0 5px; color: var(--green); font-family: Georgia, serif; font-size: 23px; }
.receipt-option p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.receipt-option img { grid-column: 2; grid-row: 1 / span 2; display: block; width: 118px; height: 118px; padding: 5px; border: 1px solid #ece9df; border-radius: 14px; background: white; object-fit: contain; }
.receipt-option a { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 14px; border-radius: 11px; color: white; background: var(--green); font-size: 12px; font-weight: 850; }
.receipt-option a:hover { background: var(--green-2); }
.receipt-help-done { display: block; min-width: 150px; min-height: 44px; margin: 18px 0 0 auto; color: white; background: var(--green); font-weight: 800; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px; border-bottom: 1px solid var(--line); }
.drawer-header-actions { display: flex; align-items: center; gap: 8px; }
.clear-cart-button { min-height: 38px; padding: 0 12px; color: var(--danger); background: #fff0ed; font-size: 12px; font-weight: 700; }
.drawer-header small { color: var(--muted); }
.drawer-header h2 { margin-top: 2px; font-size: 32px; }
.icon-button { width: 40px; height: 40px; color: var(--green); background: var(--cream); font-size: 25px; }
.cart-summary { display: grid; grid-template-columns: repeat(3, 1fr); padding: 16px 24px; background: var(--cream); }
.cart-summary div { padding: 5px 12px; border-right: 1px solid var(--line); }
.cart-summary div:last-child { border: 0; }
.cart-summary span, .cart-summary strong { display: block; }
.cart-summary span { color: var(--muted); font-size: 11px; }
.cart-lines { flex: 0 0 auto; overflow: visible; padding: 8px 24px; }
.cart-empty { padding: 55px 10px; color: var(--muted); text-align: center; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-line h4 { margin: 0 0 4px; }
.cart-line p { margin: 0; color: var(--muted); font-size: 12px; }
.cart-line strong { white-space: nowrap; }
.cart-line button { margin-top: 6px; padding: 4px 0; color: var(--danger); background: transparent; font-size: 12px; }
.customer-form { flex: 0 0 auto; padding: 18px 24px; border-top: 1px solid var(--line); }
.customer-form h3 { margin: 0 0 12px; font-size: 16px; }
label { display: block; color: var(--muted); font-size: 12px; }
.required-mark { color: var(--danger); font-weight: 800; }
input, textarea {
  width: 100%; margin-top: 5px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 10px; outline: 0; background: white;
}
select {
  width: 100%; margin-top: 5px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 10px; outline: 0; background: white;
}
input[type="checkbox"] { width: auto; margin: 0; padding: 0; accent-color: var(--green); }
input:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(40,90,53,.1); }
input.field-error { border-color: var(--danger); background: #fff8f6; box-shadow: 0 0 0 3px rgba(163,59,49,.1); }
.customer-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.customer-form h3, .customer-form label:last-child { grid-column: 1 / -1; }
.customer-form .customer-email, .customer-form .customer-full-name, .customer-form .customer-legal-status { grid-column: 1 / -1; }
.contract-customer-fields {
  grid-column: 1 / -1;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--cream);
}
.contract-customer-fields summary {
  padding: 12px 14px; cursor: pointer;
  color: var(--green); font-weight: 800;
}
.contract-customer-fields[open] summary { border-bottom: 1px solid var(--line); }
.contract-customer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
.contract-customer-grid .wide-field { grid-column: 1 / -1; }
textarea { min-height: 65px; resize: vertical; }
.drawer-footer { flex: 0 0 auto; padding: 20px 24px; border-top: 1px solid var(--line); background: white; }
.grand-total { display: flex; justify-content: space-between; margin-bottom: 14px; font-size: 18px; }
.grand-total strong { color: var(--green); font-size: 26px; }
.drawer-footer > small { display: block; margin-top: 9px; color: var(--muted); text-align: center; }

.admin-modal { width: min(1440px, calc(100% - 32px)); padding-bottom: 24px; }
.admin-note { margin: 16px 24px; color: var(--muted); }
.cloud-settings-panel { margin: 0 24px 18px; padding: 16px; border: 1px solid rgba(20,72,43,.2); border-radius: 16px; background: linear-gradient(135deg, #f7fbf7, #fffdf8); }
.cloud-settings-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.cloud-settings-head > div { display: grid; gap: 2px; }
.cloud-settings-head > div small { color: var(--muted); }
.cloud-settings-head > div strong { color: var(--green); font-size: 18px; }
#cloudStatus { max-width: 520px; color: #a13a2e; text-align: right; }
#cloudStatus[data-connected="true"] { color: var(--green); }
.cloud-settings-fields { padding: 0; }
.cloud-settings-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.minimum-order-setting { display: grid; grid-template-columns: minmax(200px, 1fr) auto; align-items: end; gap: 10px; margin: 0 24px 18px; padding: 16px; border: 1px solid rgba(220,165,43,.35); border-radius: 14px; background: #fffaf0; }
.minimum-order-setting small { grid-column: 1 / -1; color: var(--muted); }
.admin-toolbar { display: flex; align-items: end; gap: 12px; padding: 0 24px 18px; }
.admin-toolbar label { flex: 1; }
.admin-tabs { display: flex; gap: 8px; padding: 0 24px 16px; }
.admin-tabs button { padding: 10px 14px; color: var(--green); background: var(--cream); }
.admin-tabs button.active { color: white; background: var(--green); }
.admin-tabs button span { margin-left: 3px; opacity: .72; }
.admin-table { width: calc(100% - 48px); margin: 0 24px; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }
.admin-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.admin-table input[type="number"] { width: 85px; }
.admin-table input[type="text"] { min-width: 160px; }
.admin-table .save-row { padding: 8px 10px; color: white; background: var(--green); }
.admin-data-view { margin: 0 24px; }
.data-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.orders-summary-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.data-summary-grid > div { display: grid; gap: 4px; min-height: 82px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.data-summary-grid small { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.data-summary-grid strong { color: var(--green); font-family: Georgia, serif; font-size: 21px; }
.data-toolbar { display: flex; align-items: end; gap: 12px; margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--cream); }
.data-toolbar label { flex: 1 1 260px; }
.data-toolbar label + label { flex: 0 1 250px; }
.data-toolbar > span { margin: 0 4px 10px auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.excel-export-button { flex: 0 0 auto; min-height: 42px; border-color: #1f6b45; color: #17472f; background: #eef8f1; white-space: nowrap; }
.excel-export-button:hover { color: white; background: #1f6b45; }
.data-table-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: white; }
.data-table-wrap .admin-table { width: 100%; min-width: 980px; margin: 0; }
.table-scroll-top { height: 18px; margin: -2px 3px 7px; overflow-x: auto; overflow-y: hidden; border-radius: 8px; scrollbar-color: var(--gold) #eee9dd; scrollbar-width: auto; }
.table-scroll-top > div { height: 1px; }
.table-scroll-top::-webkit-scrollbar { height: 12px; }
.table-scroll-top::-webkit-scrollbar-track { border-radius: 99px; background: #eee9dd; }
.table-scroll-top::-webkit-scrollbar-thumb { border: 2px solid #eee9dd; border-radius: 99px; background: var(--gold); }
.orders-data-table { min-width: 880px !important; table-layout: fixed; }
.orders-data-table th, .orders-data-table td { padding: 8px 7px; vertical-align: middle; }
.orders-data-table th:nth-child(1) { width: 14%; }
.orders-data-table th:nth-child(2) { width: 13%; }
.orders-data-table th:nth-child(3) { width: 19%; }
.orders-data-table th:nth-child(4) { width: 10%; }
.orders-data-table th:nth-child(5) { width: 12%; }
.orders-data-table th:nth-child(6) { width: 13%; }
.orders-data-table th:nth-child(7) { width: 19%; }
.order-table-wrap { scrollbar-color: var(--gold) #eee9dd; }
.data-table th { position: sticky; z-index: 1; top: 0; background: #f7f3e9; white-space: nowrap; }
.data-table tbody tr:hover { background: #fbfaf6; }
.movement-delta { font-weight: 900; }
.positive, .movement-delta.positive { color: #17613a !important; }
.negative, .movement-delta.negative { color: #a43e34 !important; }
.row-archive-mark { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.order-archive-button, .order-delete-button, .movement-delete-button { padding: 8px 10px; border-radius: 9px; font-size: 11px; font-weight: 800; }
.order-archive-button { color: #7a5810; background: #fff7de; }
.order-delete-button, .movement-delete-button { color: var(--danger); background: #fff0ed; }
.order-archive-button { grid-column: span 1; }
.order-delete-button { grid-column: span 2; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 16px; padding: 16px; border: 1px solid rgba(164,62,52,.22); border-radius: 16px; background: #fff8f6; }
.danger-zone > div:first-child { display: grid; gap: 4px; }
.danger-zone > div:first-child strong { color: var(--danger); }
.danger-zone > div:first-child span { color: var(--muted); font-size: 12px; }
.danger-zone > div:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.danger-zone .danger-solid { color: white; background: var(--danger); }
.stock-control-panel { margin: 0 24px; }
.stock-control-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.stock-control-head h3 { margin: 0 0 4px; color: var(--green); font-family: Georgia, serif; font-size: 24px; }
.stock-control-head p { margin: 0; color: var(--muted); font-size: 13px; }
.stock-sync-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.sync-direction { display: grid; gap: 5px; padding: 16px; border: 1px solid rgba(24,61,36,.15); border-radius: 16px; text-align: left; background: white; }
.sync-direction small { color: var(--muted); font-weight: 700; }
.sync-direction strong { color: var(--green); font-size: 18px; }
.sync-direction span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.sync-direction.google-to-site { border-color: rgba(49,95,116,.28); background: #f3f9fb; }
.sync-direction.site-to-google { border-color: rgba(23,97,58,.25); background: #f3faf5; }
.stock-compare-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: white; }
.stock-compare-table .admin-table { width: 100%; margin: 0; }
.stock-inline-editor { display: grid; grid-template-columns: minmax(110px, 150px); gap: 4px; }
.stock-inline-editor input { margin: 0; padding: 9px 10px; font-weight: 800; }
.stock-inline-editor small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.stock-row.changed { background: #fff9e8; }
.stock-row.stock-warning > td { background: #fff7d6; }
.stock-row.stock-critical > td { background: #fde4e1; }
.stock-row.stock-warning > td:first-child { box-shadow: inset 5px 0 #e3b62f; }
.stock-row.stock-critical > td:first-child { box-shadow: inset 5px 0 #c64a40; }
.stock-row.changed > td { background: #fff9e8; }
.stock-row.changed .stock-inline-editor input { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(220,165,43,.1); }
.stock-alert-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 12px; color: var(--muted); font-size: 12px; font-weight: 700; }
.stock-alert-legend span { display: inline-flex; align-items: center; gap: 7px; }
.stock-alert-legend i { width: 12px; height: 12px; border-radius: 4px; }
.stock-alert-legend i.warning { background: #e3b62f; }
.stock-alert-legend i.critical { background: #c64a40; }
.stock-save-button { min-height: 38px; padding: 0 12px; color: white; background: var(--green); font-size: 12px; font-weight: 800; white-space: nowrap; }
.stock-difference { font-weight: 800; }
.stock-difference.match { color: #17613a; }
.stock-difference.mismatch { color: #a43e34; }
.stock-difference.unknown { color: var(--muted); }
.sync-state { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.sync-state.match { color: #17613a; background: #e9f6ee; }
.sync-state.mismatch { color: #a43e34; background: #fff0ed; }
.sync-state.unknown { color: #6c675d; background: #f0ede5; }
@media (max-width: 760px) {
  .admin-data-view { margin: 0 14px; }
  .data-summary-grid { grid-template-columns: 1fr 1fr; }
  .data-toolbar { align-items: stretch; flex-direction: column; }
  .data-toolbar label, .data-toolbar label + label { flex-basis: auto; width: 100%; }
  .data-toolbar > span { margin: 0; }
  .danger-zone { align-items: stretch; flex-direction: column; }
  .danger-zone > div:last-child { display: grid; grid-template-columns: 1fr; }
  .stock-control-head { align-items: stretch; flex-direction: column; }
  .stock-sync-actions { grid-template-columns: 1fr; }
}
.order-log-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 7px;
  min-width: 360px;
  padding: 8px;
  border: 1px solid rgba(24,61,36,.1);
  border-radius: 16px;
  background: #f7f3e9;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.order-log-button {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid rgba(24,61,36,.14);
  border-radius: 10px;
  color: var(--green);
  background: white;
  box-shadow: 0 2px 8px rgba(24,61,36,.07);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .01em;
}
.order-log-button::before { content: "↗"; margin-right: 7px; color: var(--gold); font-size: 13px; }
.order-log-button:hover { border-color: rgba(24,61,36,.3); transform: translateY(-1px); box-shadow: 0 5px 12px rgba(24,61,36,.1); }
.order-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(176,119,0,.18);
  border-radius: 999px;
  color: #855d00;
  background: #fff6d9;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.order-status-badge::before { content: ""; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(176,119,0,.1); }
.order-status-badge[data-status="Выдан"] { color: #315f74; border-color: rgba(49,95,116,.18); background: #e9f4f8; }
.order-status-badge[data-status="Подтверждён"] { color: #17613a; border-color: rgba(23,97,58,.18); background: #e9f6ee; }
.order-status-badge[data-status="Отменён"] { color: #a43e34; border-color: rgba(164,62,52,.18); background: #fff0ed; }
.order-status-button {
  min-height: 36px;
  padding: 8px 9px;
  border: 1px solid rgba(24,61,36,.14);
  border-radius: 10px;
  color: #315f74;
  background: rgba(255,255,255,.78);
  font-size: 11px;
  font-weight: 800;
  transition: transform .16s ease, box-shadow .16s ease, color .16s ease, background .16s ease;
}
.order-status-button[data-order-status="Подтверждён"] { color: #17613a; }
.order-status-button[data-order-status="Отменён"] { color: #a43e34; }
.order-status-button:hover:not(:disabled) { transform: translateY(-1px); background: white; box-shadow: 0 5px 12px rgba(24,61,36,.1); }
.order-status-button:focus-visible, .order-log-button:focus-visible { outline: 3px solid rgba(222,166,35,.3); outline-offset: 2px; }
.order-status-button:disabled { color: white; cursor: default; opacity: 1; box-shadow: inset 0 -2px 0 rgba(0,0,0,.09); }
.order-status-button[data-order-status="Выдан"]:disabled { background: #315f74; }
.order-status-button[data-order-status="Подтверждён"]:disabled { background: #17613a; }
.order-status-button[data-order-status="Отменён"]:disabled { background: #a43e34; }
.order-status-button:disabled::after { content: " ✓"; }
.order-status-select { min-width: 155px; min-height: 38px; padding: 7px 30px 7px 10px; border-radius: 10px; font-size: 11px; font-weight: 800; }
.order-row-actions { display: flex; align-items: flex-start; gap: 7px; min-width: 150px; }
.order-row-actions .order-log-button { grid-column: auto; min-height: 38px; white-space: nowrap; }
.order-issued-button { min-height: 38px; padding: 8px 10px; border: 1px solid rgba(23,97,58,.22); border-radius: 10px; color: #17613a; background: #e9f6ee; font-size: 11px; font-weight: 850; white-space: nowrap; }
.order-issued-button:hover { color: white; background: #17613a; }
.order-more-menu { position: relative; flex: 0 0 auto; }
.order-more-menu > summary { display: grid; place-items: center; width: 40px; min-height: 38px; border: 1px solid rgba(24,61,36,.14); border-radius: 10px; color: var(--green); background: white; cursor: pointer; font-size: 17px; font-weight: 900; list-style: none; }
.order-more-menu > summary::-webkit-details-marker { display: none; }
.order-more-menu[open] > summary { color: white; background: var(--green); }
.order-more-popover { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; display: grid; gap: 5px; width: 220px; max-width: calc(100vw - 32px); padding: 9px; border: 1px solid rgba(24,61,36,.14); border-radius: 13px; background: #f8f5eb; box-shadow: 0 12px 28px rgba(18,45,27,.15); }
.order-more-popover > strong { padding: 4px 6px 7px; color: var(--green); font-size: 11px; }
.order-more-popover button { width: 100%; padding: 9px 10px; border: 1px solid rgba(24,61,36,.1); border-radius: 9px; color: var(--green); background: white; text-align: left; font-size: 11px; font-weight: 750; }
.order-more-popover button:hover { border-color: rgba(24,61,36,.28); transform: none; }
.order-more-popover .danger-menu-action { color: #a43e34; background: #fff1ee; }
.order-discount-mark, .order-prepayment-mark { display: block; margin-top: 3px; white-space: nowrap; font-size: 9px; }
.order-discount-mark { color: #a43e34; font-weight: 850; }
.order-prepayment-mark { color: var(--muted); }
.orders-data-table tbody tr > td { transition: background-color .18s ease, box-shadow .18s ease; }
.orders-data-table tbody tr.payment-none > td { background: #fff1ee; }
.orders-data-table tbody tr.payment-none > td:first-child { box-shadow: inset 5px 0 #c75a50; }
.orders-data-table tbody tr.payment-complete > td { background: #edf8f0; }
.orders-data-table tbody tr.payment-complete > td:first-child { box-shadow: inset 5px 0 #3c9660; }
.order-payment-cell { min-width: 116px; }
.order-payment-control { display: grid; gap: 5px; min-width: 102px; }
.order-payment-control label { display: flex; align-items: center; gap: 7px; min-height: 29px; padding: 5px 8px; border: 1px solid rgba(24,61,36,.11); border-radius: 9px; color: #4f5f53; background: rgba(255,255,255,.72); cursor: pointer; font-size: 10px; font-weight: 800; white-space: nowrap; }
.order-payment-control label:hover { border-color: rgba(24,61,36,.28); background: white; }
.order-payment-control input { width: 16px; height: 16px; margin: 0; accent-color: #278150; cursor: pointer; }
.order-payment-control input:focus-visible { outline: 3px solid rgba(222,166,35,.28); outline-offset: 2px; }
.order-payment-control.saving { opacity: .58; }
.order-identity-cell strong, .order-identity-cell small,
.order-customer-cell strong, .order-customer-cell a,
.order-volume-cell strong, .order-volume-cell small { display: block; }
.order-identity-cell strong { overflow-wrap: anywhere; line-height: 1.15; }
.order-identity-cell > small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.order-customer-cell strong { overflow-wrap: anywhere; line-height: 1.2; }
.order-customer-cell a { margin-top: 4px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.order-volume-cell strong { color: var(--green); white-space: nowrap; }
.order-volume-cell small { margin-top: 3px; color: var(--muted); white-space: nowrap; }
.order-total-cell > strong { white-space: nowrap; }
.mobile-order-list { display: none; }
.mobile-order-card { position: relative; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 5px 14px rgba(18,45,27,.05); }
.mobile-order-card.payment-none { border-color: rgba(199,90,80,.34); background: #fff4f1; box-shadow: inset 5px 0 #c75a50; }
.mobile-order-card.payment-complete { border-color: rgba(60,150,96,.3); background: #f0f9f2; box-shadow: inset 5px 0 #3c9660; }
.mobile-order-card > header { display: block; }
.mobile-order-card > header > div { min-width: 0; }
.mobile-order-card > header strong, .mobile-order-card > header small { display: block; overflow-wrap: anywhere; }
.mobile-order-card > header small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.mobile-order-card .order-status-select { width: 100%; min-width: 0; }
.mobile-order-customer { display: grid; gap: 3px; margin: 12px 0; padding: 11px; border-radius: 11px; background: var(--cream); }
.mobile-order-customer strong { overflow-wrap: anywhere; color: var(--green); }
.mobile-order-customer a { color: var(--muted); font-size: 12px; }
.mobile-order-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 0 0 12px; }
.mobile-order-facts div { min-width: 0; padding: 9px; border: 1px solid rgba(24,61,36,.09); border-radius: 10px; }
.mobile-order-facts dt { margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.mobile-order-facts dd { margin: 0; overflow-wrap: anywhere; font-size: 12px; }
.mobile-order-facts .order-pickup-button { width: 100%; padding: 0; text-align: left; background: transparent; }
.mobile-order-card > .order-payment-control { grid-template-columns: 1fr 1fr; margin: 0 0 12px; }
.mobile-order-card > .order-payment-control label { justify-content: center; background: white; }
.mobile-order-card > .order-row-actions { justify-content: flex-end; width: 100%; }
.mobile-order-card > .order-row-actions .order-log-button { flex: 1 1 auto; }
.mobile-order-card > .order-row-actions .order-issued-button { flex: 1 1 auto; }
.order-edit-card { width: min(650px, 100%); max-height: calc(100dvh - 30px); overflow: auto; }
.order-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; margin-top: 18px; }
.order-edit-grid .wide-field { grid-column: 1 / -1; }
.finance-edit-groups { display: grid; gap: 10px; margin-top: 16px; }
.finance-input-group { padding: 12px; border: 1px solid rgba(24,61,36,.12); border-radius: 14px; background: rgba(255,255,255,.72); }
.finance-input-group > div:first-child strong, .finance-input-group > div:first-child small { display: block; }
.finance-input-group > div:first-child strong { color: var(--green); font-size: 13px; }
.finance-input-group > div:first-child small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.finance-input-group .order-edit-grid { margin-top: 10px; }
.paid-finance-group > label { margin-top: 10px; }
.finance-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(145px, 100%), 1fr)); gap: 7px; margin-top: 16px; padding: 10px; border: 1px solid rgba(24,61,36,.12); border-radius: 14px; background: white; }
.finance-preview div { min-width: 0; padding: 8px; border-radius: 9px; background: #f7f4ea; }
.finance-preview small, .finance-preview strong { display: block; }
.finance-preview small { overflow-wrap: anywhere; color: var(--muted); font-size: 9px; line-height: 1.25; }
.finance-preview strong { margin-top: 4px; color: var(--green); font-size: 12px; }
.finance-history { margin-top: 12px; padding: 10px 12px; border: 1px solid rgba(24,61,36,.12); border-radius: 12px; background: white; }
.finance-history summary { color: var(--green); cursor: pointer; font-size: 11px; font-weight: 800; }
.finance-history div { display: grid; gap: 6px; margin-top: 10px; }
.finance-history p { display: grid; grid-template-columns: 130px 1fr; gap: 10px; margin: 0; padding-top: 6px; border-top: 1px solid var(--line); font-size: 10px; }
.finance-history time { color: var(--muted); }
.contract-order-edit-card { display: flex; width: min(820px, 100%); max-height: calc(100dvh - 30px); flex-direction: column; overflow: hidden; }
.contract-order-edit-scroll { flex: 1 1 auto; min-height: 0; max-height: min(58dvh, 610px); margin-top: 16px; padding-right: 5px; overflow-y: auto; }
.contract-order-edit-scroll fieldset { margin: 0 0 12px; padding: 14px; border: 1px solid rgba(24,61,36,.14); border-radius: 14px; background: white; }
.contract-order-edit-scroll legend { padding: 0 7px; color: var(--green); font-size: 12px; font-weight: 850; }
.contract-order-edit-scroll .order-edit-grid { margin-top: 0; }
.contract-edit-actions { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); flex: 0 0 auto; }
.contract-edit-actions button { width: 100%; min-width: 0; white-space: normal; }
.contract-edit-actions #saveContractEditButton { grid-column: 1 / -1; }
.items-order-edit-card { display: flex; width: min(760px, 100%); max-height: calc(100dvh - 30px); flex-direction: column; overflow: hidden; }
.items-order-edit-scroll { flex: 1 1 auto; min-height: 0; margin-top: 14px; padding-right: 5px; overflow-y: auto; }
.paid-order-warning { display: grid; gap: 4px; margin-top: 13px; padding: 12px 14px; border: 1px solid rgba(199,90,80,.3); border-radius: 13px; background: #fff1ed; color: #8b3029; }
.paid-order-warning b { font-size: 13px; }
.paid-order-warning span { font-size: 11px; line-height: 1.45; }
.items-editor-list { display: grid; gap: 8px; }
.items-editor-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid rgba(24,61,36,.13); border-radius: 13px; background: white; }
.items-editor-row-info { min-width: 0; }
.items-editor-row-info strong, .items-editor-row-info small { display: block; }
.items-editor-row-info strong { overflow-wrap: anywhere; color: var(--green); }
.items-editor-row-info small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.items-editor-quantity { display: grid; grid-template-columns: 34px 68px 34px; gap: 5px; }
.items-editor-quantity button { min-height: 34px; padding: 4px; border: 1px solid rgba(24,61,36,.16); border-radius: 9px; background: var(--cream); color: var(--green); font-weight: 900; }
.items-editor-quantity input { min-width: 0; height: 34px; padding: 5px; text-align: center; }
.items-editor-remove { min-height: 34px; padding: 5px 9px; border: 1px solid rgba(199,90,80,.2); border-radius: 9px; background: #fff1ed; color: #a43e34; font-weight: 850; }
.items-editor-add { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 10px; margin-top: 12px; padding: 12px; border: 1px dashed rgba(24,61,36,.2); border-radius: 13px; background: rgba(247,244,234,.65); }
.items-editor-add label, .paid-advance-field { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.paid-advance-field { margin-top: 12px; padding: 12px; border: 1px solid rgba(222,166,35,.28); border-radius: 13px; background: #fff9e8; }
.items-editor-preview { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin-top: 12px; }
.items-editor-preview > div { min-width: 0; padding: 10px; border-radius: 11px; background: #f7f4ea; }
.items-editor-preview small, .items-editor-preview strong { display: block; }
.items-editor-preview small { color: var(--muted); font-size: 9px; line-height: 1.25; }
.items-editor-preview strong { margin-top: 4px; overflow-wrap: anywhere; color: var(--green); font-size: 12px; }
.items-editor-preview .refund { background: #fff1ed; }
.items-editor-preview .refund strong { color: #a43e34; }
.items-editor-preview .minimum-warning { grid-column: 1 / -1; background: #fff4d8; color: #805b00; font-size: 11px; }
.items-edit-actions { flex: 0 0 auto; }
.order-finance-summary { width: min(430px, 100%); margin: 22px 0 0 auto; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: #faf8f1; }
.order-prepayment-warning { margin: 0 0 10px; padding: 0 0 11px; border-bottom: 1px solid #efc4bf; color: #b02f28; font-size: 13px; font-weight: 650; line-height: 1.4; }
.order-finance-summary > div { display: flex; justify-content: space-between; gap: 20px; padding: 6px 0; }
.order-finance-summary .discount-row { color: #a43e34; }
.order-finance-summary .document-total { margin: 4px 0; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.status-confirm-overlay {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8,24,13,.58);
  backdrop-filter: blur(5px);
}
.status-confirm-overlay[hidden] { display: none; }
.status-confirm-card {
  width: min(440px, 100%);
  padding: 26px;
  border: 1px solid rgba(24,61,36,.14);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(8,24,13,.28);
}
.status-confirm-card small { color: #a46d00; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.status-confirm-card h3 { margin: 8px 0 10px; color: var(--green); font-family: Georgia, serif; font-size: 27px; }
.status-confirm-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.status-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.empty-admin { margin: 30px 24px; color: var(--muted); }
.archive-panel { margin: 0 24px; }
.archive-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; padding: 17px 18px; border: 1px solid rgba(24,61,36,.12); border-radius: 16px; background: var(--cream); }
.archive-heading h3 { margin: 0 0 4px; color: var(--green); font-family: Georgia, serif; font-size: 23px; }
.archive-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.archive-total { display: grid; flex: 0 0 auto; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: white; background: var(--green); font-weight: 900; }
.archive-list { display: grid; gap: 9px; }
.archive-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.archive-photo { width: 64px; height: 64px; border-radius: 11px; background-color: #edf0eb; background-repeat: no-repeat; }
.archive-info { min-width: 0; }
.archive-info strong, .archive-info span, .archive-info small { display: block; }
.archive-info strong { overflow: hidden; color: var(--green); text-overflow: ellipsis; white-space: nowrap; }
.archive-info span { margin-top: 4px; color: var(--ink); font-size: 11px; }
.archive-info small { margin-top: 5px; color: var(--muted); }
.archive-actions { display: flex; gap: 8px; }
.archive-actions button { min-height: 38px; padding: 0 12px; font-size: 12px; }
.restore-button { color: white; background: var(--green); }
.archive-empty { display: grid; place-items: center; min-height: 220px; margin: 0 24px; border: 1px dashed rgba(24,61,36,.2); border-radius: 18px; color: var(--muted); text-align: center; background: rgba(247,243,233,.5); }
.archive-empty strong { color: var(--green); font-family: Georgia, serif; font-size: 24px; }
.archive-empty span { margin-top: -65px; font-size: 13px; }
.product-image.no-photo::before {
  content: "Фото будет добавлено позже";
  position: absolute; inset: 0; display: grid; place-items: center;
  padding: 30px; color: var(--muted); text-align: center;
}
.product-editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px 18px; color: var(--muted); }
.admin-product-workspace { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; padding: 0 24px; align-items: start; }
.product-picker { display: grid; gap: 6px; max-height: min(680px, 67vh); overflow-y: auto; padding-right: 6px; }
.product-picker-item { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; padding: 7px; border: 1px solid transparent; color: var(--ink); background: transparent; text-align: left; }
.product-picker-item:hover { background: var(--cream); transform: none !important; }
.product-picker-item.selected { border-color: var(--green); background: var(--cream); }
.picker-photo { width: 52px; height: 52px; border-radius: 9px; background-color: #edf0eb; background-repeat: no-repeat; }
.product-picker-item strong, .product-picker-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-picker-item strong { font-size: 13px; }
.product-picker-item small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.product-editor-detail { min-width: 0; }
.product-editor { display: grid; grid-template-columns: 180px 1fr; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.editor-photo { grid-column: 1; grid-row: 1; min-height: 180px; border-radius: 12px; background-color: #edf0eb; background-repeat: no-repeat; overflow: hidden; }
.editor-photo span { display: none; height: 100%; align-items: center; justify-content: center; padding: 20px; color: var(--muted); text-align: center; }
.editor-photo.empty span { display: flex; }
.editor-photo-actions { grid-column: 1; grid-row: 2; display: grid; align-content: start; gap: 8px; }
.editor-photo-actions button, .editor-photo-actions label { min-height: 38px; padding: 0 10px; font-size: 12px; }
.upload-button { position: relative; overflow: hidden; }
.upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.editor-fields { grid-column: 2; grid-row: 1 / span 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 12px; }
.editor-fields label:first-child { grid-column: span 2; }
.editor-fields label small { display: block; margin-top: 5px; color: var(--muted); }
.tier-price-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tier-price-fields label:first-child { grid-column: auto; }
.product-option-group { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(190px, auto)); align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: #faf9f4; }
.product-option-group > div { display: grid; gap: 3px; }
.product-option-group > div strong { color: var(--green); font-size: 13px; }
.product-option-group > div small { color: var(--muted); font-size: 11px; }
.product-option-group label, .product-option-group label:first-child { grid-column: auto; }
.option-switch { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 700; }
.option-switch input { flex: 0 0 auto; }
.option-switch:has(input:disabled) { opacity: .48; }
.editor-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.editor-footer > div { display: flex; gap: 8px; }
.editor-footer button { min-height: 40px; padding: 0 14px; }
.active-switch { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.editor-footer .catalog-order-controls { display: flex; flex: 1; align-items: center; justify-content: center; flex-wrap: wrap; }
.catalog-order-controls span { color: var(--muted); font-size: 11px; font-weight: 700; }
.danger-button { color: var(--danger); background: #fff0ed; }
.save-row { color: white; background: var(--green); }
.segment-manager { padding: 0 24px; }
.new-segment-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--cream); }
.new-segment-card h3 { margin: 0 0 14px; color: var(--green); }
.segment-fields { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr) auto; align-items: end; gap: 10px; }
.segment-list { display: grid; gap: 10px; margin-top: 16px; }
.segment-editor { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); align-items: end; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.segment-update-row { grid-column: 1 / -1; display: flex; align-items: end; justify-content: space-between; gap: 14px; padding-top: 4px; }
.segment-update-row > label { flex: 1; }
.segment-actions { display: flex; gap: 7px; }
.segment-actions button { min-height: 41px; padding: 0 12px; }

.contract-settings-form { margin: 0 24px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.contract-settings-form h3 { margin: 0 0 5px; color: var(--green); }
.contract-settings-form > p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.contract-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.contract-settings-grid .wide-field { grid-column: 1 / -1; }
.contract-fixed-setting { display: flex; flex-direction: column; justify-content: center; min-height: 66px; padding: 10px 12px; border: 1px solid rgba(24,61,36,.18); border-radius: 10px; background: var(--cream); }
.contract-fixed-setting span { color: var(--muted); font-size: 12px; }
.contract-fixed-setting strong { margin-top: 5px; color: var(--green); }
.contract-settings-actions { display: flex; justify-content: flex-end; margin-top: 16px; }

.order-modal { width: min(850px, calc(100% - 32px)); }
#printableOrder { padding: 30px; }
.document-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 2px solid var(--green); }
.document-head h2 { font-size: 36px; }
.document-head p { margin: 5px 0; color: var(--muted); }
.order-table { width: 100%; margin-top: 22px; border-collapse: collapse; font-size: 13px; }
.order-table th, .order-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.order-table th:first-child, .order-table td:first-child { text-align: left; }
.document-total { display: flex; justify-content: flex-end; margin-top: 20px; font-size: 20px; }
.document-total strong { margin-left: 20px; color: var(--green); font-size: 28px; }
.order-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 30px; border-top: 1px solid var(--line); }
.order-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 30px; border-top: 1px solid var(--line); background: #fffaf0; }
.order-actions[hidden], .order-confirm-actions[hidden] { display: none !important; }
.contract-modal { width: min(1100px, calc(100% - 32px)); }
#contractPrintable { padding: 24px; background: #e9e5dc; }
.contract-document { color: #111; }
.contract-pdf-staging { position: fixed; z-index: -1; top: 0; left: -100000px; width: 210mm; overflow: hidden; background: white; }
.contract-pdf-document { width: 210mm; margin: 0; background: white; }
.contract-sheet.contract-pdf-sheet { margin: 0; box-shadow: none; }
.contract-sheet {
  position: relative; box-sizing: border-box; width: 210mm; min-height: 297mm;
  margin: 0 auto 24px; padding: 20mm 15mm 20mm 30mm;
  background: white; box-shadow: 0 10px 35px rgba(0,0,0,.12);
  font: 15px/1.16 "Times New Roman", Times, serif;
}
.contract-sheet:last-child { margin-bottom: 0; }
.contract-sheet h1, .contract-sheet h2, .contract-sheet h3 { color: #111; font-family: "Times New Roman", Times, serif; font-weight: 700; }
.contract-sheet h1 { margin: 0 0 4mm; font-size: 19px; text-align: center; }
.contract-sheet h2 { margin: 4mm 0 2mm; font-size: 17px; text-align: left; }
.contract-sheet h3 { margin: 3mm 0 2mm; font-size: 17px; text-align: center; }
.contract-sheet p { margin: 0 0 1.5mm; text-align: justify; }
.contract-meta { display: flex; justify-content: space-between; gap: 15mm; margin-bottom: 5mm; }
.contract-meta p { margin: 0; }
.contract-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 12mm; margin-top: 8mm; }
.contract-parties > div { min-width: 0; }
.contract-parties p { overflow-wrap: anywhere; }
.contract-sheet .signature { margin-top: 10mm; padding-top: 2mm; border-top: 1px solid #111; }
.contract-sheet .signature-caption { margin-top: 1mm; font-size: 12px; font-style: italic; text-align: center; }
.contract-sheet .contract-subclause { font-weight: 700; }
.contract-sheet .contract-payment-line { padding-left: 8mm; }
.contract-page-number { position: absolute; right: 15mm; bottom: 8mm; left: 30mm; font-size: 12px; text-align: center; }
.contract-requisites { min-height: 46mm; margin-top: 4mm; }
.contract-appendix-title { margin-top: 10mm; }
.contract-appendix-title p { margin-bottom: 3mm; }
.contract-sheet .center { text-align: center; }
.contract-sheet table { width: 100%; margin-top: 4mm; border-collapse: collapse; font-size: 12px; }
.contract-sheet th, .contract-sheet td { padding: 2mm; border: 1px solid #111; text-align: center; vertical-align: middle; }
.contract-sheet th:first-child, .contract-sheet td:first-child { text-align: left; }
.contract-sheet th { background: #e7e7e7; font-weight: 700; }
.contract-sheet tr.total td { font-weight: 700; }
.contract-sheet tr.total td:first-child, .contract-sheet tr.contract-discount-row td:first-child, .contract-sheet tbody tr:nth-last-child(-n+3) td:first-child { text-align: right; }
.contract-signature-heading { margin-top: 2mm !important; }
.contract-appendix-signatures { margin-top: 0; }
.contract-amounts { width: 60%; margin: 6mm 0 0 auto; }
.contract-amounts p { display: flex; justify-content: space-between; gap: 10mm; margin-bottom: 1.5mm; }
.contract-note { font-size: 12px; }
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: 25px;
  padding: 12px 18px; border-radius: 12px;
  color: white; background: var(--green);
  opacity: 0; transform: translate(-50%, 20px); pointer-events: none; transition: .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Панель управления 2.0 */
.admin-modal { width: min(1500px, calc(100% - 24px)); height: min(920px, calc(100vh - 24px)); max-height: none; padding: 0; overflow: hidden; border: 1px solid rgba(24,61,36,.12); border-radius: 24px; background: #f4f4ee; }
.admin-shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); height: 100%; }
.admin-sidebar { position: relative; display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; padding: 20px 14px 16px; color: white; background: linear-gradient(180deg, #183d24, #102d1a); }
.admin-sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 17px; border-bottom: 1px solid rgba(255,255,255,.12); }
.admin-sidebar-brand > span:last-child { min-width: 0; }
.admin-sidebar-brand strong, .admin-sidebar-brand small { display: block; }
.admin-sidebar-brand strong { font-family: Georgia, serif; font-size: 20px; }
.admin-sidebar-brand small { margin-top: 2px; color: rgba(255,255,255,.58); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.admin-sidebar-mark { display: grid; flex: 0 0 auto; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: var(--green); background: var(--gold); font-family: Georgia, serif; font-weight: 900; }
.admin-cloud-badge { display: flex; align-items: center; gap: 8px; margin: 14px 6px 9px; padding: 9px 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; color: rgba(255,255,255,.7); background: rgba(255,255,255,.055); font-size: 11px; }
.admin-cloud-badge span { width: 8px; height: 8px; border-radius: 50%; background: #d4a23a; box-shadow: 0 0 0 4px rgba(212,162,58,.12); }
.admin-cloud-badge[data-connected="true"] span { background: #72d39a; box-shadow: 0 0 0 4px rgba(114,211,154,.13); }
.admin-cloud-badge b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-tabs { display: flex; flex: 1 1 0; min-height: 0; flex-direction: column; gap: 3px; overflow-x: hidden; overflow-y: auto; padding: 0 5px 12px 3px; overscroll-behavior: contain; scrollbar-color: rgba(255,255,255,.28) transparent; scrollbar-gutter: stable; scrollbar-width: thin; }
.admin-tabs::-webkit-scrollbar { width: 6px; }
.admin-tabs::-webkit-scrollbar-track { background: transparent; }
.admin-tabs::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(255,255,255,.25); }
.admin-nav-label { margin: 13px 9px 4px; color: rgba(255,255,255,.38); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.admin-tabs button { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; width: 100%; min-height: 42px; padding: 7px 10px; border-radius: 11px; color: rgba(255,255,255,.72); background: transparent; text-align: left; }
.admin-tabs button:hover { color: white; background: rgba(255,255,255,.08); transform: none !important; }
.admin-tabs button.active { color: #173d24; background: #fffdf8; box-shadow: 0 8px 25px rgba(0,0,0,.12); }
.admin-tabs button b { font-size: 17px; font-weight: 500; text-align: center; }
.admin-tabs button span { overflow: hidden; margin: 0; opacity: 1; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 750; }
.admin-tabs button i { display: grid; min-width: 21px; height: 21px; place-items: center; padding: 0 5px; border-radius: 99px; color: #173d24; background: var(--gold); font-size: 10px; font-style: normal; font-weight: 900; }
.admin-tabs button i:empty { display: none; }
.admin-workspace { display: flex; min-width: 0; min-height: 0; flex-direction: column; }
.admin-workspace-header { z-index: 6; display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 20px; min-height: 94px; padding: 18px 24px; border-bottom: 1px solid var(--line); background: rgba(255,253,248,.96); backdrop-filter: blur(14px); }
.admin-workspace-header small { color: #9a6c05; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.admin-workspace-header h2 { margin-top: 2px; font-size: 30px; font-weight: 500; }
.admin-workspace-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.admin-header-actions { display: flex; align-items: center; gap: 9px; }
.web-push-control { position: relative; }
.notification-bell { position: relative; display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 13px; color: var(--green); background: white; font-size: 19px; box-shadow: 0 5px 16px rgba(21,47,29,.06); }
.notification-bell:hover { border-color: rgba(24,61,36,.3); transform: translateY(-1px); }
.notification-bell[data-state="active"] { border-color: #83b796; background: #edf8f0; }
.notification-bell[data-state="blocked"] { color: #a33b31; background: #fff2ef; }
.notification-bell i { position: absolute; top: -5px; right: -5px; display: grid; min-width: 19px; height: 19px; place-items: center; padding: 0 5px; border: 2px solid white; border-radius: 99px; color: white; background: #c94339; font-size: 9px; font-style: normal; font-weight: 900; }
.web-push-panel { position: absolute; z-index: 30; top: calc(100% + 10px); right: 0; width: min(330px, calc(100vw - 30px)); padding: 16px; border: 1px solid rgba(24,61,36,.15); border-radius: 16px; background: #fffdf8; box-shadow: 0 20px 55px rgba(18,45,27,.2); }
.web-push-panel strong { display: block; color: var(--green); font-family: Georgia, serif; font-size: 18px; }
.web-push-panel p { max-width: none; margin: 7px 0 13px; overflow: visible; color: var(--muted); font-size: 12px; line-height: 1.45; white-space: normal; }
.web-push-panel button { width: 100%; min-height: 39px; }
.web-push-panel .ghost-button { margin-top: 7px; }
.admin-content { flex: 1; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 22px 24px 30px; overscroll-behavior: contain; }
.admin-content .admin-data-view, .admin-content .stock-control-panel, .admin-content .archive-panel, .admin-content .contract-settings-form, .admin-content .segment-manager { margin: 0; }
.admin-content .admin-product-workspace { padding: 0; }
.admin-content .product-editor-toolbar { padding: 0 0 16px; }
.admin-content .archive-empty { margin: 0; }
.admin-content .empty-admin { margin: 24px; }
.admin-content .admin-table { width: 100%; margin: 0; }
.admin-content .data-summary-grid > div { box-shadow: 0 6px 18px rgba(21,47,29,.035); }

.admin-dashboard { display: grid; gap: 16px; }
.dashboard-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; overflow: hidden; padding: 24px 26px; border-radius: 20px; color: white; background: radial-gradient(circle at 85% 20%, rgba(220,165,43,.24), transparent 25%), linear-gradient(135deg, #1b4a2a, #12351e); box-shadow: 0 14px 35px rgba(18,55,31,.15); }
.dashboard-hero small { color: var(--gold); font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.dashboard-hero h3 { margin: 5px 0 6px; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.dashboard-hero p { margin: 0; color: rgba(255,255,255,.65); font-size: 13px; }
.dashboard-quick-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dashboard-hero .primary-button { color: var(--green); background: var(--gold); }
.dashboard-hero .secondary-button { color: white; border-color: rgba(255,255,255,.38); background: rgba(255,255,255,.05); }
.dashboard-visitors { overflow: hidden; border: 1px solid rgba(220,165,43,.32); border-radius: 18px; background: linear-gradient(135deg, #fffdf7, #f7faf5); }
.dashboard-visitors > header { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 15px 17px 12px; border-bottom: 1px solid rgba(24,61,36,.09); }
.dashboard-visitors > header small { color: #a06c00; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.dashboard-visitors > header h3 { margin: 3px 0 0; color: var(--green); font-family: Georgia, serif; font-size: 21px; }
.dashboard-visitors > header span { color: var(--muted); font-size: 10px; text-align: right; }
.visitor-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.visitor-metrics > div { display: grid; gap: 4px; min-height: 92px; padding: 14px 16px; border-right: 1px solid rgba(24,61,36,.09); }
.visitor-metrics > div:last-child { border-right: 0; }
.visitor-metrics small { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.visitor-metrics strong { color: var(--green); font-family: Georgia, serif; font-size: 25px; }
.visitor-metrics span { color: var(--muted); font-size: 10px; }
.visitor-metrics .conversion { background: rgba(220,165,43,.08); }
.dashboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.dashboard-metrics button { display: grid; gap: 5px; min-height: 120px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: white; text-align: left; box-shadow: 0 6px 18px rgba(21,47,29,.035); }
.dashboard-metrics button:hover { border-color: rgba(24,61,36,.25); transform: translateY(-2px); }
.dashboard-metrics button.attention { border-color: rgba(163,59,49,.2); background: #fff8f6; }
.dashboard-metrics small { color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.dashboard-metrics strong { color: var(--green); font-family: Georgia, serif; font-size: 29px; }
.dashboard-metrics strong i { font-family: inherit; font-size: 15px; font-style: normal; }
.dashboard-metrics span { color: var(--muted); font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dashboard-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; }
.dashboard-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.dashboard-panel header small { color: #9a6c05; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.dashboard-panel header h3 { margin: 3px 0 0; color: var(--green); font-family: Georgia, serif; font-size: 20px; }
.dashboard-panel header button, .dashboard-system button { padding: 7px 9px; color: var(--green); background: var(--cream); font-size: 11px; font-weight: 800; }
.dashboard-list { display: grid; }
.dashboard-list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 58px; padding: 10px 18px; border-bottom: 1px solid #edf0eb; border-radius: 0; color: var(--ink); background: white; text-align: left; }
button.dashboard-list-row:hover { background: #fbfaf6; transform: none !important; }
.dashboard-list-row:last-child { border-bottom: 0; }
.dashboard-list-row span { min-width: 0; }
.dashboard-list-row span:last-child { text-align: right; }
.dashboard-list-row strong, .dashboard-list-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-list-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.dashboard-list-row b { white-space: nowrap; font-size: 12px; }
.dashboard-empty { margin: 0; padding: 35px 18px; color: var(--muted); font-size: 12px; text-align: center; }
.dashboard-system { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 16px; background: #fbfaf6; }
.dashboard-system > div { display: flex; align-items: center; gap: 11px; }
.dashboard-system strong, .dashboard-system small { display: block; }
.dashboard-system small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.system-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(220,165,43,.12); }
.system-dot.online { background: #36a366; box-shadow: 0 0 0 5px rgba(54,163,102,.12); }

.product-editor-toolbar { align-items: end; }
.product-editor-filters { display: flex; flex: 1; align-items: end; gap: 10px; }
.product-editor-filters label:first-child { flex: 1 1 330px; }
.product-editor-filters label:nth-child(2) { flex: 0 1 210px; }
.product-editor-filters span { margin-bottom: 11px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.product-picker-empty { padding: 24px 8px; color: var(--muted); font-size: 12px; text-align: center; }
.stock-inline-editor { grid-template-columns: minmax(118px, 150px); }
.stock-step-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.stock-step-buttons button { min-height: 28px; padding: 0 8px; color: var(--green); background: var(--cream); font-size: 10px; font-weight: 850; }
.sync-details { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.sync-details summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 17px; cursor: pointer; list-style: none; }
.sync-details summary::-webkit-details-marker { display: none; }
.sync-details summary span, .sync-details summary b, .sync-details summary small { display: block; }
.sync-details summary b { color: var(--green); }
.sync-details summary small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.sync-details summary i { color: #9a6c05; font-size: 11px; font-style: normal; font-weight: 850; }
.sync-details[open] summary { border-bottom: 1px solid var(--line); }
.sync-details[open] summary i { font-size: 0; }
.sync-details[open] summary i::after { content: "Свернуть"; font-size: 11px; }
.sync-details-body { padding: 16px; }
.settings-intro { margin-bottom: 14px; padding: 20px; border-radius: 18px; color: white; background: linear-gradient(135deg, #1b4a2a, #12351e); }
.settings-intro > div { display: flex; align-items: center; gap: 14px; }
.settings-intro span { display: grid; flex: 0 0 auto; place-items: center; width: 45px; height: 45px; border-radius: 14px; color: var(--green); background: var(--gold); font-size: 20px; }
.settings-intro h3 { margin: 0; font-family: Georgia, serif; font-size: 23px; }
.settings-intro p { margin: 4px 0 0; color: rgba(255,255,255,.65); font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.settings-card { padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.settings-card > div:first-child small { color: #9a6c05; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.settings-card h3 { margin: 3px 0 5px; color: var(--green); font-family: Georgia, serif; font-size: 21px; }
.settings-card p { margin: 0 0 14px; color: var(--muted); font-size: 11px; }
.settings-card .minimum-order-setting, .settings-card .admin-toolbar { margin: 0; padding: 0; border: 0; background: transparent; }
.settings-card .admin-toolbar { display: grid; }
.settings-card .admin-toolbar button { width: 100%; margin-top: 10px; }
.backup-settings-card { grid-column: 1 / -1; }
.backup-settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.backup-settings-heading .secondary-button { flex: 0 0 auto; }
.server-storage-summary { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(125px, .7fr)); gap: 9px; margin-top: 5px; }
.storage-disk, .storage-metric { padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: #f8f7f1; }
.storage-disk header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.storage-disk small, .storage-metric small { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.storage-disk strong, .storage-metric strong { display: block; margin-top: 5px; color: var(--green); font-family: Georgia, serif; font-size: 19px; }
.storage-disk header strong { margin: 0; font-family: inherit; font-size: 12px; }
.storage-progress { height: 8px; margin: 11px 0 7px; overflow: hidden; border-radius: 99px; background: #e4e5dc; }
.storage-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2b7a48, #dca52b); }
.storage-disk span, .storage-metric span { color: var(--muted); font-size: 10px; }
.storage-placeholder { grid-column: 1 / -1; padding: 22px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; }
.backup-settings-controls { display: grid; grid-template-columns: minmax(150px, 220px) auto auto; align-items: end; gap: 9px; margin-top: 12px; }
.backup-settings-controls label { margin: 0; color: var(--muted); font-size: 10px; }
.backup-settings-controls input { margin-top: 5px; }
.backup-list { display: grid; margin-top: 13px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.backup-list-row { display: grid; grid-template-columns: minmax(180px, 1fr) 120px auto; align-items: center; gap: 12px; min-height: 52px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: white; }
.backup-list-row:last-child { border-bottom: 0; }
.backup-list-row strong, .backup-list-row small { display: block; }
.backup-list-row strong { color: var(--green); font-size: 12px; }
.backup-list-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.backup-list-row > span { color: var(--ink); font-size: 11px; }
.backup-list-actions { display: flex; justify-content: flex-end; gap: 6px; }
.backup-list-actions button { min-height: 30px; padding: 5px 8px; font-size: 9px; }
.backup-empty { padding: 22px; color: var(--muted); font-size: 11px; text-align: center; }
.telegram-settings-card { grid-column: 1 / -1; }
.telegram-settings-state { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: #f8f7f1; }
.telegram-status { display: inline-flex; align-items: center; gap: 8px; color: #8a463c; font-size: 12px; }
.telegram-status i { width: 9px; height: 9px; border-radius: 50%; background: #c35a4e; box-shadow: 0 0 0 4px rgba(195,90,78,.1); }
.telegram-status[data-connected="true"] { color: #17613a; }
.telegram-status[data-connected="true"] i { background: #3ca06a; box-shadow: 0 0 0 4px rgba(60,160,106,.12); }
.telegram-settings-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.telegram-settings-actions button { flex: 0 0 auto; }
.telegram-recipients { display: grid; gap: 8px; margin-top: 10px; }
.telegram-recipient { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid #dce4db; border-radius: 13px; background: #fbfdfb; }
.telegram-recipient.inactive { background: #f7f5ef; opacity: .72; }
.telegram-recipient-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #e4f3e8; color: #17613a; font-size: 15px; font-weight: 900; }
.telegram-recipient.inactive .telegram-recipient-avatar { background: #ebe7dd; color: #80796d; }
.telegram-recipient-info { display: grid; min-width: 0; gap: 2px; }
.telegram-recipient-info strong { overflow: hidden; color: var(--green); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.telegram-recipient-info small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.telegram-recipient-actions { display: flex; gap: 6px; }
.telegram-recipient-actions button { min-height: 32px; padding: 7px 10px; font-size: 10px; }
.telegram-recipient-actions .danger { color: #a13e34; }
.telegram-recipients-empty { display: grid; gap: 3px; padding: 15px; border: 1px dashed #ccd7cb; border-radius: 13px; color: var(--muted); text-align: center; }
.telegram-recipients-empty strong { color: var(--green); font-size: 12px; }
.telegram-recipients-empty span { font-size: 10px; }
.telegram-settings-hint { display: block; margin-top: 9px; color: var(--muted); font-size: 10px; }
.telegram-settings-hint a { color: var(--green); font-weight: 800; }

/* Оформление заказа и график выдачи */
.cart-drawer { width: min(560px, 100%); background: #fbfaf5; }
.cart-drawer .drawer-header { padding: 19px 22px; background: rgba(255,253,248,.96); backdrop-filter: blur(14px); }
.cart-drawer .drawer-header h2 { font-size: 29px; }
.cart-drawer .cart-summary { position: sticky; z-index: 3; top: 79px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.cart-drawer .cart-lines { padding: 4px 22px 12px; background: white; }
.cart-drawer .cart-line { padding: 13px 0; }
.pickup-booking { flex: 0 0 auto; margin: 12px 18px; padding: 17px; border: 1px solid rgba(222,166,35,.42); border-radius: 18px; background: linear-gradient(145deg, #fffaf0, #f6f4e9); box-shadow: 0 8px 22px rgba(45,55,32,.04); }
.pickup-booking-heading { display: flex; align-items: flex-start; gap: 12px; }
.pickup-booking-icon { display: grid; flex: 0 0 auto; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--green); background: var(--gold); font-size: 22px; font-weight: 900; }
.pickup-booking-heading small { color: #9a6c05; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .11em; }
.pickup-booking-heading h3 { margin: 2px 0 3px; color: var(--green); font-family: Georgia, serif; font-size: 18px; }
.pickup-booking-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.pickup-booking-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.pickup-booking-fields input { min-height: 44px; border-color: rgba(24,61,36,.2); font-weight: 750; }
.pickup-booking-note { margin-top: 10px; color: var(--muted); font-size: 10px; }
.cart-drawer .customer-form { margin: 0 18px 14px; padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.cart-drawer .customer-form h3 { color: var(--green); font-family: Georgia, serif; font-size: 19px; }
.cart-drawer .drawer-footer { position: sticky; z-index: 4; bottom: 0; padding: 16px 22px; box-shadow: 0 -12px 28px rgba(18,45,26,.08); }
.cart-drawer .grand-total { align-items: center; margin-bottom: 10px; }
.cart-drawer .grand-total strong { font-family: Georgia, serif; font-size: 28px; }
.cart-drawer #createOrderButton { min-height: 48px; }

.order-modal { width: min(920px, calc(100% - 32px)); background: #f7f5ee; }
.order-modal > .drawer-header { position: sticky; z-index: 5; top: 0; padding: 17px 24px; background: rgba(255,253,248,.96); backdrop-filter: blur(14px); }
.order-modal > .drawer-header h2 { font-size: 27px; }
#printableOrder { padding: 24px; }
.order-document-head { align-items: flex-start; padding: 22px; border: 0; border-radius: 18px 18px 0 0; color: white; background: linear-gradient(135deg, #174426, #0e321b); }
.order-document-brand small, .order-document-number small { color: rgba(255,255,255,.58); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .11em; }
.order-document-brand h2 { margin: 3px 0 4px; color: white; font-family: Georgia, serif; font-size: 31px; }
.order-document-brand p, .order-document-number p { margin: 2px 0; color: rgba(255,255,255,.66); }
.order-document-number { text-align: right; }
.order-document-number strong { display: block; margin: 4px 0; color: var(--gold); font-size: 18px; }
.pickup-confirmation { display: flex; align-items: center; gap: 13px; padding: 15px 20px; border: 1px solid rgba(222,166,35,.35); border-top: 0; background: #fff8e7; }
.pickup-confirmation > span { display: grid; flex: 0 0 auto; place-items: center; width: 39px; height: 39px; border-radius: 12px; color: white; background: var(--green); font-size: 21px; }
.pickup-confirmation small, .pickup-confirmation strong, .pickup-confirmation p { display: block; }
.pickup-confirmation small { color: #9a6c05; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .09em; }
.pickup-confirmation strong { margin-top: 2px; color: var(--green); font-size: 16px; }
.pickup-confirmation p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.order-party-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 0; }
.order-party-grid > div { min-height: 90px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.order-party-grid small { display: block; color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.order-party-grid strong { display: block; margin: 5px 0; color: var(--green); }
.order-party-grid p { margin: 2px 0; color: var(--muted); font-size: 11px; }
.order-modal .order-table { margin-top: 4px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; }
.order-modal .order-table th { color: var(--green); background: #f1f2ea; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.order-comment { margin: 13px 0 0; padding: 12px 14px; border-left: 3px solid var(--gold); border-radius: 8px; background: #fffaf0; font-size: 12px; }
.order-modal .document-total { align-items: baseline; margin-top: 16px; padding: 18px 20px; border-radius: 14px; color: white; background: var(--green); }
.order-modal .document-total strong { color: var(--gold); }
.order-modal .order-confirm-actions { position: sticky; z-index: 5; bottom: 0; padding: 15px 24px; box-shadow: 0 -10px 24px rgba(24,61,36,.08); }

.pickup-schedule-panel { margin: 14px 0; padding: 17px; border: 1px solid rgba(222,166,35,.35); border-radius: 18px; background: linear-gradient(145deg, #fffdf7, #f4f3e9); }
.pickup-schedule-panel > header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.pickup-schedule-panel > header small { color: #9a6c05; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.pickup-schedule-panel > header h3 { margin: 2px 0 0; color: var(--green); font-family: Georgia, serif; font-size: 23px; }
.pickup-schedule-panel > header p { margin: 0; color: var(--muted); font-size: 11px; }
.pickup-schedule-days { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
.pickup-day { flex: 0 0 255px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; scroll-snap-align: start; }
.pickup-day > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line); background: #f4f4ed; }
.pickup-day > header small, .pickup-day > header strong { display: block; }
.pickup-day > header small { color: var(--green); font-weight: 850; text-transform: capitalize; }
.pickup-day > header strong, .pickup-day > header span { color: var(--muted); font-size: 10px; }
.pickup-day-slots { display: grid; gap: 5px; padding: 7px; }
.pickup-slot { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 9px; width: 100%; padding: 9px; border: 1px solid transparent; color: var(--ink); background: transparent; text-align: left; }
.pickup-slot:hover { border-color: rgba(24,61,36,.18); background: #f8f7f1; transform: none !important; }
.pickup-slot time { color: var(--green); font-weight: 900; }
.pickup-slot span strong, .pickup-slot span small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pickup-slot span strong { font-size: 11px; }
.pickup-slot span small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.pickup-slot i { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; color: #a54135; background: #fff0ed; font-size: 9px; font-style: normal; font-weight: 900; }
.pickup-schedule-empty { display: flex; align-items: center; gap: 12px; padding: 22px; border: 1px dashed rgba(24,61,36,.2); border-radius: 14px; color: var(--muted); background: rgba(255,255,255,.6); }
.pickup-schedule-empty > span { font-size: 25px; }
.pickup-schedule-empty strong { color: var(--green); }
.pickup-schedule-empty p { margin: 3px 0 0; font-size: 11px; }
.order-pickup-button { padding: 7px 9px; color: var(--green); background: #f2f5ef; text-align: left; }
.order-pickup-button strong, .order-pickup-button small { display: block; white-space: nowrap; }
.order-pickup-button strong { font-size: 11px; }
.order-pickup-button small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.schedule-edit-card { width: min(470px, 100%); }
.schedule-edit-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 18px; }
.schedule-conflict-note { margin-top: 12px !important; padding: 10px 12px; border-radius: 10px; color: #356647 !important; background: #edf7f0; font-size: 11px; }
.schedule-conflict-note[data-conflict="true"] { color: #9a5300 !important; background: #fff5df; }

@media (min-width: 761px) and (max-height: 720px) {
  .admin-sidebar { padding: 11px 10px 9px; }
  .admin-sidebar-brand { padding-bottom: 9px; }
  .admin-sidebar-mark { width: 34px; height: 34px; border-radius: 10px; }
  .admin-sidebar-brand strong { font-size: 17px; }
  .admin-sidebar-brand small { font-size: 8px; }
  .admin-cloud-badge { margin: 8px 4px 4px; padding: 7px 9px; }
  .admin-nav-label { margin: 7px 8px 2px; }
  .admin-tabs { gap: 1px; padding-bottom: 8px; }
  .admin-tabs button { min-height: 36px; padding: 5px 8px; }
  .admin-tabs button b { font-size: 15px; }
  .admin-tabs button span { font-size: 12px; }
}

@media (max-width: 1100px) {
  .catalog-grid { grid-template-columns: repeat(3, 1fr); }
  .terms-strip { grid-template-columns: repeat(2, 1fr); }
  nav { display: none; }
  .segment-fields, .segment-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segment-update-row { display: grid; grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .dashboard-metrics { grid-template-columns: 1fr 1fr; }
  .visitor-metrics { grid-template-columns: repeat(3, 1fr); }
  .visitor-metrics > div { border-bottom: 1px solid rgba(24,61,36,.09); }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 68px; }
  button, a { touch-action: manipulation; }
  .site-header { display: grid; grid-template-columns: auto minmax(68px, 1fr) auto; gap: 6px; min-height: 60px; padding: 8px 10px; }
  .brand { min-width: 0; margin-right: 0; }
  .brand small { display: none; }
  .brand strong { font-size: 13px; }
  .header-minimum { justify-self: center; min-height: 40px; padding: 5px 8px; }
  .header-minimum small { display: none; }
  .header-minimum strong { font-size: 11px; }
  .header-actions { gap: 5px; }
  .payment-help-button { width: 40px; min-height: 40px; padding: 0; }
  .payment-help-button span { display: none; }
  .header-actions #adminButton { width: 40px; min-height: 40px; padding: 0; font-size: 0; }
  .header-actions #adminButton::before { content: "⚙"; font-size: 19px; }
  .header-clear-cart { width: 40px; min-height: 40px; padding: 0; }
  .header-clear-cart span { display: none; }
  .header-actions .cart-button { min-height: 40px; padding: 0 12px; }
  .cart-button span { min-width: 22px; height: 22px; margin-left: 6px; }
  .hero-content { padding: 48px 18px 44px; }
  .hero { min-height: auto; }
  h1 { font-size: clamp(36px, 10.5vw, 50px); line-height: 1.02; }
  .hero p { margin: 16px 0 20px; font-size: 16px; line-height: 1.5; }
  .hero-actions > * { flex: 1 1 155px; }
  .hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 25px; }
  .hero-facts strong { font-size: 19px; }
  .terms-strip { grid-template-columns: 1fr; gap: 9px; padding: 12px; }
  .terms-strip div { min-height: 92px; padding: 18px 48px 17px 70px; }
  .terms-strip div::before { left: 16px; top: 50%; width: 38px; height: 38px; transform: translateY(-50%); }
  .terms-strip span { right: 16px; top: 16px; font-size: 20px; }
  .terms-strip strong { font-size: 17px; }
  .terms-strip small { margin-top: 5px; }
  .catalog-section { padding: 48px 12px 62px; }
  .section-heading { display: block; }
  .section-heading h2, .contact-section h2 { font-size: clamp(34px, 9vw, 46px); }
  .order-progress { margin-top: 20px; }
  .filters { margin: 0 -12px 24px; padding: 0 12px 8px; scrollbar-width: none; }
  .filters::-webkit-scrollbar, .admin-tabs::-webkit-scrollbar, .product-picker::-webkit-scrollbar { display: none; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-image { height: 210px; }
  .product-body { padding: 13px; }
  .product-body h3 { font-size: 18px; }
  .specs { display: block; }
  .price-tiers { padding: 8px; }
  .qty-control button { min-height: 44px; }
  .contact-section { display: block; padding: 48px 18px; }
  .contact-links { margin-top: 24px; }
  .contact-links { flex-wrap: wrap; }
  .contact-links a { flex: 1 1 170px; text-align: center; }
  .cart-drawer { width: 100%; height: 100dvh; }
  .drawer-header { position: sticky; z-index: 5; top: 0; gap: 10px; padding: 15px 14px; background: var(--paper); }
  .drawer-header h2 { font-size: 26px; }
  .drawer-header-actions { gap: 5px; }
  .cart-summary { padding: 12px 10px; }
  .cart-summary div { min-width: 0; padding: 4px 9px; }
  .cart-lines { padding: 6px 14px; }
  .customer-form { padding: 16px 14px; }
  .drawer-footer { position: sticky; z-index: 4; bottom: 0; padding: 14px; box-shadow: 0 -8px 24px rgba(21,47,29,.08); }
  .modal { top: 0; left: 0; width: 100%; height: 100dvh; max-height: none; transform: translateY(18px); border-radius: 0; }
  .modal.open { transform: none; }
  .admin-modal, .order-modal, .contract-modal { width: 100%; padding-bottom: 0; }
  .order-actions, .order-confirm-actions { position: sticky; z-index: 4; bottom: 0; flex-wrap: wrap; padding: 12px 14px; background: var(--paper); }
  .order-actions button, .order-confirm-actions button { flex: 1 1 170px; }
  #printableOrder { padding: 18px 14px; overflow-x: auto; }
  .document-head { align-items: flex-start; flex-direction: column; }
  .document-head h2 { font-size: 28px; }
  .order-table { min-width: 610px; }
  .document-total { justify-content: space-between; }
  .document-total strong { margin-left: 12px; font-size: 24px; }
  input, textarea, select { font-size: 16px; }
  .admin-toolbar { display: block; }
  .admin-note { margin: 14px; }
  .admin-toolbar { padding: 0 14px 14px; }
  .admin-toolbar button { width: 100%; margin-top: 10px; }
  .cloud-settings-panel { margin: 0 14px 16px; }
  .cloud-settings-head { align-items: flex-start; flex-direction: column; }
  #cloudStatus { text-align: left; }
  .cloud-settings-actions > button { width: 100%; }
  .admin-tabs { position: sticky; z-index: 3; top: 70px; overflow-x: auto; padding: 8px 14px 14px; background: var(--paper); scrollbar-width: none; }
  .admin-tabs button { flex: 0 0 auto; }
  .archive-panel { margin: 0 14px; }
  .archive-item { grid-template-columns: 54px minmax(0, 1fr); }
  .archive-photo { width: 54px; height: 54px; }
  .archive-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .minimum-order-setting { grid-template-columns: 1fr; margin: 0 14px 16px; }
  .minimum-order-setting small { grid-column: auto; }
  .table-scroll-top, .desktop-order-table { display: none; }
  .mobile-order-list { display: grid; gap: 10px; }
  .admin-table { display: block; overflow-x: auto; }
  .admin-product-workspace { display: block; padding: 0 14px; }
  .product-editor-toolbar { align-items: stretch; flex-direction: column; padding: 0 14px 14px; }
  .product-editor-toolbar button { width: 100%; }
  .product-picker { display: flex; max-height: none; overflow-x: auto; margin: 0 -14px 12px; padding: 0 14px 8px; scrollbar-width: none; }
  .product-picker-item { flex: 0 0 180px; }
  .product-picker-item { grid-template-columns: 40px minmax(0, 1fr); }
  .picker-photo { width: 40px; height: 40px; }
  .product-editor { grid-template-columns: 150px 1fr; gap: 12px; padding: 12px; }
  .editor-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tier-price-fields, .product-option-group { grid-template-columns: 1fr; }
  .product-option-group label, .product-option-group label:first-child { grid-column: auto; }
  .editor-footer .catalog-order-controls { justify-content: flex-start; }
  .segment-manager { padding: 0 14px; }
  .contract-settings-form { margin: 0 14px; padding: 14px; }
  .contract-customer-grid { grid-template-columns: 1fr; }
  .contract-customer-grid .wide-field { grid-column: auto; }
  .stock-control-panel { margin: 0 14px; }
  .stock-compare-table .admin-table { min-width: 720px; }
  .contract-sheet { width: 100%; min-height: 0; padding: 18px; }
  .toast { bottom: 14px; width: calc(100% - 28px); text-align: center; }
  .status-confirm-overlay { align-items: end; padding: 12px; }
  .status-confirm-card { padding: 20px; border-radius: 20px; }
  .status-confirm-actions button { flex: 1; }
  .finance-preview { grid-template-columns: 1fr 1fr; }
  .finance-preview div:last-child { grid-column: 1 / -1; }
  .contract-order-edit-scroll { max-height: 55dvh; }
  .admin-modal { height: 100dvh; max-height: none; border: 0; }
  .admin-shell { display: grid; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .admin-sidebar { display: block; padding: 9px 10px 8px; }
  .admin-sidebar-brand { display: inline-flex; padding: 0 4px 8px; border: 0; }
  .admin-sidebar-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
  .admin-sidebar-brand strong { font-size: 16px; }
  .admin-sidebar-brand small { display: none; }
  .admin-cloud-badge { position: absolute; top: 11px; right: 13px; width: auto; margin: 0; padding: 7px 9px; }
  .admin-tabs { position: static; display: flex; height: auto; flex-direction: row; gap: 5px; overflow-x: auto; padding: 0 2px 2px; background: transparent; scrollbar-width: none; }
  .admin-tabs .admin-nav-label { display: none; }
  .admin-tabs button { display: flex; flex: 0 0 auto; gap: 6px; width: auto; min-height: 38px; padding: 7px 11px; color: rgba(255,255,255,.72); background: rgba(255,255,255,.06); }
  .admin-tabs button.active { color: var(--green); background: white; }
  .admin-tabs button b { font-size: 15px; }
  .admin-tabs button span { font-size: 12px; }
  .admin-workspace-header { min-height: 75px; padding: 13px 14px; }
  .admin-workspace-header h2 { font-size: 25px; }
  .admin-workspace-header p { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-header-actions { gap: 6px; }
  .notification-bell, .admin-header-actions > .icon-button { width: 38px; height: 38px; border-radius: 11px; }
  .web-push-panel { position: fixed; top: 78px; right: 12px; }
  .admin-content { padding: 14px 12px 24px; }
  .admin-content .admin-data-view, .admin-content .stock-control-panel, .admin-content .archive-panel, .admin-content .contract-settings-form, .admin-content .segment-manager { margin: 0; }
  .admin-content .admin-product-workspace { padding: 0; }
  .admin-content .product-editor-toolbar { padding: 0 0 12px; }
  .dashboard-hero { align-items: stretch; flex-direction: column; padding: 20px; }
  .dashboard-quick-actions { justify-content: flex-start; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .product-editor-filters { align-items: stretch; flex-direction: column; width: 100%; }
  .product-editor-filters label:first-child, .product-editor-filters label:nth-child(2) { flex-basis: auto; }
  .product-editor-filters span { margin: 0; }
  .settings-grid { grid-template-columns: 1fr; }
  #adminSettings .cloud-settings-panel { margin: 0 0 14px; }
  #adminSettings .admin-toolbar { padding: 0; }
  #adminSettings .minimum-order-setting { margin: 0; }
  .server-storage-summary { grid-template-columns: 1fr 1fr; }
  .storage-disk { grid-column: 1 / -1; }
  .backup-settings-controls { grid-template-columns: 1fr 1fr; }
  .backup-settings-controls label { grid-column: 1 / -1; }
  .telegram-settings-state { align-items: stretch; flex-direction: column; }
  .telegram-settings-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .telegram-settings-state button { width: 100%; }
}
@media (max-width: 560px) {
  .backup-settings-heading { align-items: stretch; flex-direction: column; }
  .backup-settings-heading button { width: 100%; }
  .server-storage-summary, .backup-settings-controls { grid-template-columns: 1fr; }
  .storage-disk, .backup-settings-controls label { grid-column: auto; }
  .backup-settings-controls button { width: 100%; }
  .backup-list-row { grid-template-columns: 1fr auto; }
  .backup-list-row > span { text-align: right; }
  .backup-list-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .receipt-help-overlay { align-items: end; padding: 8px; }
  .receipt-help-card { width: 100%; max-height: calc(100dvh - 16px); padding: 20px 14px 14px; border-radius: 20px; }
  .receipt-help-heading { padding-right: 34px; }
  .telegram-settings-actions { grid-template-columns: 1fr; }
  .telegram-recipient { grid-template-columns: 32px minmax(0,1fr); }
  .telegram-recipient-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .receipt-help-heading > span { width: 40px; height: 40px; border-radius: 12px; }
  .receipt-help-heading h2 { font-size: 24px; }
  .receipt-help-message { margin: 14px 0; font-size: 13px; }
  .receipt-help-options { grid-template-columns: 1fr; }
  .receipt-option { grid-template-columns: minmax(0, 1fr) 102px; padding: 12px; }
  .receipt-option img { width: 102px; height: 102px; }
  .receipt-help-done { width: 100%; }
  .cart-drawer .drawer-header { padding: 14px; }
  .cart-drawer .drawer-header h2 { font-size: 25px; }
  .cart-drawer .cart-summary { top: 69px; padding: 10px 8px; }
  .cart-drawer .cart-summary div { padding: 4px 9px; }
  .cart-drawer .cart-lines { padding: 3px 14px 9px; }
  .pickup-booking, .cart-drawer .customer-form { margin-right: 10px; margin-left: 10px; padding: 14px; }
  .cart-drawer .drawer-footer { padding: 13px 14px; }
  .order-modal { width: 100%; height: 100dvh; max-height: none; border-radius: 0; }
  #printableOrder { padding: 12px; }
  .order-document-head { display: block; padding: 18px; }
  .order-document-brand h2 { font-size: 26px; }
  .order-document-number { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.14); text-align: left; }
  .order-party-grid { grid-template-columns: 1fr; }
  .order-modal .order-table { display: block; min-width: 0; overflow: visible; border: 0; background: transparent; }
  .order-modal .order-table thead { display: none; }
  .order-modal .order-table tbody { display: grid; gap: 8px; }
  .order-modal .order-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: white; }
  .order-modal .order-table td { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0; border: 0; text-align: right; }
  .order-modal .order-table td:first-child { grid-column: 1 / -1; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-weight: 850; text-align: left; }
  .order-modal .order-table td:nth-child(2)::before { content: "Коробок"; }
  .order-modal .order-table td:nth-child(3)::before { content: "Штук"; }
  .order-modal .order-table td:nth-child(4)::before { content: "Цена"; }
  .order-modal .order-table td:nth-child(5)::before { content: "Сумма"; }
  .order-modal .order-table td::before { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
  .order-modal .document-total { position: sticky; right: 0; }
  .pickup-schedule-panel { padding: 14px; }
  .pickup-schedule-panel > header { align-items: flex-start; flex-direction: column; gap: 5px; }
  .pickup-day { flex-basis: 235px; }
  .schedule-edit-fields { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: 1fr; }
  .product-image { height: clamp(270px, 82vw, 350px); }
  .customer-form { grid-template-columns: 1fr; }
  .customer-form h3, .customer-form label:last-child, .customer-form .customer-email, .customer-form .customer-full-name, .customer-form .customer-legal-status { grid-column: auto; }
  .data-summary-grid { grid-template-columns: 1fr; }
  .data-summary-grid > div { min-height: 70px; }
  .segment-fields, .segment-editor { grid-template-columns: 1fr; }
  .segment-update-row, .segment-actions { display: grid; grid-template-columns: 1fr; }
  .segment-actions button { width: 100%; }
  .product-editor { display: block; width: 100%; max-width: 100%; }
  .product-editor-detail, .editor-fields, .editor-fields label { min-width: 0; max-width: 100%; }
  .editor-photo { min-height: 240px; margin-bottom: 10px; }
  .editor-photo-actions { margin-bottom: 14px; }
  .editor-footer { display: block; }
  .editor-footer > div { display: grid; grid-template-columns: 1fr; margin-top: 12px; }
  .editor-footer .catalog-order-controls { display: grid; grid-template-columns: 1fr; }
  .editor-footer .catalog-order-controls button { width: 100%; }
  .archive-heading { align-items: flex-start; }
  .danger-zone { align-items: stretch; flex-direction: column; }
  .danger-zone > div:last-child { display: grid; grid-template-columns: 1fr; }
  .stock-control-head { align-items: stretch; flex-direction: column; }
  .admin-cloud-badge b { display: none; }
  .order-edit-grid { grid-template-columns: 1fr; }
  .order-edit-grid .wide-field { grid-column: auto; }
  .contract-edit-actions { grid-template-columns: 1fr; }
  .contract-edit-actions #saveContractEditButton { grid-column: auto; }
  .items-editor-row { grid-template-columns: 1fr auto; }
  .items-editor-quantity { grid-column: 1 / -1; grid-template-columns: 38px minmax(70px,1fr) 38px; }
  .items-editor-add { grid-template-columns: 1fr; }
  .items-editor-add button { width: 100%; }
  .items-editor-preview { grid-template-columns: 1fr 1fr; }
  .items-edit-actions { display: grid; grid-template-columns: 1fr; }
  .order-more-popover { width: 190px; }
  .stock-control-head button { width: 100%; }
  .stock-sync-actions { grid-template-columns: 1fr; }
  .dashboard-metrics { grid-template-columns: 1fr 1fr; }
  .dashboard-metrics button { min-height: 106px; padding: 14px; }
  .dashboard-metrics strong { font-size: 25px; }
  .dashboard-quick-actions { display: grid; grid-template-columns: 1fr; }
  .dashboard-quick-actions button { width: 100%; }
  .dashboard-visitors > header { align-items: flex-start; flex-direction: column; }
  .dashboard-visitors > header span { text-align: left; }
  .visitor-metrics { grid-template-columns: 1fr 1fr; }
  .visitor-metrics > div { min-height: 82px; padding: 12px 14px; }
  .visitor-metrics > div:nth-child(even) { border-right: 0; }
  .visitor-metrics > div:last-child { grid-column: 1 / -1; }
  .dashboard-system { align-items: stretch; flex-direction: column; }
  .dashboard-system button { width: 100%; }
  .sync-details summary { align-items: flex-start; }
  .sync-details summary i { display: none; }
}
@media (max-width: 430px) {
  .mobile-order-card > header { grid-template-columns: 1fr; }
  .mobile-order-facts { grid-template-columns: 1fr 1fr; }
  .mobile-order-facts > div:last-child { grid-column: 1 / -1; }
  .pickup-booking-fields { grid-template-columns: 1fr; }
  .pickup-confirmation { align-items: flex-start; padding: 13px; }
  .brand { gap: 6px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand > span:last-child { display: none; }
  .header-minimum { padding: 4px 7px; }
  .header-actions .cart-button { padding: 0 9px; font-size: 12px; }
  .hero-facts { grid-template-columns: 1fr 1fr; }
  .hero-facts span:last-child { grid-column: 1 / -1; }
  .editor-fields { grid-template-columns: 1fr; }
  .editor-fields label:first-child { grid-column: auto; }
  .contract-customer-grid, .contract-settings-grid, .contract-parties { grid-template-columns: 1fr; }
  .contract-customer-grid .wide-field, .contract-settings-grid .wide-field { grid-column: auto; }
  #contractPrintable { padding: 8px; }
  .contract-sheet { font-size: 12px; }
  .contract-table { font-size: 10px; }
  .contract-amounts { width: 100%; }
  .status-confirm-actions { display: grid; grid-template-columns: 1fr; }
}

@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { width: auto; height: auto; margin: 0; padding: 0; background: white; }
  body.print-order > :not(#orderModal), body.print-contract > :not(#contractModal) { display: none !important; }
  body.print-order #orderModal, body.print-contract #contractModal {
    display: block !important; visibility: visible !important; opacity: 1 !important;
    position: static !important; inset: auto !important;
    width: 100% !important; max-width: none !important; max-height: none !important;
    margin: 0 !important; overflow: visible !important; transform: none !important;
    border-radius: 0; box-shadow: none;
  }
  body.print-order #orderModal *, body.print-contract #contractModal * { visibility: visible !important; }
  body.print-order #orderModal .drawer-header,
  body.print-order #orderModal .order-actions,
  body.print-order #orderModal .order-confirm-actions,
  body.print-contract #contractModal .drawer-header,
  body.print-contract #contractModal .order-actions { display: none !important; }
  body.print-order #printableOrder { padding: 14mm; }
  .order-table { page-break-inside: auto; }
  .order-table tr { page-break-inside: avoid; page-break-after: auto; }
  .document-head, .document-total { page-break-inside: avoid; }
  body.print-contract #contractPrintable { padding: 0; background: white; }
  body.print-contract .contract-sheet {
    width: 210mm; min-height: 297mm; margin: 0; padding: 20mm 15mm 20mm 30mm;
    box-shadow: none; break-after: page; page-break-after: always;
  }
  body.print-contract .contract-sheet:last-child { break-after: auto; page-break-after: auto; }
}
