* { box-sizing: border-box; }

:root {
  --admin-bg: #f4f4f4;
  --admin-fg: #0a0a0a;
  --admin-muted: #6b6b6b;
  --admin-border: #e0e0e0;
  --admin-error: #b42318;
  --admin-error-bg: #fef3f2;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--admin-fg);
  background: var(--admin-bg);
  -webkit-font-smoothing: antialiased;
}

/* ─── Login ─── */
.login-screen {
  min-height: 100vh;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 480px);
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(2rem, 6vw, 4rem);
  background: #0a0a0a;
  color: #fff;
}

.login-brand__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.login-brand__logo {
  display: block;
  width: auto;
  height: 56px;
  max-width: 120px;
  object-fit: contain;
  flex-shrink: 0;
  margin: 0;
}

.login-brand__tagline {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.login-brand__copy {
  margin: 0;
  max-width: 28ch;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.95rem;
  line-height: 1.6;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: #fff;
}

.login-panel__inner {
  width: 100%;
  max-width: 380px;
}

.login-header {
  margin-bottom: 2rem;
}

.login-header__logo {
  display: none;
  height: 48px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  margin-bottom: 1.25rem;
}

.login-header h1 {
  margin: 0 0 0.35rem;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.login-header p {
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 1.15rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #444;
}

.field input {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--admin-border);
  border-radius: 2px;
  font: inherit;
  color: var(--admin-fg);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder {
  color: #aaa;
}

.field input:focus {
  outline: none;
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.pin-input {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-align: center;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 4.5rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: #666;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
}

.password-toggle:hover {
  color: #111;
}

.login-error {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 2px;
  background: var(--admin-error-bg);
  border: 1px solid #fecdca;
  color: var(--admin-error);
  font-size: 0.88rem;
  line-height: 1.45;
}

.login-submit {
  position: relative;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 2px;
  background: #0a0a0a;
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.login-submit:hover:not(:disabled) {
  background: #222;
}

.login-submit:disabled {
  opacity: 0.72;
  cursor: wait;
}

.login-submit__spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.login-submit.is-loading .login-submit__label {
  visibility: hidden;
}

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

.login-footer {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--admin-border);
}

.login-footer a {
  color: var(--admin-muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.login-footer a:hover {
  color: #111;
}

@media (max-width: 860px) {
  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-brand {
    display: none;
  }

  .login-header__logo {
    display: block;
  }

  .login-panel {
    min-height: 100vh;
  }
}

.error { color: var(--admin-error); font-size: 13px; }

/* ─── App shell ─── */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #0a0a0a;
  color: #fff;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-right: 1px solid #1a1a1a;
}

.sidebar-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.5rem;
}

.sidebar-logo {
  display: block;
  height: 36px;
  width: auto;
  max-width: 80px;
  object-fit: contain;
  flex-shrink: 0;
  margin: 0;
}

.sidebar-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.75rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-icon {
  width: 1.1rem;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-footer {
  display: grid;
  gap: 0.65rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-link {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.82rem;
  text-decoration: none;
  padding: 0 0.5rem;
}

.sidebar-link:hover {
  color: #fff;
}

.logout-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.75);
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  border-radius: 6px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.logout-btn:hover {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.main {
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 4vw, 2.5rem);
  overflow: auto;
  background: var(--admin-bg);
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.main-header h1 {
  margin: 0 0 0.25rem;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.view-subtitle {
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.user-badge {
  flex-shrink: 0;
  padding: 0.4rem 0.75rem;
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  color: var(--admin-muted);
  font-size: 0.78rem;
}

.view-root {
  display: grid;
  gap: 1.25rem;
}

/* ─── Layout blocks ─── */
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-toolbar__meta {
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.88rem;
}

.card {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.card--flat {
  box-shadow: none;
}

.card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.card__title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 600;
}

.card__desc {
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.section-divider {
  height: 1px;
  background: var(--admin-border);
  margin: 1.25rem 0;
  border: none;
}

/* ─── Stats ─── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.stat-card__label {
  display: block;
  color: var(--admin-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-card__value {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.1;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.quick-link {
  display: block;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.quick-link:hover {
  border-color: #bbb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.quick-link strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
}

.quick-link span {
  color: var(--admin-muted);
  font-size: 0.82rem;
}

/* ─── Forms ─── */
.form-grid {
  display: grid;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.form-field label,
.field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #333;
}

.field-required {
  color: var(--admin-error);
  font-weight: 700;
}

.variant-list {
  display: grid;
  gap: 0.85rem;
}

.variant-card {
  padding: 1rem;
  background: #fafafa;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
}

.variant-card__actions {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.add-variant-panel {
  margin-top: 1.25rem;
  padding: 1.1rem 1rem;
  background: #fff;
  border: 2px dashed var(--admin-border);
  border-radius: 10px;
}

.add-variant-panel__title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.add-variant-submit {
  min-height: 2.85rem;
  font-size: 0.92rem;
  font-weight: 600;
  gap: 0.5rem;
}

.add-variant-submit__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 700;
}


.form-field .hint,
.field-hint {
  display: block;
  margin-top: 0.3rem;
  color: var(--admin-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.form-field input,
.form-field textarea,
.form-field select,
.form-grid input,
.form-grid textarea,
.form-grid select {
  display: block;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  font: inherit;
  color: var(--admin-fg);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus,
.form-grid input:focus,
.form-grid textarea:focus,
.form-grid select:focus {
  outline: none;
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.form-grid textarea,
.form-field textarea {
  min-height: 96px;
  resize: vertical;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.25rem;
}

.switch-field {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0;
}

.switch-field input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #111;
}

.switch-field label {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}

.file-upload {
  display: grid;
  gap: 0.75rem;
}

.file-upload input[type="file"] {
  font-size: 0.85rem;
}

.file-preview__inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.75rem;
  background: #fafafa;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
}

.file-preview__img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  flex-shrink: 0;
  background: #fff;
}

.file-preview__info {
  flex: 1;
  min-width: 0;
}

.file-preview__info strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

.file-preview__info span {
  display: block;
  color: var(--admin-muted);
  font-size: 0.78rem;
  word-break: break-all;
}

.file-preview__remove {
  flex-shrink: 0;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border: 1px solid #111;
  border-radius: 6px;
  background: #111;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
  background: #222;
  border-color: #222;
}

.btn.secondary {
  background: #fff;
  color: #111;
}

.btn.secondary:hover:not(:disabled) {
  background: #f5f5f5;
}

.btn.ghost {
  background: transparent;
  border-color: var(--admin-border);
  color: #333;
}

.btn.ghost:hover:not(:disabled) {
  background: #f5f5f5;
}

.btn.danger {
  border-color: #b42318;
  background: #b42318;
}

.btn.danger:hover:not(:disabled) {
  background: #912018;
  border-color: #912018;
}

.btn.sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.btn--block {
  width: 100%;
}

/* ─── Tables ─── */
.table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  padding: 0.85rem 0.65rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0f0;
}

.data-table th {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--admin-muted);
  background: #fafafa;
}

.data-table tbody tr:hover {
  background: #fafafa;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 200px;
}

.product-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  background: #f0f0f0;
  border: 1px solid var(--admin-border);
  flex-shrink: 0;
}

.product-thumb--empty {
  display: grid;
  place-items: center;
  color: #bbb;
  font-size: 0.65rem;
}

.product-name {
  font-weight: 500;
  line-height: 1.35;
}

.product-meta {
  color: var(--admin-muted);
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

/* ─── Badges ─── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  background: #eee;
  color: #444;
}

.badge--success,
.badge.paid {
  background: #ecfdf3;
  color: #027a48;
}

.badge--warning,
.badge.unpaid {
  background: #fffaeb;
  color: #b54708;
}

.badge--danger,
.badge.used {
  background: #fef3f2;
  color: #b42318;
}

.badge--muted {
  background: #f2f2f2;
  color: #666;
}

/* ─── Empty & loading ─── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--admin-muted);
}

.empty-state strong {
  display: block;
  color: var(--admin-fg);
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--admin-muted);
  padding: 2rem 0;
}

.loading-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid #ddd;
  border-top-color: #111;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ─── Modal ─── */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.45);
}

.modal {
  width: min(720px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-bottom: 1px solid var(--admin-border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.modal__title {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.modal__subtitle {
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.85rem;
}

.modal__close {
  border: none;
  background: #f5f5f5;
  color: #666;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.modal__close:hover {
  background: #eee;
  color: #111;
}

.modal__body {
  padding: 1.25rem 1.35rem 1.5rem;
  display: grid;
  gap: 1.25rem;
}

.modal-section {
  display: grid;
  gap: 0.85rem;
}

.modal-section__title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #333;
}

.image-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.image-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: #fafafa;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
}

.image-list img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
}

.image-list span {
  flex: 1;
  font-size: 0.78rem;
  color: var(--admin-muted);
  word-break: break-all;
}

.variant-table .variant-field {
  width: 100%;
  min-width: 4.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--admin-border);
  border-radius: 4px;
  font: inherit;
  font-size: 0.85rem;
  background: #fff;
}

.variant-table .variant-field:focus {
  outline: none;
  border-color: #111;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

.variant-table .variant-field--stock {
  max-width: 5rem;
}

.variant-table td:last-child {
  white-space: nowrap;
  width: 1%;
  vertical-align: middle;
}

.variant-table .btn-group {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.variant-table .btn-group .btn {
  flex-shrink: 0;
}

/* ─── Order detail ─── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.detail-block {
  padding: 1rem;
  background: #fafafa;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
}

.detail-block dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--admin-muted);
  margin-bottom: 0.35rem;
}

.detail-block dd {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.detail-block ul {
  margin: 0;
  padding-left: 1.1rem;
}

.order-detail { font-size: 0.88rem; line-height: 1.6; }
.order-detail dt { font-weight: 600; margin-top: 0.75rem; }

.order-items-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  background: #fafafa;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
}

.order-item__img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  flex-shrink: 0;
  background: #fff;
}

.order-item__img--empty {
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  color: #aaa;
  text-align: center;
  line-height: 1.2;
  padding: 0.25rem;
}

.order-item__body {
  flex: 1;
  min-width: 0;
}

.order-item__name {
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.order-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: 0.78rem;
  color: var(--admin-muted);
}

.order-item__meta span {
  padding: 0.12rem 0.45rem;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
}

.order-item__unit {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--admin-muted);
}

.order-item__total {
  flex-shrink: 0;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: right;
  min-width: 4.5rem;
}

/* ─── Barber cards ─── */
.barber-card {
  display: grid;
  gap: 1rem;
}

.barber-card__stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.barber-stat {
  padding: 1rem 1.15rem;
  background: #fafafa;
  border-radius: 8px;
}

.barber-stat span {
  display: block;
  font-size: 0.72rem;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.barber-stat strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.1rem;
}

.barber-detail {
  display: flex;
  flex-direction: column;
  margin-top: 0;
}

.barber-detail .card__header {
  margin-bottom: 1.25rem;
}

.barber-detail .barber-card__stats {
  margin-bottom: 1.5rem;
}

.barber-detail .btn-group {
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.barber-card__actions {
  flex-shrink: 0;
}

.barber-customer-list {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.6;
}

code, .code-chip {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  background: #f5f5f5;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* ─── Toast ─── */
.toast-root {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 300;
  display: grid;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1rem;
  background: #111;
  color: #fff;
  border-radius: 8px;
  font-size: 0.88rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  animation: toast-in 0.25s ease;
}

.toast--error {
  background: #b42318;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.panel h2 { font-size: 1rem; margin: 0 0 1rem; }

#barber-list {
  display: grid;
  gap: 1.25rem;
}

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { border-bottom: 1px solid #f0f0f0; padding: 0.75rem 0.5rem; text-align: left; vertical-align: middle; }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--admin-muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.card strong { display: block; font-size: 1.5rem; margin-top: 0.25rem; }

/* ─── Mobile top bar (hidden on desktop) ─── */
.mobile-topbar {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

/* ─── Mobile layout ─── */
@media (max-width: 768px) {
  body.admin-nav-open {
    overflow: hidden;
  }

  .app {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 180;
    background: rgba(0, 0, 0, 0.5);
    -webkit-tap-highlight-color: transparent;
  }

  .app.is-nav-open .sidebar-backdrop {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    width: min(280px, 88vw);
    max-width: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 1.25rem;
    padding: 1.25rem 1rem;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app.is-nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-nav {
    flex-direction: column;
    flex: 1;
    width: 100%;
    gap: 0.15rem;
  }

  .nav-item {
    width: 100%;
  }

  .sidebar-footer {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: -0.25rem 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--admin-border);
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
  }

  .nav-toggle__icon {
    display: block;
    width: 1.1rem;
    height: 2px;
    background: #111;
    position: relative;
    border-radius: 1px;
  }

  .nav-toggle__icon::before,
  .nav-toggle__icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: #111;
    border-radius: 1px;
  }

  .nav-toggle__icon::before {
    top: -6px;
  }

  .nav-toggle__icon::after {
    top: 6px;
  }

  .mobile-topbar__logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
  }

  .mobile-topbar__title {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--admin-muted);
  }

  .main {
    padding: 1rem 1rem 1.5rem;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
  }

  .main-header h1 {
    font-size: 1.5rem;
  }

  .view-subtitle {
    font-size: 0.88rem;
  }

  .user-badge {
    display: none;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-grid .stat-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .stat-card {
    padding: 0.9rem 1rem;
  }

  .stat-card__value {
    font-size: 1.45rem;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }

  .page-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .page-toolbar .btn {
    width: 100%;
    justify-content: center;
  }

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

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

  .barber-card__stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-cell {
    min-width: 0;
  }

  .card {
    padding: 1rem 1.05rem;
  }

  .card__header {
    margin-bottom: 0.9rem;
  }

  .card__title {
    font-size: 0.95rem;
  }

  .table-wrap--stack {
    overflow: visible;
    margin: 0;
  }

  .data-table--stack {
    border-collapse: separate;
    border-spacing: 0;
  }

  .data-table--stack thead {
    display: none;
  }

  .data-table--stack tbody tr {
    display: block;
    margin-bottom: 0.75rem;
    padding: 0.85rem 1rem;
    background: #fafafa;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
  }

  .data-table--stack tbody tr:last-child {
    margin-bottom: 0;
  }

  .data-table--stack td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ececec;
    text-align: right;
  }

  .data-table--stack td:last-child {
    border-bottom: none;
    padding-bottom: 0;
    padding-top: 0.65rem;
  }

  .data-table--stack td::before {
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--admin-muted);
    text-align: left;
    flex-shrink: 0;
  }

  .data-table--stack td[data-label="Product"],
  .data-table--stack td[data-label="Customer"] {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }

  .data-table--stack td[data-label="Product"]::before,
  .data-table--stack td[data-label="Customer"]::before {
    margin-bottom: 0.25rem;
  }

  .variant-card__actions .btn {
    min-height: 2.75rem;
    font-size: 0.88rem;
  }

  .btn-group--stack {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .btn-group--stack .btn {
    width: 100%;
    justify-content: center;
    min-height: 2.5rem;
  }

  .barber-detail .btn-group {
    flex-direction: column;
    gap: 0.5rem;
  }

  .barber-detail .btn-group .btn {
    width: 100%;
    min-height: 2.5rem;
  }

  .form-actions--stack,
  .modal .form-actions {
    flex-direction: column;
  }

  .form-actions--stack .btn,
  .modal .form-actions .btn {
    width: 100%;
    min-height: 2.75rem;
  }

  .form-grid--comfortable .form-field input,
  .form-grid--comfortable .form-field textarea {
    font-size: 16px;
  }

  .file-preview__inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .file-preview__remove {
    width: 100%;
  }

  .image-list li {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .image-list img {
    width: 100%;
    max-width: 120px;
    height: auto;
    aspect-ratio: 1;
  }

  .image-list .btn {
    width: 100%;
  }

  .order-item {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .order-item__total {
    width: 100%;
    text-align: left;
    margin-top: 0.15rem;
    padding-top: 0.35rem;
    border-top: 1px solid #eee;
  }

  .modal-root {
    padding: 0;
    align-items: stretch;
  }

  .modal {
    width: 100%;
    max-width: none;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }

  .modal__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1rem 1.5rem;
  }

  .modal__header {
    padding: 1rem;
  }

  .toast-root {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  #barber-list {
    gap: 1rem;
  }

  .barber-detail .card__header {
    flex-direction: column;
    align-items: stretch;
  }

  .barber-card__actions {
    width: 100%;
  }

  .barber-card__actions .btn {
    flex: 1;
  }

  .code-chip {
    word-break: break-all;
  }
}

@media (max-width: 400px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid .stat-card:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .barber-card__stats {
    grid-template-columns: 1fr;
  }
}
