/* Admin dashboard — restyles using Blan design tokens from design-tokens.css */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w: 224px;
  --header-h:  58px;
}

html, body {
  height: 100%;
  background: var(--bg-page);
  color: var(--fg-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root { height: 100%; display: flex; }

/* ─── Sidebar ──────────────────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface-dark);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 10;
}

.sidebar__logo {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 var(--space-5);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  gap: var(--space-2);
}

.sidebar__logo-text {
  font-size: 16px;
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-h);
  color: var(--fg-on-dark);
}

.sidebar__logo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent-500);
  flex-shrink: 0;
  margin-bottom: 5px;
}

.sidebar__nav {
  flex: 1;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 9px var(--space-3);
  border-radius: var(--radius-xs);
  cursor: pointer;
  color: var(--fg-on-dark-muted);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-medium);
  font-family: var(--font-sans);
  transition: background 0.14s, color 0.14s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item svg { flex-shrink: 0; }

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--fg-on-dark);
}

.nav-item.active {
  background: rgba(253,58,37,0.18);
  color: var(--color-accent-300);
}

.sidebar__footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar__role {
  font-size: 10px;
  color: var(--fg-on-dark-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-1);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(253,58,37,0.2);
  color: var(--color-accent-300);
}

/* ─── Layout ───────────────────────────────────────────────────────────────── */

.layout {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Top header ───────────────────────────────────────────────────────────── */

.top-header {
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.top-header__title {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  color: var(--fg-primary);
  letter-spacing: var(--tracking-h);
}

.top-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ─── Main ─────────────────────────────────────────────────────────────────── */

.main {
  flex: 1;
  padding: var(--space-8);
}

/* ─── Notification badge ───────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-1);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: var(--fw-bold);
  background: var(--color-accent-500);
  color: var(--color-white);
  box-shadow: var(--shadow-btn-accent);
}

/* ─── Page headings ────────────────────────────────────────────────────────── */

.page-title {
  font-size: var(--fs-h5);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-h);
  color: var(--fg-primary);
  margin-bottom: var(--space-1);
}

.page-subtitle {
  font-size: var(--fs-caption);
  color: var(--fg-secondary);
  margin-bottom: var(--space-6);
}

/* ─── Stat cards ───────────────────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-5);
  box-shadow: var(--shadow-card-soft);
}

.stat-card__label {
  font-size: 11px;
  color: var(--fg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-2);
}

.stat-card__value {
  font-size: 32px;
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-display);
  color: var(--fg-primary);
  line-height: 1;
}

.stat-card__delta {
  font-size: 11px;
  color: var(--fg-secondary);
  margin-top: var(--space-1);
}

.stat-card--accent {
  background: var(--gradient-accent);
  border-color: var(--color-accent-600);
  box-shadow: var(--shadow-btn-accent);
}

.stat-card--accent .stat-card__label,
.stat-card--accent .stat-card__value,
.stat-card--accent .stat-card__delta { color: var(--color-white); }

/* ─── Tables ───────────────────────────────────────────────────────────────── */

.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-card-soft);
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--color-neutral-50);
}

.table-header__label {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  color: var(--fg-primary);
}

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

thead th {
  padding: var(--space-3) var(--space-5);
  text-align: left;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--fg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--color-neutral-50);
}

tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--color-neutral-50); }

tbody td {
  padding: var(--space-3) var(--space-5);
  font-size: var(--fs-body-sm);
  color: var(--fg-primary);
  vertical-align: middle;
}

.td-muted { color: var(--fg-secondary); }

