/* ================================================================
   MEGRA Components Library
   Extracted reusable components — buttons, badges, cards, tables,
   modals, empty states, forms, sidebar enhancements, tabs, alerts.
   Loaded AFTER megra.css (overrides/extends base definitions).
   ================================================================ */


/* ================================================================
   1. BUTTONS — extended variants
   ================================================================ */

/* -- Size variants -- */
.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  gap: 4px;
}
.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
  gap: 8px;
}
.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
}

/* -- Icon button (square, lucide icon centered) -- */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all 100ms ease;
  flex-shrink: 0;
}
.btn-icon:hover {
  background: var(--bg-1);
  color: var(--text);
}
.btn-icon.btn-danger {
  color: var(--fail);
  background: transparent;
  border-color: transparent;
}
.btn-icon.btn-danger:hover {
  background: #fef2f2;
  color: var(--fail);
}
.btn-icon.btn-success {
  color: var(--ok);
  background: transparent;
  border-color: transparent;
}
.btn-icon.btn-success:hover {
  background: #ecfdf5;
  color: var(--ok);
}
.btn-icon i,
.btn-icon svg {
  width: 18px;
  height: 18px;
}

/* -- Success variant (approve actions) -- */
.btn-success {
  background: var(--ok);
  color: #fff;
  border-color: var(--ok);
}
.btn-success:hover {
  background: #15803d;
}

/* -- Disabled state for all buttons -- */
.btn:disabled,
.btn[disabled],
.btn-icon:disabled,
.btn-icon[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* -- Focus ring (accessibility) -- */
.btn:focus-visible,
.btn-icon:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}


/* ================================================================
   2. BADGES — extended status variants
   ================================================================ */

/* Status-mapped aliases (templates use status-X classes) */
.badge.status-active,
.badge-active {
  background: #ecfdf5;
  color: #059669;
}
.badge.status-paused,
.badge-paused {
  background: #f5f5f4;
  color: #78716c;
}
.badge.status-error,
.badge-error {
  background: #fef2f2;
  color: #dc2626;
}
.badge.status-draft,
.badge.status-pending {
  background: var(--violet-soft);
  color: var(--violet);
}
.badge.status-approved {
  background: #ecfdf5;
  color: #059669;
}
.badge.status-dispatched {
  background: var(--cyan-soft);
  color: var(--cyan);
}
.badge.status-rejected {
  background: #fef2f2;
  color: #dc2626;
}
.badge-info {
  background: #f0f9ff;
  color: #0284c7;
}

/* Badge with dot prefix */
.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}


/* ================================================================
   3. CHIPS (pill, removable)
   ================================================================ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-1);
  color: var(--text-1);
  border: 1px solid var(--border);
  cursor: default;
  transition: all 100ms ease;
}
.chip:hover {
  background: var(--bg);
  border-color: var(--border-strong);
}
.chip.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.chip .chip-remove {
  display: inline-flex;
  width: 14px;
  height: 14px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 100ms;
}
.chip .chip-remove:hover {
  opacity: 1;
}
.chip .chip-remove svg,
.chip .chip-remove i {
  width: 10px;
  height: 10px;
}


/* ================================================================
   4. KPI CARDS — enhanced with hover lift + shadow
   ================================================================ */

