/* ==========================================================================
   CompareHub Admin CSS
   Complete stylesheet for the admin backend
   ========================================================================== */

/* ==========================================================================
   1. RESET & BASE
   ========================================================================== */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #1e293b;
  background: #f1f5f9;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  color: #1d4ed8;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: 600;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

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

/* ==========================================================================
   2. LAYOUT
   ========================================================================== */

.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: #1e293b;
  color: #cbd5e1;
  overflow-y: auto;
  z-index: 50;
  transition: transform 0.2s ease;
}

.admin-sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #334155;
}

.admin-sidebar-header h1 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.admin-sidebar-header img {
  height: 28px;
  width: auto;
}

/* Nav */
.admin-nav {
  padding: 0.75rem 0;
}

.admin-nav-section {
  padding: 0.5rem 1.5rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-top: 0.5rem;
}

.admin-nav-item {
  margin: 1px 0;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  transition: color 0.15s, background-color 0.15s;
}

.admin-nav-link:hover {
  color: #ffffff;
  background: #334155;
}

.admin-nav-link.active {
  color: #ffffff;
  background: #334155;
  border-right: 3px solid #2563eb;
}

.admin-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.admin-nav-icon svg {
  width: 18px;
  height: 18px;
}

/* ---------- Main Content ---------- */

.admin-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
}

/* ---------- Top Bar ---------- */

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  height: 56px;
}

.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-topbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
}

.admin-topbar-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
}

/* Mobile sidebar toggle */
.admin-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  color: #475569;
}

.admin-sidebar-toggle:hover {
  background: #f1f5f9;
}

.admin-sidebar-toggle svg {
  width: 22px;
  height: 22px;
}

/* Content padding */
.admin-content-body {
  padding: 1.5rem;
}

@media (min-width: 1024px) {
  .admin-content-body {
    padding: 2rem;
  }
}

/* Page header */
.admin-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-page-header h1 {
  font-size: 1.5rem;
}

/* ==========================================================================
   3. DOMAIN SWITCHER
   ========================================================================== */

.domain-switcher {
  position: relative;
}

.domain-switcher select {
  appearance: none;
  padding: 0.4375rem 2rem 0.4375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  min-width: 160px;
}

.domain-switcher select:hover {
  border-color: #cbd5e1;
}

.domain-switcher select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.domain-switcher::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #64748b;
  border-bottom: 1.5px solid #64748b;
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}

/* ==========================================================================
   4. CARDS
   ========================================================================== */

.admin-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
  padding: 1.25rem;
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.admin-card-header h2 {
  font-size: 1.0625rem;
  margin: 0;
}

.admin-card-header h3 {
  font-size: 1rem;
  margin: 0;
}

.admin-card-body {
  padding: 1.25rem;
}

/* ==========================================================================
   5. STATS GRID
   ========================================================================== */

.stats-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.stat-card-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 0.375rem;
}

.stat-card-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

.stat-card-change {
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

.stat-card-change.up {
  color: #16a34a;
}

.stat-card-change.down {
  color: #dc2626;
}

/* ==========================================================================
   6. TABLES
   ========================================================================== */

.admin-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  min-width: 600px;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: middle;
  font-size: 0.875rem;
}

.admin-table thead th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.8125rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.admin-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
}

.admin-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.admin-table tbody tr:hover {
  background: #f1f5f9;
}

.admin-table tbody tr:last-child {
  border-bottom: none;
}

.admin-table .actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.admin-table .actions a,
.admin-table .actions button {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background-color 0.15s;
}

.admin-table .actions a:hover,
.admin-table .actions button:hover {
  background: #f1f5f9;
}

.admin-table .action-edit {
  color: #2563eb;
}

.admin-table .action-delete {
  color: #dc2626;
}

.admin-table .action-view {
  color: #475569;
}

/* Drag handle for sortable rows */
.admin-table .drag-handle {
  cursor: grab;
  color: #94a3b8;
  padding: 0.25rem;
}

