/* ─────────────────────────────────────────────────────────────────
   IKAS ADMIN PANEL — Modern Design System
   ───────────────────────────────────────────────────────────────── */

:root {
  --brand-primary:   #6366f1;
  --brand-dark:      #4f46e5;
  --brand-light:     #eef2ff;
  --brand-gradient:  linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  --sidebar-width:   260px;
  --sidebar-bg:      #0f172a;
  --sidebar-border:  #1e293b;
  --sidebar-text:    #cbd5e1;
  --sidebar-active:  #6366f1;
  --sidebar-hover:   #1e293b;

  --topbar-height:   64px;
  --topbar-bg:       #ffffff;
  --topbar-border:   #e2e8f0;

  --content-bg:      #f8fafc;
  --surface:         #ffffff;
  --surface-2:       #f1f5f9;

  --text-primary:    #0f172a;
  --text-secondary:  #475569;
  --text-muted:      #94a3b8;

  --border:          #e2e8f0;
  --border-focus:    #6366f1;

  --success:         #10b981;
  --success-light:   #d1fae5;
  --warning:         #f59e0b;
  --warning-light:   #fef3c7;
  --danger:          #ef4444;
  --danger-light:    #fee2e2;
  --info:            #3b82f6;
  --info-light:      #dbeafe;

  --radius-sm:       6px;
  --radius:          10px;
  --radius-lg:       16px;
  --radius-xl:       24px;

  --shadow-sm:       0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:          0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg:       0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-xl:       0 20px 25px -5px rgba(0,0,0,.1),  0 10px 10px -5px rgba(0,0,0,.04);

  --transition:      all .2s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; height: 100%; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--content-bg);
  color: var(--text-primary);
  min-height: 100%;
  overflow-x: hidden;
}

body.sidebar-open {
  overflow: hidden;
}