.kpi-card {
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.kpi-value {
  font-family: 'DM Sans', sans-serif;
}

/* Additional KPI color variants used in templates */
.kpi-card.kpi-green::after { background: var(--ok); }
.kpi-card.kpi-pink::after { background: #ec4899; }
.kpi-card.kpi-amber::after { background: #f59e0b; }
.kpi-card.kpi-blue::after { background: #3b82f6; }

/* KPI grid responsive (4-3-2 breakpoints) */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ================================================================
   5. DENSE TABLE — header bg, hover, status dots, row-actions
   ================================================================ */

.dense-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dense-table thead {
  position: sticky;
  top: 52px; /* below topbar */
  z-index: 10;
}
.dense-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  font-family: 'Space Mono', monospace;
  background: var(--surface-1);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.dense-table th:first-child { border-radius: var(--r-sm) 0 0 0; }
.dense-table th:last-child { border-radius: 0 var(--r-sm) 0 0; }

.dense-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.dense-table tr:last-child td { border-bottom: none; }
.dense-table tbody tr {
  transition: background 80ms ease;
}
.dense-table tbody tr:hover td {
  background: var(--surface-1);
}

/* Status dot (inline in table cells) */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}
.status-dot.status-active,
.status-dot.status-ok { background: var(--ok); }
.status-dot.status-paused,
.status-dot.status-idle { background: var(--idle); }
.status-dot.status-error,
.status-dot.status-fail { background: var(--fail); }
.status-dot.status-warn { background: var(--warn); }
.status-dot.status-running {
  background: var(--lime);
  animation: pulse 1.5s ease-in-out infinite;
}
.status-dot.status-pending { background: var(--violet); }
.status-dot.status-approved { background: var(--ok); }
.status-dot.status-dispatched { background: var(--cyan); }

/* Row actions — show on hover */
.row-actions {
  white-space: nowrap;
  opacity: 0;
  transition: opacity 120ms ease;
}
.row-actions form {
  display: inline-flex;
}
.dense-table tbody tr:hover .row-actions,
.row-actions:focus-within {
  opacity: 1;
}

/* Link cells styled lime */
.dense-table td a {
  color: var(--lime-dim);
  font-weight: 500;
}
.dense-table td a:hover {
  color: var(--lime);
  text-decoration: underline;
}


/* ================================================================
   6. CARD GRID — for carousels, templates, pool
   ================================================================ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Individual cards in grid */
.carousel-card,
.template-card,
.meme-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.carousel-card:hover,
.template-card:hover,
.meme-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-thumb {
  width: 100%;
  min-height: 200px;
  background: var(--bg-1);
  position: relative;
}

.card-meta {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-meta .template-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.card-meta .slide-count {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text-2);
}
.card-meta .sound-status {
  font-size: 13px;
  color: var(--text-2);
}

.card-actions {
  padding: 8px 16px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}


/* ================================================================
   7. MODAL / DIALOG
   ================================================================ */

dialog {
  border: none;
  border-radius: var(--r-lg);
  padding: 0;
  max-width: 480px;
  width: calc(100vw - 48px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.14), 0 4px 16px rgba(0, 0, 0, 0.08);
  background: var(--surface);
  color: var(--text);
}
dialog::backdrop {
  background: rgba(28, 27, 24, 0.45);
  backdrop-filter: blur(4px);
}
dialog[open] {
  animation: dialog-in 200ms ease forwards;
}
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
dialog form,
dialog .dialog-body {
  padding: 24px;
}
dialog h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.modal-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--r-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 100ms ease;
}
.modal-actions button:hover {
  background: var(--surface-1);
}
.modal-actions .btn-primary,
.modal-actions button[type="submit"] {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.modal-actions .btn-primary:hover,
.modal-actions button[type="submit"]:hover {
  background: #333;
}

/* Modal close button (top-right) */
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: all 100ms;
}
.modal-close:hover {
  background: var(--bg-1);
  color: var(--text);
}


/* ================================================================
   8. EMPTY STATE — enhanced
   ================================================================ */

.empty-state {
  text-align: center;
  padding: 64px 24px;
}
.empty-state .empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--lime-soft);
  color: var(--lime-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.empty-state .empty-icon i,
.empty-state .empty-icon svg {
  width: 24px;
  height: 24px;
}
.empty-state h4 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.empty-state p {
  font-size: 13px;
  color: var(--text-2);
  max-width: 340px;
  margin: 0 auto 20px;
  line-height: 1.6;
}
.empty-state .btn {
  margin-top: 4px;
}

/* Simple empty text (used in templates as .empty class) */
.empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-2);
  font-size: 14px;
}


/* ================================================================
   9. TABS + STATUS-TABS (underline accent)
   ================================================================ */

.status-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.status-tabs .tab,
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  transition: color 100ms ease;
  text-decoration: none;
  white-space: nowrap;
}
.tab:hover {
  color: var(--text);
}
.tab.active {
  color: var(--text);
  font-weight: 600;
}
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--lime);
  border-radius: 1px 1px 0 0;
}

/* Tab count badge */
.tab .tab-count {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  background: var(--bg-1);
  color: var(--text-2);
  padding: 1px 6px;
  border-radius: 3px;
}
.tab.active .tab-count {
  background: var(--lime-soft);
  color: var(--lime-dim);
}


/* ================================================================
   10. ALERTS
   ================================================================ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.alert-info {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0c4a6e;
}
.alert-success {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #065f46;
}
.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
}
.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}
.alert i,
.alert svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}


/* ================================================================
   11. TOAST NOTIFICATIONS — positioned top-right, auto-dismiss
   ================================================================ */

.toast-container {
  position: fixed;
  top: 68px; /* below topbar */
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
  pointer-events: none;
}
.toast-container .toast {
  pointer-events: auto;
  box-shadow: var(--shadow-md);
  animation: toast-in 250ms ease forwards;
}
.toast-container .toast.toast-out {
  animation: toast-out 200ms ease forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(24px); }
}

/* Toast close button */
.toast .toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.toast .toast-close:hover {
  opacity: 1;
}


/* ================================================================
   12. FORMS — labels, spacing, focus ring, validation
   ================================================================ */

/* Form group pattern: label wrapping input */
dialog label,
.form-group label,
form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
}
dialog label input,
dialog label select,
dialog label textarea,
.form-group input,
.form-group select,
.form-group textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
}
dialog label input:focus,
dialog label select:focus,
dialog label textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px var(--lime-soft);
}