/* ─── Status pills ─────────────────────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pill--new        { background: rgba(245,158,11,0.12); color: rgb(161,107,0);  }
.pill--in_progress { background: rgba(59,130,246,0.12); color: rgb(37,99,235); }
.pill--completed  { background: rgba(22,163,74,0.12);  color: rgb(22,163,74);  }
.pill--pending    { background: rgba(245,158,11,0.12); color: rgb(161,107,0);  }
.pill--done       { background: rgba(22,163,74,0.12);  color: rgb(22,163,74);  }
.pill--archived   { background: var(--color-neutral-100); color: var(--fg-tertiary); }
.pill--review     { background: rgba(139,92,246,0.12); color: rgb(109,40,217); }

/* ─── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 9px var(--space-4);
  border-radius: var(--radius-xs);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  transition: filter 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn--primary {
  background: var(--gradient-accent);
  color: var(--color-white);
  box-shadow: var(--shadow-btn-accent);
}
.btn--primary:hover { filter: brightness(1.07); }

.btn--dark {
  background: var(--gradient-dark-btn);
  color: var(--fg-on-dark);
  box-shadow: var(--shadow-btn-dark);
}
.btn--dark:hover { filter: brightness(1.1); }

.btn--ghost {
  background: var(--gradient-light-btn);
  color: var(--fg-primary);
  box-shadow: var(--shadow-btn-light);
  border: 1px solid var(--border-default);
}
.btn--ghost:hover { filter: brightness(0.97); }

/* ─── Status select in table ───────────────────────────────────────────────── */

.status-select {
  appearance: none;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  font-family: var(--font-sans);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

/* ─── Request detail expansion ─────────────────────────────────────────────── */

.detail-row td { padding: 0; border-bottom: 1px solid var(--border-subtle); }

.detail-panel {
  padding: var(--space-5);
  background: var(--color-neutral-50);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.detail-field__label {
  font-size: 10px;
  color: var(--fg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
  font-weight: var(--fw-semibold);
}

.detail-field__value {
  font-size: var(--fs-body-sm);
  color: var(--fg-primary);
  line-height: var(--lh-normal);
}

/* ─── Inputs (unified across all contexts) ─────────────────────────────────── */

.field { margin-bottom: var(--space-4); }

.field label {
  display: block;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--fg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: var(--space-1);
}

.field input, .field select, .field textarea,
.editor-row input, .editor-row textarea, .editor-row select,
.settings-section input, .settings-section select, .settings-section textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  padding: 9px var(--space-3);
  color: var(--fg-primary);
  font-size: var(--fs-body-sm);
  font-family: var(--font-sans);
  font-weight: var(--fw-regular);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.field input:focus, .field select:focus, .field textarea:focus,
.editor-row input:focus, .editor-row textarea:focus, .editor-row select:focus,
.settings-section input:focus, .settings-section select:focus, .settings-section textarea:focus {
  border-color: var(--color-accent-500);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.field textarea, .editor-row textarea, .settings-section textarea {
  resize: vertical;
  min-height: 80px;
  line-height: var(--lh-normal);
}

/* ─── Settings sections ────────────────────────────────────────────────────── */

.settings-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-card-soft);
}

.settings-section__title {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-bold);
  color: var(--fg-primary);
  letter-spacing: var(--tracking-h);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

/* ─── Tabs ─────────────────────────────────────────────────────────────────── */

.tab-bar {
  display: flex;
  gap: 2px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  padding: 4px;
  border-radius: var(--radius-xs);
  width: fit-content;
  margin-bottom: var(--space-6);
}

.tab {
  padding: 6px var(--space-4);
  border-radius: 6px;
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-medium);
  font-family: var(--font-sans);
  color: var(--fg-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
  white-space: nowrap;
}

.tab.active {
  background: var(--bg-surface);
  color: var(--fg-primary);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-btn-light);
}

.tab:hover:not(.active) { color: var(--fg-primary); }

/* ─── Toggle switch ────────────────────────────────────────────────────────── */

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: var(--space-5);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row__label { font-size: var(--fs-body-sm); color: var(--fg-primary); font-weight: var(--fw-medium); }
.toggle-row__desc  { font-size: var(--fs-caption); color: var(--fg-secondary); margin-top: 2px; }

.toggle { position: relative; display: inline-flex; width: 36px; height: 20px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--color-neutral-200); border-radius: var(--radius-pill); transition: background 0.2s; }
.toggle-slider:before { position: absolute; content: ''; height: 14px; width: 14px; left: 3px; bottom: 3px; background: var(--color-neutral-400); border-radius: 50%; transition: transform 0.2s, background 0.2s; }
.toggle input:checked + .toggle-slider { background: var(--color-accent-100); }
.toggle input:checked + .toggle-slider:before { transform: translateX(16px); background: var(--color-accent-500); }

