:root {
  --bg-start: #f9f4ee;
  --bg-end: #efe6db;
  --page-glow: rgba(169, 95, 45, 0.18);
  --page-glow-secondary: rgba(126, 88, 58, 0.1);
  --page-glow-tertiary: rgba(232, 199, 159, 0.26);
  --surface: rgba(255, 250, 245, 0.92);
  --surface-strong: #f1e5d5;
  --surface-elevated: #fffdf9;
  --table-row-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 240, 232, 0.96) 100%);
  --table-row-bg-hover: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(244, 235, 225, 0.98) 100%);
  --table-row-border: rgba(169, 95, 45, 0.16);
  --badge-soft-bg: rgba(169, 95, 45, 0.08);
  --text: #23160d;
  --muted: #6b5b4d;
  --line: #dbc9b6;
  --line-soft: rgba(107, 91, 77, 0.12);
  --accent: #a95f2d;
  --accent-dark: #83461f;
  --danger: #a63d40;
  --shadow: 0 18px 60px rgba(45, 26, 13, 0.08);
  --radius: 22px;
  --header-bg: rgba(249, 244, 238, 0.84);
  --field-bg: #ffffff;
  --flash-bg: #fff3e8;
  --flash-border: #f0c59b;
  --hero-overlay-start: rgba(35, 22, 13, 0.1);
  --hero-overlay-end: rgba(35, 22, 13, 0.25);
}

:root[data-theme="dark"] {
  --bg-start: #1b1410;
  --bg-end: #120d0a;
  --page-glow: rgba(217, 144, 84, 0.18);
  --page-glow-secondary: rgba(236, 188, 120, 0.08);
  --page-glow-tertiary: rgba(99, 66, 45, 0.18);
  --surface: rgba(34, 25, 20, 0.92);
  --surface-strong: #2e221a;
  --surface-elevated: #261b15;
  --table-row-bg: linear-gradient(180deg, rgba(39, 28, 21, 0.98) 0%, rgba(31, 22, 17, 0.96) 100%);
  --table-row-bg-hover: linear-gradient(180deg, rgba(47, 35, 27, 0.98) 0%, rgba(34, 24, 18, 0.98) 100%);
  --table-row-border: rgba(217, 144, 84, 0.18);
  --badge-soft-bg: rgba(217, 144, 84, 0.14);
  --text: #f5e7d8;
  --muted: #ccb8a5;
  --line: #5f4738;
  --line-soft: rgba(204, 184, 165, 0.14);
  --accent: #d99054;
  --accent-dark: #ef9d5a;
  --danger: #d16b6e;
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.34);
  --header-bg: rgba(23, 16, 12, 0.88);
  --field-bg: #1f1713;
  --flash-bg: #3d2818;
  --flash-border: #875c39;
  --hero-overlay-start: rgba(10, 8, 7, 0.24);
  --hero-overlay-end: rgba(10, 8, 7, 0.54);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 4%, var(--page-glow), transparent 34%),
    radial-gradient(circle at 78% 18%, var(--page-glow-secondary), transparent 28%),
    radial-gradient(circle at 94% 92%, var(--page-glow-tertiary), transparent 30%),
    linear-gradient(125deg, rgba(255, 255, 255, 0.32) 0%, transparent 38%),
    linear-gradient(205deg, rgba(255, 244, 228, 0.28) 8%, transparent 36%),
    linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: -1;
  filter: blur(12px);
}

body::before {
  top: -120px;
  right: -80px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(169, 95, 45, 0.16) 0%, transparent 68%),
    radial-gradient(circle at 62% 62%, rgba(255, 255, 255, 0.2) 0%, transparent 72%);
}

body::after {
  left: -120px;
  bottom: -140px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 40%, rgba(130, 93, 61, 0.14) 0%, transparent 66%),
    radial-gradient(circle at 68% 58%, rgba(255, 245, 230, 0.16) 0%, transparent 74%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: min(1180px, calc(100% - clamp(20px, 4vw, 40px)));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(16px);
}