.admin-table .drag-handle:active {
  cursor: grabbing;
}

.admin-table tr.is-dragging {
  opacity: 0.5;
  background: #eff6ff;
}

/* ==========================================================================
   7. FORMS
   ========================================================================== */

.admin-form {
  max-width: 720px;
}

.admin-form.admin-form-full {
  max-width: 100%;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.375rem;
}

.form-label .required {
  color: #dc2626;
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.5625rem 0.75rem;
  font-size: 0.875rem;
  color: #1e293b;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #9ca3af;
}

.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
  border-color: #dc2626;
}

.form-input.is-invalid:focus,
.form-select.is-invalid:focus,
.form-textarea.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-select {
  appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  cursor: pointer;
  flex-shrink: 0;
}

.form-check label {
  font-size: 0.875rem;
  color: #334155;
  cursor: pointer;
}

.form-help {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.25rem;
  line-height: 1.5;
}

.form-error {
  font-size: 0.8125rem;
  color: #dc2626;
  margin-top: 0.25rem;
}

.form-row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  margin-top: 1.5rem;
}

/* ==========================================================================
   8. BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

.btn-secondary {
  background: #ffffff;
  color: #475569;
  border-color: #d1d5db;
}

.btn-secondary:hover {
  background: #f8fafc;
  color: #1e293b;
  border-color: #94a3b8;
}

.btn-danger {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}

.btn-sm {
  padding: 0.3125rem 0.625rem;
  font-size: 0.8125rem;
}

/* ==========================================================================
   9. ALERTS
   ========================================================================== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 8px;
  border: 1px solid;
  margin-bottom: 1rem;
}

.alert svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

/* ==========================================================================
   10. BADGES
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 50px;
  white-space: nowrap;
}

.badge-success {
  background: #f0fdf4;
  color: #166534;
}

.badge-warning {
  background: #fffbeb;
  color: #92400e;
}

.badge-danger {
  background: #fef2f2;
  color: #991b1b;
}

.badge-info {
  background: #eff6ff;
  color: #1e40af;
}

.badge-neutral {
  background: #f1f5f9;
  color: #475569;
}

/* ==========================================================================
   11. THEME PICKER
   ========================================================================== */

.theme-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.theme-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
}

.theme-swatch:hover {
  transform: scale(1.1);
}

.theme-swatch.active {
  border-color: #1e293b;
}