/* ─── Icon buttons ─────────────────────────────────────────────────────────── */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius-xs);
  border: none; cursor: pointer;
  background: transparent;
  color: var(--fg-tertiary);
  transition: background 0.14s, color 0.14s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-surface-2); color: var(--fg-primary); }
.icon-btn--danger:hover { background: rgba(239,68,68,0.08); color: rgb(220,38,38); }

/* ─── Content cards ────────────────────────────────────────────────────────── */

.content-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-card-soft);
}

.content-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--color-neutral-50);
}

.content-card__title { font-size: var(--fs-body-sm); font-weight: var(--fw-semibold); color: var(--fg-primary); }
.content-card__count { font-size: var(--fs-caption); color: var(--fg-secondary); }
.content-card__body  { }

/* ─── Content items ────────────────────────────────────────────────────────── */

.content-item {
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-3); transition: background 0.1s;
}
.content-item:last-child { border-bottom: none; }
.content-item:hover { background: var(--color-neutral-50); }

.content-item__thumb   { flex-shrink: 0; }
.content-item__text    { flex: 1; min-width: 0; }
.content-item__q       { font-size: var(--fs-body-sm); font-weight: var(--fw-medium); color: var(--fg-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.content-item__a       { font-size: var(--fs-caption); color: var(--fg-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content-item__actions { display: flex; gap: 2px; flex-shrink: 0; margin-top: 1px; }

/* ─── Inline editor rows ───────────────────────────────────────────────────── */

.editor-row {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: var(--space-2);
  background: var(--color-neutral-50);
}

.editor-label {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--fg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}

.editor-optional {
  font-weight: var(--fw-regular);
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-secondary);
  opacity: 0.7;
  margin-left: 4px;
}

.editor-two-col    { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.editor-toggle-row { display: flex; align-items: center; gap: var(--space-2); padding: 4px 0; }
.editor-actions    { display: flex; gap: var(--space-2); padding-top: var(--space-1); }

/* ─── Empty state ──────────────────────────────────────────────────────────── */

.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: var(--space-20) var(--space-5);
  text-align: center; color: var(--fg-secondary);
}
.empty-state__title { font-size: var(--fs-h6); font-weight: var(--fw-bold); color: var(--fg-primary); margin: var(--space-4) 0 var(--space-2); letter-spacing: var(--tracking-h); }
.empty-state__desc  { font-size: var(--fs-body-sm); color: var(--fg-secondary); max-width: 280px; line-height: var(--lh-relaxed); }

/* ─── Content page layout ──────────────────────────────────────────────────── */

.content-layout { display: flex; gap: var(--space-5); align-items: flex-start; }

.content-nav {
  width: 152px; flex-shrink: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: sticky; top: calc(var(--header-h) + 16px);
  box-shadow: var(--shadow-card-soft);
}

.content-nav__item {
  display: block; width: 100%;
  padding: 9px var(--space-4);
  text-align: left;
  font-size: var(--fs-body-sm);
  color: var(--fg-secondary);
  background: none; border: none;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  font-family: var(--font-sans);
}
.content-nav__item:last-child { border-bottom: none; }
.content-nav__item:hover { background: var(--color-neutral-50); color: var(--fg-primary); }
.content-nav__item.active {
  background: rgba(253,58,37,0.06);
  color: var(--color-accent-500);
  font-weight: var(--fw-semibold);
  border-left: 2px solid var(--color-accent-500);
}

.content-section { flex: 1; min-width: 0; }

/* ─── Review preview ───────────────────────────────────────────────────────── */

.review-preview {
  background: var(--color-neutral-50);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: var(--space-4);
}
.review-preview__header { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.review-preview__avatar { display: inline-block; width: 32px; height: 32px; border-radius: 50%; background-size: cover; background-position: center; flex-shrink: 0; }
.review-preview__avatar--empty { background: var(--bg-surface-2); border: 1px solid var(--border-default); }
.review-preview__name { font-size: var(--fs-body-sm); font-weight: var(--fw-semibold); color: var(--fg-primary); }
.review-preview__role { font-size: var(--fs-caption); color: var(--fg-secondary); }
.review-preview__quote { font-size: var(--fs-body-sm); color: var(--fg-secondary); line-height: var(--lh-normal); font-style: italic; }

/* ─── Review list avatar ───────────────────────────────────────────────────── */

.review-list-avatar { display: inline-block; width: 28px; height: 28px; border-radius: 50%; background-size: cover; background-position: center; }
.review-list-avatar--empty { background: var(--bg-surface-2); border: 1px solid var(--border-subtle); }

/* ─── Image upload ─────────────────────────────────────────────────────────── */

.img-upload { display: flex; flex-direction: column; gap: var(--space-2); }

.img-upload__dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-1); padding: var(--space-5); width: 100%;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  color: var(--fg-secondary);
  font-size: var(--fs-caption); font-family: var(--font-sans);
  cursor: pointer; transition: border-color 0.14s, background 0.14s, color 0.14s;
}
.img-upload__dropzone:hover {
  border-color: var(--color-accent-500);
  background: rgba(253,58,37,0.03);
  color: var(--color-accent-500);
}
.img-upload__dropzone:disabled { opacity: 0.5; cursor: not-allowed; }

.img-upload__preview-wrap {
  position: relative; border-radius: var(--radius-xs); overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.img-upload__preview-wrap--avatar { width: 56px; height: 56px; border-radius: 50%; }
.img-upload__img        { width: 100%; height: 140px; object-fit: cover; display: block; }
.img-upload__img--avatar { width: 56px; height: 56px; object-fit: cover; border-radius: 50%; display: block; }

.img-upload__overlay {
  position: absolute; inset: 0; background: rgba(9,9,11,0.5);
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-2); opacity: 0; transition: opacity 0.14s;
}
.img-upload__preview-wrap:hover .img-upload__overlay { opacity: 1; }
.img-upload__overlay-btn { padding: 5px var(--space-3); font-size: 11px; }
.img-upload__overlay-btn--danger { color: rgb(239,68,68); border-color: rgba(239,68,68,0.4); }

.img-upload__error { font-size: 11px; color: rgb(220,38,38); line-height: var(--lh-normal); }
.img-upload__error code { font-family: var(--font-mono); font-size: 10px; background: rgba(239,68,68,0.08); padding: 1px 4px; border-radius: 4px; }

/* ─── Multi-image upload ───────────────────────────────────────────────────── */

.multi-img-upload__grid { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.multi-img-upload__item { position: relative; width: 72px; height: 56px; border-radius: var(--radius-xs); overflow: hidden; border: 1px solid var(--border-subtle); }
.multi-img-upload__thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.multi-img-upload__remove {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(9,9,11,0.65); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff;
  opacity: 0; transition: opacity 0.14s;
}
.multi-img-upload__item:hover .multi-img-upload__remove { opacity: 1; }

.multi-img-upload__add {
  width: 72px; height: 56px; border-radius: var(--radius-xs);
  border: 1px dashed var(--border-default);
  background: var(--bg-surface); color: var(--fg-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: border-color 0.14s, color 0.14s, background 0.14s;
}
.multi-img-upload__add:hover { border-color: var(--color-accent-500); color: var(--color-accent-500); background: rgba(253,58,37,0.03); }
.multi-img-upload__add:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── CTA field ────────────────────────────────────────────────────────────── */

.cta-field {
  padding: var(--space-4);
  background: var(--color-neutral-50);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.cta-field .editor-label { margin-bottom: 4px; }
.cta-field input, .cta-field select { padding: 8px var(--space-3); }

/* ─── Content two-col ──────────────────────────────────────────────────────── */

.content-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }

/* ─── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar  { transform: translateX(-100%); }
  .layout   { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .detail-panel { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .content-layout { flex-direction: column; }
  .content-nav { width: 100%; position: static; display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .content-nav::-webkit-scrollbar { display: none; }
  .content-nav__item { flex: 0 0 auto; text-align: center; border-bottom: none; border-right: 1px solid var(--border-subtle); border-left: none; }
  .content-nav__item:last-child { border-right: none; }
  .content-nav__item.active { border-left: none; border-bottom: 2px solid var(--color-accent-500); }
  .editor-two-col  { grid-template-columns: 1fr; }
  .content-two-col { grid-template-columns: 1fr; }
}

/* ─── Sidebar: sign-out + email ─────────────────────────────────────────────── */

.sidebar__signout-wrap {
  margin-top: auto;
  padding-top: var(--space-2);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.nav-item--signout:hover {
  background: rgba(239, 68, 68, 0.12);
  color: rgb(252, 165, 165);
}

.sidebar__email {
  font-size: var(--fs-caption);
  color: var(--fg-on-dark-muted);
  margin-top: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* ─── Login page ─────────────────────────────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  padding: var(--space-6);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-8);
  box-shadow: var(--shadow-card);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.login-brand__name {
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-h);
  color: var(--fg-primary);
}

.login-brand__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent-500);
  flex-shrink: 0;
  margin-bottom: 5px;
}

.login-title {
  font-size: var(--fs-h5);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-h);
  color: var(--fg-primary);
  margin: 0 0 var(--space-1);
}

.login-sub {
  font-size: var(--fs-body-sm);
  color: var(--fg-secondary);
  margin: 0 0 var(--space-6);
}

.login-error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-xs);
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.18);
  font-size: var(--fs-body-sm);
  color: rgb(220, 38, 38);
  line-height: var(--lh-normal);
  margin-bottom: var(--space-4);
}

