:root {
  --bg: #f6f2ed;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #fcf8f5;

  --text: #342927;
  --muted: #7e6d67;

  --line: rgba(91, 63, 63, 0.12);
  --line-strong: rgba(91, 63, 63, 0.18);

  --accent: #5b3f3f;
  --accent-soft: #7a5a54;
  --accent-gradient: linear-gradient(135deg, var(--accent) 0%, #71534c 100%);

  --shadow: 0 10px 28px rgba(67, 47, 43, 0.10);
  --shadow-soft: 0 4px 14px rgba(67, 47, 43, 0.06);
  --shadow-hover: 0 8px 18px rgba(91, 63, 63, 0.14);

  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --transition-fast: 0.18s ease;
  --transition-normal: 0.22s ease;

  --container-width: 1120px;
  --page-gutter: 40px;
  --content-padding-x: 44px;
  --content-padding-y: 42px;

  --input-height: 52px;
  --btn-height: 50px;
}

/* =========================================
   RESET / BASE
========================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(122, 90, 84, 0.05), transparent 24%),
    linear-gradient(180deg, #fbf8f5 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

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

/* =========================================
   LAYOUT
========================================= */

.page {
  position: relative;
  width: min(var(--container-width), calc(100% - var(--page-gutter)));
  margin: 24px auto;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 34px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.header {
  height: clamp(220px, 28vw, 320px);
  background-image: url("banner.webp");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  background-color: #efe7e2;
  border-bottom: 1px solid var(--line);
}

.content {
  padding: var(--content-padding-y) var(--content-padding-x) 28px;
}

.footer-brand {
  height: clamp(72px, 9vw, 100px);
  margin: 8px 24px 24px;
  border-radius: 20px;
  background: #fff url("lower.webp") center center / contain no-repeat;
  border: 1px solid rgba(91, 63, 63, 0.08);
}

/* =========================================
   SHARED PANELS / CARDS
========================================= */

.hero-panel,
.form-card,
.table-card {
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-soft) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  max-width: 620px;
  margin: 8px auto 24px;
  padding: 52px 34px;
  text-align: center;
}

.form-card,
.table-card {
  padding: 34px;
}

.table-card {
  margin-top: 18px;
}

/* =========================================
   TYPOGRAPHY
========================================= */

.hero-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero-subtitle {
  max-width: 450px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.section-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 600;
}

.section-copy {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

/* =========================================
   BUTTONS / ACTIONS
========================================= */

.menu-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 44px;
  margin-top: -24px;
  position: relative;
  z-index: 2;
}

.actions {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.btn,
.dashboard-btn,
.back-btn {
  border: none;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    opacity var(--transition-fast),
    background var(--transition-fast);
  will-change: transform;
}

.btn,
.dashboard-btn {
  min-width: 210px;
  height: var(--btn-height);
  padding: 0 26px;
  border-radius: var(--radius-pill);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 18px rgba(91, 63, 63, 0.16);
}

.btn:hover,
.dashboard-btn:hover,
.back-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn:disabled,
.dashboard-btn:disabled,
.back-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.back-btn {
  position: absolute;
  right: 26px;
  bottom: 132px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 8px 18px rgba(91, 63, 63, 0.16);
}

/* =========================================
   FORM FIELDS
========================================= */

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.input-group {
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.input-group input,
.dropdown-header {
  width: 100%;
  min-height: var(--input-height);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(91, 63, 63, 0.14);
  background: #fcfbf9;
  color: var(--text);
  font-size: 14px;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.input-group input::placeholder,
.dropdown-header::placeholder {
  color: #9a8a84;
}

.input-group input:focus,
.dropdown-header:focus,
.table-row input:focus {
  outline: none;
  border-color: rgba(91, 63, 63, 0.28);
  box-shadow: 0 0 0 3px rgba(91, 63, 63, 0.07);
}

.input-group input[readonly],
.table-row input[readonly] {
  background: rgba(91, 63, 63, 0.05);
  color: #6b5a54;
  font-weight: 500;
}

/* =========================================
   DROPDOWN
========================================= */

.dropdown {
  position: relative;
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.arrow {
  font-size: 12px;
  color: var(--muted);
}

.dropdown-list {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(91, 63, 63, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  z-index: 10;
}

.dropdown-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.dropdown-list label:hover {
  background: rgba(91, 63, 63, 0.05);
}

.dropdown-list input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* =========================================
   TABLES
========================================= */

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 18px;
}

thead th {
  padding: 16px 14px;
  background: #f5eeea;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: left;
  border-bottom: 1px solid rgba(91, 63, 63, 0.10);
}

tbody td {
  padding: 16px 14px;
  background: #fff;
  border-bottom: 1px solid rgba(91, 63, 63, 0.07);
  font-size: 14px;
}

tbody tr:hover td {
  background: #fcf8f5;
}

/* =========================================
   SUPPLIER FORM
========================================= */

.supplier-card {
  max-width: 1080px;
  margin: 8px auto 24px;
}

.supplier-title {
  text-align: center;
  margin-bottom: 10px;
}

.supplier-copy {
  max-width: 720px;
  margin: 0 auto 30px;
  text-align: center;
}

.supplier-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 30px;
}

.product-table {
  margin-top: 30px;
}

.table-header,
.table-row {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr 1fr 1.4fr;
  gap: 14px;
  align-items: center;
}

.table-header {
  padding: 0 4px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.table-row {
  margin-bottom: 16px;
}

.table-row input {
  width: 100%;
  min-height: var(--input-height);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(91, 63, 63, 0.14);
  background: #fcfbf9;
  color: var(--text);
  font-size: 14px;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.supplier-actions {
  margin-top: 30px;
}

.supplier-submit {
  min-width: 260px;
}

/* =========================================
   ACCESSIBILITY / UTILITIES
========================================= */

:focus-visible {
  outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(91, 63, 63, 0.12);
}

.hidden {
  display: none !important;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 900px) {
  .content {
    padding: 34px 22px 24px;
  }

  .top-actions {
    padding: 0 22px;
    margin-top: -18px;
  }

  .form-row,
  .supplier-info {
    grid-template-columns: 1fr;
  }

  .form-card,
  .table-card,
  .hero-panel {
    padding: 24px;
  }

  .table-header {
    display: none;
  }

  .table-row {
    grid-template-columns: 1fr;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-soft);
  }

  .back-btn {
    right: 18px;
    bottom: 124px;
  }
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 20px, var(--container-width));
    margin: 10px auto;
    border-radius: 24px;
  }

  .header {
    height: 150px;
    background-size: cover;
  }

  .btn,
  .dashboard-btn,
  .supplier-submit {
    width: 100%;
    min-width: 0;
  }

  .menu-buttons {
    flex-direction: column;
  }

  .top-actions {
    margin-top: 16px;
  }

  .content {
    padding-top: 24px;
  }

  .section-title {
    font-size: 23px;
  }

  .hero-title {
    font-size: 28px;
  }

  .footer-brand {
    margin: 12px 14px 14px;
    border-radius: 16px;
  }

  .back-btn {
    width: 46px;
    height: 46px;
    right: 14px;
    bottom: 110px;
  }
}