@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Manrope:wght@300;400;500;600&display=swap");

:root {
  --bg: #070708;
  --panel: #101013;
  --panel-2: #151418;
  --line: rgba(255, 255, 255, 0.11);
  --text: #eee9f0;
  --muted: #89848d;
  --violet: #805b9c;
  --violet-light: #b28bca;
  --danger: #b85c68;
  --success: #669b82;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(106, 65, 135, 0.2), transparent 36%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
}

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

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

button {
  color: inherit;
}

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

.auth-page {
  min-height: 100vh;
  padding: 35px 18px;
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(520px, 100%);
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid var(--line);
  background: rgba(14, 14, 16, 0.94);
  box-shadow: 0 25px 90px rgba(0, 0, 0, 0.38);
}

.auth-logo {
  width: 76px;
  height: 96px;
  object-fit: contain;
  margin: 0 auto 18px;
  filter: drop-shadow(0 0 20px rgba(139, 91, 174, 0.5));
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--violet-light);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.auth-card > .eyebrow,
.auth-card > h1,
.auth-card > .intro {
  text-align: center;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 500;
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(40px, 8vw, 58px);
  line-height: 0.95;
  text-transform: uppercase;
}

.intro {
  margin: 20px auto 30px;
  color: var(--muted);
  line-height: 1.75;
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field > span {
  color: #aca7b0;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  background: #0b0b0d;
  color: var(--text);
  transition: border-color 0.2s;
}

input,
select {
  min-height: 44px;
  padding: 0 13px;
}

textarea {
  min-height: 105px;
  padding: 13px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--violet);
}

input[type="file"] {
  padding: 10px;
}

input[type="checkbox"] {
  width: 17px;
  min-height: 17px;
  accent-color: var(--violet);
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #aca7b0;
  font-size: 11px;
}