/* ─── Admin Toast ────────────────────────────────────────────────────────────── */

.admin-toast {
  position: fixed;
  bottom: var(--space-8);
  left: calc(var(--sidebar-w) + (100% - var(--sidebar-w)) / 2);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  font-family: var(--font-sans);
  z-index: 999;
  white-space: nowrap;
  pointer-events: none;
  animation: toast-in 220ms ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.admin-toast--success {
  background: var(--color-neutral-900);
  color: var(--fg-on-dark);
  box-shadow: var(--shadow-btn-dark);
}

.admin-toast--error {
  background: rgb(220, 38, 38);
  color: #fff;
}

/* ─── Mobile sidebar toggle ──────────────────────────────────────────────────── */

.sidebar--open {
  transform: translateX(0) !important;
  z-index: 11;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10;
  cursor: pointer;
}
.sidebar-overlay.is-open { display: block; }

/* Hamburger — hidden on desktop, shown on mobile */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  border: none;
  background: none;
  color: var(--fg-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s;
}
.menu-toggle:hover { background: var(--bg-surface-2); }

/* ─── Sidebar logo image ──────────────────────────────────────────────────────*/

.sidebar__logo-img {
  height: 28px;
  width: auto;
  display: block;
}

/* ─── Hide cells on mobile ───────────────────────────────────────────────────*/

.td-hide-mobile { /* visible on desktop — hidden by media query below */ }

/* ─── Tablet (≤768px) ────────────────────────────────────────────────────────*/

@media (max-width: 768px) {
  .menu-toggle     { display: flex; }
  .stats-grid      { grid-template-columns: 1fr 1fr; }
  .content-layout  { flex-direction: column; }
  /* Content nav: scrollable horizontal strip — no wrapping */
  .content-nav { width: 100%; position: static; display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .content-nav::-webkit-scrollbar { display: none; }
  .content-nav__item { flex: 0 0 auto; border-bottom: none; border-right: 1px solid var(--border-subtle); border-left: none; }
  .content-nav__item:last-child { border-right: none; }
  .content-nav__item.active { border-left: none; border-bottom: 2px solid var(--color-accent-500); }
  .editor-two-col  { grid-template-columns: 1fr; }
  .content-two-col { grid-template-columns: 1fr; }
  .main            { padding: var(--space-4); }
  .top-header      { padding: 0 var(--space-4); }
  .settings-section { padding: var(--space-4); }
  .stat-card__value { font-size: 26px; }
  .pill            { white-space: nowrap; }

  /* Tab bars: scroll horizontally, no wrap, no scrollbar */
  .tab-bar { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tab-bar::-webkit-scrollbar { display: none; }
}

/* ─── Mobile card tables (≤640px) ────────────────────────────────────────────*/

@media (max-width: 640px) {
  /* Convert tables to card layout */
  .table-wrap          { overflow-x: visible; }
  .table-wrap table    { display: block; width: 100%; }
  .table-wrap thead    { display: none; }
  .table-wrap tbody    { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); }

  .table-wrap tbody tr {
    display: block;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xs);
    padding: var(--space-4);
    box-shadow: var(--shadow-card-soft);
    cursor: pointer;
  }

  .table-wrap tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--fs-body-sm);
    min-height: 32px;
  }
  .table-wrap tbody td:last-child { border-bottom: none; }

  /* Field label (left) from data-label attribute */
  .table-wrap tbody td[data-label]::before {
    content: attr(data-label);
    font-size: var(--fs-caption);
    font-weight: var(--fw-semibold);
    color: var(--fg-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    min-width: 68px;
    margin-right: var(--space-3);
  }

  /* Cells explicitly hidden on mobile */
  .td-hide-mobile { display: none !important; }

  /* Expanded detail panel: full width single column */
  .detail-row td  { padding: 0; display: block; }
  .detail-panel   { grid-template-columns: 1fr !important; padding: var(--space-4); gap: var(--space-3); }

  /* Stats: single column */
  .stats-grid     { grid-template-columns: 1fr; }
  .stat-card__value { font-size: 22px; }

  /* Page title */
  .page-title     { font-size: var(--fs-h6); }
  .tab-bar .tab   { font-size: var(--fs-caption); padding: 5px var(--space-3); }
}