/* ── Layout Shell ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.row > * {
  min-width: 0;
}

/* ──────────────────────────────
   SIDEBAR
   ────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1000;
  transition: var(--transition);
  overflow: hidden;
  transform: translateX(0);
}

body.sidebar-collapsed .sidebar {
  transform: translateX(calc(-1 * var(--sidebar-width)));
  box-shadow: none;
}

.sidebar-close-btn {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-close-btn:hover {
  background: #1e293b;
  color: #f8fafc;
}

.sidebar-close-btn svg {
  width: 18px;
  height: 18px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
  min-height: var(--topbar-height);
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--brand-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(99,102,241,.25);
}

.sidebar-brand-icon svg { color: #fff; }

.sidebar-brand-name {
  font-size: .95rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -.01em;
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: .7rem;
  color: var(--sidebar-text);
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

.nav-section-label {
  padding: 16px 20px 6px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #475569;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 0;
  font-size: .875rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .7;
  transition: var(--transition);
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}

.sidebar-link:hover svg { opacity: 1; }

.sidebar-link.active {
  background: rgba(99,102,241,.15);
  color: #a5b4fc;
  font-weight: 600;
}

.sidebar-link.active svg {
  opacity: 1;
  color: var(--brand-primary);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--brand-primary);
  border-radius: 0 2px 2px 0;
}

.sidebar-link .nav-badge {
  margin-left: auto;
  font-size: .65rem;
  padding: 2px 7px;
  border-radius: 99px;
  background: #1e293b;
  color: #64748b;
  font-weight: 600;
  letter-spacing: .02em;
}

.sidebar-link.disabled {
  opacity: .45;
  pointer-events: none;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-footer-text {
  font-size: .7rem;
  color: #475569;
  text-align: center;
}

.sidebar-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.18);
  border-radius: 8px;
  color: #f87171;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-logout-btn:hover {
  background: rgba(239,68,68,.16);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  border: none;
  padding: 0;
  background: rgba(15,23,42,.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: var(--transition);
  z-index: 999;
}

/* ──────────────────────────────
   MAIN CONTENT AREA
   ────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

body.sidebar-collapsed .main-content {
  margin-left: 0;
}

/* ── Top Bar ── */
.topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  flex: 1;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.topbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  font-size: .8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.topbar-status,
.topbar-user-pill {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-user-pill {
  padding: 4px 10px;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 20px;
  color: #a5b4fc;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user-pill svg {
  flex-shrink: 0;
}

.mobile-sidebar-toggle {
  display: inline-flex;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.mobile-sidebar-toggle:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.mobile-sidebar-toggle svg {
  width: 20px;
  height: 20px;
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.topbar-icon-btn:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.topbar-icon-btn svg { width: 18px; height: 18px; }

.topbar-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(16,185,129,.25);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0%,100% { box-shadow: 0 0 0 2px rgba(16,185,129,.25); }
  50%      { box-shadow: 0 0 0 4px rgba(16,185,129,.1); }
}

/* ── Page Container ── */
.page-container {
  flex: 1;
  padding: 28px;
  min-width: 0;
}

/* ── Page Header ── */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
  letter-spacing: -.02em;
}

.page-header p {
  font-size: .875rem;
  color: var(--text-secondary);
  margin: 0;
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ──────────────────────────────
   CARDS
   ────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-header-icon.indigo  { background: var(--brand-light);   color: var(--brand-primary); }
.card-header-icon.green   { background: var(--success-light);  color: var(--success); }
.card-header-icon.amber   { background: var(--warning-light);  color: var(--warning); }
.card-header-icon.red     { background: var(--danger-light);   color: var(--danger); }
.card-header-icon.blue    { background: var(--info-light);     color: var(--info); }

.card-header-icon svg { width: 16px; height: 16px; }

.card-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.card-body { padding: 20px; }

.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* ──────────────────────────────
   BUTTONS
   ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: .875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn svg { width:16px; height:16px; flex-shrink:0; }

.btn:focus { outline: 2px solid var(--brand-primary); outline-offset: 2px; box-shadow: none; }
.btn:active:focus { box-shadow: none; }
.btn-link.nav-link:focus { box-shadow: none; }
.form-control:focus { box-shadow: 0 0 0 3px rgba(99,102,241,.15); border-color: var(--border-focus); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(99,102,241,.15); }

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-success:hover { background: #059669; border-color: #059669; color: #fff; }

.btn-outline-primary {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  background: transparent;
}
.btn-outline-primary:hover { background: var(--brand-primary); color: #fff; }

.btn-outline-secondary {
  color: var(--text-secondary);
  border-color: var(--border);
  background: transparent;
}
.btn-outline-secondary:hover { background: var(--surface-2); color: var(--text-primary); border-color: var(--border); }

.btn-outline-success {
  color: var(--success);
  border-color: var(--success);
  background: transparent;
}
.btn-outline-success:hover { background: var(--success); color: #fff; }

.btn-sm  { padding: 6px 12px; font-size: .8rem; }
.btn-xs  { padding: 2px 8px;  font-size: .72rem; border-radius: var(--radius-sm); }

.btn-lg { padding: 12px 24px; font-size: .95rem; border-radius: var(--radius); }

.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: all; }

/* ──────────────────────────────
   FORM ELEMENTS
   ────────────────────────────── */
.form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: .01em;
}

.form-control, .form-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: .875rem;
  color: var(--text-primary);
  background: var(--surface);
  transition: var(--transition);
  width: 100%;
}

.form-control:hover, .form-select:hover { border-color: #cbd5e1; }
.form-control:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
  outline: none;
}

.form-text { font-size: .76rem; color: var(--text-muted); margin-top: 4px; }

.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .input-group-text {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-size: .875rem;
  padding: 9px 12px;
}

.form-check-input {
  border-color: #cbd5e1;
  border-radius: 4px;
}

.form-check-input:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

/* ──────────────────────────────
   BADGES
   ────────────────────────────── */
.badge {
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
  letter-spacing: .01em;
}

.bg-primary   { background-color: var(--brand-primary) !important; }
.bg-success   { background-color: var(--success) !important; }
.bg-warning   { background-color: var(--warning) !important; }
.bg-danger    { background-color: var(--danger)  !important; }
.bg-secondary { background-color: #94a3b8 !important; }

.badge.badge-soft-indigo    { background: var(--brand-light);    color: var(--brand-primary); }
.badge.badge-soft-green     { background: var(--success-light);  color: #059669; }
.badge.badge-soft-amber     { background: var(--warning-light);  color: #d97706; }
.badge.badge-soft-success   { background: var(--success-light);  color: #059669; }
.badge.badge-soft-danger    { background: #fee2e2;               color: #dc2626; }
.badge.badge-soft-secondary { background: #f1f5f9;               color: #64748b; }
.badge.badge-soft-red       { background: #fee2e2;               color: #dc2626; }
.badge.badge-soft-blue      { background: var(--info-light);     color: #1d4ed8; }

.btn-outline-indigo { color: var(--brand-primary); border-color: var(--brand-primary); background: transparent; }
.btn-outline-indigo:hover { background: var(--brand-primary); color: #fff; }

/* ──────────────────────────────
   DROP ZONE
   ────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  transition: var(--transition);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--brand-primary);
  background: var(--brand-light);
}

.drop-zone-icon {
  width: 48px;
  height: 48px;
  background: var(--surface);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  box-shadow: var(--shadow);
  color: var(--brand-primary);
}

.drop-zone-icon svg { width: 22px; height: 22px; }

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.batch-review-header {
  gap: 12px;
}

.bulk-edit-card {
  position: relative;
  overflow: visible;
  z-index: 12;
}

.bulk-edit-card .card-body {
  overflow: visible;
}

.review-table {
  min-width: 1280px;
}

.review-table th:nth-child(4) {
  min-width: 260px;
}

.review-name-input {
  min-width: 240px;
  font-size: .95rem;
  font-weight: 600;
}

.review-meta-button {
  min-width: 88px;
}

.bulk-meta-field {
  min-width: 260px;
}

.bulk-category-picker {
  position: relative;
  min-width: 260px;
}

.bulk-category-toggle {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: .84rem;
  text-align: left;
  transition: var(--transition);
}

.bulk-category-toggle:hover {
  border-color: #cbd5e1;
}

.bulk-category-toggle:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.bulk-category-toggle-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bulk-category-toggle-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform .18s ease;
}

.bulk-category-picker.open .bulk-category-toggle-icon {
  transform: rotate(180deg);
}

.bulk-category-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(340px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 30;
}

.bulk-category-search {
  margin-bottom: 10px;
}

.bulk-category-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.bulk-category-action {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--brand-primary);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
}

.bulk-category-action:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.bulk-category-summary {
  margin-bottom: 10px;
  font-size: .76rem;
  color: var(--text-muted);
}

.bulk-category-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 8px 10px;
  display: grid;
  gap: 6px;
}

.bulk-category-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: .82rem;
  color: var(--text-primary);
}

.bulk-category-item-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bulk-category-empty {
  font-size: .8rem;
  color: var(--text-muted);
  padding: 4px 0;
}

/* ──────────────────────────────
   STAT CARDS (Dashboard)
   ────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow); }

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.stat-card-icon svg { width: 22px; height: 22px; }
.stat-card-icon.indigo { background: var(--brand-light);   color: var(--brand-primary); }
.stat-card-icon.green  { background: var(--success-light);  color: var(--success); }
.stat-card-icon.amber  { background: var(--warning-light);  color: var(--warning); }
.stat-card-icon.blue   { background: var(--info-light);     color: var(--info); }

.stat-card-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.02em;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ──────────────────────────────
   ALERTS
   ────────────────────────────── */
.alert {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .875rem;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert svg { width:16px; height:16px; flex-shrink:0; margin-top:1px; }

.alert-danger  { background: var(--danger-light);  color: #b91c1c; border-color: #fca5a5; }
.alert-success { background: var(--success-light); color: #065f46; border-color: #6ee7b7; }
.alert-warning { background: var(--warning-light); color: #92400e; border-color: #fcd34d; }
.alert-info    { background: var(--info-light);    color: #1e40af; border-color: #93c5fd; }

/* ──────────────────────────────
   STEP / WORKFLOW INDICATOR
   ────────────────────────────── */
.workflow-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  position: relative;
}

.workflow-step:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: calc(50% - 20px);
  height: 2px;
  background: var(--border);
  left: calc(50% + 20px);
}

.workflow-step.done::after   { background: var(--brand-primary); }

.step-bubble {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition);
  z-index: 1;
}

.step-bubble svg { width:16px; height:16px; }

.workflow-step.active .step-bubble {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(99,102,241,.2);
}

.workflow-step.done .step-bubble {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.workflow-step.active .step-label { color: var(--brand-primary); }
.workflow-step.done .step-label   { color: var(--success); }

/* ──────────────────────────────
   SUCCESS STATE
   ────────────────────────────── */
.success-state {
  text-align: center;
  padding: 32px 24px;
}

.success-state-icon {
  width: 64px;
  height: 64px;
  background: var(--success-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--success);
}

.success-state-icon svg { width: 32px; height: 32px; }

/* ──────────────────────────────
   EMPTY STATE
   ────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 72px;
  height: 72px;
  background: var(--surface-2);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #cbd5e1;
}

.empty-state-icon svg { width: 36px; height: 36px; }

/* ──────────────────────────────
   CHECKBOX LIST (Tags / Cats)
   ────────────────────────────── */
.checkbox-list {
  max-height: 150px;
  overflow-y: auto;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.checkbox-list::-webkit-scrollbar { width: 4px; }
.checkbox-list::-webkit-scrollbar-track { background: transparent; }
.checkbox-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.checkbox-list .form-check {
  margin: 0;
  padding: 0;
}

.checkbox-list .form-check label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: .76rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  white-space: nowrap;
}

.checkbox-list .form-check label:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

.checkbox-list .form-check input[type=checkbox] { display: none; }

.checkbox-list .form-check input[type=checkbox]:checked + span,
.checkbox-list .form-check label:has(input:checked) {
  background: var(--brand-light);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  font-weight: 600;
}

/* ──────────────────────────────
   DIAGNOSTICS LIST
   ────────────────────────────── */
.diag-list { list-style: none; margin: 0; padding: 0; }

.diag-list li,
.diag-list .diag-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .83rem;
}

.diag-list li:last-child,
.diag-list .diag-list-item:last-child { border-bottom: none; }

.diag-list li:hover,
.diag-list .diag-list-item:hover { background: var(--surface-2); }

.diag-list-id {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: .7rem;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ──────────────────────────────
   RESPONSIVE
   ────────────────────────────── */
.stock-alert-kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}

.stock-alert-kv:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.stock-alert-kv span {
  color: var(--text-secondary);
}

.stock-alert-code {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #0f172a;
  color: #e2e8f0;
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: .76rem;
  line-height: 1.6;
  word-break: break-word;
}

.stock-alert-grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(248,250,252,.96), rgba(248,250,252,.82));
}

.stock-alert-grid-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.stock-alert-grid-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stock-alert-grid-search {
  width: min(260px, 100%);
  flex-shrink: 0;
}

.stock-alert-grid-page-size {
  width: 120px;
  flex-shrink: 0;
}

.stock-alert-grid-frame {
  position: relative;
}

.stock-alert-grid-scroll {
  max-height: 540px;
  overflow: auto;
}

.stock-alert-grid-table {
  min-width: 720px;
}

.stock-alert-grid-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 var(--border);
  white-space: nowrap;
  padding: 0;
}

.stock-alert-grid-table tbody td {
  vertical-align: middle;
}

.stock-alert-grid-sort {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: .77rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  cursor: pointer;
}

.stock-alert-grid-sort:hover {
  color: var(--text-primary);
}

.stock-alert-grid-sort.is-active {
  color: var(--brand-primary);
}

.stock-alert-grid-sort-indicator {
  font-size: .85rem;
  line-height: 1;
}

.stock-alert-grid-empty {
  padding: 16px 20px 20px;
  color: var(--text-muted);
  font-size: .85rem;
}

.stock-alert-grid-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.stock-alert-grid-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 991.98px) {
  .mobile-sidebar-toggle,
  .sidebar-close-btn {
    display: inline-flex;
  }

  .sidebar {
    transform: translateX(-100%);
    max-width: min(86vw, 320px);
    box-shadow: var(--shadow-xl);
  }

  .sidebar.show { transform: translateX(0); }

  .sidebar.show + .sidebar-overlay,
  .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar-brand {
    padding-right: 64px;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .topbar {
    height: auto;
    min-height: var(--topbar-height);
    padding: 12px 16px;
    flex-wrap: wrap;
    align-items: center;
  }

  .topbar-title {
    min-width: 0;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-meta {
    width: 100%;
    justify-content: flex-start;
    gap: 10px 12px;
  }

  .page-container { padding: 18px 14px; }

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

  .page-header-row > * {
    width: 100%;
  }

  .page-header-row .ms-auto,
  .card-header .ms-auto,
  .card-footer .ms-auto {
    margin-left: 0 !important;
  }

  .card-header,
  .card-footer {
    padding: 14px 16px;
  }

  .card-body {
    padding: 16px;
  }

  .card-header > .ms-auto,
  .card-footer > .ms-auto {
    width: 100%;
  }

  .card-header .d-flex,
  .card-footer .d-flex,
  .page-container .card-body > .d-flex {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .card-header .input-group,
  .card-footer .input-group {
    width: 100% !important;
    max-width: 100%;
  }

  .batch-review-header {
    flex-direction: column;
    align-items: stretch !important;
  }

  .batch-review-header > * {
    width: 100%;
  }

  .bulk-edit-grid > .col-auto {
    width: 100%;
  }

  .workflow-steps {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .workflow-step {
    flex: none;
  }

  .workflow-step:not(:last-child)::after {
    display: none;
  }

  .step-label {
    white-space: normal;
  }

  .drop-zone {
    min-height: 160px;
    padding: 20px 16px;
  }

  .table-responsive > .table {
    min-width: 720px;
  }

  .review-table {
    min-width: 1420px !important;
  }

  .review-name-input {
    min-width: 280px;
    font-size: 1rem;
  }

  .bulk-category-picker {
    width: 100%;
    min-width: 0;
  }

  .bulk-category-panel {
    width: 100%;
  }

  .bulk-category-list {
    min-height: 120px;
  }

  .stock-alert-grid-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px 12px;
  }

  .stock-alert-grid-controls {
    justify-content: stretch;
  }

  .stock-alert-grid-search {
    width: 100%;
  }

  .stock-alert-grid-page-size {
    width: 100%;
  }

  .stock-alert-grid-scroll {
    max-height: 420px;
  }

  .tree-row {
    flex-wrap: wrap;
  }

  .tree-label {
    min-width: 0;
    white-space: normal;
  }

  .tree-badge {
    margin-left: 22px;
  }
}

@media (max-width: 767.98px) {
  html {
    font-size: 14px;
  }

  .sidebar {
    max-width: calc(100vw - 32px);
  }

  .page-container {
    padding: 16px 12px 24px;
  }

  .topbar {
    padding: 12px 14px;
  }

  .topbar-status,
  .topbar-user-pill {
    width: 100%;
  }

  .card-header,
  .card-body,
  .card-footer {
    padding: 14px;
  }

  .page-header-row .btn,
  .card-header .btn,
  .card-footer .btn,
  .bulk-edit-grid .btn,
  .page-container .card-body > .d-flex > .btn,
  .page-container .card-body > .d-flex > .form-control,
  .page-container .card-body > .d-flex > .input-group {
    width: 100%;
    max-width: none !important;
  }

  .table-responsive > .table {
    min-width: 640px;
  }

  .review-table {
    min-width: 1420px !important;
  }

  .stock-alert-grid-scroll {
    max-height: 360px;
  }

  .stock-alert-grid-footer {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .stock-alert-grid-pagination {
    width: 100%;
  }

  .stock-alert-grid-pagination .btn {
    flex: 1;
  }
}

/* ──────────────────────────────
   UTILITIES
   ────────────────────────────── */
.text-muted { color: var(--text-muted) !important; }
.border-top { border-top: 1px solid var(--border) !important; }

.font-mono {
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: .82rem;
}

.spinner-border {
  border-color: currentColor;
  border-right-color: transparent;
}

/* footer override */
footer { display: none; }
