/* Oscar CMS Admin v3 — World-class CMS dashboard */

/* Color System */
:root {
  --color-bg: #0a0f1a;
  --color-bg-elevated: #111827;
  --color-surface: #1f2937;
  --color-surface-hover: #283548;
  --color-surface-active: #2d3a4f;
  --color-border: #374151;
  --color-border-strong: #4b5563;
  --color-text: #f9fafb;
  --color-text-muted: #9ca3af;
  --color-text-dim: #6b7280;
  --color-accent: #3b82f6;
  --color-accent-hover: #2563eb;
  --color-accent-glow: rgba(59, 130, 246, 0.25);

  --color-listing: #3b82f6;     /* blue */
  --color-blogpost: #10b981;    /* green */
  --color-product: #a855f7;     /* purple */
  --color-recipe: #f97316;      /* orange */
  --color-event: #ef4444;       /* red */

  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #06b6d4;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.30);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.40);
  --shadow-xl: 0 24px 48px rgba(0,0,0,0.50);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.cms-admin {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Header === */
.cms-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(180deg, var(--color-bg-elevated) 0%, var(--color-bg) 100%);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.cms-header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}

.cms-header-brand-icon {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--color-accent), #8b5cf6);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 14px;
}

.cms-header-spacer { flex: 1; }

.cms-search {
  position: relative;
  width: 320px;
  max-width: 40%;
}

.cms-search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: var(--font);
}

.cms-search-input::placeholder { color: var(--color-text-dim); }

.cms-search-input:hover { border-color: var(--color-border-strong); }

.cms-search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.cms-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-dim);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.cms-search-shortcut {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-dim);
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 2px 6px;
  pointer-events: none;
}

.cms-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  white-space: nowrap;
}

.cms-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}

.cms-btn:active { background: var(--color-surface-active); transform: translateY(1px); }

.cms-btn-primary {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 1px 2px rgba(0,0,0,0.2);
}

.cms-btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 4px 12px var(--color-accent-glow);
}

.cms-btn-success {
  background: var(--color-success);
  color: white;
  border-color: var(--color-success);
}

.cms-btn-success:hover {
  background: #0e9e74;
  border-color: #0e9e74;
}

.cms-btn-danger {
  background: transparent;
  color: var(--color-danger);
  border-color: var(--color-border);
}

.cms-btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--color-danger);
}

.cms-btn-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
}

/* === Sub-bar (filter chips) === */
.cms-subbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  white-space: nowrap;
}

.cms-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  white-space: nowrap;
}

.cms-chip:hover {
  color: var(--color-text);
  background: var(--color-surface);
  border-color: var(--color-border-strong);
}

.cms-chip.active {
  color: var(--color-text);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.cms-chip-count {
  font-size: 11px;
  opacity: 0.7;
  background: rgba(255,255,255,0.1);
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

.cms-chip.active .cms-chip-count {
  background: rgba(0,0,0,0.2);
  opacity: 0.9;
}

/* === Bulk action bar === */
.cms-bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(90deg, var(--color-accent), #6366f1);
  color: white;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border);
  animation: slideDown 200ms ease;
}

.cms-bulk-bar.hidden { display: none; }

.cms-bulk-count { font-weight: 600; }

.cms-bulk-spacer { flex: 1; }

.cms-bulk-actions { display: flex; gap: 8px; }

.cms-bulk-btn {
  padding: 6px 12px;
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}

.cms-bulk-btn:hover { background: rgba(255,255,255,0.25); }

@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* === Main content area === */
.cms-main {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--color-bg);
}

/* === Card grid === */
.cms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.cms-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  overflow: hidden;
}

.cms-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-color, var(--color-accent));
  opacity: 0.6;
  transition: opacity var(--transition);
}

.cms-card:hover {
  background: var(--color-surface-hover);
  border-color: var(--card-color, var(--color-accent));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cms-card:hover::before { opacity: 1; }

.cms-card.selected {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-glow);
}

.cms-card-select {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  opacity: 0;
  transition: opacity var(--transition);
}

.cms-card:hover .cms-card-select,
.cms-card.selected .cms-card-select { opacity: 1; }

.cms-card-select input { cursor: pointer; }

.cms-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-color, var(--color-accent));
  color: white;
  border-radius: var(--radius-md);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.cms-card-type {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--card-color, var(--color-accent));
  color: white;
  border-radius: 999px;
  margin-bottom: 8px;
}