/* ─── Table action column ─────────────────────────────────────────────────────*/

.td-action-col {
  width: 40px;
  text-align: right;
  padding-right: var(--space-2) !important;
}

/* On mobile card layout the action cell sits at the bottom right */
@media (max-width: 640px) {
  .td-action-col {
    border-bottom: none !important;
    justify-content: flex-end;
  }
}

/* ─── Detail modal (requests / bookings) ─────────────────────────────────────*/

.detail-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end; /* bottom sheet on mobile */
  justify-content: center;
}

.detail-modal {
  background: var(--bg-surface);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-btn-dark);
}

/* Centered dialog on desktop */
@media (min-width: 641px) {
  .detail-modal-overlay { align-items: center; padding: var(--space-6); }
  .detail-modal { max-width: 520px; border-radius: var(--radius-sm); }
}

.detail-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 1;
}

.detail-modal__title {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-h);
  color: var(--fg-primary);
}

.detail-modal__sub {
  font-size: var(--fs-caption);
  color: var(--fg-secondary);
  margin-top: var(--space-1);
}

.detail-modal__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.detail-modal__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.detail-modal__row:last-child { border-bottom: none; }

.detail-modal__row .detail-field__label { flex-shrink: 0; }
.detail-modal__row .detail-field__value { text-align: right; word-break: break-word; }

