/* ── CSS Variables ───────────────────────────────────────────────────────────── */
:root {
  --primary:        #eab308;
  --primary-dark:   #ca8a04;
  --primary-light:  #fef9c3;
  --dark:           #1a1f2c;
  --sidebar-bg:     #1a1f2c;
  --sidebar-text:   #cbd5e1;
  --sidebar-active: #eab308;
  --sidebar-hover:  #252d3d;
  --sidebar-w:      240px;
  --topbar-h:       56px;

  --white:          #ffffff;
  --gray-50:        #f8fafc;
  --gray-100:       #f1f5f9;
  --gray-200:       #e2e8f0;
  --gray-300:       #cbd5e1;
  --gray-400:       #94a3b8;
  --gray-500:       #64748b;
  --gray-600:       #475569;
  --gray-700:       #334155;
  --gray-800:       #1e293b;
  --gray-900:       #0f172a;

  --success:        #22c55e;
  --success-bg:     #dcfce7;
  --danger:         #ef4444;
  --danger-bg:      #fee2e2;
  --warning:        #f59e0b;
  --warning-bg:     #fef3c7;
  --info:           #3b82f6;
  --info-bg:        #dbeafe;

  --border:         #e2e8f0;
  --radius:         8px;
  --radius-sm:      4px;
  --shadow:         0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --shadow-md:      0 4px 6px rgba(0,0,0,.1), 0 2px 4px rgba(0,0,0,.06);

  --font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition:     0.18s ease;
}

/* ── Reset & Base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.85em;
  background: var(--gray-100);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--gray-700);
}

/* ── Admin layout ────────────────────────────────────────────────────────────── */
.admin-body {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--transition);
}

.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: var(--topbar-h);
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar__logo-icon { font-size: 1.4rem; }

.sidebar__logo-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .02em;
}

.sidebar__close {
  display: none;
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1.25rem;
  color: var(--sidebar-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  position: relative;
}

.sidebar__link:hover {
  background: var(--sidebar-hover);
  color: var(--white);
  text-decoration: none;
}

.sidebar__link--active {
  background: rgba(234,179,8,.15);
  color: var(--primary);
  border-right: 3px solid var(--primary);
}

.sidebar__icon { font-size: 1rem; flex-shrink: 0; }

.sidebar__footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sidebar__logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--sidebar-text);
  font-size: 0.875rem;
  text-decoration: none;
  padding: 0.4rem 0.25rem;
  transition: color var(--transition);
}

.sidebar__logout:hover { color: var(--danger); text-decoration: none; }

/* ── Overlay ─────────────────────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 190;
}

/* ── Main content wrapper ────────────────────────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ──────────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.topbar__burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.topbar__burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: var(--transition);
}

.topbar__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  flex: 1;
}

.topbar__right { display: flex; align-items: center; gap: 0.75rem; }

.topbar__site-link {
  font-size: 0.8rem;
  color: var(--gray-500);
  text-decoration: none;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.topbar__site-link:hover {
  background: var(--gray-100);
  text-decoration: none;
  color: var(--gray-700);
}

/* ── Content area ────────────────────────────────────────────────────────────── */
.content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
}

/* ── Alerts / Flash ──────────────────────────────────────────────────────────── */
.flash-messages { margin-bottom: 1rem; }