.primary-button,
.ghost-button,
.danger-button {
  min-height: 43px;
  padding: 0 18px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.primary-button {
  background: var(--violet);
  color: white;
}

.primary-button:hover {
  background: #9268ad;
}

.ghost-button {
  border-color: var(--line);
  background: transparent;
  color: #bdb7c1;
}

.danger-button {
  border-color: rgba(184, 92, 104, 0.45);
  background: rgba(184, 92, 104, 0.08);
  color: #dc8994;
}

.auth-card .primary-button {
  width: 100%;
  margin-top: 24px;
}

.notice,
.flash {
  margin: 0 0 22px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  line-height: 1.6;
}

.notice.error,
.flash.error {
  border-color: rgba(184, 92, 104, 0.5);
  background: rgba(184, 92, 104, 0.08);
  color: #e3a1aa;
}

.notice.success,
.flash.success {
  border-color: rgba(102, 155, 130, 0.48);
  background: rgba(102, 155, 130, 0.08);
  color: #9ed0b9;
}

.auth-foot {
  margin: 26px 0 0;
  text-align: center;
}

.auth-foot a {
  color: var(--violet-light);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.admin-header {
  min-height: 76px;
  padding: 12px clamp(18px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 8, 0.92);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-brand img {
  width: 40px;
  height: 50px;
  object-fit: contain;
}

.admin-brand span {
  font-family: var(--serif);
  font-size: 23px;
  letter-spacing: 0.08em;
}

.admin-nav,
.admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-nav a {
  padding: 9px 12px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.admin-nav a.active {
  color: var(--text);
  background: rgba(128, 91, 156, 0.15);
}

.admin-user {
  color: #8a858e;
  font-size: 9px;
}

.admin-user a {
  color: var(--violet-light);
}

.admin-shell {
  width: min(1420px, calc(100% - 36px));
  margin: 0 auto;
  padding: 45px 0 80px;
}

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

.page-head h1 {
  margin: 5px 0 0;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 0.9;
  text-transform: uppercase;
}

.page-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stat {
  min-width: 105px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.stat strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
}

.stat span {
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
}

.panel + .panel {
  margin-top: 22px;
}

.panel-head {
  min-height: 64px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 25px;
  text-transform: uppercase;
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.panel-body {
  padding: 22px;
}

.product-list {
  display: grid;
  gap: 10px;
}

.product-row {
  display: grid;
  grid-template-columns: 80px minmax(170px, 1.6fr) repeat(4, minmax(80px, 0.6fr)) auto;
  gap: 17px;
  align-items: center;
  min-height: 105px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #0c0c0e;
}

.product-row > img {
  width: 70px;
  height: 80px;
  object-fit: cover;
  background: var(--panel-2);
}

.product-row h3 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.product-row p,
.data-label {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.data-label {
  display: block;
  margin-bottom: 5px;
  font-size: 7px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status {
  width: max-content;
  padding: 5px 7px;
  border: 1px solid rgba(102, 155, 130, 0.4);
  color: #8bc0a6;
  font-size: 7px;
  text-transform: uppercase;
}

.status.off {
  border-color: var(--line);
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 7px;
}

.row-actions .ghost-button,
.row-actions .danger-button {
  min-height: 35px;
  padding: 0 11px;
}

.product-editor[hidden] {
  display: none;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 30px;
}

.image-preview {
  aspect-ratio: 4 / 5;
  margin-bottom: 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #0b0b0d;
  color: var(--muted);
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.form-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.team-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
  gap: 22px;
}

.team-list {
  display: grid;
  gap: 9px;
}

.team-row {
  padding: 15px;
  display: grid;
  grid-template-columns: 1fr 120px auto;
  gap: 15px;
  align-items: center;
  border: 1px solid var(--line);
}

.team-row strong {
  font-weight: 500;
}

.team-row span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.help-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.9;
}

.empty-state {
  padding: 55px 20px;
  color: var(--muted);
  text-align: center;
}

.payment-mode-notice {
  display: grid;
  gap: 5px;
  border-color: rgba(178, 139, 202, 0.4);
  background: rgba(128, 91, 156, 0.08);
  color: #c6b8cd;
}

.payment-mode-notice strong {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.payment-mode-notice small {
  margin-top: 4px;
  color: var(--muted);
  word-break: break-all;
}

.order-list {
  display: grid;
  gap: 12px;
}

.order-row {
  border: 1px solid var(--line);
  background: #0b0b0d;
}

.order-row-head {
  min-height: 88px;
  padding: 15px;
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(160px, 1fr) minmax(90px, 0.6fr) minmax(120px, 0.8fr) minmax(110px, 0.7fr);
  gap: 18px;
  align-items: center;
}

.order-row h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.order-row strong {
  font-weight: 500;
}

.order-row .status {
  display: inline-block;
}

.status.payment-pending,
.status.payment-waiting_for_capture,
.status.order-new {
  border-color: rgba(178, 139, 202, 0.38);
  color: var(--violet-light);
}

.status.payment-succeeded,
.status.payment-demo_succeeded,
.status.order-completed {
  border-color: rgba(102, 155, 130, 0.45);
  color: #8bc0a6;
}

.status.payment-canceled,
.status.payment-failed,
.status.order-cancelled {
  border-color: rgba(184, 92, 104, 0.45);
  color: #dc8994;
}

.order-row details {
  border-top: 1px solid var(--line);
}

.order-row summary {
  padding: 13px 15px;
  color: var(--violet-light);
  cursor: pointer;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.order-details {
  padding: 4px 15px 18px;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.3fr) minmax(210px, 0.7fr);
  gap: 25px;
}

.order-customer {
  display: grid;
  gap: 10px;
}

.order-customer p {
  margin: 0;
  color: #c8c2cb;
  line-height: 1.55;
}

.order-customer p span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.order-customer a {
  color: var(--violet-light);
}

.order-items {
  border-top: 1px solid var(--line);
}

.order-items > div {
  padding: 11px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.order-items strong {
  color: var(--text);
  white-space: nowrap;
}

.order-status-form {
  display: grid;
  align-content: start;
  gap: 12px;
}

@media (max-width: 1050px) {
  .admin-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .admin-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .product-row {
    grid-template-columns: 72px 1fr repeat(2, minmax(80px, 0.6fr)) auto;
  }

  .product-row .optional-cell {
    display: none;
  }

  .order-row-head {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .order-details {
    grid-template-columns: 1fr 1fr;
  }

  .order-status-form {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .admin-shell {
    width: min(100% - 24px, 1420px);
    padding-top: 30px;
  }

  .admin-user span {
    display: none;
  }

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

  .product-row {
    grid-template-columns: 64px 1fr;
  }

  .product-row > :not(img):not(.product-main):not(.row-actions) {
    display: none;
  }

  .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .editor-grid,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .editor-grid > aside {
    order: -1;
    max-width: 220px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid > * {
    grid-column: 1 !important;
  }

  .team-row {
    grid-template-columns: 1fr auto;
  }

  .team-row span {
    display: none;
  }

  .order-row-head,
  .order-details {
    grid-template-columns: 1fr;
  }

  .order-row-head > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
  }

  .order-row-head .data-label {
    margin: 0;
  }

  .order-status-form {
    grid-column: auto;
  }
}