.detail-modal__desc {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border-subtle);
}

.detail-modal__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  position: sticky;
  bottom: 0;
}

/* ─── Blog form ──────────────────────────────────────────────────────────────*/

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card-soft);
}

.input, .textarea {
  display: block;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  padding: 9px var(--space-3);
  color: var(--fg-primary);
  font-size: var(--fs-body-sm);
  font-family: var(--font-sans);
  font-weight: var(--fw-regular);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.input:focus, .textarea:focus {
  border-color: var(--color-accent-500);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.textarea { resize: vertical; min-height: 80px; line-height: var(--lh-normal); }

.btn--danger {
  background: rgba(220, 38, 38, 0.08);
  color: rgb(220, 38, 38);
  border: 1px solid rgba(220, 38, 38, 0.2);
}
.btn--danger:hover { background: rgba(220, 38, 38, 0.14); }

.blog-form-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-6);
  align-items: start;
}

.blog-section-label {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--fg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: var(--space-4);
}

.blog-field-label {
  display: block;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--fg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: var(--space-1);
}

.blog-field-hint {
  font-size: var(--fs-caption);
  color: var(--fg-secondary);
  margin-top: 4px;
}

.blog-field-error {
  font-size: var(--fs-caption);
  color: rgb(220, 38, 38);
  margin-top: 4px;
}

