.admin-page {
  background:
    linear-gradient(rgba(6, 7, 11, 0.88), rgba(6, 7, 11, 0.96)),
    url("https://images.unsplash.com/photo-1596838132731-3301c3fd4317?auto=format&fit=crop&w=1800&q=80") center top / cover fixed,
    var(--bg);
}

[hidden] {
  display: none !important;
}

.admin-page:not(.is-authenticated) .admin-shell {
  display: none;
}

.admin-page.is-authenticated .admin-login {
  display: none;
}

.admin-login {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 28px;
}

.admin-login::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(245, 213, 138, 0.2), transparent 28%),
    linear-gradient(rgba(6, 7, 11, 0.24), rgba(6, 7, 11, 0.72));
  pointer-events: none;
}

.admin-login::after {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(245, 213, 138, 0.14);
  border-radius: 14px;
  pointer-events: none;
}

.admin-login-card {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(460px, 100%);
  gap: 16px;
  border: 1px solid rgba(245, 213, 138, 0.34);
  border-radius: 8px;
  padding: 34px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025)),
    rgba(12, 14, 20, 0.9);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px);
}

.admin-login-card::before {
  content: "";
  width: 78px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-bright), var(--gold));
  box-shadow: 0 0 28px rgba(245, 213, 138, 0.44);
}

.admin-login-card h1 {
  max-width: 360px;
  margin: -2px 0 0;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 0.98;
}

.admin-login-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.7;
}

.admin-login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-login-card input {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  font: inherit;
  padding: 12px 14px;
  outline: none;
}

.admin-login-card input:focus {
  border-color: rgba(245, 213, 138, 0.6);
  box-shadow: 0 0 0 3px rgba(245, 213, 138, 0.1);
}

.login-error {
  min-height: 18px;
  color: var(--err);
  font-size: 0.82rem;
}

.admin-login-card .button {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  cursor: pointer;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 70px;
}

.admin-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.admin-nav a {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 7px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-nav a.active,
.admin-nav a:hover {
  color: var(--gold-bright);
  background: rgba(245, 213, 138, 0.08);
  box-shadow: inset 0 -2px 0 var(--gold-bright);
}

.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.admin-header h1 {
  max-width: none;
  margin: 8px 0 10px;
  font-size: clamp(2rem, 5vw, 4.2rem);
}

.admin-header p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.admin-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.admin-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.admin-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(15, 17, 24, 0.84);
}

.admin-stat span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-stat strong {
  display: block;
  margin-top: 10px;
  color: var(--gold-bright);
  font-size: 1.45rem;
}

.admin-form,
.admin-list-panel,
.admin-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 17, 24, 0.84);
  backdrop-filter: blur(18px);
}

.admin-form {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.admin-form h2 {
  margin: 0 0 4px;
  color: var(--gold-bright);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-form small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: none;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  padding: 12px;
  outline: none;
}

.admin-form textarea {
  resize: vertical;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: rgba(245, 213, 138, 0.6);
  box-shadow: 0 0 0 3px rgba(245, 213, 138, 0.1);
}

.admin-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.admin-preview {
  display: grid;
  min-height: 150px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(245, 213, 138, 0.32);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.84rem;
  text-align: center;
}

.admin-preview img {
  display: block;
  width: 100%;
  max-height: 230px;
  object-fit: contain;
  background: #f8fafc;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-actions .button {
  cursor: pointer;
}

.danger {
  border-color: rgba(251, 113, 133, 0.45);
  color: #fecdd3;
}

.admin-list-panel {
  padding: 18px;
}

.admin-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.admin-filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-filter-row select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  padding: 0 10px;
}

.admin-list-head h2 {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.15rem;
}

.admin-list-head span {
  color: var(--gold-bright);
  font-weight: 900;
}

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

.admin-item {
  display: grid;
  grid-template-columns: 36px 92px minmax(170px, 1fr) 130px 100px 132px auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
}

.admin-thumb {
  overflow: hidden;
  width: 92px;
  height: 58px;
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(15, 17, 24, 0.78)),
    repeating-linear-gradient(135deg, rgba(213, 173, 91, 0.2) 0 1px, transparent 1px 12px);
}

.admin-row-number {
  color: var(--gold-bright);
  font-weight: 900;
  text-align: center;
}

.admin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-item h3 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  line-height: 1.3;
  text-transform: uppercase;
}

.admin-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.admin-cell {
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 800;
}

.admin-cell.amount {
  color: var(--gold-bright);
}

.admin-pill {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  padding: 4px 7px;
  border-radius: 5px;
  color: var(--gold-bright);
  background: rgba(245, 213, 138, 0.12);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-item-actions {
  display: grid;
  gap: 8px;
}

.admin-mini {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-weight: 800;
}

.admin-placeholder {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: rgba(15, 17, 24, 0.7);
}

.admin-placeholder h2 {
  margin: 0 0 8px;
  color: var(--gold-bright);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
}

.admin-placeholder p {
  margin: 0;
  color: var(--muted);
}

.admin-simple-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.admin-simple-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-simple-form input,
.admin-simple-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  padding: 12px;
  outline: none;
}

