:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe3ef;
  --soft: #f5f7fb;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --warn: #c2410c;
  --good: #15803d;
  --danger: #b91c1c;
  --radius: 8px;
  --shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: #f6f8fb;
  color: var(--ink);
}
button, input, textarea, select { font: inherit; }
.hidden { display: none !important; }
.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 50;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: 0.2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--good); }

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: linear-gradient(135deg, #0f172a 0%, #134e4a 100%);
}
.auth-panel {
  width: min(980px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.25);
}
.brand-block,
.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}
.brand-block strong { display: block; font-size: 24px; }
.brand-block p { margin: 2px 0 0; color: var(--muted); font-weight: 800; }
.mode-switch {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  margin: 26px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}
.mode {
  border: 0;
  border-radius: var(--radius);
  padding: 10px 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}
.mode.active { background: var(--ink); color: #fff; }
.auth-form {
  display: grid;
  gap: 14px;
}
.auth-form h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
}
.muted, .hint {
  color: var(--muted);
  font-weight: 700;
}
.hint { font-size: 13px; }
.form-alert {
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: #f8fbff;
  color: var(--ink);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}
.form-alert strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}
.form-alert span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}
.form-alert.success {
  border-left-color: var(--good);
  background: #effcf6;
}
.form-alert.error {
  border-left-color: var(--danger);
  background: #fff5f5;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.form-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}
input, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0 12px;
  color: var(--ink);
}
input { height: 42px; }
textarea {
  min-height: 118px;
  padding-top: 10px;
  resize: vertical;
}
.wide { grid-column: 1 / -1; }
.primary-btn, .outline-btn, .mini-btn, .logout {
  border: 0;
  border-radius: var(--radius);
  min-height: 42px;
  padding: 0 16px;
  font-weight: 900;
  cursor: pointer;
}
.primary-btn, .mini-btn {
  background: var(--brand);
  color: #fff;
}
.outline-btn {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
}
.brand-link {
  margin-bottom: 28px;
  font-size: 20px;
  font-weight: 900;
}
.nav {
  display: grid;
  gap: 8px;
}
.nav a, .logout {
  color: #cbd5e1;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 13px 12px;
  font-weight: 900;
}
.nav a:hover, .nav a.active {
  background: var(--brand);
  color: #fff;
}
.logout {
  margin-top: auto;
  background: transparent;
  text-align: left;
  color: #fecaca;
}
.main {
  min-width: 0;
  padding: 28px;
}
.topbar, .panel, .metrics article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px;
  margin-bottom: 20px;
}
.eyebrow {
  margin: 0;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 900;
}
.topbar h1 {
  margin: 4px 0;
  font-size: 34px;
  line-height: 1.1;
}
.topbar p { margin: 0; color: var(--muted); font-weight: 700; }
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.metrics article {
  padding: 20px;
  min-height: 130px;
  display: grid;
  align-content: space-between;
  border-top: 4px solid var(--brand);
}
.metrics span {
  color: var(--muted);
  font-weight: 900;
}
.metrics strong {
  font-size: 32px;
}
.panel {
  margin-bottom: 20px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  margin: 2px 0 0;
  font-size: 24px;
}
.table-wrap { overflow: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}
td span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-top: 3px;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}
.product-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.product-media {
  height: 150px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #134e4a, #0f766e);
  color: #fff;
  font-size: 42px;
  font-weight: 900;
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-card-body {
  padding: 14px;
  display: grid;
  gap: 10px;
}
.product-card h3 {
  margin: 0;
  font-size: 18px;
}
.product-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.card-meta span {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: var(--radius);
  background: #ecfeff;
  color: #155e75;
  font-size: 12px;
  font-weight: 900;
}
.badge {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-weight: 900;
  text-transform: capitalize;
}
.badge.admin_review { background: #fff7ed; color: var(--warn); }
.badge.approved_by_admin, .badge.accepted { background: #ecfdf5; color: var(--good); }
.badge.rejected { background: #fef2f2; color: var(--danger); }
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}
.profile-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}
.profile-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.empty {
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 1100px) {
  .metrics, .product-grid, .profile-grid, .form-grid, .form-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app { display: block; }
  .sidebar {
    position: static;
    height: auto;
  }
  .nav {
    display: flex;
    overflow-x: auto;
  }
  .nav a { white-space: nowrap; }
  .main { padding: 16px; }
  .topbar, .panel-head {
    align-items: stretch;
    flex-direction: column;
  }
  .metrics, .product-grid, .profile-grid, .form-grid, .form-grid.compact {
    grid-template-columns: 1fr;
  }
}