/* Error state */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: var(--fail);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}
.form-error {
  font-size: 12px;
  color: var(--fail);
  margin-top: -8px;
  margin-bottom: 12px;
}

/* Textarea */
textarea {
  font-family: 'DM Sans', sans-serif;
  resize: vertical;
  min-height: 80px;
}
textarea.mono,
textarea[name*="json"] {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
}

/* Search input with icon space */
.search-input {
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  width: 240px;
  transition: border-color 120ms, box-shadow 120ms;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a8a49b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 16px;
}
.search-input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px var(--lime-soft);
}
.search-input::placeholder {
  color: var(--text-3);
}

/* Status filter (select) */
.status-filter {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a776e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 28px;
}
.status-filter:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px var(--lime-soft);
}


/* ================================================================
   13. FILTER BAR
   ================================================================ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}


/* ================================================================
   14. SIDEBAR — active left-bar accent, hover, disabled
   ================================================================ */

/* Active state override — lime left bar instead of full black fill */
.sidebar .nav-item.active {
  background: var(--lime-soft);
  color: var(--text);
  position: relative;
}
.sidebar .nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--lime);
}
.sidebar .nav-item.active i {
  color: var(--lime-dim);
}

/* Hover refinement */
.sidebar .nav-item:not(.active):not(.disabled):hover {
  background: var(--bg);
  color: var(--text);
}
.sidebar .nav-item:not(.active):not(.disabled):hover i {
  color: var(--text-1);
}

/* Disabled */
.sidebar .nav-item.disabled {
  color: var(--text-3);
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.65;
}

/* Sidebar section divider */
.sidebar .nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 4px;
}

/* Sidebar footer */
.sidebar .sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--text-3);
}


/* ================================================================
   15. BREADCRUMB
   ================================================================ */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 20px;
}
.breadcrumb a {
  color: var(--text-2);
  text-decoration: none;
  transition: color 100ms;
}
.breadcrumb a:hover {
  color: var(--text);
}
.breadcrumb .breadcrumb-sep {
  color: var(--text-3);
  font-size: 11px;
}
.breadcrumb .breadcrumb-current {
  color: var(--text);
  font-weight: 600;
}


/* ================================================================
   16. CAROUSEL DETAIL
   ================================================================ */

.carousel-detail {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
.slide-viewer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.slide-strip {
  display: flex;
  gap: 8px;
  padding: 16px;
  overflow-x: auto;
}
.slide-item {
  flex-shrink: 0;
  text-align: center;
}
.slide-thumb {
  border-radius: var(--r-sm);
  overflow: hidden;
}
.slide-num {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  display: block;
}

.meta-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.meta-sidebar .card {
  padding: 16px;
}
.meta-sidebar dt {
  font-size: 11px;
  font-family: 'Space Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
  margin-bottom: 2px;
}
.meta-sidebar dd {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 10px;
}
.meta-sidebar dd:last-child {
  margin-bottom: 0;
}

.actions-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


/* ================================================================
   17. MEME GRID (pool page)
   ================================================================ */

.meme-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
@media (max-width: 1280px) {
  .meme-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1024px) {
  .meme-grid { grid-template-columns: repeat(3, 1fr); }
}

.meme-card {
  position: relative;
}
.meme-card .thumb-placeholder {
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.meme-card .meta {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.meme-card .meta .src {
  font-weight: 500;
  font-size: 12px;
  color: var(--lime-dim);
}
.meme-card .meta .dim {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--text-3);
}
.meme-card .meme-check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--lime);
  z-index: 2;
}
.meme-card .hover-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 120ms;
  z-index: 2;
}
.meme-card:hover .hover-actions {
  opacity: 1;
}
.meme-card .hover-actions .btn-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--r-sm);
  backdrop-filter: blur(4px);
}
.meme-card .hover-actions .btn-icon:hover {
  background: #fff;
}


/* ================================================================
   18. BULK ACTION BAR (pool page)
   ================================================================ */

.bulk-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
  border-radius: var(--r-md) var(--r-md) 0 0;
  font-size: 13px;
  z-index: 50;
}
.bulk-bar .bulk-count {
  font-weight: 600;
  color: var(--text);
  margin-right: auto;
}


/* ================================================================
   19. RECENT RUNS section (dashboard)
   ================================================================ */

.recent-runs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.recent-runs h3 {
  padding: 16px 20px 12px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
}


/* ================================================================
   20. UTILITY CLASSES
   ================================================================ */

/* Text utilities */
.text-mono { font-family: 'Space Mono', monospace; }
.text-muted { color: var(--text-2); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Spacing */
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* Flex helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* Display */
.hidden { display: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Truncate */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}
