@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 [hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(rgba(7, 7, 8, 0.91), rgba(7, 7, 8, 0.97)),
    radial-gradient(circle at 50% -10%, rgba(106, 65, 135, 0.24), transparent 36%),
    url("../img/moscow-night-hero.webp") center top / cover fixed,
    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 rgba(178, 139, 202, 0.22);
  background:
    radial-gradient(circle at 50% 0%, rgba(128, 91, 156, 0.17), transparent 35%),
    rgba(10, 10, 12, 0.92);
  box-shadow: 0 25px 110px rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(22px);
}

.auth-logo {
  width: min(185px, 52%);
  height: auto;
  object-fit: contain;
  margin: 0 auto 26px;
  filter:
    drop-shadow(0 0 18px rgba(255, 255, 255, 0.08))
    drop-shadow(0 0 26px rgba(139, 91, 174, 0.32));
}

.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: linear-gradient(135deg, #6f438d, #9467ad);
  color: white;
  box-shadow: 0 12px 30px rgba(104, 60, 132, 0.2);
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.primary-button:hover {
  background: linear-gradient(135deg, #80519e, #aa7bc1);
  box-shadow: 0 15px 36px rgba(120, 72, 151, 0.35);
  transform: translateY(-1px);
}

.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 {
  position: sticky;
  z-index: 50;
  top: 0;
  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.88);
  backdrop-filter: blur(20px);
}

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

.admin-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 0 13px rgba(128, 91, 156, 0.35));
}

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

.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;
  transition: color 0.2s, background 0.2s;
}

.admin-nav a:hover,
.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:
    linear-gradient(145deg, rgba(128, 91, 156, 0.1), transparent 58%),
    rgba(14, 14, 17, 0.92);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.17);
}

.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 rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(145deg, rgba(128, 91, 156, 0.055), transparent 34%),
    rgba(13, 13, 16, 0.94);
  box-shadow: 0 25px 75px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
}

.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: rgba(9, 9, 11, 0.86);
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.product-row:hover,
.team-row:hover {
  border-color: rgba(178, 139, 202, 0.3);
  background: rgba(16, 14, 19, 0.94);
  transform: translateY(-1px);
}

.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-tools {
  margin-bottom: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(160px, 0.7fr) minmax(170px, 0.7fr) auto;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  background:
    linear-gradient(100deg, rgba(128, 91, 156, 0.08), transparent 55%),
    rgba(9, 9, 11, 0.88);
}

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

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

.order-result-count {
  min-width: 88px;
  min-height: 44px;
  padding: 8px 12px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
}

.order-result-count strong {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
}

.order-result-count span {
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.order-row:hover {
  border-color: rgba(178, 139, 202, 0.34);
  background: #0d0c0f;
}

.order-row-head {
  min-height: 88px;
  padding: 15px;
  display: grid;
  grid-template-columns: minmax(130px, 0.85fr) minmax(150px, 1fr) minmax(90px, 0.55fr) minmax(120px, 0.75fr) minmax(110px, 0.7fr) auto;
  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;
}

.order-row-action {
  display: flex;
  align-items: center;
  gap: 10px;
}

.order-row-action .data-label {
  margin: 0;
  white-space: nowrap;
}

.order-row-action .ghost-button {
  min-height: 36px;
  padding: 0 13px;
}

.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-filter-empty {
  margin-top: 12px;
  border: 1px dashed var(--line);
}

body.order-modal-open {
  overflow: hidden;
}

.order-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  padding: 24px;
  display: grid;
  place-items: center;
}

.order-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  cursor: default;
}

.order-modal-card {
  position: relative;
  width: min(1120px, 100%);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  border: 1px solid rgba(178, 139, 202, 0.26);
  background:
    radial-gradient(circle at 80% 0%, rgba(128, 91, 156, 0.13), transparent 34%),
    #0b0b0d;
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.72);
}

.order-modal-head {
  position: sticky;
  z-index: 2;
  top: 0;
  min-height: 92px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 13, 0.96);
  backdrop-filter: blur(14px);
}

.order-modal-head h2 {
  margin: 2px 0 4px;
  font-size: clamp(31px, 4vw, 48px);
  line-height: 0.9;
  text-transform: uppercase;
}

.order-modal-head > div > span {
  color: var(--muted);
  font-size: 9px;
}

.order-modal-close {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: transparent;
  color: #bcb6c0;
  cursor: pointer;
  font-size: 28px;
  font-weight: 300;
}

.order-modal-body {
  padding: 24px;
}

.order-modal-summary {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
}

.order-modal-summary > div {
  min-height: 94px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  border-right: 1px solid var(--line);
}

.order-modal-summary > div:last-child {
  border-right: 0;
}

.order-modal-summary > div > span,
.order-info-card dt,
.order-modal-section-head span {
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.order-modal-summary > div:first-child strong {
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 500;
}

.order-modal-summary .status {
  font-family: var(--sans);
  font-weight: 500;
}

.order-modal-grid {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.order-info-card,
.order-modal-products {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
}

.order-info-card {
  padding: 20px;
}

.order-info-card h3,
.order-modal-section-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  text-transform: uppercase;
}

.order-info-card dl {
  margin: 18px 0 0;
  display: grid;
  gap: 13px;
}

.order-info-card dl > div {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.order-info-card dl > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.order-info-card dt {
  margin-bottom: 5px;
}

.order-info-card dd {
  margin: 0;
  color: #d3ced6;
  line-height: 1.55;
  white-space: pre-line;
}

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

.order-payment-id {
  overflow-wrap: anywhere;
  font-family: monospace;
  font-size: 11px;
}

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

.order-modal-items {
  padding: 0 20px;
}

.order-modal-item {
  min-height: 94px;
  padding: 13px 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.order-modal-item img {
  width: 64px;
  height: 72px;
  object-fit: cover;
  background: var(--panel-2);
}

.order-modal-item h4 {
  margin: 0 0 7px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.order-modal-item p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.order-modal-item > strong {
  font-weight: 500;
  white-space: nowrap;
}

.order-modal-total {
  min-height: 70px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.order-modal-total span {
  font-family: var(--serif);
  font-size: 23px;
  text-transform: uppercase;
}

.order-modal-total strong {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}

.order-status-panel {
  margin-top: 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
  border: 1px solid rgba(178, 139, 202, 0.3);
  background: rgba(128, 91, 156, 0.08);
}

.order-status-panel .primary-button {
  min-width: 190px;
}

@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-row-action {
    justify-content: space-between;
  }

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

  .order-search {
    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-modal-grid,
  .order-modal-summary,
  .order-status-panel {
    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-row-action {
    justify-content: flex-end !important;
  }

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

  .order-search {
    grid-column: auto;
  }

  .order-result-count {
    justify-content: flex-start;
  }

  .order-modal {
    padding: 0;
  }

  .order-modal-card {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    border: 0;
  }

  .order-modal-head,
  .order-modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .order-modal-summary > div {
    min-height: 72px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .order-modal-summary > div:last-child {
    border-bottom: 0;
  }

  .order-modal-item {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .order-modal-item img {
    width: 54px;
    height: 64px;
  }

  .order-modal-item > strong {
    grid-column: 2;
  }

  .order-status-panel .primary-button {
    width: 100%;
    min-width: 0;
  }
}