.theme-swatch.active::after {
  content: "\2713";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.theme-swatch[data-theme="tech-blue"] { background: #2563eb; }
.theme-swatch[data-theme="forest-green"] { background: #16a34a; }
.theme-swatch[data-theme="sunset-orange"] { background: #ea580c; }
.theme-swatch[data-theme="royal-purple"] { background: #7c3aed; }
.theme-swatch[data-theme="cherry-red"] { background: #dc2626; }
.theme-swatch[data-theme="ocean-teal"] { background: #0d9488; }
.theme-swatch[data-theme="slate-gray"] { background: #475569; }
.theme-swatch[data-theme="golden-amber"] { background: #d97706; }
.theme-swatch[data-theme="rose-pink"] { background: #e11d48; }

/* ==========================================================================
   12. FILE UPLOAD
   ========================================================================== */

.file-upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.file-upload-area:hover {
  border-color: #2563eb;
  background: #f8fafc;
}

.file-upload-area.is-dragover {
  border-color: #2563eb;
  background: #eff6ff;
}

.file-upload-area p {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.5rem;
}

.file-upload-area svg {
  width: 36px;
  height: 36px;
  color: #94a3b8;
  margin: 0 auto 0.5rem;
}

.file-upload-preview {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.file-upload-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
}

.file-upload-preview .file-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
}

.file-upload-preview .file-size {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* ==========================================================================
   13. RESPONSIVE
   ========================================================================== */

/* Sidebar collapse on mobile */
@media (max-width: 1023px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }

  .admin-sidebar.is-open {
    transform: translateX(0);
  }

  .admin-content {
    margin-left: 0;
  }

  .admin-sidebar-toggle {
    display: flex;
  }

  /* Overlay when sidebar is open */
  .admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 40;
  }

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

/* Stacked cards on small screens */
@media (max-width: 639px) {
  .admin-page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions .btn {
    justify-content: center;
  }

  .admin-content-body {
    padding: 1rem;
  }
}

/* ==========================================================================
   14. UTILITIES
   ========================================================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #64748b; }
.text-sm { font-size: 0.8125rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  color: #cbd5e1;
}

.empty-state p {
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

/* ==========================================================================
   17. COMPREHENSIVE VIEW-CLASS ADDITIONS
   ========================================================================== */

/* Content padding (no admin-content-body wrapper in layout) */
.admin-content {
  padding: 1.5rem;
}

@media (min-width: 1024px) {
  .admin-content {
    padding: 2rem;
  }
}

/* Flash messages inside admin-content */
.alert {
  padding: 0.875rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
}

/* Page title / subtitle */
.admin-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.admin-page-subtitle {
  font-size: 0.9375rem;
  color: #64748b;
  margin: 0.25rem 0 0;
}

/* Version badge */
.admin-version-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 50px;
}

/* Card title (used directly on h2 without admin-card-header wrapper) */
.admin-card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 1.25rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  margin-left: -1.25rem;
  margin-right: -1.25rem;
  margin-top: -1.25rem;
}

.admin-card-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* Grid system */
.admin-grid {
  display: grid;
  gap: 1.5rem;
}

.admin-grid-2 {
  grid-template-columns: repeat(1, 1fr);
}

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

@media (min-width: 768px) {
  .admin-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Stats grid — alias for .stats-grid */
.admin-stats-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
  .admin-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .admin-stats-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Stat card — alias for .stat-card */
.admin-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.admin-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

.admin-stat-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  margin-top: 0.25rem;
}

.admin-stat-icon {
  color: var(--admin-primary);
  opacity: 0.55;
  margin-bottom: 0.5rem;
}

.admin-stat-card--accent {
  border-color: var(--admin-primary);
  background: linear-gradient(135deg, #eff6ff 0%, #fff 100%);
}

.admin-stat-card--accent .admin-stat-value {
  color: var(--admin-primary);
}

.admin-stat-card--accent .admin-stat-icon {
  opacity: 1;
}

/* Table responsive — alias for .admin-table-wrapper */
.admin-table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Table extras */
.admin-table-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

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

.admin-table-no-image {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.75rem;
}

/* Empty state text */
.admin-empty-text {
  text-align: center;
  padding: 2rem 1rem;
  color: #94a3b8;
  font-size: 0.9375rem;
}

/* Form — additional fields */
.admin-form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  margin-top: 0.5rem;
  border-top: 1px solid #f1f5f9;
}

.form-hint {
  font-size: 0.8125rem;
  color: #94a3b8;
  margin-top: 0.375rem;
}

.form-help-text {
  font-size: 0.8125rem;
  color: #94a3b8;
  margin-top: 0.375rem;
}

.form-label-unit {
  font-size: 0.875rem;
  color: #64748b;
  margin-left: 0.375rem;
}

.form-color {
  width: 48px;
  height: 38px;
  padding: 2px 4px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  background: none;
}

.form-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: #374151;
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #2563eb;
}

.form-select-multi {
  min-height: 120px;
}

.form-wysiwyg {
  min-height: 200px;
  font-family: inherit;
}

/* Inline form (for delete buttons in tables) */
.inline-form {
  display: inline;
}

/* Badges */
.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50px;
  white-space: nowrap;
}

.admin-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50px;
}

.admin-role-admin {
  background: #eff6ff;
  color: #2563eb;
}

.admin-role-editor {
  background: #f0fdf4;
  color: #16a34a;
}

/* Status badges */
.admin-status {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50px;
}

.admin-status-active {
  background: #f0fdf4;
  color: #16a34a;
}

.admin-status-inactive {
  background: #fef2f2;
  color: #dc2626;
}

/* Buttons extras */
.btn-small {
  padding: 0.3125rem 0.75rem;
  font-size: 0.8125rem;
}

/* Divider */
.admin-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 1.5rem 0;
}

/* Color preview */
.admin-color-preview {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  vertical-align: middle;
  margin-right: 0.5rem;
}

/* Image previews */
.admin-current-image,
.admin-preview-image,
.admin-preview-logo {
  max-width: 200px;
  max-height: 120px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 0.75rem;
  object-fit: contain;
}

/* Checkbox list */
.admin-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/* Chart placeholder */
.admin-chart {
  min-height: 200px;
}

/* Maintenance status */
.admin-maintenance-status {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.admin-maintenance-on {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
}

.admin-maintenance-off {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #16a34a;
}

.admin-maintenance-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 50px;
  background: currentColor;
}

/* Security checks */
.admin-security-checks {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-security-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.admin-security-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.admin-security-text {
  flex: 1;
  font-size: 0.875rem;
}

.admin-security-text strong {
  display: block;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.125rem;
}

/* Theme selector */
.admin-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.admin-theme-option {
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  transition: border-color 0.15s;
}

.admin-theme-option input[type="radio"] {
  display: none;
}

.admin-theme-option input[type="radio"]:checked + .admin-theme-swatch {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.admin-theme-swatch {
  height: 40px;
  display: block;
  border-radius: 6px 6px 0 0;
}

.admin-theme-label {
  display: block;
  text-align: center;
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151;
}

/* Add content block */
.admin-add-block {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

/* Info box */
.admin-info-box {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.875rem 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #1e40af;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.admin-info-box svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: #2563eb;
}

.admin-info-box strong {
  color: #1e40af;
}

/* ==========================================================================
   15. VIEW-CLASS FIXES
   (HTML uses different class names than originally in CSS)
   ========================================================================== */

/* Body layout */
body.admin-body {
  display: flex;
  min-height: 100vh;
  margin: 0;
}

/* Admin logo in sidebar */
.admin-logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
}

.admin-logo:hover {
  color: #e2e8f0;
}

/* Nav items — HTML uses .admin-nav-item on <a> tags directly */
.admin-nav .admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
  border-right: 3px solid transparent;
}

.admin-nav .admin-nav-item:hover {
  color: #ffffff;
  background: #334155;
}

.admin-nav .admin-nav-item.active {
  color: #ffffff;
  background: #334155;
  border-right-color: #2563eb;
}

.admin-nav .admin-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Nav divider */
.admin-nav-divider {
  height: 1px;
  background: #334155;
  margin: 0.5rem 1.5rem;
}

/* Domain switcher in sidebar */
.admin-domain-switcher {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #334155;
}

.admin-domain-select {
  width: 100%;
  appearance: none;
  padding: 0.4375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #cbd5e1;
  background: #334155;
  border: 1px solid #475569;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

.admin-domain-select:focus {
  border-color: #2563eb;
}

/* Sidebar footer */
.admin-sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.5rem;
  border-top: 1px solid #334155;
}

.admin-user-info {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-bottom: 0.625rem;
}

.admin-logout-link {
  display: inline-block;
  font-size: 0.8125rem;
  color: #64748b;
  transition: color 0.15s;
  text-decoration: none;
}

.admin-logout-link:hover {
  color: #ffffff;
}

/* btn-block */
.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
}

/* ==========================================================================
   16. LOGIN PAGE
   ========================================================================== */

body.admin-login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f1f5f9;
  margin: 0;
}

.admin-login-container {
  width: 100%;
  max-width: 440px;
  padding: 1.5rem;
}

.admin-login-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
}

.admin-login-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  margin-bottom: 0.25rem;
}