.blog-input--error {
  border-color: rgba(220, 38, 38, 0.5);
}

.blog-not-translated {
  font-size: 10px;
  font-weight: var(--fw-regular);
  color: #f97316;
  background: rgba(249, 115, 22, 0.1);
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0;
  text-transform: none;
}

@media (max-width: 768px) {
  .blog-form-grid { grid-template-columns: 1fr; }
}

/* ─── Rich toolbar ───────────────────────────────────────────────────────────*/

.rich-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  padding: 6px var(--space-3);
  background: var(--color-neutral-50);
  border: 1px solid var(--border-default);
  border-bottom: none;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
}

.rich-toolbar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 6px;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--fg-secondary);
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}
.rich-toolbar__btn:hover { background: var(--bg-surface); color: var(--fg-primary); }

.rich-toolbar__sep {
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
  margin: 0 4px;
  flex-shrink: 0;
}

/* ─── Blog preview pane ──────────────────────────────────────────────────────*/

.blog-preview-pane {
  padding: var(--space-5);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  min-height: 300px;
  background: var(--bg-surface);
  font-size: var(--fs-body-sm);
  line-height: 1.7;
  color: var(--fg-primary);
}
.blog-preview-pane h1, .blog-preview-pane h2, .blog-preview-pane h3 {
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-h);
  margin: 1.2em 0 0.5em;
  color: var(--fg-primary);
}
.blog-preview-pane h1 { font-size: var(--fs-h4); }
.blog-preview-pane h2 { font-size: var(--fs-h5); }
.blog-preview-pane h3 { font-size: var(--fs-h6); }
.blog-preview-pane p  { margin: 0.75em 0; }
.blog-preview-pane ul, .blog-preview-pane ol { padding-left: 1.5em; margin: 0.75em 0; }
.blog-preview-pane li { margin: 0.3em 0; }
.blog-preview-pane strong { font-weight: var(--fw-semibold); }
.blog-preview-pane em     { font-style: italic; }
.blog-preview-pane a      { color: var(--color-accent-500); text-decoration: underline; }
.blog-preview-pane img    { max-width: 100%; border-radius: var(--radius-xs); display: block; margin: 1em 0; }
.blog-preview-pane blockquote {
  border-left: 3px solid var(--color-accent-500);
  padding-left: var(--space-4);
  margin: 1em 0;
  color: var(--fg-secondary);
  font-style: italic;
}
.blog-preview-pane pre {
  background: var(--color-neutral-50);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: var(--space-4);
  overflow-x: auto;
  margin: 0.75em 0;
}
.blog-preview-pane code { font-family: var(--font-mono); font-size: 13px; }

