:root {
  --ink: #111;
  --muted: #777;
  --line: #e8e8e8;
  --soft: #f7f7f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.admin-login-page {
  background: #000;
  color: #fff;
}

.admin-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid #242424;
  border-radius: 10px;
  background: #000;
  box-shadow: 0 18px 50px rgba(255, 255, 255, .08);
}

.admin-login-logo {
  display: flex;
  justify-content: center;
  padding: 4px 0 8px;
}

.admin-login-card img {
  width: 210px;
  display: block;
  padding: 0;
  border-radius: 0;
  background: #000;
}

.admin-login-card p {
  color: #aaa;
}

.admin-login-card label {
  display: grid;
  gap: 8px;
  color: #bbb;
  font-size: 13px;
}

.admin-login-card input {
  color: #fff;
  border-color: #2b2b2b;
  background: #111;
}

.admin-login-card button {
  height: 44px;
  border: 1px solid #fff;
  border-radius: 8px;
  color: #000;
  background: #fff;
  cursor: pointer;
}

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

button,
.upload-mini {
  position: relative;
}

button:disabled,
.upload-mini.is-loading {
  cursor: wait;
  opacity: .78;
}

.is-loading {
  pointer-events: none;
}

.is-loading::after {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin .75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 28px;
  background: #111;
  color: #fff;
}

.sidebar img {
  width: 168px;
  display: block;
  margin-bottom: 16px;
}

.sidebar p {
  color: #aaa;
  line-height: 1.5;
}

.sidebar nav {
  display: grid;
  gap: 10px;
  margin-top: 32px;
}

.nav {
  height: 42px;
  border: 1px solid #333;
  border-radius: 8px;
  color: #ddd;
  background: transparent;
  cursor: pointer;
}

.nav.active {
  color: #111;
  background: #fff;
}

.main {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

.topbar span,
.login-panel p,
td {
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.topbar button,
.login-row button,
.edit-actions button {
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #111;
  cursor: pointer;
}

.ghost-btn {
  color: #111 !important;
  border: 1px solid var(--line) !important;
  background: #fff !important;
}

.login-panel,
.stats article,
.table-wrap,
.item-card,
.panel-card,
.edit-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.login-panel {
  padding: 20px;
  margin-bottom: 22px;
}

.login-panel h2 {
  margin-bottom: 8px;
}

.login-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}

.panel-card {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.card-title-row h2 {
  line-height: 1.2;
}

.panel-card p {
  color: var(--muted);
}

.panel-card button {
  height: 40px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #111;
  cursor: pointer;
}

.admin-table {
  margin-top: 14px;
}

input,
select,
textarea {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: #fff;
}

input[readonly] {
  color: var(--muted);
  background: #f7f7f7;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: #111;
}

textarea {
  min-height: 86px;
  padding: 10px 12px;
  resize: vertical;
}

.sms-card {
  grid-column: 1 / -1;
}

.settings-grid .sms-card {
  grid-column: auto;
}

.info-list {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px 16px;
  align-items: start;
  padding-top: 4px;
}

.info-list span {
  color: var(--muted);
}

.info-list strong {
  min-width: 0;
  color: #111;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.settings-editor {
  display: grid;
  gap: 16px;
}

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

.editor-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.editor-head h2 {
  margin-bottom: 6px;
}

.editor-head p {
  color: var(--muted);
}

.settings-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.settings-form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.settings-form-grid h3 {
  margin: 0;
}

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

.privacy-editor-card textarea {
  min-height: 320px;
  resize: vertical;
  line-height: 1.7;
}

.privacy-preview {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.privacy-preview strong {
  font-size: 16px;
}

.avatar-setting-preview {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

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

.avatar-setting-preview > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.avatar-setting-preview span {
  font-weight: 700;
}

@media (max-width: 760px) {
  .avatar-gender-grid {
    grid-template-columns: 1fr;
  }
}

.avatar-setting-preview img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: #111;
}

.avatar-setting-preview strong {
  min-width: 0;
  color: #333;
  font-size: 13px;
  word-break: break-all;
}

#privacyAdminPreview {
  max-height: 240px;
  overflow: auto;
  color: #555;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.settings-save-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.menu-admin-card {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.menu-preview {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  text-align: center;
}

.menu-preview img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.menu-preview b {
  font-size: 13px;
}

.menu-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
}

.menu-form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.menu-actions {
  display: grid;
  gap: 10px;
  min-width: 92px;
}

.menu-actions button {
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
}

.menu-preview-icon {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  color: #111;
}

.menu-preview-icon::before,
.menu-preview-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
  border-color: currentColor;
}