.header-row,
.nav-links,
.cta-row,
.stats,
.catalog-grid,
.product-grid,
.admin-grid,
.kpi-grid,
.dashboard-grid,
.table-actions,
.form-grid,
.hero-actions,
.split,
.checkout-grid,
.cart-row,
.button-row,
.price-range,
.filter-actions,
.export-actions,
.cart-qty-form,
.contact-list {
  display: flex;
  gap: 16px;
}

.header-row,
.cta-row,
.cart-row,
.table-actions {
  align-items: center;
  justify-content: space-between;
}

.nav-links,
.hero-actions,
.button-row,
.stats,
.product-grid,
.kpi-grid,
.dashboard-grid,
.export-actions {
  flex-wrap: wrap;
}

.brand {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.site-header .container {
  padding: 16px 0;
}

.header-nav {
  gap: 22px;
  align-items: center;
}

.header-actions {
  gap: 16px;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.nav-link,
.subtle-link {
  color: var(--muted);
  transition: color 0.2s ease;
}

.nav-link:hover,
.subtle-link:hover {
  color: var(--accent);
}

.button,
button,
input,
textarea,
select {
  font: inherit;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
  background: var(--accent-dark);
}

.button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.theme-toggle {
  width: 52px;
  min-width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
}

.theme-toggle-icons {
  position: relative;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-icon {
  position: absolute;
  inset: 0;
  width: 20px;
  height: 20px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

:root[data-theme="light"] .theme-icon-sun {
  opacity: 0;
  transform: scale(0.65) rotate(-25deg);
}

:root[data-theme="light"] .theme-icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

:root[data-theme="dark"] .theme-icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

:root[data-theme="dark"] .theme-icon-moon {
  opacity: 0;
  transform: scale(0.65) rotate(25deg);
}

.hero {
  padding: 58px 0 46px;
}

.hero-card,
.panel,
.card,
.product-card,
.stat-card,
.admin-card,
.table-wrap,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  padding: 36px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(169, 95, 45, 0.09);
  color: var(--accent);
  font-size: 0.92rem;
}

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(2.65rem, 7vw, 5.4rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: 1.6rem;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.hero-lead {
  max-width: 760px;
  font-size: 1.12rem;
}

.hero-actions {
  margin: 30px 0 28px;
  gap: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 6px;
}

.hero-benefits {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.hero-benefits .stat-card-wide {
  grid-column: 1 / -1;
}

.hero-benefits .stat-card {
  padding: 20px 24px;
  border-color: rgba(169, 95, 45, 0.09);
  box-shadow: 0 16px 36px rgba(45, 26, 13, 0.05);
}

.hero-benefits .stat-card .muted {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
}

.hero-benefits .stat-card strong {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text);
}

.stat-card {
  flex: 1 1 210px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-card strong {
  display: block;
  font-size: 1.28rem;
  line-height: 1.28;
  color: var(--text);
}

.hero-visual {
  min-height: 420px;
  border-radius: calc(var(--radius) - 4px);
  background:
    linear-gradient(180deg, var(--hero-overlay-start), var(--hero-overlay-end)),
    url("https://images.unsplash.com/photo-1518455027359-f3f8164ba6bd?auto=format&fit=crop&w=1400&q=80") center/cover;
}

main section {
  margin: 38px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 20px;
}

.product-card,
.admin-card,
.panel {
  overflow: hidden;
}

.product-card {
  display: flex;
  flex-direction: column;
  width: auto;
  min-width: 0;
}

.product-card img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.product-card .content,
.panel,
.card,
.admin-card {
  padding: 20px;
}

.product-card .content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-card .cta-row {
  margin-top: auto;
  padding-top: 8px;
}

.price {
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.3;
}

.badge-soft {
  background: var(--badge-soft-bg);
  border: 1px solid var(--table-row-border);
}

.split {
  gap: 22px;
  align-items: start;
}

.split > * {
  flex: 1;
}

.sidebar {
  max-width: 360px;
}

.field,
.field textarea,
.field input,
.field select {
  width: 100%;
}

.field {
  margin-top: 0;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.table-inline-text {
  overflow-wrap: anywhere;
  word-break: break-word;
}

input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--field-bg);
  padding: 14px 16px;
  color: var(--text);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 5L7 9L11 5' stroke='%23a95f2d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 22px center;
  padding-right: 58px;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.panel form > .field + .field {
  margin-top: 16px;
}

.form-grid {
  flex-wrap: wrap;
  align-items: flex-start;
}

.form-grid .field {
  flex: 1 1 280px;
}

.form-grid .field + .field {
  margin-top: 0;
}

.price-range {
  gap: 12px;
}

.price-range input {
  flex: 1;
}

.filter-actions {
  flex-direction: column;
  margin-top: 20px;
}

.filter-actions .button,
.filter-actions button {
  width: 100%;
}

.form-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel + .panel,
.table-wrap + .table-wrap {
  margin-top: 18px;
}

.panel form > button,
.panel form > .button-row,
.panel form > .filter-actions,
.panel form > .export-actions {
  margin-top: 22px;
}

.flash {
  margin: 18px auto 0;
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--flash-bg);
  border: 1px solid var(--flash-border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.92rem;
}

.small {
  font-size: 0.94rem;
}

.muted {
  color: var(--muted);
}

.danger {
  background: var(--danger);
}

.site-footer {
  margin-top: 44px;
  padding: 28px 0 46px;
  border-top: 1px solid var(--line-soft);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.footer-brand-block,
.footer-contacts {
  min-width: 0;
}

.footer-contacts p + p {
  margin-top: 8px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, 0.82fr);
  gap: 22px;
  align-items: start;
}

.catalog-layout {
  align-items: flex-start;
}

.catalog-sidebar {
  flex: 0 0 340px;
}

.catalog-results {
  min-width: 0;
  flex: 1 1 auto;
}

.product-badges {
  align-items: flex-start;
}

.product-layout > * {
  min-width: 0;
}

.product-visual {
  padding: 0;
}

.product-hero-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.product-info p + p {
  margin-top: 8px;
}

.product-qty-field {
  max-width: 180px;
}

.product-actions {
  margin-top: 18px;
}

.cart-item-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.cart-thumb {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 18px;
  flex-shrink: 0;
}

.cart-item-copy {
  min-width: 0;
}

.cart-item-actions {
  align-items: center;
  justify-content: flex-end;
}

.cart-summary {
  position: sticky;
  top: 108px;
}

.admin-nav-title {
  margin-bottom: 16px;
}

.admin-nav-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-list p,
.footer-contacts p,
.cart-item-copy strong,
.product-info,
.catalog-results {
  min-width: 0;
}

.checkout-grid > *,
.dashboard-grid > * {
  flex: 1;
}

.dashboard-grid {
  gap: 22px;
}

.dashboard-grid .wide {
  flex: 1 1 100%;
}

.kpi-grid {
  gap: 18px;
  margin-bottom: 28px;
}

.kpi-grid .card {
  flex: 1 1 200px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 18px;
  padding: 28px 0 40px;
}

.admin-shell.container {
  width: min(1300px, calc(100% - clamp(40px, 5vw, 88px)));
}

.admin-shell > section,
.admin-shell > aside,
.admin-shell .table-wrap {
  min-width: 0;
}

.admin-nav {
  position: sticky;
  top: 92px;
  height: fit-content;
}

.admin-nav a {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
}

.admin-nav a:hover,
.admin-nav a.active {
  background: var(--surface-strong);
  color: var(--text);
}

.admin-shell section .panel,
.admin-shell section .table-wrap {
  margin-left: 4px;
  margin-right: 10px;
}

.cart-row {
  gap: 18px;
}

.cart-qty-form {
  align-items: center;
  gap: 12px;
}

.cart-qty-form input {
  width: 92px;
}

.contact-list {
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.contact-list p {
  color: var(--text);
}

.export-actions {
  margin-top: 0;
  margin-bottom: 18px;
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 14px;
}

.admin-table thead th {
  padding: 0 18px 12px;
  border: none;
  color: var(--muted);
}

.admin-table tbody td {
  padding: 18px 18px;
  vertical-align: middle;
  background: var(--table-row-bg);
  border-top: 1px solid var(--table-row-border);
  border-bottom: 1px solid var(--table-row-border);
}

.admin-table tbody td:first-child {
  border-left: 1px solid var(--table-row-border);
  border-radius: 20px 0 0 20px;
}

.admin-table tbody td:last-child {
  border-right: 1px solid var(--table-row-border);
  border-radius: 0 20px 20px 0;
}

.admin-table tbody tr:hover td {
  background: var(--table-row-bg-hover);
}

.admin-table th {
  font-size: 0.98rem;
  font-weight: 700;
}

.admin-table td {
  vertical-align: middle;
}

.admin-table tbody tr:last-child td {
  border-bottom: 1px solid var(--table-row-border);
}

.table-title {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.table-meta,
.table-inline-text,
.table-date {
  line-height: 1.45;
}

.table-inline-text {
  display: inline-block;
}

.table-date {
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: nowrap;
}

.table-date-main {
  font-weight: 700;
  color: var(--text);
}

.table-date-secondary {
  color: var(--muted);
  font-size: 0.9rem;
}

.table-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.table-stack-compact {
  gap: 4px;
}

.table-contact-block,
.table-payment-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.table-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-table .cell-id,
.admin-table .cell-price,
.admin-table .cell-stock,
.admin-table .actions-cell {
  white-space: nowrap;
}

.admin-table .cell-price,
.admin-table .cell-stock {
  font-weight: 600;
}

.status-form {
  margin: 0;
}

.status-form select {
  min-width: 168px;
  min-height: 50px;
  margin: 0;
  background-color: var(--surface-elevated);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.status-form-compact select {
  min-width: 196px;
}

.nowrap-button {
  white-space: nowrap;
}

.actions-cell {
  width: 1%;
  padding-top: 18px;
}

.table-actions-top {
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
}

.table-actions-top form {
  margin: 0;
}

.table-actions-inline {
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.table-actions-inline form {
  margin: 0;
}

.table-action-group {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.table-action-group form {
  display: flex;
  align-items: center;
  margin: 0;
}

.table-action-button {
  min-width: 120px;
  min-height: 52px;
  padding-inline: 20px;
  white-space: nowrap;
  font-weight: 700;
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--text);
  font-weight: 600;
  line-height: 1.5;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
}

.auth-panel,
.checkout-panel {
  max-width: 860px;
  margin: 40px auto;
}

.auth-panel-small {
  max-width: 560px;
}

.profile-shell {
  align-items: flex-start;
}

.profile-title {
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  line-height: 1.1;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.profile-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-summary p {
  margin: 0;
}

.profile-role-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-role-badge {
  display: inline-flex;
  justify-content: center;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

.profile-order-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.profile-order-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-order-chips .badge {
  max-width: 100%;
  white-space: normal;
}

.profile-order-card p {
  margin: 0;
}

.profile-order-card + .profile-order-card {
  margin-top: 16px;
}

.order-payment-status {
  margin-top: 6px;
}

.form-image-preview {
  margin-top: 18px;
  max-width: 340px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line-soft);
  background: var(--surface-elevated);
}

.form-image-preview img {
  width: 100%;
  margin-top: 12px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 16px;
}

.form-footer {
  margin-top: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.form-footer-actions {
  margin-left: auto;
  display: flex;
  justify-content: flex-end;
}

.payment-chip-row {
  margin: 14px 0 12px;
}

.auth-remember-field {
  margin-top: 18px;
  margin-bottom: 8px;
}

.verify-resend-form {
  margin-top: 16px;
}

.admin-table-orders-preview .cell-id {
  width: 58px;
}

.admin-table-orders-preview .cell-status {
  width: 138px;
}

.admin-table-orders-preview .cell-payment {
  width: 220px;
}

.admin-table-orders-preview .cell-price {
  width: 118px;
}

.admin-table-orders-preview .cell-date {
  width: 184px;
}

.admin-table-orders-preview thead th:first-child,
.admin-table-orders-preview tbody .cell-id {
  width: 58px;
  padding-left: 12px;
  padding-right: 8px;
}

.admin-table-orders-preview .actions-cell .table-action-group .order-delete-form {
  position: relative;
  top: -4px;
}

.admin-table-orders-preview .actions-cell .table-action-button {
  transform: translateY(0);
}

.admin-table-orders-full .cell-id {
  width: 52px;
}

.admin-table-orders-full .cell-client {
  width: 34%;
}

.admin-table-orders-full .cell-payment {
  width: 17%;
}

.admin-table-orders-full .cell-price {
  width: 78px;
  text-align: center;
}

.admin-table-orders-full .cell-status {
  width: 120px;
}

.admin-table-orders-full .cell-date {
  width: 102px;
}

.admin-table-orders-full .actions-cell {
  width: 104px;
}

.admin-table-orders-full .actions-cell .order-delete-form {
  position: relative;
  top: -5px;
}

.admin-table-products .cell-price {
  width: 126px;
}

.admin-table-products .cell-stock {
  width: 92px;
}

.admin-table-products .cell-status {
  width: 150px;
}

.admin-table-products .actions-cell {
  width: 276px;
}

.admin-table-products .table-actions-inline {
  align-items: center;
}

.admin-table-products .table-actions-inline > * {
  align-self: center;
}

.admin-table-products .actions-cell .table-action-group {
  min-height: 52px;
  align-items: center;
}

.admin-table-products .actions-cell .table-action-group .product-delete-form {
  position: relative;
  top: -7px;
}

.admin-table-products .actions-cell .product-delete-button {
  transform: translateY(0);
}

.admin-table-orders-full,
.admin-table-users {
  table-layout: fixed;
}

.admin-table-orders-full thead th,
.admin-table-orders-full tbody td,
.admin-table-users thead th,
.admin-table-users tbody td {
  padding-left: 12px;
  padding-right: 12px;
}

.admin-table-orders-full thead th,
.admin-table-orders-full tbody td {
  padding-left: 8px;
  padding-right: 8px;
}

.admin-table-orders-full .status-form-compact,
.admin-table-users .status-form-compact {
  width: 100%;
}

.admin-table-orders-full .status-form-compact select,
.admin-table-users .status-form-compact select {
  width: 100%;
  min-width: 0;
  font-size: 0.94rem;
  padding-left: 14px;
  padding-right: 42px;
  background-position: right 16px center;
}

.admin-table-orders-full .status-form-compact select {
  min-height: 46px;
  font-size: 0.86rem;
  padding-left: 10px;
  padding-right: 32px;
  background-position: right 12px center;
}

.admin-table-orders-full .badge,
.admin-table-users .badge {
  padding: 7px 12px;
  font-size: 0.84rem;
}

.admin-table-orders-full .cell-id,
.admin-table-users .cell-id {
  font-size: 0.9rem;
}

.admin-table-orders-full .cell-id {
  text-align: left;
  padding-right: 4px;
}

.admin-table-orders-full thead th:first-child,
.admin-table-orders-full tbody .cell-id {
  width: 52px;
  padding-left: 12px;
  padding-right: 8px;
}

.admin-table-orders-full .table-contact-block {
  gap: 6px;
}

.admin-table-orders-full .table-payment-block {
  gap: 0;
  align-items: center;
  justify-content: center;
}

.admin-table-orders-full thead th,
.admin-table-orders-full tbody td,
.admin-table-products thead th,
.admin-table-products tbody td {
  text-align: center;
}

.admin-table-orders-full thead th:nth-child(2),
.admin-table-orders-full tbody .cell-client,
.admin-table-products thead th:first-child,
.admin-table-products tbody .cell-product {
  text-align: left;
}

.admin-table-orders-full .table-action-group,
.admin-table-products .table-action-group {
  justify-content: center;
}

.admin-table-orders-full .table-date,
.admin-table-orders-full .cell-price,
.admin-table-products .cell-price,
.admin-table-products .cell-stock,
.admin-table-products .cell-status {
  align-items: center;
}

.admin-table-users .cell-id {
  width: 58px;
}

.admin-table-users thead th:first-child,
.admin-table-users tbody .cell-id {
  width: 58px;
  padding-left: 12px;
  padding-right: 8px;
}

.admin-table-users .cell-contacts {
  width: 24%;
}

.admin-table-users .cell-status {
  width: 150px;
}

.admin-table-users .cell-date {
  width: 118px;
}

.admin-table-users .actions-cell {
  width: 124px;
}

.admin-table-users .actions-cell .table-action-button {
  min-width: 108px;
  min-height: 46px;
  padding-inline: 16px;
}

.admin-table-orders-full .table-title,
.admin-table-users .table-title {
  font-size: 0.96rem;
}

.admin-table-orders-full .small,
.admin-table-users .small,
.admin-table-orders-full .table-inline-text,
.admin-table-users .table-inline-text {
  font-size: 0.9rem;
}

@media (max-width: 1100px) {
  .hero-card {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 330px;
  }

  .admin-table-orders-full .cell-payment,
  .admin-table-orders-full .cell-contacts {
    width: auto;
  }
}

@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-shell.container {
    width: min(calc(100% - 22px), 1180px);
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split,
  .catalog-layout,
  .product-layout,
  .cart-row {
    flex-direction: column;
  }

  .checkout-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    max-width: none;
  }

  .catalog-sidebar {
    flex-basis: auto;
  }

  .admin-nav,
  .cart-summary {
    position: static;
  }

  .admin-nav-links {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 820px) {
  .header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .header-nav,
  .header-actions {
    width: 100%;
  }

  .header-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .header-nav .nav-link {
    white-space: nowrap;
  }

  .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .theme-toggle {
    min-width: 52px;
  }
}

@media (max-width: 720px) {
  .section-head,
  .cta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .container {
    width: min(100% - 18px, 1180px);
  }

  .hero-card {
    padding: 22px;
    gap: 22px;
  }

  .hero-actions,
  .header-actions,
  .button-row,
  .cart-item-actions,
  .product-actions {
    width: 100%;
  }

  .stats,
  .product-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-benefits {
    grid-template-columns: 1fr;
  }

  .hero-benefits .stat-card-wide {
    grid-column: auto;
  }

  .hero-actions .button,
  .hero-actions button,
  .hero-actions a,
  .header-actions .button,
  .header-actions button,
  .header-actions a,
  .cart-item-actions form,
  .cart-item-actions .cart-qty-form,
  .product-actions .button,
  .product-actions button,
  .product-actions a {
    width: 100%;
  }

  .header-actions .theme-toggle {
    width: 52px;
    min-width: 52px;
  }

  .price-range {
    flex-direction: column;
  }

  .cart-item-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .cart-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .cart-item-actions {
    justify-content: stretch;
  }

  .cart-qty-form {
    align-items: flex-start;
  }

  .cart-qty-form input,
  .product-qty-field {
    width: 100%;
    max-width: none;
  }

  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td,
  .admin-table th {
    display: block;
    width: 100%;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table {
    border-spacing: 0;
  }

  .admin-table tr {
    padding: 16px 18px;
    margin-bottom: 14px;
    border: 1px solid var(--table-row-border);
    border-radius: 20px;
    background: var(--table-row-bg);
  }

  .admin-table td {
    padding: 10px 0;
    background: transparent;
    border: none;
    border-radius: 0;
    border-bottom: none;
  }

  .admin-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
  }

  .admin-table .cell-id,
  .admin-table .cell-price,
  .admin-table .cell-stock,
  .admin-table .cell-status,
  .admin-table .cell-payment,
  .admin-table .cell-date,
  .admin-table .actions-cell {
    width: 100%;
  }

  .table-actions-inline {
    flex-wrap: wrap;
  }

  .table-action-group,
  .table-actions-inline,
  .actions-cell form,
  .status-form {
    width: 100%;
  }

  .status-form select,
  .table-action-button {
    width: 100%;
    min-width: 0;
  }

  .form-footer {
    align-items: stretch;
  }

  .form-footer-actions {
    width: 100%;
    margin-left: 0;
  }

  .form-footer-actions .button,
  .form-footer-actions button {
    width: 100%;
  }

  .profile-order-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .site-header .container {
    padding: 14px 0;
  }

  .panel,
  .card,
  .product-card .content,
  .admin-card {
    padding: 18px;
  }

  h1 {
    font-size: clamp(2.2rem, 12vw, 3.4rem);
  }

  h2 {
    font-size: clamp(1.7rem, 8vw, 2.3rem);
  }

  .brand {
    font-size: 1.8rem;
  }

  .button,
  button {
    padding: 12px 18px;
  }
}

/* --- Order detail / reports / checkout summary --- */

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}

.checkout-submit {
  width: 100%;
  margin-top: 8px;
  font-size: 1.05rem;
}

.checkout-summary {
  position: sticky;
  top: 96px;
}

.checkout-summary-note {
  margin-top: 12px;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}

.order-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.order-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 4px;
}

.order-item-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--table-row-bg);
}

.order-item-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-item-thumb-empty {
  color: var(--muted);
  font-size: 1.4rem;
}

.order-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.order-item-total {
  font-weight: 700;
  white-space: nowrap;
}

.order-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px solid var(--line);
  font-size: 1.15rem;
}

.order-total-row strong {
  font-size: 1.4rem;
  color: var(--accent-dark);
}

.order-notes {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--badge-soft-bg);
}

.order-notes h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.order-notes p {
  margin: 0;
  white-space: pre-wrap;
}

.order-client-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.order-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.order-history-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--table-row-bg);
  text-decoration: none;
}

.badge-paid {
  background: rgba(63, 140, 84, 0.16);
  color: #2f7a44;
}

:root[data-theme="dark"] .badge-paid {
  color: #8fd6a3;
}

.badge-status-new {
  background: rgba(169, 95, 45, 0.14);
}

.report-period-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.report-period-chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.report-period-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 180px;
  overflow-x: auto;
  padding-top: 10px;
}

.chart-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 34px;
  flex: 1;
}

.chart-bar {
  width: 100%;
  max-width: 38px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
}

.chart-bar-label {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .checkout-grid,
  .order-detail-grid {
    grid-template-columns: 1fr;
  }

  .checkout-summary {
    position: static;
    order: -1;
  }
}

/* --- Admin filters --- */

.admin-filter-input,
.admin-filter-select {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
}

.admin-filter-input {
  min-width: 240px;
  flex: 1;
  max-width: 380px;
}

/* --- Product import --- */

.import-result {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.import-kpi {
  margin: 12px 0;
}

.import-errors {
  margin: 12px 0;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(166, 61, 64, 0.08);
  color: var(--danger);
  font-size: 0.95rem;
  line-height: 1.5;
}

.import-errors li + li {
  margin-top: 6px;
}

input[type="file"] {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--field-bg);
  width: 100%;
}

/* --- Bulk edit in admin table --- */

.bulk-save-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
  position: sticky;
  top: 80px;
  z-index: 5;
}

