/* ========================================
   Admin Panel — Афоризмус
   Dark plum sidebar + warm ivory content
   ======================================== */

/*
   ШАБЛОН ФОРМЫ (модал)
   ─────────────────────────────────────────
   <form class="admin-form-grid">

     <!-- Одиночное поле -->
     <div class="admin-form-group">
       <label>Название *</label>
       <small>Подсказка (необязательно)</small>
       <input class="admin-input" />
     </div>

     <!-- Два поля в ряд -->
     <div class="admin-form-row">
       <div class="admin-form-group">...</div>
       <div class="admin-form-group">...</div>
     </div>

     <!-- Три поля в ряд -->
     <div class="admin-form-row admin-form-row--3">
       <div class="admin-form-group">...</div>
       ...
     </div>

     <!-- Секция (вложенная карточка) -->
     <div class="admin-card" style="padding:16px">
       <div class="admin-form-grid">...</div>
     </div>

     <!-- Кнопки -->
     <div class="admin-form-actions">
       <button class="btn btn--secondary">Отмена</button>
       <button class="btn btn--primary">Сохранить</button>
     </div>

   </form>
   ─────────────────────────────────────────
*/

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

:root {
  --plum: #5B2C5E;
  --plum-light: #7A4B7D;
  --plum-dark: #3E1A40;
  --amber: #D4943A;
  --amber-light: #E4AE5E;
  --sage: #5B8C7E;
  --ivory: #FAFAF5;
  --ivory-dark: #F0EDE4;
  --charcoal: #2D2D2D;
  --smoke: #888888;

  --bg: var(--ivory);
  --bg-card: #fff;
  --text: var(--charcoal);
  --border: #E3E3E3;
}

.dark {
  --bg: #1a1418;
  --bg-card: #2a2230;
  --text: #F0EDE4;
  --border: #3a3240;
  --ivory-dark: #231e26;
  --ivory: #1e1922;
  --smoke: #9a8fa0;
  --charcoal: #d4cdd8;
}

body.admin-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
}

.font-heading {
  font-family: 'Cormorant Garamond', Georgia, serif;
}

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

.admin-sidebar {
  width: 256px;
  min-height: 100vh;
  background: var(--ivory-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s ease, width .3s ease;
  border-right: 1px solid rgba(91,44,94,.08);
}

.dark .admin-sidebar {
  background: #231e26;
}

.admin-sidebar.collapsed {
  width: 0;
  overflow: hidden;
}

.admin-sidebar__header {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid rgba(91,44,94,.08);
}

.admin-sidebar__logo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--plum);
  text-decoration: none;
}

.dark .admin-sidebar__logo {
  color: #C4A0C7;
}

.admin-sidebar__section {
  padding: 16px 12px 8px;
}

.admin-sidebar__section-title {
  padding: 0 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--smoke);
}

.admin-sidebar__nav {
  flex: 1;
  padding: 0 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(91,44,94,.15) transparent;
}

.admin-sidebar__nav::-webkit-scrollbar { width: 4px; }
.admin-sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar__nav::-webkit-scrollbar-thumb { background: rgba(91,44,94,.15); border-radius: 4px; }

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--charcoal);
  text-decoration: none;
  font-size: 14px;
  border-radius: 8px;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}

.dark .admin-nav-item {
  color: #c8bfcc;
}

.admin-nav-item:hover {
  background: rgba(91,44,94,.05);
  color: var(--plum);
}

.dark .admin-nav-item:hover {
  background: rgba(196,160,199,.1);
  color: #C4A0C7;
}

.admin-nav-item.active {
  background: rgba(91,44,94,.08);
  color: var(--plum);
  font-weight: 600;
}

.dark .admin-nav-item.active {
  background: rgba(196,160,199,.15);
  color: #C4A0C7;
}