.admin-login-subtitle {
  font-size: 0.9375rem;
  color: #64748b;
  text-align: center;
  margin-bottom: 2rem;
}

.admin-login-form .form-group {
  margin-bottom: 1.25rem;
}

.admin-login-form .form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}

.admin-login-form .form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #1e293b;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.admin-login-form .form-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: #ffffff;
}

.admin-login-form .btn {
  margin-top: 0.5rem;
}

/* ==========================================================================
   18. CHANGELOG DETAILS + DOMAIN SWITCHER POLISH
   ========================================================================== */

.admin-changelog-details summary {
  cursor: pointer;
  color: #2563eb;
  font-size: 0.875rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.admin-changelog-details summary::-webkit-details-marker { display: none; }

.admin-changelog-details summary::before {
  content: '▶';
  font-size: 0.625rem;
  transition: transform 0.15s;
}

.admin-changelog-details[open] summary::before {
  transform: rotate(90deg);
}

.admin-changelog-full {
  margin-top: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: #f8fafc;
  border-left: 3px solid #2563eb;
  border-radius: 0 4px 4px 0;
  font-size: 0.875rem;
  color: #334155;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Polished domain switcher */
.admin-domain-switcher {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.admin-domain-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-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='rgba(255,255,255,0.7)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  padding-right: 2rem;
  transition: background-color 0.15s, border-color 0.15s;
}

.admin-domain-select:hover {
  background-color: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.25);
}

.admin-domain-select option {
  background: #1e293b;
  color: #f8fafc;
}

/* Maintenance badge improvements */
.admin-maintenance-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
}