.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.alert--success { background: var(--success-bg); color: #166534; border: 1px solid #bbf7d0; }
.alert--danger  { background: var(--danger-bg);  color: #991b1b; border: 1px solid #fecaca; }
.alert--warning { background: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; }
.alert--info    { background: var(--info-bg);    color: #1e40af; border: 1px solid #bfdbfe; }

.alert__close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: .6;
  flex-shrink: 0;
  margin-left: 0.5rem;
}
.alert__close:hover { opacity: 1; }

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.card__title {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
}

.card__body { padding: 1.25rem; }
.card__body--table { padding: 0; overflow-x: auto; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background var(--transition), box-shadow var(--transition), opacity var(--transition);
  line-height: 1.4;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn--primary   { background: var(--primary); color: var(--gray-900); border-color: var(--primary-dark); }
.btn--primary:hover { background: var(--primary-dark); }

.btn--secondary { background: var(--gray-600); color: var(--white); }
.btn--secondary:hover { background: var(--gray-700); }

.btn--danger    { background: var(--danger); color: var(--white); }
.btn--danger:hover { background: #dc2626; }

.btn--warning   { background: var(--warning); color: var(--white); }
.btn--warning:hover { background: #d97706; }

.btn--outline {
  background: transparent;
  color: var(--gray-600);
  border-color: var(--border);
}
.btn--outline:hover { background: var(--gray-100); color: var(--gray-800); }

.btn--sm { padding: 0.3rem 0.65rem; font-size: 0.78rem; }
.btn--lg { padding: 0.6rem 1.4rem; font-size: 0.9rem; }
.btn--full { width: 100%; justify-content: center; }

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.5;
}

.badge--success   { background: var(--success-bg); color: #166534; }
.badge--danger    { background: var(--danger-bg);  color: #991b1b; }
.badge--warning   { background: var(--warning-bg); color: #92400e; }
.badge--secondary { background: var(--gray-200);   color: var(--gray-600); }
.badge--info      { background: var(--info-bg);    color: #1e40af; }

/* Lead status badges */
.badge-new    { background: #fee2e2; color: #991b1b; }
.badge-work   { background: #fef3c7; color: #92400e; }
.badge-done   { background: #dcfce7; color: #166534; }
.badge-closed { background: var(--gray-200); color: var(--gray-600); }

/* Clickable avail badge */
.badge-avail {
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  user-select: none;
}
.badge-avail:hover { opacity: .8; transform: scale(1.03); }

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table th {
  text-align: left;
  padding: 0.625rem 1rem;
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr:last-child td { border-bottom: none; }

.table--compact th,
.table--compact td { padding: 0.4rem 0.75rem; }

.row--inactive { opacity: .5; }

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.table-actions--lead .inline-form { display: inline; }

/* ── Product table specifics ─────────────────────────────────────────────────── */
.col-photo { width: 60px; }

.product-thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
}

.product-thumb-placeholder {
  width: 50px;
  height: 50px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--gray-400);
  border: 1px solid var(--border);
}

.product-name-cell { display: flex; flex-direction: column; gap: 3px; }

.product-name-link {
  font-weight: 500;
  color: var(--gray-800);
  text-decoration: none;
}
.product-name-link:hover { color: var(--primary-dark); text-decoration: underline; }

.product-flags { display: flex; gap: 4px; flex-wrap: wrap; }

.flag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
}
.flag--star     { background: var(--primary-light); color: var(--primary-dark); }
.flag--promo    { background: #fee2e2; color: #991b1b; }
.flag--inactive { background: var(--gray-200); color: var(--gray-500); }

.price-val { font-weight: 600; color: var(--gray-800); }
.price-old { font-size: 0.75rem; color: var(--gray-400); text-decoration: line-through; margin-top: 1px; }

/* ── Stats grid ──────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.stat-card--green { border-left: 3px solid var(--success); }
.stat-card--yellow { border-left: 3px solid var(--primary); }

.stat-card__icon { font-size: 2rem; flex-shrink: 0; }

.stat-card__value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.1;
}

.stat-card__label {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-top: 2px;
}

/* ── Quick actions ───────────────────────────────────────────────────────────── */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ── Dashboard rebuild summary ───────────────────────────────────────────────── */
.rebuild-summary { display: flex; flex-direction: column; gap: 0.5rem; }
.rebuild-summary__row { display: flex; align-items: center; gap: 0.5rem; }
.rebuild-summary__label { color: var(--gray-500); min-width: 100px; font-size: 0.85rem; }

/* ── Page toolbar ────────────────────────────────────────────────────────────── */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* ── Filter card ─────────────────────────────────────────────────────────────── */
.filter-card .card__body { padding: 0.875rem 1.25rem; }

.filter-form__fields {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-group { display: flex; flex-direction: column; gap: 3px; }
.filter-group--search { flex: 1; min-width: 200px; }

.search-input-wrap { display: flex; gap: 0.4rem; }

.filter-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--danger);
  text-decoration: none;
}
.filter-reset:hover { text-decoration: underline; }

/* ── Forms ───────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 4px;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.45rem 0.7rem;
  font-size: 0.875rem;
  font-family: var(--font);
  color: var(--gray-800);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.5;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(234,179,8,.2);
}

.form-control--sm { font-size: 0.8rem; padding: 0.3rem 0.6rem; }
.form-control--mono { font-family: 'Fira Code', 'Consolas', monospace; font-size: 0.82rem; }

textarea.form-control { resize: vertical; min-height: 80px; }

.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 3px;
}

.required { color: var(--danger); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-check-wrap { padding-top: 0.3rem; }

.form-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
  color: var(--gray-700);
}

.form-check input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); }

.form-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

.form-submit-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ── Two column form layout ──────────────────────────────────────────────────── */
.form-grid { display: grid; gap: 1.5rem; }
.form-grid--2 { grid-template-columns: 1fr 1fr; }

@media (max-width: 900px) {
  .form-grid--2 { grid-template-columns: 1fr; }
}

/* ── Photo dropzone ──────────────────────────────────────────────────────────── */
.photo-preview-wrap {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

.photo-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: contain;
  display: block;
}

.photo-preview-placeholder {
  width: 100%;
  height: 120px;
  background: var(--gray-100);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 0.875rem;
}

.dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: var(--gray-50);
}

.dropzone:hover, .dropzone--active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.dropzone__icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.dropzone__text { font-size: 0.85rem; color: var(--gray-600); margin-bottom: 0.25rem; }
.dropzone__hint { font-size: 0.75rem; color: var(--gray-400); }

.upload-progress {
  margin-top: 0.75rem;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 6px;
  position: relative;
}

.upload-progress__bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.2s linear;
  width: 0%;
}

/* ── Pagination ──────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 1rem;
  flex-wrap: wrap;
}

.pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--gray-600);
  background: var(--white);
  text-decoration: none;
  transition: var(--transition);
}

.pagination__btn:hover { background: var(--gray-100); text-decoration: none; color: var(--gray-800); }
.pagination__btn--active { background: var(--primary); border-color: var(--primary-dark); color: var(--gray-900); font-weight: 600; }
.pagination__ellipsis { padding: 0 4px; color: var(--gray-400); font-size: 0.85rem; }

/* ── Empty state ─────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}

.empty-state__icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { margin-bottom: 1rem; font-size: 0.9rem; }

/* ── Slug badge ──────────────────────────────────────────────────────────────── */
.slug-badge {
  display: inline-block;
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  font-size: 0.8rem;
  color: var(--gray-600);
  font-family: monospace;
}

/* ── Status tabs (leads) ─────────────────────────────────────────────────────── */
.status-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
}

.status-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--gray-600);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: var(--transition);
}

.status-tab:hover { color: var(--gray-900); text-decoration: none; }
.status-tab--active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }

/* ── Lead table ──────────────────────────────────────────────────────────────── */
.lead-row { cursor: pointer; }
.lead-row--new { background: #fffbeb; }
.lead-row--new:hover { background: #fef9c3; }

.lead-detail { background: var(--gray-50); }
.lead-detail__body { padding: 1rem 1.25rem; }
.lead-detail__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.5rem;
  font-size: 0.85rem;
}
.lead-detail__full { grid-column: 1 / -1; }

.phone-link { color: var(--gray-800); font-weight: 600; text-decoration: none; }
.phone-link:hover { color: var(--primary-dark); text-decoration: underline; }

.lead-product { font-style: italic; color: var(--gray-600); }
.lead-comment { color: var(--gray-600); }
.page-link { font-size: 0.78rem; color: var(--gray-400); }
.page-link:hover { color: var(--info); }

.status-select { min-width: 120px; }

/* ── Rebuild page ────────────────────────────────────────────────────────────── */
.rebuild-wrap { max-width: 800px; }

.rebuild-trigger-card { text-align: center; }

.rebuild-icon { font-size: 3rem; margin-bottom: 1rem; }

.rebuild-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
}

.rebuild-desc {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.rebuild-btn {
  padding: 0.75rem 2.5rem;
  font-size: 1rem;
}

.rebuild-running-msg {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--warning);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  background: var(--warning-bg);
  border-radius: var(--radius);
}

.rebuild-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: var(--gray-600);
}

.rebuild-log-wrap {
  background: var(--gray-900);
  border-radius: var(--radius);
  overflow: hidden;
}

.rebuild-log {
  padding: 1rem;
  font-size: 0.8rem;
  font-family: 'Fira Code', 'Consolas', monospace;
  color: #a8ff78;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.6;
}

/* ── Spinners ────────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(234,179,8,.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-inline {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(92,44,8,.3);
  border-top-color: var(--warning);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 2px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility ─────────────────────────────────────────────────────────────────── */
.text-muted   { color: var(--gray-400); }
.text-center  { text-align: center; }
.text-nowrap  { white-space: nowrap; }

/* ── Toast notifications ─────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: slideIn 0.25s ease forwards;
  max-width: 300px;
}

.toast--success { background: #166534; color: #dcfce7; }
.toast--danger  { background: #991b1b; color: #fee2e2; }
.toast--warning { background: #92400e; color: #fef3c7; }

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Login page ──────────────────────────────────────────────────────────────── */
.login-body {
  background: linear-gradient(135deg, var(--dark) 0%, #2d3748 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem 1rem;
}

.login-wrap {
  width: 100%;
  max-width: 380px;
}

.login-card {
  background: var(--white);
  border-radius: 12px;
  padding: 2.25rem 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-card__logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-card__logo-icon { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }

.login-card__title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

.login-card__subtitle {
  color: var(--gray-400);
  font-size: 0.85rem;
}

.login-form .form-group { margin-bottom: 1rem; }

.login-footer {
  text-align: center;
  margin-top: 1.25rem;
  color: rgba(255,255,255,.35);
  font-size: 0.78rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: var(--shadow-md);
  }

  .sidebar__close { display: block; }

  .sidebar-overlay.is-open { display: block; }

  .main-wrap { margin-left: 0; }

  .topbar__burger { display: flex; }

  .content { padding: 1rem; }

  .stats-grid { grid-template-columns: 1fr 1fr; }

  .form-row { grid-template-columns: 1fr; }

  .table-actions { flex-wrap: wrap; }

  .filter-form__fields { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .quick-actions { flex-direction: column; }
}