.admin-nav-item .ni {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.admin-sidebar__divider {
  height: 1px;
  background: rgba(91,44,94,.08);
  margin: 12px 12px;
}

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

.admin-main {
  flex: 1;
  margin-left: 256px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .3s ease;
}

.admin-main.expanded {
  margin-left: 0;
}

.admin-topbar {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--bg-card);
  border-bottom: 1px solid rgba(91,44,94,.08);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.admin-topbar__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.admin-burger {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  transition: background .15s;
}

.admin-burger:hover {
  background: rgba(91,44,94,.05);
}

.admin-topbar__spacer {
  flex: 1;
}

.admin-topbar__btn {
  padding: 8px;
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  transition: background .15s;
}

.admin-topbar__btn:hover {
  background: rgba(91,44,94,.05);
}

.admin-topbar__btn--danger:hover {
  background: rgba(220,38,38,.1);
  color: #DC2626;
}

.admin-content {
  flex: 1;
  padding: 24px;
  padding-bottom: 48px;
  max-width: 1400px;
  overflow-x: auto;
}

/* ── Stats cards ───────────────────────── */

/* Alias: admin-stats = inline flex row of stat cards */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
}

.stat-card--accent {
  background: linear-gradient(135deg, #FDF7F0, #FFF3E0);
  border-color: var(--amber);
}

.dark .stat-card--accent {
  background: linear-gradient(135deg, #3E1A40, #2a2230);
  border-color: var(--plum-light);
}

.stat-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: rgba(91,44,94,.1);
  color: var(--plum);
}

.stat-card__value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
}

.stat-card__label {
  font-size: 13px;
  color: var(--smoke);
  margin-top: 4px;
}

.stat-card__sub {
  font-size: 12px;
  color: var(--smoke);
  margin-top: 2px;
}

/* ── Cards & tables ────────────────────── */

/* Tab bar */
.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.admin-tab {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  color: var(--smoke);
  text-decoration: none;
  transition: color .15s, border-color .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.admin-tab:hover { color: var(--plum); }
.admin-tab--active {
  border-bottom-color: var(--plum);
  color: var(--plum);
}

/* Icon-only round button */
.admin-btn-icon {
  padding: 6px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--smoke);
  transition: background .15s;
  text-decoration: none;
}
.admin-btn-icon:hover { background: rgba(91,44,94,.06); color: var(--plum); }

.admin-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 16px;
}

.admin-card__title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.admin-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

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

.admin-flex--between {
  justify-content: space-between;
}

.admin-flex--wrap {
  flex-wrap: wrap;
}

.admin-gap-1 { gap: 4px; }
.admin-gap-2 { gap: 8px; }
.admin-gap-3 { gap: 12px; }
.admin-gap-4 { gap: 16px; }

.admin-flex-1 { flex: 1; }
.admin-flex-shrink-0 { flex-shrink: 0; }

.admin-mb-2 { margin-bottom: 8px; }
.admin-mb-4 { margin-bottom: 16px; }
.admin-mb-6 { margin-bottom: 24px; }

.admin-table-wrap { overflow-x: auto; }

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

.admin-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--smoke);
  border-bottom: 2px solid var(--border);
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: rgba(91,44,94,.03);
}

.dark .admin-table tbody tr:hover {
  background: rgba(196,160,199,.05);
}

.admin-table--compact td,
.admin-table--compact th {
  padding: 6px 10px;
  font-size: 13px;
}

.admin-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
}

.admin-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ivory-dark);
  color: var(--smoke);
  font-size: 12px;
}

.admin-link { color: var(--plum); font-weight: 500; text-decoration: none; }
.admin-link:hover { opacity: .8; }

a.stat-card, a.admin-card { text-decoration: none; color: inherit; }
a.stat-card:hover, a.admin-card:hover { box-shadow: 0 4px 12px rgba(91,44,94,.1); }

.admin-empty { text-align: center; color: var(--smoke); padding: 24px !important; }

.admin-text-muted { font-size: 13px; color: var(--smoke); }
.admin-text-sm { font-size: 12px; }
.admin-text-lg { font-size: 18px; }
.admin-text-xl { font-size: 24px; }
.admin-font-semibold { font-weight: 600; }
.admin-font-bold { font-weight: 700; }