.menu-preview-today::before,
.menu-preview-home::before {
  left: 5px;
  top: 4px;
  width: 16px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.menu-preview-today::after,
.menu-preview-home::after {
  left: 8px;
  top: 9px;
  width: 10px;
  border-top: 2px solid currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.menu-preview-closet::before,
.menu-preview-bag::before {
  left: 4px;
  top: 8px;
  width: 18px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.menu-preview-closet::after,
.menu-preview-bag::after {
  left: 9px;
  top: 3px;
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.menu-preview-profile::before,
.menu-preview-user::before {
  left: 9px;
  top: 4px;
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.menu-preview-profile::after,
.menu-preview-user::after {
  left: 5px;
  top: 15px;
  width: 16px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 10px 10px 4px 4px;
}

.menu-preview-star::before {
  left: 5px;
  top: 4px;
  width: 16px;
  height: 16px;
  background: currentColor;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 92%, 50% 70%, 21% 92%, 32% 57%, 2% 35%, 39% 35%);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.stats article {
  padding: 18px;
}

.stats span {
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}

.stats strong {
  font-size: 34px;
}

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

.sub-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 18px 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sub-section-head h3 {
  margin: 0 0 4px;
}

.sub-section-head p {
  color: var(--muted);
}

.user-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bulk-actions span {
  margin-right: auto;
  color: var(--muted);
}

.bulk-actions button {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #111;
  cursor: pointer;
}

.danger-btn {
  background: #000 !important;
}

.edit-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  margin-bottom: 14px;
}

.edit-panel[hidden] {
  display: none;
}

.edit-panel h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.edit-panel p {
  color: var(--muted);
}

.edit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
}

.edit-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

.item-edit-layout {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  align-items: start;
}

.item-image-editor {
  display: grid;
  gap: 10px;
}

.item-image-editor img {
  width: 150px;
  height: 190px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.upload-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border: 1px solid #111;
  border-radius: 8px;
  color: #fff;
  background: #111;
  cursor: pointer;
}

.item-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: #111;
  background: var(--soft);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.wardrobe-folder-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.wardrobe-folder-card p {
  color: var(--muted);
  margin-top: 6px;
}

.wardrobe-folder-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 28px;
  background: var(--soft);
}

.wardrobe-folder-card button,
.wardrobe-folder-bar button {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #111;
  cursor: pointer;
}

.wardrobe-folder-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.item-card,
.gallery-image-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  padding: 12px;
}

.item-card img,
.gallery-image-card img {
  width: 86px;
  height: 108px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--soft);
}

.item-card b,
.item-card span,
.gallery-image-card b,
.gallery-image-card span {
  display: block;
}

.item-card span,
.gallery-image-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.gallery-image-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.empty-admin-card {
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

.item-card button {
  margin-top: 8px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f5f5f5;
  cursor: pointer;
}

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

.small-action {
  height: 30px;
  padding: 0 12px;
  border: 1px solid #111;
  border-radius: 7px;
  color: #fff;
  background: #111;
  cursor: pointer;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  color: #111;
  background: #f2f2f2;
}

.status-badge.blocked {
  color: #fff;
  background: #111;
}

@media (max-width: 840px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

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

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

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

  .menu-admin-card {
    grid-template-columns: 1fr;
  }

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

  .editor-head {
    display: grid;
  }

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

  .item-edit-layout {
    grid-template-columns: 1fr;
  }

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