:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-soft: #f6f8fa;
  --sidebar: #152c25;
  --sidebar-soft: #23453a;
  --text: #17201d;
  --muted: #6c7672;
  --line: #e1e6e3;
  --green: #176d4d;
  --green-hover: #125b40;
  --green-soft: #e4f4ec;
  --orange: #a65d18;
  --orange-soft: #fff1df;
  --red: #b84242;
  --red-soft: #fde9e7;
  --blue: #32669b;
  --blue-soft: #e8f0f8;
  --shadow: 0 18px 55px rgba(20, 39, 32, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a, input, select, textarea { outline-color: var(--green); }
svg { width: 17px; height: 17px; flex: 0 0 auto; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell { display: grid; grid-template-columns: 188px minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; gap: 25px; padding: 22px 14px 16px; color: #f2faf6; background: var(--sidebar); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 650; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #143126; background: #9ee4bd; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.brand-mark svg { width: 19px; height: 19px; }
.main-nav { display: grid; gap: 5px; }
.main-nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 11px; border-radius: 10px; color: #c5d5ce; font-size: 13px; transition: color .15s ease, background .15s ease; }
.main-nav a:hover { color: #fff; }
.main-nav a[aria-current="page"] { color: #fff; background: var(--sidebar-soft); }
.sidebar-spacer { flex: 1; }
.profile { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 13px 7px 2px; border-top: 1px solid rgba(255,255,255,.12); color: #dce9e3; }
.avatar { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; color: #143126; background: #e8c57d; font-size: 12px; font-weight: 700; }
.profile-copy { display: grid; min-width: 0; }
.profile-copy strong { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { color: #91a79d; font-size: 10px; }
.icon-plain { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; color: #adc2b8; background: transparent; cursor: pointer; }
.icon-plain:hover { color: #fff; }

.workspace { min-width: 0; padding: 22px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.topbar h1 { margin: 0 0 4px; font-size: clamp(23px, 3vw, 31px); font-weight: 650; letter-spacing: -.04em; }
.topbar p { margin: 0; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 8px; }

.button, .icon-button, .add-button, .quantity-control button, .category-filters button {
  border: 1px solid var(--line);
  cursor: pointer;
}
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 0 14px; border-radius: 10px; font-size: 13px; font-weight: 650; }
.button-primary { border-color: var(--green); color: #fff; background: var(--green); }
.button-primary:hover { background: var(--green-hover); }
.button-secondary { color: var(--text); background: var(--surface); }
.button-secondary:hover { border-color: #cbd4cf; background: var(--surface-soft); }
.button-block { width: 100%; }
.button:disabled, .add-button:disabled, .quantity-control button:disabled { cursor: default; opacity: .45; }
.icon-button { display: inline-grid; place-items: center; width: 31px; height: 31px; padding: 0; border-radius: 8px; color: var(--muted); background: var(--surface); }
.icon-button:hover { color: var(--green); border-color: #bcd4c9; }
.icon-button.archive-action { color: var(--red); }
.icon-button.archive-action:hover { border-color: #e7b9b9; background: var(--red-soft); }
.add-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 30px; padding: 0 9px; border-color: transparent; border-radius: 8px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 650; white-space: nowrap; }
.add-button:hover { border-color: #b5dcca; }
.add-button svg { width: 14px; height: 14px; }

.alert { margin-bottom: 14px; padding: 11px 13px; border: 1px solid transparent; border-radius: 10px; font-size: 12px; }
.alert-success { border-color: #bfe0d0; color: var(--green); background: var(--green-soft); }
.alert-error { border-color: #ecc6c3; color: var(--red); background: var(--red-soft); }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 15px; }
.metric { position: relative; overflow: hidden; padding: 16px 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.metric::after { content: ""; position: absolute; right: -20px; bottom: -35px; width: 82px; height: 82px; border-radius: 50%; background: var(--green-soft); }
.metric-label { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.metric-label svg { width: 15px; height: 15px; }
.metric > strong { display: block; font-size: 22px; font-weight: 650; letter-spacing: -.03em; }
.metric > small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 15px; border-bottom: 1px solid var(--line); }
.panel-head h2, .catalog-head h2, .cart-head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.panel-head > span, .panel-head > a { color: var(--muted); font-size: 11px; }
.panel-head > a { color: var(--green); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap: 14px; }
.catalog-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.settings-grid { display: grid; grid-template-columns: minmax(270px, .65fr) minmax(0, 1.35fr); gap: 14px; align-items: start; }

.catalog-head { display: grid; gap: 12px; padding: 14px 14px 11px; border-bottom: 1px solid var(--line); }
.catalog-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.catalog-title-row > div > small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.search-field { position: relative; width: min(280px, 100%); }
.search-field svg { position: absolute; top: 50%; left: 10px; width: 15px; height: 15px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.search-field input, .client-picker select, .form-stack input, .form-stack select, .form-stack textarea, .form-grid input, .form-grid select, .form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface-soft);
}
.search-field input { min-height: 36px; padding: 0 10px 0 32px; font-size: 12px; }
.search-field input:focus, .client-picker select:focus, .form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus, .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--green); }
.category-filters { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.category-filters::-webkit-scrollbar { display: none; }
.category-filters button { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; color: var(--muted); background: transparent; font-size: 11px; }
.category-filters button[aria-pressed="true"] { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.attribute-filters { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.attribute-filters[hidden], .attribute-filters label[hidden] { display: none; }
.attribute-filters label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.attribute-filters label span { font-weight: 650; }
.attribute-filters select { min-height: 32px; padding: 0 28px 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--surface); font-size: 11px; }
.attribute-filters select:focus { border-color: var(--green); }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 10px; color: var(--muted); background: var(--surface-soft); font-weight: 500; text-align: left; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { padding-left: 15px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 15px; }
.data-table td { padding: 11px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:first-child td { border-top: 0; }
.data-table .number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table td > strong, .data-table td > small { display: block; }
.data-table td > strong { font-weight: 650; }
.data-table td > small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.data-table.compact td { padding-top: 10px; padding-bottom: 10px; }
.empty-cell { padding: 35px 15px !important; color: var(--muted); text-align: center !important; }
.product-name-cell { display: flex; align-items: center; gap: 9px; min-width: 205px; }
.product-name-cell > span:last-child { min-width: 0; }
.product-name-cell strong, .product-name-cell small { display: block; }
.product-name-cell strong { font-weight: 650; }
.product-name-cell small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.product-icon, .activity-icon { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--green); background: var(--green-soft); }
.product-icon svg { width: 17px; height: 17px; }
.product-name-cell .product-icon { width: 42px; height: 42px; overflow: hidden; }
.product-photo img { width: 100%; height: 100%; object-fit: cover; }
.product-photo:hover { box-shadow: 0 0 0 2px rgba(20, 112, 78, .18); }
.product-copy { display: block; }
.product-links { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 5px; }
.product-links a { display: inline-flex; align-items: center; gap: 3px; color: var(--green); font-size: 10px; font-weight: 650; }
.product-links a:hover { text-decoration: underline; }
.product-links svg { width: 12px; height: 12px; }
.product-attributes { display: flex; flex-wrap: wrap; gap: 4px 9px; margin-top: 5px; color: var(--muted); font-size: 10px; }
.product-attributes span { white-space: nowrap; }
.product-attributes b { color: var(--text); font-weight: 650; }
.stock { display: inline-flex; align-items: center; gap: 5px; }
.stock::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.stock.low { color: var(--red); }
.stock.low::before { background: var(--red); }
.row-actions { display: table-cell; vertical-align: middle; text-align: right; white-space: nowrap; }
.row-actions > * { vertical-align: middle; }
.row-actions > * + * { margin-left: 5px; }
.row-actions form { display: inline-flex; margin-top: 0; margin-right: 0; margin-bottom: 0; }
.restore-action { color: var(--green); }
.archive-table { min-width: 850px; }
.contact-lines { display: grid; gap: 4px; color: var(--muted); }
.contact-lines > span { display: flex; align-items: center; gap: 5px; }
.contact-lines svg { width: 13px; height: 13px; }
.category-field-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 280px; }
.category-field-empty { color: var(--muted); font-size: 10px; }
.category-field-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 7px 6px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.category-field-chip > span { display: grid; gap: 1px; }
.category-field-chip strong { font-size: 10px; font-weight: 650; }
.category-field-chip small { color: var(--muted); font-size: 9px; }
.category-field-chip button { display: grid; place-items: center; width: 25px; height: 25px; border: 0; border-radius: 7px; color: var(--green); background: var(--green-soft); cursor: pointer; }
.category-field-chip button:hover { background: var(--green); color: #fff; }
.category-field-chip svg, .category-field-add svg { width: 12px; height: 12px; }
.category-field-add { display: inline-flex; align-items: center; gap: 4px; min-height: 31px; padding: 0 9px; border: 1px dashed var(--green); border-radius: 9px; color: var(--green); background: transparent; font-size: 10px; font-weight: 650; cursor: pointer; }
.category-field-add:hover { color: #fff; background: var(--green); }

.cart-panel { position: sticky; top: 16px; }
.cart-head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.cart-head h2 { display: flex; align-items: center; gap: 8px; }
.cart-head h2 svg { color: var(--green); }
.count-badge { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 650; }
.client-picker { padding: 13px 14px; border-bottom: 1px solid var(--line); }
.client-picker label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.client-picker select { min-height: 36px; padding: 0 9px; font-size: 12px; }
.cart-items { display: grid; padding: 5px 14px; }
.cart-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item-name { min-width: 0; }
.cart-item-name strong, .cart-item-name small { display: block; }
.cart-item-name strong { overflow: hidden; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-name small, .cart-stock { margin-top: 3px; color: var(--muted); font-size: 10px; }
.cart-line-price { align-self: center; font-size: 11px; white-space: nowrap; }
.quantity-control { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.quantity-control form { display: flex; }
.quantity-control button { display: grid; place-items: center; width: 25px; height: 25px; padding: 0; border-radius: 7px; color: var(--text); background: var(--surface-soft); }
.quantity-control button svg { width: 12px; height: 12px; }
.quantity-control > span { min-width: 13px; text-align: center; font-size: 11px; }
.cart-summary { display: grid; gap: 9px; padding: 13px 14px 14px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.cart-summary > div { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.cart-summary > div strong { color: var(--text); font-weight: 650; }
.cart-summary .cart-total { margin-top: 1px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--text); font-size: 13px; }
.cart-summary .cart-total strong { font-size: 17px; letter-spacing: -.025em; }
.empty-state { display: grid; place-items: center; gap: 8px; min-height: 125px; padding: 22px; color: var(--muted); text-align: center; font-size: 12px; }
.cart-empty svg { width: 29px; height: 29px; opacity: .65; }

.activity-list { display: grid; }
.activity-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.activity-row:last-child { border-bottom: 0; }
.activity-row:hover { background: var(--surface-soft); }
.activity-icon { width: 31px; height: 31px; }
.activity-icon svg { width: 15px; height: 15px; }
.activity-row strong, .activity-row small { display: block; }
.activity-row strong { font-size: 12px; font-weight: 650; }
.activity-row small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.activity-value { font-size: 11px; font-weight: 650; white-space: nowrap; }
.status { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 650; }
.status-issued { color: var(--blue); background: var(--blue-soft); }
.status-completed { color: var(--green); background: var(--green-soft); }
.status-cancelled { color: var(--red); background: var(--red-soft); }
.movement-value { font-weight: 650; }
.movement-value.positive { color: var(--green); }
.movement-value.negative { color: var(--red); }

.form-panel { padding-bottom: 15px; }
.form-stack { display: grid; gap: 13px; padding: 15px; }
.form-stack label, .form-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.form-stack label small, .form-grid label small { color: var(--muted); font-size: 10px; }
.form-stack input, .form-stack select, .form-grid input, .form-grid select { min-height: 40px; padding: 0 11px; color: var(--text); font-size: 13px; }
.form-stack textarea, .form-grid textarea { padding: 10px 11px; resize: vertical; color: var(--text); font-size: 13px; }
.form-stack .button { justify-self: start; }

.modal { width: min(620px, calc(100% - 24px)); max-height: calc(100% - 30px); padding: 0; border: 0; border-radius: 16px; color: var(--text); background: transparent; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(9, 23, 18, .46); backdrop-filter: blur(2px); }
.modal-card { max-height: calc(100vh - 30px); overflow: auto; border-radius: 16px; background: var(--surface); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0 0 3px; font-size: 17px; font-weight: 650; }
.modal-head p { margin: 0; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding: 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.custom-field-section { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.custom-field-section[hidden], [data-category-field][hidden] { display: none; }
.form-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.form-section-title strong { font-size: 12px; font-weight: 650; }
.form-section-title small { color: var(--muted); font-size: 10px; }
.custom-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.file-field input[type="file"] { min-height: 44px; padding: 7px; }
.file-field input[type="file"]::file-selector-button { margin-right: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: var(--surface); cursor: pointer; }
.current-file { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--green-soft); }
.current-file[hidden] { display: none; }
.current-file > a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--green); font-size: 11px; font-weight: 650; }
.current-file > a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.current-file > label { display: flex; grid-auto-flow: column; align-items: center; gap: 6px; white-space: nowrap; }
.current-file input { width: auto; min-height: auto; }
.current-image { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--green-soft); }
.current-image[hidden] { display: none; }
.current-image > a { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--green); font-size: 11px; font-weight: 650; }
.current-image > a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.current-image img { flex: 0 0 auto; width: 72px; height: 54px; border-radius: 8px; background: var(--surface); object-fit: cover; }
.current-image > label { display: flex; grid-auto-flow: column; align-items: center; gap: 6px; white-space: nowrap; }
.current-image input { width: auto; min-height: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--line); background: var(--surface-soft); }

.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; background: var(--sidebar); }
.auth-card { width: min(410px, 100%); padding: 28px; border-radius: 18px; background: var(--surface); box-shadow: 0 26px 70px rgba(0,0,0,.24); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; font-weight: 700; }
.auth-card h1 { margin: 0 0 7px; font-size: 25px; font-weight: 650; letter-spacing: -.035em; }
.auth-copy { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.auth-card .form-stack { padding: 7px 0 0; }
.auth-card .button { margin-top: 3px; }

.quote-page { min-height: 100vh; padding: 25px; }
.quote-toolbar { display: flex; justify-content: space-between; width: min(900px, 100%); margin: 0 auto 13px; }
.quote-sheet { width: min(900px, 100%); min-height: 1060px; margin: 0 auto; padding: 52px 55px; background: var(--surface); box-shadow: var(--shadow); }
.quote-header { display: flex; justify-content: space-between; gap: 30px; padding-bottom: 25px; border-bottom: 2px solid var(--sidebar); }
.quote-brand { display: flex; align-items: center; gap: 10px; }
.quote-brand > span:last-child, .quote-number { display: grid; gap: 2px; }
.quote-brand strong { font-size: 16px; }
.quote-brand small, .quote-number span, .quote-number small { color: var(--muted); font-size: 10px; }
.quote-number { text-align: right; }
.quote-number strong { font-size: 18px; }
.quote-party { padding: 30px 0 23px; }
.quote-party > span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.quote-party h1 { margin: 5px 0 7px; font-size: 24px; font-weight: 650; }
.quote-party p { margin: 3px 0; color: var(--muted); font-size: 12px; }
.quote-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.quote-table th { padding: 10px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 500; text-align: left; }
.quote-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); }
.quote-table th:first-child, .quote-table td:first-child { padding-left: 0; }
.quote-table th:last-child, .quote-table td:last-child { padding-right: 0; }
.quote-table .number { text-align: right; white-space: nowrap; }
.quote-totals { display: flex; justify-content: flex-end; padding: 20px 0; }
.quote-totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: 50px; min-width: 280px; }
.quote-totals span { color: var(--muted); font-size: 12px; }
.quote-totals strong { font-size: 22px; }
.quote-footer { display: flex; justify-content: space-between; gap: 30px; margin-top: 60px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }

@media (max-width: 1050px) {
  .settings-grid { grid-template-columns: 1fr; }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .products-table .product-name-cell { min-width: 155px; }
  .products-table th, .products-table td { padding-left: 7px; padding-right: 7px; }
  .products-table th:first-child, .products-table td:first-child { padding-left: 13px; }
  .products-table th:last-child, .products-table td:last-child { padding-right: 10px; }
  .products-table .add-button span { display: none; }
}

@media (max-width: 900px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .cart-panel { position: static; }
  .cart-items { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .brand { justify-content: center; padding: 0; }
  .brand-name, .main-nav a span, .profile-copy { display: none; }
  .main-nav a { justify-content: center; padding: 0; }
  .profile { display: flex; justify-content: center; padding-left: 0; padding-right: 0; }
  .profile form { display: none; }
  .overview-grid { grid-template-columns: 1fr; }
  .workspace { padding: 19px; }
}

@media (max-width: 620px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; top: 0; z-index: 20; flex-direction: row; align-items: center; gap: 8px; padding: 9px 12px; }
  .brand { margin-right: auto; }
  .brand-name { display: block; }
  .main-nav { display: flex; }
  .main-nav a { width: 36px; min-height: 36px; }
  .main-nav a:nth-child(n+3) { display: none; }
  .sidebar-spacer, .sidebar > .main-nav:nth-of-type(2), .profile { display: none; }
  .workspace { padding: 15px 12px; }
  .topbar { align-items: center; }
  .topbar p { max-width: 250px; }
  .top-actions .button { width: 39px; padding: 0; }
  .top-actions .button span { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:last-child { grid-column: 1 / -1; }
  .catalog-title-row { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .cart-items { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .custom-field-grid { grid-template-columns: 1fr; }
  .quote-page { padding: 10px; }
  .quote-sheet { min-height: 0; padding: 28px 22px; }
  .quote-header { flex-direction: column; }
  .quote-number { text-align: left; }
  .quote-table { min-width: 620px; }
  .quote-sheet { overflow-x: auto; }
  .quote-footer { flex-direction: column; gap: 4px; }
}

@media (max-width: 410px) {
  .brand-name { display: none; }
  .metrics { grid-template-columns: 1fr; }
  .metric:last-child { grid-column: auto; }
  .auth-card { padding: 22px; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .no-print { display: none !important; }
  .quote-page { padding: 0; }
  .quote-sheet { width: 100%; min-height: 0; padding: 0; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