.bulk-input {
  width: 110px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
  text-align: right;
}

.bulk-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.bulk-input-stock {
  width: 72px;
}

/* --- One-click toggles in products table --- */

.badge-toggle {
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 999px;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.badge-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.featured-star {
  background: transparent;
  color: var(--muted);
  border-color: var(--line-soft);
}

.featured-star-on {
  background: rgba(217, 164, 65, 0.18);
  color: #9a7414;
}

:root[data-theme="dark"] .featured-star-on {
  color: #f0c869;
}

/* --- Product gallery --- */

.product-gallery {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.product-gallery-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-strong);
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.product-gallery-thumb:hover {
  transform: translateY(-2px);
}

.product-gallery-thumb.active {
  border-color: var(--accent);
}

.product-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-admin {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.gallery-admin h3 {
  margin: 0 0 14px;
}

.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}

.gallery-admin-item {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
  background: var(--table-row-bg);
}

.gallery-admin-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.gallery-admin-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
}

.gallery-admin-actions form {
  margin: 0;
}

.gallery-admin-actions .table-action-button {
  width: 100%;
}

.gallery-admin-empty {
  margin-top: 18px;
}

/* --- Pagination --- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 20px;
}

.pagination-link {
  min-width: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.pagination-link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.pagination-link.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pagination-dots {
  color: var(--muted);
  padding: 0 4px;
}
