:root {
  --ink: #17202a;
  --muted: #667085;
  --line: #d8dee8;
  --panel: #fff;
  --soft: #f4f7fb;
  --accent: #c9202f;
  --accent-dark: #a51522;
  --teal: #14747f;
  --green: #16794c;
  --shadow: 0 18px 45px rgba(28, 39, 53, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
}

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

button,
a {
  min-height: 40px;
  border-radius: 6px;
}

button {
  border: 1px solid transparent;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  background: var(--accent-dark);
}

a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

.admin-shell {
  min-height: 100vh;
  padding: 28px;
}

.auth-panel {
  display: grid;
  gap: 24px;
  width: min(440px, 100%);
  margin: 8vh auto 0;
  padding: 30px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-form,
.product-form {
  display: grid;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 34px;
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
}

.admin-app {
  display: grid;
  gap: 20px;
}

.admin-header,
.toolbar,
.content-grid,
.editor-head,
.list-head,
.header-actions,
.check-row,
.row-actions {
  display: flex;
}

.admin-header {
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.header-actions {
  gap: 10px;
}

.header-actions button,
.editor-head button,
.row-actions button {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.header-actions button:hover,
.editor-head button:hover,
.row-actions button:hover {
  background: #f8fafc;
}

.status-bar {
  min-height: 42px;
  padding: 12px 14px;
  color: #244036;
  background: #effaf4;
  border: 1px solid #ccebd9;
  border-radius: 6px;
  line-height: 1.4;
}

.status-bar.error {
  color: #8a1220;
  background: #fff5f6;
  border-color: #f1c5ca;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px 180px 160px auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 20px;
  align-items: start;
}

.product-list,
.editor-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(28, 39, 53, 0.06);
}

.list-head,
.editor-head {
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.list-head span {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid #edf1f6;
  vertical-align: middle;
}

th {
  color: #475467;
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
}

td {
  color: #344054;
  font-size: 14px;
}

tr {
  cursor: pointer;
}

tr:hover td {
  background: #fbfcfe;
}

.flag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 2px 4px 2px 0;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.flag-active {
  color: var(--green);
  background: #effaf4;
  border: 1px solid #ccebd9;
}

.flag-inactive {
  color: #8a1220;
  background: #fff5f6;
  border: 1px solid #f1c5ca;
}

.flag-featured {
  color: #8a4a00;
  background: #fff7e8;
  border: 1px solid #f1d3a0;
}

.row-actions {
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.editor-panel {
  position: sticky;
  top: 18px;
}

.product-form {
  padding: 18px;
}

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

.check-row {
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

@media (max-width: 1100px) {
  .toolbar,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .admin-shell {
    padding: 16px;
  }

  .admin-header,
  .header-actions,
  .form-row {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .toolbar {
    padding: 14px;
  }

  .auth-panel,
  .admin-header,
  .product-list,
  .editor-panel {
    border-radius: 6px;
  }
}