.cms-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 4px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cms-card-snippet {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 8px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cms-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-text-dim);
}

.cms-card-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.cms-card-status.published { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.cms-card-status.draft { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.cms-card-status.archived { background: rgba(107, 114, 128, 0.15); color: var(--color-text-dim); }

.cms-card-menu {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  opacity: 0;
  transition: opacity var(--transition);
}

.cms-card:hover .cms-card-menu { opacity: 1; }

.cms-card-menu-btn {
  width: 28px;
  height: 28px;
  background: var(--color-bg-elevated);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.cms-card-menu-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}

.cms-card-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 10;
  padding: 4px;
  animation: fadeIn 150ms ease;
}

.cms-card-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--color-text);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: background var(--transition-fast);
}

.cms-card-menu-item:hover { background: var(--color-surface); }
.cms-card-menu-item.danger { color: var(--color-danger); }
.cms-card-menu-item.danger:hover { background: rgba(239, 68, 68, 0.1); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Card skeleton (loading) === */
.cms-card.skeleton {
  pointer-events: none;
  background: var(--color-surface);
  border-color: var(--color-border);
}

.cms-skeleton-bar {
  background: linear-gradient(90deg, var(--color-surface) 0%, var(--color-surface-hover) 50%, var(--color-surface) 100%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
  height: 14px;
  margin-bottom: 8px;
}

.cms-skeleton-bar.icon { width: 40px; height: 40px; border-radius: var(--radius-md); }
.cms-skeleton-bar.type { width: 60px; height: 14px; }
.cms-skeleton-bar.title { width: 80%; height: 18px; }
.cms-skeleton-bar.snippet { width: 100%; }
.cms-skeleton-bar.short { width: 60%; }

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Empty state === */
.cms-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

.cms-empty-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg-elevated) 100%);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  margin-bottom: 20px;
  color: var(--color-text-dim);
}

.cms-empty-icon svg { width: 40px; height: 40px; }

.cms-empty-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 8px 0;
}

.cms-empty-text {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0 0 20px 0;
  max-width: 400px;
}

.cms-empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--color-accent), #8b5cf6);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 12px var(--color-accent-glow);
}

.cms-empty-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px var(--color-accent-glow);
}

/* === Edit form === */
.cms-edit {
  display: flex;
  height: 100%;
  background: var(--color-bg);
}

.cms-edit-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

.cms-edit-sidebar {
  width: 320px;
  background: var(--color-bg-elevated);
  border-left: 1px solid var(--color-border);
  overflow-y: auto;
  padding: 20px;
}

.cms-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}

.cms-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.cms-section-header:hover { background: var(--color-surface-hover); }

.cms-section-chevron {
  transition: transform var(--transition);
  color: var(--color-text-muted);
}

.cms-section.collapsed .cms-section-chevron { transform: rotate(-90deg); }

.cms-section.collapsed .cms-section-body { display: none; }

.cms-section-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cms-section-body { padding: 18px; }

.cms-field {
  margin-bottom: 16px;
}

.cms-field:last-child { margin-bottom: 0; }

.cms-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
}

.cms-label-required {
  color: var(--color-danger);
  font-weight: 700;
}

.cms-label-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-border);
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  margin-left: 4px;
}

.cms-input, .cms-textarea, .cms-select {
  width: 100%;
  padding: 8px 12px;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.cms-input:hover, .cms-textarea:hover, .cms-select:hover { border-color: var(--color-border-strong); }

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

.cms-textarea { resize: vertical; min-height: 100px; line-height: 1.5; }

.cms-input-large {
  font-size: 22px;
  font-weight: 600;
  padding: 12px 16px;
  background: transparent;
  border: 1px solid transparent;
}

.cms-input-large:hover { border-color: var(--color-border); }
.cms-input-large:focus { border-color: var(--color-accent); background: var(--color-bg); }

.cms-field-help {
  font-size: 12px;
  color: var(--color-text-dim);
  margin-top: 4px;
}

.cms-field-error {
  font-size: 12px;
  color: var(--color-danger);
  margin-top: 4px;
}

.cms-image-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--color-bg);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.cms-image-drop:hover {
  border-color: var(--color-accent);
  background: rgba(59, 130, 246, 0.05);
  color: var(--color-text);
}

.cms-image-preview {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
}

.cms-image-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.cms-image-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition);
}

.cms-image-remove:hover { background: var(--color-danger); }