/* ── Badges ────────────────────────────── */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.badge--draft    { background: #F0F0F0; color: #666; }
.badge--active   { background: #DBEAFE; color: #1E40AF; }
.badge--completed { background: #DCFCE7; color: #166534; }
.badge--pending  { background: #FEF3C7; color: #92400E; }
.badge--paused   { background: #FEF3C7; color: #92400E; }
.badge--archived { background: #F0F0F0; color: #888; }
.badge--cancelled { background: #F0F0F0; color: #888; }
.badge--urgent   { background: #FEF2F2; color: #DC2626; }
.badge--new      { background: #EDE9FE; color: #7C3AED; }
.badge--idea     { background: #E0E7FF; color: #3730A3; }
.badge--design   { background: #FFF3D0; color: #92400E; }
.badge--production { background: #DBEAFE; color: #1E40AF; }
.badge--done     { background: #DCFCE7; color: #166534; }

/* ── Files Section ─────────────────────── */

.files-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--smoke);
  text-transform: uppercase;
  letter-spacing: .05em;
  cursor: pointer;
  padding: 6px 0;
  list-style: none;
  user-select: none;
}
.files-summary::-webkit-details-marker { display: none; }
.files-summary::before {
  content: '▸';
  font-size: 10px;
  color: var(--smoke);
  transition: transform .15s;
  flex-shrink: 0;
}
details[open] > .files-summary::before { transform: rotate(90deg); }

.files-count {
  font-weight: 400;
  opacity: .7;
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.files-img-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--ivory);
  aspect-ratio: 3/4;
}
.files-img-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .15s;
}
.files-img-card:hover img { opacity: .85; }

.files-img-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #10b981;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.files-img-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px;
  background: linear-gradient(transparent, rgba(0,0,0,.5));
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity .15s;
}
.files-img-card:hover .files-img-actions { opacity: 1; }

.files-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255,255,255,.9);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  transition: background .1s;
}
.files-action-btn:hover { background: white; }
.files-action-btn--danger:hover { background: #fee2e2; color: #dc2626; }

.files-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--ivory);
  font-size: 13px;
}
.files-row .files-action-btn {
  background: transparent;
  color: var(--smoke);
  width: 22px;
  height: 22px;
}
.files-row .files-action-btn:hover { background: var(--border); }

.dark .badge--draft      { background: #2a2535; color: #aaa; }
.dark .badge--active     { background: #1E3A5F; color: #93C5FD; }
.dark .badge--completed  { background: #14532D; color: #86EFAC; }
.dark .badge--pending    { background: #422006; color: #FCD34D; }
.dark .badge--paused     { background: #422006; color: #FCD34D; }
.dark .badge--archived   { background: #2a2535; color: #888; }
.dark .badge--cancelled  { background: #2a2535; color: #888; }
.dark .badge--urgent     { background: #450A0A; color: #FCA5A5; }
.dark .badge--new        { background: #2E1065; color: #C4B5FD; }
.dark .badge--idea       { background: #1E1B4B; color: #A5B4FC; }
.dark .badge--design     { background: #422006; color: #FCD34D; }
.dark .badge--production { background: #1E3A5F; color: #93C5FD; }
.dark .badge--done       { background: #14532D; color: #86EFAC; }

/* ── Toolbar & filters ─────────────────── */

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-input, .admin-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--ivory-dark);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: rgba(250,250,245,.5);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.dark .admin-input, .dark .admin-select {
  background: #1a1418;
  border-color: #3a3240;
  color: #F0EDE4;
}

.admin-input:focus, .admin-select:focus {
  border-color: var(--plum);
  box-shadow: none;
}

.admin-input--lg {
  padding: 14px 18px;
  font-size: 16px;
}

textarea.admin-input { resize: vertical; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, transform .1s;
}

.btn:active { transform: scale(.97); }

.btn--primary {
  background: var(--plum);
  color: #fff;
}
.btn--primary:hover { background: var(--plum-light); }

.btn--secondary {
  background: transparent;
  border: 1px solid rgba(91,44,94,.2);
  color: var(--plum);
}
.btn--secondary:hover { background: rgba(91,44,94,.05); }
.dark .btn--secondary { border-color: rgba(196,160,199,.3); color: #C4A0C7; }
.dark .btn--secondary:hover { background: rgba(196,160,199,.1); }

.btn--success   { background: #DCFCE7; color: #166534; }
.btn--success:hover { background: #BBF7D0; }
.btn--warn      { background: #FEF3C7; color: #92400E; }
.btn--warn:hover { background: #FDE68A; }
.btn--danger    { background: #FEF2F2; color: #DC2626; }
.btn--danger:hover { background: #FEE2E2; }
.btn--amber     { background: var(--amber); color: #fff; }
.btn--amber:hover { background: var(--amber-light); }
.btn--sage      { background: var(--sage); color: #fff; }
.btn--sage:hover { background: #6FA091; }

.btn--sm { padding: 8px 16px; font-size: 13px; }
.btn--xs { padding: 4px 8px; font-size: 12px; border-radius: 6px; }
.btn--icon { padding: 8px; }
.btn--full { width: 100%; }

.btn--ghost {
  background: transparent;
  color: var(--text);
}
.btn--ghost:hover {
  background: rgba(91,44,94,.05);
}

/* ── Forms ─────────────────────────────── */

.admin-form-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-form-group { display: flex; flex-direction: column; gap: 6px; }
.admin-form-group label { font-size: 14px; font-weight: 500; color: var(--text); }
.admin-form-group small { font-size: 12px; color: var(--smoke); }
.admin-form-group--wide { grid-column: 1 / -1; }

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

.admin-form-row--3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
}

.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
}

.admin-checkbox--active {
  border-color: var(--plum) !important;
  background: rgba(91,44,94,.06);
  color: var(--plum);
}

.dark .admin-checkbox--active {
  border-color: #9B6B9E !important;
  background: rgba(155,107,158,.12);
  color: #C4A0C7;
}

.admin-checkbox input { width: 18px; height: 18px; accent-color: var(--plum); }

.admin-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.admin-preview {
  max-width: 200px;
  max-height: 120px;
  border-radius: 8px;
  object-fit: cover;
}

.admin-inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── Alerts ────────────────────────────── */

.admin-alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.admin-alert--info {
  background: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.admin-alert--success {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #86EFAC;
}

.admin-alert--warning {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.admin-alert--error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

/* ── Modal ─────────────────────────────── */

.admin-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.admin-modal.open {
  display: flex;
}

.admin-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
}

.admin-modal__content {
  position: relative;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
  max-width: 32rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(91,44,94,.25) transparent;
}

.admin-modal__content::-webkit-scrollbar { width: 5px; }
.admin-modal__content::-webkit-scrollbar-track { background: transparent; }
.admin-modal__content::-webkit-scrollbar-thumb { background: rgba(91,44,94,.3); border-radius: 4px; }
.admin-modal__content::-webkit-scrollbar-thumb:hover { background: var(--plum-light); }

.admin-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.admin-modal__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
}

.admin-modal__close {
  padding: 4px;
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--smoke);
  transition: background .15s;
}

.admin-modal__close:hover {
  background: rgba(91,44,94,.05);
}

.admin-modal__body {
  padding: 24px;
}

/* ── Toast notifications ───────────────── */

.admin-toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-toast {
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,.2);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  animation: toast-in .3s ease;
}

.admin-toast--success { background: var(--sage); }
.admin-toast--error { background: #DC2626; }
.admin-toast--warning { background: var(--amber); }

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

/* ── Chat button ───────────────────────── */

.admin-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
}

.admin-chat-btn a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--plum);
  color: #fff;
  font-weight: 500;
  border-radius: 9999px;
  box-shadow: 0 10px 25px -5px rgba(91,44,94,.4);
  text-decoration: none;
  transition: background .15s, box-shadow .15s;
}

.admin-chat-btn a:hover {
  background: var(--plum-light);
  box-shadow: 0 15px 30px -5px rgba(91,44,94,.5);
}

.admin-chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #DC2626;
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

/* ── Kanban ────────────────────────────── */

.kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

.kanban-column {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  min-height: 200px;
}

.kanban-column__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.kanban-column__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.kanban-column__count {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--ivory-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.dark .kanban-column__count {
  background: #3a3240;
}

.kanban-column__body {
  padding: 12px;
  min-height: 100px;
}

.kanban-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: box-shadow .15s, transform .15s;
}

.kanban-card:hover {
  box-shadow: 0 4px 12px rgba(91,44,94,.1);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.kanban-card__title {
  font-weight: 600;
  margin-bottom: 8px;
}

.kanban-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--smoke);
}

.kanban-card__deadline {
  color: var(--amber);
}

.kanban-card__deadline--overdue {
  color: #DC2626;
}

.kanban-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--smoke);
  transition: background .15s, color .15s;
}

.kanban-card__btn:hover {
  background: rgba(91,44,94,.1);
  color: var(--plum);
}

.kanban-card__btn .ni {
  width: 14px;
  height: 14px;
}

/* ── Pagination ────────────────────────── */

.admin-pagination {
  display: flex;
  gap: 4px;
  margin-top: 16px;
  justify-content: center;
}

.admin-pagination__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: background .15s;
}

.admin-pagination__btn:hover { background: rgba(91,44,94,.05); }
.admin-pagination__btn.active { background: var(--plum); color: #fff; border-color: var(--plum); }

/* ── Overlay for mobile ────────────────── */

.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}

.admin-overlay.open { display: block; }

/* ── Selection ─────────────────────────── */

::selection {
  background: rgba(91,44,94,.15);
  color: var(--charcoal);
}

/* ── Scrollbar ─────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--plum-light); }

/* ── Checkbox ──────────────────────────── */

input[type="checkbox"] {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #d1d5db;
  border-radius: 0.375rem;
  background: white;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

input[type="checkbox"]:checked {
  background: var(--plum);
  border-color: var(--plum);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
  background-size: 100%;
  background-position: center;
}

input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(91,44,94,.2);
}

.dark input[type="checkbox"] {
  background: var(--bg-card);
  border-color: #555;
}

.dark input[type="checkbox"]:checked {
  background: #9B6B9E;
  border-color: #9B6B9E;
}

/* ── Progress ──────────────────────────── */

.progress-track {
  background: var(--ivory-dark);
  border-radius: 9999px;
  height: 6px;
  overflow: hidden;
}

.progress-fill {
  background: var(--plum);
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.dark .progress-track {
  background: #3a3240;
}

.dark .progress-fill {
  background: #9B6B9E;
}

/* ── Checklist ─────────────────────────── */

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  transition: background .15s;
}

.checklist-item:hover {
  background: rgba(91,44,94,.03);
}

.checklist-item.completed {
  opacity: 0.6;
}

.checklist-item.completed .checklist-item__text {
  text-decoration: line-through;
}

/* ── Loading spinner ───────────────────── */

.admin-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--plum);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

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

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

@media (max-width: 1024px) {
  .admin-sidebar {
    transform: translateX(-100%);
    position: fixed;
  }
  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,.3);
  }
  .admin-main { margin-left: 0; }
  .admin-burger { display: block; }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .admin-grid-3 { grid-template-columns: 1fr 1fr; }
  .admin-grid-4 { grid-template-columns: 1fr 1fr; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 16px; }
  .admin-topbar { padding: 0 16px; }
}

@media (max-width: 640px) {
  .admin-stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-grid-3 { grid-template-columns: 1fr; }
  .admin-grid-4 { grid-template-columns: 1fr 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
  .admin-table { font-size: 12px; }
  .admin-table td, .admin-table th { padding: 6px 8px; }
}

/* ── Drag-and-drop ─────────────────────── */

[draggable="true"] { cursor: grab; }
[draggable="true"]:active { cursor: grabbing; }
.dragging { opacity: 0.4; }

.drag-handle { user-select: none; color: var(--smoke); cursor: grab; }
.drag-handle:hover { color: var(--plum); }

/* ── Hide/show helpers ─────────────────── */

.hidden { display: none !important; }
[data-cloak] { display: none !important; }

/* ── Tailwind-like utilities (for Marketing forms) ─────────────────── */

.space-y-4 > * + * { margin-top: 16px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-2 > * + * { margin-top: 8px; }

.gap-3 { gap: 12px; }
.gap-2 { gap: 8px; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.col-span-2 { grid-column: span 2; }

.w-full { width: 100%; }
.block { display: block; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.font-medium { font-weight: 500; }
.mb-1, .mb-1\.5 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.pt-2 { padding-top: 8px; }

.px-4 { padding-left: 16px; padding-right: 16px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.px-5 { padding-left: 20px; padding-right: 20px; }
.py-2, .py-2\.5 { padding-top: 10px; padding-bottom: 10px; }
.p-3 { padding: 12px; }

.rounded-xl { border-radius: 12px; }

.border-2 { border-width: 2px; }
.border { border-width: 1px; }
.border-ivory-dark { border-color: var(--ivory-dark); }
.border-plum\/10, .border-plum\/20 { border-color: rgba(91,44,94,.15); }

.bg-ivory\/50 { background: rgba(250,250,245,.5); }
.bg-ivory-dark\/30 { background: rgba(240,237,228,.3); }
.bg-plum { background: var(--plum); }
.bg-plum\/5 { background: rgba(91,44,94,.05); }
.bg-white { background: var(--bg-card); }
.bg-ivory { background: var(--ivory); }
.bg-ivory-dark { background: var(--ivory-dark); }

.text-plum { color: var(--plum); }
.text-smoke { color: var(--smoke); }
.text-smoke\/60, .text-smoke\/70 { color: rgba(136,136,136,.7); }
.text-white { color: #fff; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }

.transition { transition: all .15s ease; }

.hover\:bg-plum-light:hover { background: var(--plum-light); }
.hover\:bg-plum\/5:hover { background: rgba(91,44,94,.05); }

.focus\:border-plum:focus { border-color: var(--plum); }
.focus\:outline-none:focus { outline: none; }

.dark .bg-ivory\/50, .dark .dark\:bg-\[#1a1418\] { background: #1a1418; }
.dark .dark\:border-\[#3a3240\] { border-color: #3a3240; }
.dark .dark\:text-\[\#F0EDE4\] { color: #F0EDE4; }
.dark .dark\:bg-\[#2a2230\] { background: #2a2230; }
.dark .bg-white { background: var(--bg-card); }
.dark .bg-ivory { background: var(--bg); }
.dark .bg-ivory-dark { background: #231e26; }
.dark .bg-ivory-dark\/30 { background: rgba(35,30,38,.3); }
.dark .bg-ivory-dark\/50 { background: rgba(35,30,38,.5); }

.font-mono { font-family: monospace; }

/* ── More Tailwind-like utilities for Marketplace pages ─────────────────── */

.flex-1 { flex: 1; }
.ml-4 { margin-left: 16px; }
.ml-3 { margin-left: 12px; }
.gap-1 { gap: 4px; }
.mb-6 { margin-bottom: 24px; }

.rounded-full { border-radius: 9999px; }

.px-2\.5 { padding-left: 10px; padding-right: 10px; }
.py-0\.5 { padding-top: 2px; padding-bottom: 2px; }

.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,.05); }

.bg-gray-100 { background: #f3f4f6; }
.bg-amber-100 { background: #fef3c7; }
.bg-emerald-100 { background: #d1fae5; }
.bg-emerald-600 { background: #059669; }

.text-gray-700 { color: #374151; }
.text-amber-700 { color: #b45309; }
.text-emerald-700 { color: #047857; }
.text-emerald-300 { color: #6ee7b7; }
.text-emerald-500 { color: #10b981; }
.text-blue-600 { color: #2563eb; }
.text-blue-400 { color: #60a5fa; }

.border-blue-300 { border-color: #93c5fd; }

.hover\:bg-blue-50:hover { background: #eff6ff; }
.hover\:bg-emerald-500:hover { background: #10b981; }

.dark .dark\:bg-gray-700 { background: #374151; }
.dark .dark\:text-gray-300 { color: #d1d5db; }
.dark .dark\:bg-amber-900\/30 { background: rgba(120,53,15,.3); }
.dark .dark\:text-amber-300 { color: #fcd34d; }
.dark .dark\:bg-emerald-900\/30 { background: rgba(6,78,59,.3); }
.dark .dark\:text-emerald-300 { color: #6ee7b7; }
.dark .dark\:border-blue-700 { border-color: #1d4ed8; }
.dark .dark\:hover\:bg-blue-900\/20:hover { background: rgba(30,58,138,.2); }

.animate-spin { animation: spin 1s linear infinite; }

.inline { display: inline; }

.-mt-0\.5 { margin-top: -2px; }

.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

.text-left { text-align: left; }
.text-right { text-align: right; }
.text-center { text-align: center; }

.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: .05em; }

.border-t { border-top-width: 1px; border-top-style: solid; }
.border-plum\/5 { border-color: rgba(91,44,94,.05); }

.py-3 { padding-top: 12px; padding-bottom: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-2 { padding-left: 8px; padding-right: 8px; }

.hover\:bg-ivory-dark\/30:hover { background: rgba(240,237,228,.3); }
.dark .dark\:hover\:bg-\[#1a1418\]\/30:hover { background: rgba(26,20,24,.3); }