.brand-media-grid {
  display: grid;
  gap: 16px;
}

.brand-media-field {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 14px;
  background: rgba(255, 255, 255, 0.025);
}

.brand-media-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  justify-self: center;
  width: 170px;
  height: 88px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
}

.brand-media-preview img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.brand-media-preview-wide img {
  width: 150px;
  height: 72px;
  object-fit: cover;
}

.brand-media-preview-logo img {
  width: 150px;
  height: 54px;
}

.brand-media-preview-icon {
  width: 132px;
  height: 112px;
}

.brand-media-preview-icon img {
  width: 92px;
  height: 92px;
}

.brand-media-field input[type="file"] {
  padding: 10px;
  border-color: rgba(95, 152, 255, 0.8);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-notice {
  border: 1px solid rgba(57, 200, 137, 0.45);
  border-radius: 8px;
  padding: 12px 14px;
  color: #a7f3d0;
  background: rgba(57, 200, 137, 0.12);
  font-size: 0.86rem;
  font-weight: 900;
}

.admin-notice.is-error {
  border-color: rgba(251, 113, 133, 0.52);
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.13);
}

.bubble-toolbar {
  display: flex;
  justify-content: flex-start;
  margin: 12px 0;
}

.bubble-editor {
  display: grid;
  gap: 14px;
}

.bubble-group {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.bubble-group h3 {
  margin: 0;
  color: var(--gold-bright);
  font-size: 0.82rem;
  text-transform: uppercase;
}

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

.bubble-row {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.bubble-row-main,
.bubble-icon-row {
  display: grid;
  grid-template-columns: 112px 86px 120px minmax(180px, 1fr) 42px 78px 36px;
  gap: 8px;
  align-items: center;
}

.bubble-icon-row {
  grid-template-columns: 86px minmax(180px, 1fr) 180px 42px;
}

.bubble-move {
  display: flex;
  gap: 6px;
}

.bubble-move .admin-mini {
  min-width: 50px;
  padding: 0 7px;
  font-size: 0.68rem;
}

.bubble-row input,
.bubble-row select {
  min-height: 32px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  padding: 0 9px;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
}

.bubble-row input[type="color"] {
  padding: 2px;
}

.bubble-row input[type="file"] {
  padding: 5px;
}

.bubble-icon-row span,
.bubble-toggle {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bubble-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-transform: none;
}

.bubble-toggle input {
  width: auto;
  min-height: auto;
}

.bubble-icon-preview {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.62rem;
  font-weight: 900;
}

.bubble-icon-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.admin-simple-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.admin-simple-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.article-order {
  display: flex;
  gap: 6px;
  justify-self: start;
}

.article-order .admin-mini {
  min-width: 54px;
  padding: 0 8px;
  font-size: 0.72rem;
}

.admin-mini:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

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

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(10px);
}

.admin-modal-card {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(620px, 100%);
  gap: 14px;
  border: 1px solid rgba(245, 213, 138, 0.32);
  border-radius: 8px;
  padding: 24px;
  background: rgba(15, 17, 24, 0.94);
  box-shadow: var(--shadow);
}

.admin-modal-card h2 {
  margin: 0 44px 6px 0;
  color: var(--gold-bright);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.05rem;
}

.admin-modal-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-modal-card input,
.admin-modal-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  padding: 12px;
  outline: none;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.theme-grid button {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  cursor: pointer;
  font-weight: 900;
}

.theme-grid button::before {
  content: "";
  display: block;
  height: 8px;
  margin: 0 0 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--theme-start, var(--gold-bright)), var(--theme-end, var(--gold)));
}

.theme-grid button.is-selected {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 2px rgba(245, 213, 138, 0.12);
}

.danger-zone {
  margin-top: 22px;
  border: 1px solid rgba(251, 113, 133, 0.48);
  border-radius: 8px;
  padding: 18px;
  background: rgba(127, 29, 29, 0.12);
}

.danger-zone h3 {
  margin: 0 0 8px;
  color: var(--err);
}

@media (max-width: 900px) {
  .admin-header,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-dashboard,
  .theme-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-header {
    display: grid;
  }

  .admin-form {
    position: static;
  }

  .admin-item {
    grid-template-columns: 70px 1fr auto;
  }

  .admin-row-number,
  .admin-cell,
  .admin-pill {
    display: none;
  }
}

@media (max-width: 620px) {
  .admin-login {
    padding: 18px;
  }

  .admin-login::after {
    inset: 12px;
  }

  .admin-login-card {
    padding: 24px;
  }

  .admin-two,
  .admin-item,
  .admin-dashboard,
  .theme-grid {
    grid-template-columns: 1fr;
  }

  .admin-thumb {
    width: 100%;
    height: 160px;
  }
}