/* === Status panel (sidebar) === */
.cms-status-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}

.cms-status-box-header {
  padding: 12px 16px;
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text);
}

.cms-status-box-body { padding: 16px; }

.cms-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
}

.cms-status-row + .cms-status-row { border-top: 1px solid var(--color-border); }

.cms-status-label { color: var(--color-text-muted); }

.cms-status-value { color: var(--color-text); font-weight: 500; }

/* === Tabs === */
.cms-tabs {
  display: flex;
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
  padding: 0 20px;
  gap: 4px;
}

.cms-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
  position: relative;
}

.cms-tab:hover { color: var(--color-text); }

.cms-tab.active {
  color: var(--color-text);
  border-bottom-color: var(--color-accent);
}

.cms-tab-badge {
  display: inline-block;
  padding: 1px 6px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

/* === Save bar (sticky) === */
.cms-save-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(180deg, var(--color-bg-elevated) 0%, var(--color-bg) 100%);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.cms-save-bar-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
  font-family: var(--font);
}

.cms-save-bar-back:hover {
  color: var(--color-text);
  background: var(--color-surface);
  border-color: var(--color-border);
}

.cms-save-bar-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.cms-save-bar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
  font-style: italic;
}

.cms-save-bar-status.dirty { color: var(--color-warning); font-style: normal; }
.cms-save-bar-status.saved { color: var(--color-success); font-style: normal; }
.cms-save-bar-status.saving { color: var(--color-info); font-style: normal; }

.cms-save-bar-actions { display: flex; gap: 8px; }

/* === Toast === */
.cms-toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.cms-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-bg-elevated);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 400px;
  animation: slideInRight 200ms ease;
  pointer-events: auto;
  font-size: 14px;
}

.cms-toast.success { border-left-color: var(--color-success); }
.cms-toast.error { border-left-color: var(--color-danger); }
.cms-toast.warning { border-left-color: var(--color-warning); }
.cms-toast.info { border-left-color: var(--color-info); }

.cms-toast-message { flex: 1; }

.cms-toast-action {
  padding: 4px 10px;
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
  font-family: var(--font);
}

.cms-toast-action:hover {
  background: var(--color-accent);
  color: white;
}

.cms-toast-close {
  background: transparent;
  color: var(--color-text-dim);
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  line-height: 1;
}

.cms-toast-close:hover { color: var(--color-text); }

@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* === Modal === */
.cms-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  animation: fadeIn 150ms ease;
}

.cms-modal {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 480px;
  max-width: 90%;
  padding: 24px;
}

.cms-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 12px 0;
}

.cms-modal-text {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.cms-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* === Pagination === */
.cms-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 0;
}

.cms-pagination-btn {
  padding: 6px 12px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
  font-family: var(--font);
}

.cms-pagination-btn:hover { background: var(--color-surface-hover); }
.cms-pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.cms-pagination-info {
  font-size: 13px;
  color: var(--color-text-muted);
  padding: 0 12px;
}

/* === Scrollbar === */
.cms-main::-webkit-scrollbar,
.cms-edit-main::-webkit-scrollbar,
.cms-edit-sidebar::-webkit-scrollbar {
  width: 8px;
}

.cms-main::-webkit-scrollbar-track,
.cms-edit-main::-webkit-scrollbar-track,
.cms-edit-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.cms-main::-webkit-scrollbar-thumb,
.cms-edit-main::-webkit-scrollbar-thumb,
.cms-edit-sidebar::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.cms-main::-webkit-scrollbar-thumb:hover,
.cms-edit-main::-webkit-scrollbar-thumb:hover,
.cms-edit-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-strong);
}

/* Responsive: narrow panels */
@media (max-width: 700px) {
  .cms-edit { flex-direction: column; }
  .cms-edit-sidebar { width: 100%; border-left: none; border-top: 1px solid var(--color-border); }
  .cms-search { width: 180px; }
  .cms-grid { grid-template-columns: 1fr; }
}

.cms-card-image {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, var(--card-color, var(--color-bg-elevated, #1a1a1a)) 0%, rgba(0,0,0,0.4) 100%);
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  margin: -16px -16px 12px -16px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cms-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
}
.cms-card-image-fallback {
  font-size: 48px;
  opacity: 0.3;
  color: white;
  z-index: 1;
}
.cms-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cms-card-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: linear-gradient(to top, var(--color-card-bg, rgba(0,0,0,0.6)), transparent);
  pointer-events: none;
}
