:root {
  --ink: #17221f;
  --muted: #6f7c77;
  --line: #e1e9e5;
  --canvas: #f5f8f6;
  --panel: #ffffff;
  --green: #1f6654;
  --green-dark: #174d40;
  --green-soft: #e8f4ef;
  --blue: #3979ca;
  --blue-soft: #e9f2ff;
  --mint: #259f79;
  --mint-soft: #e7f7f1;
  --amber: #d98b22;
  --amber-soft: #fff3dc;
  --violet: #745bb7;
  --violet-soft: #f1ecff;
  --danger: #bc4d50;
  --danger-soft: #ffebeb;
  --shadow: 0 8px 35px rgba(35, 67, 56, 0.07);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 27px; line-height: 1.2; letter-spacing: -0.03em; }
h2 { margin-bottom: 0; font-size: 19px; letter-spacing: -0.02em; }
h3 { margin-bottom: 0; font-size: 15px; }
.muted { color: var(--muted); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 27px 17px 20px;
  color: #dcebe6;
  background:
    radial-gradient(circle at 10% 5%, rgba(115, 191, 164, .16), transparent 25%),
    linear-gradient(180deg, #183f35 0%, #12352d 100%);
  box-shadow: 10px 0 35px rgba(19, 57, 47, .08);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 29px; color: white; }
.brand-mark {
  width: 40px;
  height: 47px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--green);
  background: #f5fff9;
  border-radius: 48% 48% 52% 52% / 36% 36% 64% 64%;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 7px 20px rgba(0, 0, 0, .16);
}
.brand b { display: block; font-size: 18px; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 2px; color: #98b9ae; font-size: 10px; }
.nav { display: grid; gap: 5px; }
.nav a, .nav-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  color: #b9d0c8;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: .18s ease;
}
.nav a span, .nav-logout span { width: 19px; text-align: center; font-size: 18px; line-height: 1; }
.nav a:hover, .nav-logout:hover { color: white; background: rgba(255, 255, 255, .07); }
.nav a.active { color: white; background: rgba(143, 207, 181, .17); box-shadow: inset 3px 0 #95d6bc; }
.logout-form { margin-top: auto; }
.nav-logout { font-size: 13px; }

.workspace { min-width: 0; }
.topbar {
  min-height: 102px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 23px clamp(22px, 3.6vw, 53px);
  background: rgba(255, 255, 255, .84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.eyebrow { margin: 0 0 5px; color: #7a8983; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.operator { margin-left: auto; display: flex; align-items: center; gap: 8px; color: #60716b; font-size: 12px; }
.operator-dot { width: 8px; height: 8px; background: #45b68f; border-radius: 50%; box-shadow: 0 0 0 4px #e4f5ef; }
.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  cursor: pointer;
}
.content { padding: 29px clamp(22px, 3.6vw, 53px) 50px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.panel-heading .eyebrow { margin-bottom: 4px; }
.panel-description { margin: 21px 24px 0; color: var(--muted); }
.text-link { color: var(--green); font-weight: 700; font-size: 12px; }
.text-link:hover { text-decoration: underline; }

.notice { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; padding: 12px 15px; border: 1px solid; border-radius: 11px; font-weight: 600; }
.notice > span { display: grid; place-items: center; width: 19px; height: 19px; flex: 0 0 auto; border-radius: 50%; color: white; font-size: 11px; }
.notice-success { color: #205f4d; background: #e9f7f1; border-color: #cceadc; }
.notice-success > span { background: #309b77; }
.notice-warning { color: #805c21; background: #fff6e5; border-color: #f0ddb9; }
.notice-warning > span { background: #d8932e; }
.notice-danger { color: #8d363b; background: var(--danger-soft); border-color: #f0c8ca; }
.notice-danger > span { background: var(--danger); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 23px; }
.metric-card { min-height: 133px; display: flex; align-items: center; gap: 17px; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.metric-icon, .quick-icon { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto; border-radius: 13px; font-size: 23px; font-weight: 700; }
.metric-card p { margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; font-size: 28px; line-height: 1.05; letter-spacing: -.04em; }
.metric-card small { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; }
.accent-blue .metric-icon, .quick-icon.accent-blue { color: var(--blue); background: var(--blue-soft); }
.accent-mint .metric-icon, .quick-icon.accent-mint { color: var(--mint); background: var(--mint-soft); }
.accent-amber .metric-icon, .quick-icon.accent-amber { color: var(--amber); background: var(--amber-soft); }
.accent-violet .metric-icon, .quick-icon.accent-violet { color: var(--violet); background: var(--violet-soft); }
.split-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .7fr); gap: 20px; }
.panel-grow { min-width: 0; }
.quick-panel { align-self: start; overflow: hidden; }
.quick-link { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 17px 21px; border-bottom: 1px solid var(--line); transition: background .18s; }
.quick-link:last-child { border-bottom: 0; }
.quick-link:hover { background: #f8fbfa; }
.quick-link .quick-icon { width: 39px; height: 39px; font-size: 18px; }
.quick-link b, .quick-link small { display: block; }
.quick-link b { font-size: 12px; }
.quick-link small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.quick-link i { color: #94a39e; font-style: normal; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; border-bottom: 1px solid #edf1ef; text-align: left; white-space: nowrap; }
th { color: #84908c; background: #fafcfa; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
td { font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfc; }
.cell-subtitle { display: block; max-width: 250px; margin-top: 4px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
.telegram-contact { display: block; width: max-content; max-width: 250px; margin-top: 4px; color: var(--green); font-size: 10px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; }
.telegram-contact:hover { text-decoration: underline; }
.balance { color: var(--green); }
.status { display: inline-flex; align-items: center; gap: 5px; width: max-content; padding: 5px 9px; border-radius: 999px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.status-new, .status-pending { color: #976116; background: var(--amber-soft); }
.status-paid, .status-confirmed { color: #23669c; background: var(--blue-soft); }
.status-processing, .status-delivery { color: #624a9c; background: var(--violet-soft); }
.status-completed, .status-approved { color: #26765c; background: var(--mint-soft); }
.status-cancelled, .status-rejected { color: #97464a; background: var(--danger-soft); }

.page-intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-intro p { max-width: 670px; margin-bottom: 0; color: var(--muted); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 750;
  font-size: 12px;
  transition: transform .12s, background .15s, border-color .15s;
}
.button:active { transform: translateY(1px); }
.button-primary { color: white; background: var(--green); box-shadow: 0 4px 14px rgba(31, 102, 84, .18); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: var(--green); background: var(--green-soft); border-color: #cfe6dc; }
.button-secondary:hover { background: #ddf0e8; }
.button-quiet { color: #596b64; background: white; border-color: var(--line); }
.button-quiet:hover { color: var(--green); border-color: #bcd7cc; }
.button-success { color: white; background: #2d9270; }
.button-success:hover { background: #257b5e; }
.button-danger { color: white; background: var(--danger); }
.button-danger:hover { background: #a43e43; }
.button-wide { width: 100%; }
.icon-button { width: 35px; height: 35px; border: 0; border-radius: 9px; color: #6c7974; background: #f0f4f2; cursor: pointer; font-size: 22px; line-height: 1; }

label { display: grid; gap: 6px; color: #5e6d67; font-size: 11px; font-weight: 750; }
input, textarea, select {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--ink);
  background: white;
  border: 1px solid #d8e1dd;
  border-radius: 8px;
  outline: none;
  font-weight: 500;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #63aa91; box-shadow: 0 0 0 3px rgba(67, 145, 119, .12); }
input::placeholder, textarea::placeholder { color: #abb5b1; }
.check-field { display: flex; align-items: center; gap: 9px; min-height: 40px; padding-top: 18px; }
.check-field input { width: 17px; min-height: 17px; height: 17px; accent-color: var(--green); }
.field-hint { margin: -7px 0 0; color: var(--muted); font-size: 10px; }
.stack-form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: minmax(80px, .35fr) minmax(180px, 1.3fr) minmax(80px, .45fr) minmax(130px, .65fr) auto; gap: 12px; align-items: end; }
.form-grid-tight { grid-template-columns: minmax(100px, .45fr) minmax(180px, 1fr); }
.field-wide { grid-column: span 2; }
.field-small { max-width: 115px; }
.compact-field { max-width: 100px; }
.compact-check { padding-top: 17px; white-space: nowrap; }
.form-actions { display: flex; justify-content: flex-end; }
.filter-bar label { display: flex; align-items: center; gap: 9px; }
.filter-bar select { min-width: 175px; }
.search-form { display: flex; gap: 8px; width: min(420px, 100%); }

.catalog-list { display: grid; gap: 17px; }
.product-card { overflow: hidden; }
.product-details > summary { display: flex; align-items: center; gap: 14px; padding: 18px 22px; cursor: pointer; list-style: none; }
.product-details > summary::-webkit-details-marker { display: none; }
.product-emoji { display: grid; place-items: center; width: 45px; height: 45px; flex: 0 0 auto; background: #edf6f2; border-radius: 12px; font-size: 25px; }
.product-title { min-width: 0; flex: 1; }
.product-title b, .product-title small { display: block; }
.product-title b { font-size: 16px; }
.product-title small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.summary-arrow { color: #77837f; font-size: 18px; transition: transform .18s; }
.product-details[open] .summary-arrow { transform: rotate(180deg); }
.product-body { padding: 21px 22px 23px; border-top: 1px solid var(--line); background: #fbfdfc; }
.product-edit { margin-bottom: 26px; }
.section-heading { display: flex; justify-content: space-between; margin-bottom: 11px; }
.variant-list { display: grid; gap: 12px; }
.variant-card { overflow: hidden; border: 1px solid #dfe8e4; border-radius: 13px; background: white; }
.variant-heading { display: grid; grid-template-columns: minmax(170px, 1fr) 100px auto auto; align-items: end; gap: 11px; padding: 13px 15px; background: #f5f9f7; border-bottom: 1px solid #e3ebe7; }
.variant-heading-price { grid-template-columns: minmax(145px, 1.2fr) 95px minmax(100px, .7fr) minmax(130px, .85fr) 85px auto auto; }
.inventory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; }
.inventory-card { display: grid; grid-template-columns: repeat(3, minmax(80px, 1fr)); gap: 9px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 11px; }
.inventory-new { border-style: dashed; background: #fbfcfb; }
.inventory-card .city-name { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; color: var(--green); }
.city-name span { display: grid; place-items: center; width: 25px; height: 25px; background: var(--green-soft); border-radius: 7px; }
.city-name small { margin-left: auto; color: var(--muted); }
.inventory-card .check-field { padding: 0; }
.inventory-card .button { grid-column: span 2; }
.inventory-stock-card, .inventory-new { grid-template-columns: minmax(90px, 1fr) auto minmax(120px, 1fr); }
.inventory-stock-card .button, .inventory-new .button { grid-column: auto; }
.add-variant-form { display: grid; grid-template-columns: minmax(145px, 1.2fr) 95px minmax(100px, .7fr) minmax(125px, .85fr) 85px auto auto; align-items: end; gap: 11px; margin-top: 13px; padding: 15px; border: 1px dashed #bfd5cc; border-radius: 12px; background: #f3f9f6; }
.inline-empty { padding: 11px 14px; color: var(--muted); background: white; border: 1px dashed var(--line); border-radius: 10px; }

.dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  padding: 23px;
  color: var(--ink);
  background: white;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 28px 90px rgba(18, 48, 40, .23);
  overflow-y: auto;
}
.dialog::backdrop { background: rgba(16, 35, 30, .48); backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.detail-list { display: grid; gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 11px; }
.detail-list > div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 13px; border-bottom: 1px solid var(--line); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; }
.separated-form { margin-top: 20px; padding-top: 19px; border-top: 1px solid var(--line); }
.danger-zone { margin-top: 20px; padding: 16px; border: 1px solid #efc9cb; border-radius: 12px; background: #fff7f7; }
.danger-zone p { margin: -8px 0 0; color: #916064; font-size: 11px; }

.segmented { display: flex; padding: 4px; background: #e9efec; border-radius: 10px; }
.segmented a { padding: 7px 13px; border-radius: 7px; color: #708079; font-size: 11px; font-weight: 750; }
.segmented a.active { color: var(--green); background: white; box-shadow: 0 2px 8px rgba(31, 61, 51, .08); }
.deposit-list { display: grid; }
.deposit-card { padding: 20px 23px; border-bottom: 1px solid var(--line); }
.deposit-card:last-child { border-bottom: 0; }
.deposit-main { display: flex; align-items: center; gap: 12px; }
.deposit-avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; color: var(--green); background: var(--green-soft); border-radius: 50%; font-weight: 850; }
.deposit-person { flex: 1; }
.deposit-person strong, .deposit-person small, .deposit-amount strong, .deposit-amount small { display: block; }
.deposit-person small, .deposit-amount small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.deposit-amount { text-align: right; }
.deposit-amount strong { color: var(--green); font-size: 17px; }
.deposit-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 20px; margin: 16px 0 0; padding: 13px; background: #f7faf8; border-radius: 10px; }
.deposit-details > div { min-width: 0; }
.deposit-details dt { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.deposit-details dd { margin: 3px 0 0; font-size: 11px; }
.deposit-actions { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; margin-top: 14px; }
.inline-action { display: flex; gap: 8px; }
.inline-action input { min-width: 100px; }

.balance-hero { display: flex; align-items: center; justify-content: space-between; padding: 15px; color: var(--green); background: var(--green-soft); border-radius: 11px; }
.balance-hero span { font-size: 11px; }
.balance-hero strong { font-size: 20px; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 20px; align-items: start; }
.settings-form { padding-bottom: 24px; }
.settings-form > label, .settings-form > .form-grid, .settings-form > button { margin: 18px 24px 0; }
.settings-form > button { width: calc(100% - 48px); }
.settings-icon { display: grid; place-items: center; width: 38px; height: 38px; color: var(--green); background: var(--green-soft); border-radius: 10px; font-size: 20px; }
.preview-card { overflow: hidden; }
.telegram-preview { padding: 18px; background: #d7e6e1; }
.telegram-bar { display: flex; align-items: center; gap: 9px; padding: 10px 12px; background: white; border-radius: 12px 12px 0 0; }
.telegram-bar > span { color: #558c79; font-size: 20px; }
.telegram-avatar { display: grid; place-items: center; width: 34px; height: 34px; color: white; background: var(--green); border-radius: 50%; font-weight: 800; }
.telegram-bar strong, .telegram-bar small { display: block; }
.telegram-bar strong { font-size: 11px; }
.telegram-bar small { color: var(--muted); font-size: 9px; }
.telegram-chat { min-height: 390px; padding: 65px 12px 20px; background: linear-gradient(135deg, rgba(255,255,255,.35), transparent), #cfe1db; border-radius: 0 0 12px 12px; }
.telegram-bubble { max-width: 91%; padding: 12px; background: white; border-radius: 4px 13px 13px 13px; box-shadow: 0 2px 5px rgba(32, 60, 50, .09); font-size: 11px; white-space: pre-line; }
.telegram-bubble p { margin: 8px 0; color: #3f4d48; }
.telegram-bubble dl { margin: 9px 0; padding: 9px; background: #f2f6f4; border-radius: 8px; }
.telegram-bubble dl > div { margin-bottom: 7px; }
.telegram-bubble dl > div:last-child { margin-bottom: 0; }
.telegram-bubble dt { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.telegram-bubble dd { margin: 2px 0 0; }
.telegram-bubble > small { color: var(--muted); }

.empty-state, .error-state { padding: 50px 24px; text-align: center; }
.empty-state > span { display: block; margin-bottom: 10px; font-size: 34px; }
.empty-state p, .error-state p { margin: 7px 0 0; color: var(--muted); }
.error-state { max-width: 660px; margin: 40px auto; }
.error-code { display: block; color: #d7e4df; font-size: 82px; font-weight: 900; line-height: 1; }
.error-actions { display: flex; justify-content: center; gap: 9px; margin-top: 23px; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: #eef5f1; }
.login-card { width: min(850px, 100%); min-height: 505px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; background: white; border: 1px solid #dbe7e1; border-radius: 25px; box-shadow: 0 30px 90px rgba(33, 71, 58, .13); }
.login-visual { position: relative; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #1e5d4d, #123d33); }
.login-visual::before, .login-visual::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.login-visual::before { width: 340px; height: 340px; left: -140px; top: -100px; }
.login-visual::after { width: 260px; height: 260px; right: -100px; bottom: -90px; }
.login-bottle { z-index: 2; width: 120px; height: 195px; display: grid; place-items: center; color: var(--green); background: #f8fffb; border-radius: 32px 32px 42px 42px; box-shadow: 0 25px 65px rgba(0,0,0,.2); font-size: 39px; font-weight: 900; transform: rotate(-4deg); }
.login-bottle::before { content: ''; position: absolute; width: 67px; height: 31px; margin-top: -220px; background: #d4ebe2; border: 9px solid #f8fffb; border-bottom: 0; border-radius: 9px 9px 0 0; }
.milk-drop { position: absolute; width: 18px; height: 25px; background: rgba(255,255,255,.7); border-radius: 70% 30% 55% 45%; transform: rotate(36deg); }
.milk-drop-one { top: 18%; right: 22%; }
.milk-drop-two { bottom: 19%; left: 21%; transform: scale(.6) rotate(36deg); }
.login-content { display: flex; flex-direction: column; justify-content: center; padding: 55px; }
.login-content h1 { margin-bottom: 11px; font-size: 34px; }
.login-content > .muted { margin-bottom: 30px; }
.login-content .notice { margin: -10px 0 20px; }

.sidebar-scrim { display: none; }
@media (max-width: 1200px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-layout { grid-template-columns: 1fr; }
  .quick-panel { display: grid; grid-template-columns: repeat(3, 1fr); }
  .quick-panel .panel-heading { grid-column: 1 / -1; }
  .quick-link { border-bottom: 0; border-right: 1px solid var(--line); }
  .quick-link:last-child { border-right: 0; }
  .inventory-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .preview-card { max-width: 600px; }
}
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: 252px; transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(12, 29, 24, .45); }
  .sidebar-scrim.visible { display: block; }
  body.menu-open { overflow: hidden; }
  .menu-button { display: block; }
  .topbar { min-height: 88px; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-wide { grid-column: span 2; }
  .form-actions { grid-column: span 2; }
  .variant-heading, .add-variant-form { grid-template-columns: minmax(150px, 1fr) 90px; }
  .variant-heading .button, .add-variant-form .button { grid-column: span 2; }
  .deposit-actions { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  h1 { font-size: 23px; }
  .content { padding: 20px 14px 36px; }
  .topbar { padding: 17px 14px; }
  .operator span:last-child { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 113px; padding: 14px; gap: 11px; }
  .metric-icon { width: 38px; height: 38px; font-size: 19px; }
  .metric-card strong { font-size: 23px; }
  .metric-card small { display: none; }
  .quick-panel { display: block; }
  .quick-link { border-right: 0; border-bottom: 1px solid var(--line); }
  .page-intro-wrap, .page-intro { align-items: stretch; flex-direction: column; }
  .search-form { width: 100%; }
  .segmented { width: 100%; overflow-x: auto; }
  .segmented a { flex: 1; text-align: center; white-space: nowrap; }
  .product-details > summary { padding: 15px; }
  .product-body { padding: 15px; }
  .form-grid, .form-grid-tight, .variant-heading, .add-variant-form { grid-template-columns: 1fr; }
  .field-wide, .form-actions, .variant-heading .button, .add-variant-form .button { grid-column: auto; }
  .field-small, .compact-field { max-width: none; }
  .check-field { padding-top: 0; }
  .inventory-card { grid-template-columns: 1fr 1fr; }
  .inventory-card .city-name { grid-column: 1 / -1; }
  .inventory-card .button { grid-column: 1 / -1; }
  .inline-action { flex-wrap: wrap; }
  .inline-action input { flex: 1 1 150px; }
  .inline-action .button { flex: 1 1 100%; }
  .deposit-main { flex-wrap: wrap; }
  .deposit-amount { width: 100%; padding-left: 52px; text-align: left; }
  .deposit-details { grid-template-columns: 1fr; }
  .settings-form > label, .settings-form > .form-grid, .settings-form > button { margin-left: 15px; margin-right: 15px; }
  .settings-form > button { width: calc(100% - 30px); }
  .login-page { padding: 0; }
  .login-card { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .login-visual { min-height: 210px; }
  .login-bottle { width: 72px; height: 111px; border-radius: 21px 21px 27px 27px; font-size: 25px; }
  .login-bottle::before { width: 38px; height: 18px; margin-top: -126px; border-width: 6px; }
  .login-content { padding: 34px 27px 45px; }
  .table-orders td:nth-child(3), .table-orders th:nth-child(3), .table-orders td:nth-child(6), .table-orders th:nth-child(6) { display: none; }
}
@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 95px; }
  .metric-card small { display: block; }
  .dialog { padding: 18px; }
  .inventory-card { grid-template-columns: 1fr; }
  .inventory-card .city-name, .inventory-card .button { grid-column: auto; }
}