/* ─── Tag input ──────────────────────────────────────────────────────────────*/

.tag-input { width: 100%; }

.tag-input__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  min-height: 38px;
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tag-input__pills:focus-within {
  border-color: var(--color-accent-500);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 10px;
  background: var(--color-neutral-100);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: var(--fs-caption);
  color: var(--fg-primary);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}

.tag-pill__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  background: none;
  color: var(--fg-tertiary);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: background 0.1s, color 0.1s;
}
.tag-pill__remove:hover { background: rgba(220,38,38,0.1); color: rgb(220,38,38); }

.tag-input__field {
  border: none;
  outline: none;
  background: none;
  font-size: var(--fs-body-sm);
  font-family: var(--font-sans);
  color: var(--fg-primary);
  min-width: 100px;
  flex: 1;
  padding: 2px 0;
}
.tag-input__field::placeholder { color: var(--fg-tertiary); }

/* ─── Blog contentEditable editor ───────────────────────────────────────────*/

.blog-editor {
  min-height: 300px;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border-default);
  border-top: none;
  border-radius: 0 0 var(--radius-xs) var(--radius-xs);
  outline: none;
  font-size: var(--fs-body-sm);
  font-family: var(--font-sans);
  line-height: 1.7;
  color: var(--fg-primary);
  background: var(--bg-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  overflow-wrap: break-word;
}
.blog-editor:focus {
  border-color: var(--color-accent-500);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

/* Placeholder via data attribute */
.blog-editor--empty::before {
  content: attr(data-placeholder);
  color: var(--fg-tertiary);
  pointer-events: none;
  position: absolute;
  left: var(--space-5);
  top: var(--space-4);
}

/* Editor typography */
.blog-editor h1 { font-size: 26px; font-weight: var(--fw-bold); margin: 1em 0 0.4em; letter-spacing: var(--tracking-h); }
.blog-editor h2 { font-size: 20px; font-weight: var(--fw-bold); margin: 1em 0 0.4em; letter-spacing: var(--tracking-h); }
.blog-editor h3 { font-size: 16px; font-weight: var(--fw-bold); margin: 1em 0 0.4em; letter-spacing: var(--tracking-h); }
.blog-editor p  { margin: 0.6em 0; }
.blog-editor ul, .blog-editor ol { padding-left: 1.5em; margin: 0.6em 0; }
.blog-editor li { margin: 0.25em 0; }
.blog-editor strong { font-weight: var(--fw-semibold); }
.blog-editor em     { font-style: italic; }
.blog-editor a      { color: var(--color-accent-500); text-decoration: underline; }
.blog-editor blockquote {
  border-left: 3px solid var(--color-accent-500);
  padding-left: var(--space-4);
  margin: 0.8em 0;
  color: var(--fg-secondary);
  font-style: italic;
}
.blog-editor pre {
  background: var(--color-neutral-50);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: var(--space-3) var(--space-4);
  overflow-x: auto;
  margin: 0.6em 0;
}
.blog-editor code  { font-family: var(--font-mono); font-size: 13px; }
.blog-editor .editor-img, .blog-editor img { max-width: 100%; border-radius: var(--radius-xs); display: block; margin: 0.8em 0; }

/* ─── Editor inline modals ───────────────────────────────────────────────────*/

.editor-modal {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: var(--space-4) var(--space-5);
  box-shadow: 0 8px 28px rgba(0,0,0,.16);
}

/* bold/italic buttons — distinct font treatment */
.rich-toolbar__btn--b { font-family: var(--font-sans); font-weight: 700; }
.rich-toolbar__btn--i { font-family: Georgia, serif; font-style: italic; }