.admin-maintenance-on {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.admin-maintenance-off {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.admin-card-subtitle {
  color: #64748b;
  font-size: 0.875rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

/* ==========================================================================
   19. DOMAIN SWITCHER COLOR DOT + ACCENT + ALL-DOMAINS PILL
   ========================================================================== */

/* Domain dot next to the select */
.admin-domain-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.admin-domain-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.3);
}

.admin-domain-dot-all {
  background: conic-gradient(#2563eb 0deg 120deg, #16a34a 120deg 240deg, #dc2626 240deg 360deg);
  border-color: rgba(255,255,255,0.2);
}

/* Accent bar at top of content to visually confirm active domain */
.admin-content {
  border-top: 3px solid var(--admin-accent, transparent);
  transition: border-color 0.25s;
}

/* Domain color pill in all-domains product table */
.admin-domain-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
}

/* ==========================================================================
   20. QUILL EDITOR OVERRIDES
   ========================================================================== */

.quill-container {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  margin-top: 0.25rem;
}

.quill-container .ql-toolbar.ql-snow {
  border: none;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
}

.quill-container .ql-container.ql-snow {
  border: none;
  font-family: inherit;
  font-size: 0.9375rem;
  color: #1e293b;
}

.quill-container .ql-editor {
  min-height: 180px;
  line-height: 1.65;
  padding: 0.875rem 1rem;
}

.quill-container .ql-editor.ql-blank::before {
  color: #94a3b8;
  font-style: normal;
}

.quill-container .ql-editor h2,
.quill-container .ql-editor h3 {
  color: #1e293b;
  font-weight: 700;
  margin: 1rem 0 0.5rem;
}

.quill-container .ql-editor p {
  margin: 0 0 0.75rem;
}

.quill-container .ql-editor a {
  color: #2563eb;
}

.quill-container .ql-editor ul,
.quill-container .ql-editor ol {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

/* Fix: focus ring when editing */
.quill-container:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ==========================================================================
   21. MAINTENANCE LAYOUT — equal-height grid cards
   ========================================================================== */

.admin-card-full {
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.admin-card-full .admin-form-actions {
  margin-top: auto;
  padding-top: 1rem;
}
