/**
 * Petals Suites & Hotel — CMS Admin Dashboard Stylesheet
 * Atelier Editorial Aesthetic: Warm Espresso Obsidian, Brushed Champagne Gold & Smoked Taupe
 */

:root {
  /* Warm Atelier Palette */
  --bg-canvas: #110f0d;
  --bg-surface: #181512;
  --bg-panel: #1f1b17;
  --bg-hover: #26211c;
  --bg-active: #2e2823;

  --border-hairline: rgba(197, 168, 128, 0.16);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-focus: rgba(197, 168, 128, 0.45);

  --accent-gold: #c5a880;
  --accent-gold-hover: #d6be9c;
  --accent-gold-dim: rgba(197, 168, 128, 0.10);
  --accent-gold-glow: rgba(197, 168, 128, 0.20);

  /* Quiet Luxury Typographic Scale */
  --text-primary: #f8f6f2;
  --text-secondary: #a8a096;
  --text-muted: #6b645c;

  /* Restrained Status Hues */
  --status-live: #68b984;
  --status-live-dim: rgba(104, 185, 132, 0.12);
  --status-draft: #d4a373;
  --status-draft-dim: rgba(212, 163, 115, 0.12);
  --status-danger: #e06d53;
  --status-danger-dim: rgba(224, 109, 83, 0.12);

  --font-serif: 'Marcellus', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', Menlo, Consolas, Monaco, monospace;

  --sidebar-width: 250px;
  --topbar-height: 60px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body.cms-body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

/* ==========================================================================
   1. LOGIN OVERLAY & CARD (Atelier Centered Luxury)
   ========================================================================== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #201a14 0%, #0d0b09 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 410px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 40px 36px 34px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 1px rgba(197, 168, 128, 0.3);
  animation: fadeInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-logo-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(197, 168, 128, 0.35);
  padding: 3px;
  background: #14110e;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.login-logo-img {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
  display: block;
}

.login-brand-title {
  font-family: var(--font-serif);
  letter-spacing: 3.5px;
  font-size: 22px;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
  text-align: center;
}

.login-brand-tag {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent-gold);
  font-weight: 600;
  text-transform: uppercase;
  display: block;
  margin-top: 5px;
  line-height: 1;
  text-align: center;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 10px;
  line-height: 1.45;
  text-align: center;
  max-width: 290px;
}

.login-form {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.login-form .form-group {
  margin-bottom: 16px;
}

.label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.label-with-icon i {
  color: var(--accent-gold);
  font-size: 11px;
  width: 13px;
  text-align: center;
}

.password-input-wrap {
  position: relative;
  width: 100%;
}

.password-input-wrap .form-input {
  padding-right: 42px;
}

.pwd-toggle-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: var(--transition);
}

.pwd-toggle-btn:hover {
  color: var(--accent-gold);
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 4px 0 20px;
}

.remember-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  color: var(--text-secondary);
}

.remember-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent-gold);
  cursor: pointer;
}

.login-error {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--status-danger-dim);
  border: 1px solid rgba(224, 109, 83, 0.3);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
}

.login-footer-hint {
  margin-top: 24px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  letter-spacing: 0.3px;
  line-height: 1;
}

.login-footer-hint i {
  color: var(--accent-gold);
  font-size: 11px;
}

/* ==========================================================================
   2. MAIN APPLICATION LAYOUT & SIDEBAR
   ========================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  transition: transform var(--transition);
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  border: 1px solid var(--border-hairline);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 2px;
  font-weight: 500;
  color: var(--text-primary);
}

.brand-badge {
  font-size: 9.5px;
  color: var(--accent-gold);
  letter-spacing: 1px;
  font-weight: 600;
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 10px;
}

.nav-section-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 1.6px;
  color: var(--text-muted);
  padding: 16px 12px 6px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: var(--transition);
}

.nav-item i {
  font-size: 14px;
  width: 18px;
  text-align: center;
  color: var(--text-muted);
  transition: var(--transition);
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item:hover i {
  color: var(--accent-gold);
}

.nav-item.active {
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
  font-weight: 600;
}

.nav-item.active i {
  color: var(--accent-gold);
}

.nav-counter {
  margin-left: auto;
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 1px 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-panel);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
}

.user-avatar {
  width: 30px;
  height: 30px;
  background: var(--accent-gold);
  color: #0d0b0a;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.user-meta {
  flex: 1;
  overflow: hidden;
}

.user-meta strong {
  display: block;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.user-meta span {
  display: block;
  font-size: 10.5px;
  color: var(--accent-gold);
  text-transform: capitalize;
}

.logout-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.logout-icon-btn:hover {
  color: var(--status-danger);
  background: var(--status-danger-dim);
}

/* ==========================================================================
   3. TOPBAR & SHELL
   ========================================================================== */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline);
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.crumb-root {
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.crumb-sep {
  font-size: 9px;
  color: var(--text-muted);
}

.crumb-current {
  color: var(--text-primary);
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content-body {
  flex: 1;
  padding: 30px 32px 48px;
  max-width: 1380px;
  width: 100%;
}

.cms-view {
  display: none;
  animation: fadeIn 0.22s ease;
}

.cms-view.active {
  display: block;
}

/* View Headers & Subtitles */
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.view-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.01em;
}

.view-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 6px 0 0 0;
  line-height: 1.45;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Spacing & Layout Utilities */
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; }
.py-4 { padding-top: 24px !important; padding-bottom: 24px !important; }

.text-muted { color: var(--text-muted) !important; }
.btn-text { line-height: 1; }
.status-text { line-height: 1; font-weight: 500; }
.file-select-label { cursor: pointer; user-select: none; margin: 0; }
.external-link i { font-size: 11px !important; }
.admin-only-section { /* Toggled dynamically by admin.js based on role */ }
.topbar-preview-site { /* Live site button */ }

/* Editor Main & Side Columns */
.editor-main-col {
  min-width: 0;
}

.editor-side-col {
  min-width: 0;
}

.editor-label-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.editor-label-bar .form-label {
  margin-bottom: 0;
}

.editor-stats {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  line-height: 1;
}

.form-input-lg {
  height: 48px !important;
  font-size: 16px !important;
  padding: 0 16px !important;
}

.form-input-sm {
  height: 34px !important;
  font-size: 12px !important;
  padding: 0 10px !important;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Reader Simulation Hero */
.sim-hero {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 20px;
}

.sim-topic {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-gold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 8px;
}

/* ==========================================================================
   4. BUTTONS & ACTIONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  height: 38px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.2px;
  box-sizing: border-box;
  vertical-align: middle;
}

.btn i {
  font-size: 0.9em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:active {
  transform: scale(0.985);
}

.btn-primary {
  background: var(--accent-gold);
  color: #12100e;
  border-color: var(--accent-gold);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-gold-hover);
  border-color: var(--accent-gold-hover);
  box-shadow: 0 4px 16px var(--accent-gold-glow);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-active);
  border-color: var(--border-hairline);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-hairline);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: var(--accent-gold-dim);
}

.btn-gold {
  background: var(--accent-gold);
  color: #12100e;
  font-weight: 600;
}

.btn-gold:hover {
  background: var(--accent-gold-hover);
}

.btn-danger {
  background: var(--status-danger-dim);
  border-color: rgba(224, 109, 83, 0.3);
  color: #fca5a5;
}

.btn-danger:hover {
  background: var(--status-danger);
  border-color: var(--status-danger);
  color: #fff;
}

.btn-outline.btn-danger,
.btn-danger-outline {
  background: transparent;
  border-color: rgba(224, 109, 83, 0.4);
  color: #f87171;
}

.btn-outline.btn-danger:hover,
.btn-danger-outline:hover {
  background: var(--status-danger);
  border-color: var(--status-danger);
  color: #ffffff;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  gap: 6px;
}

.btn-xs {
  height: 26px;
  padding: 0 9px;
  font-size: 11px;
  border-radius: var(--radius-xs);
  gap: 5px;
}

.btn-block {
  width: 100%;
}

.btn-link-sm {
  background: transparent;
  border: none;
  color: var(--accent-gold);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 0 4px;
}

.btn-link-sm:hover {
  text-decoration: underline;
}

/* ==========================================================================
   5. EDITORIAL MASTHEAD & TABULAR STAT RIBBON (Replacing 6-pack cards)
   ========================================================================== */
.editorial-masthead {
  background: linear-gradient(135deg, #1b1713 0%, #14120f 100%);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 26px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.editorial-masthead::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: radial-gradient(circle at 100% 50%, rgba(197, 168, 128, 0.08), transparent 70%);
  pointer-events: none;
}

.masthead-info h1 {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--text-primary);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.masthead-info p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
}

/* Horizontal Tabular Metrics Ribbon */
.metrics-ribbon {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-bottom: 28px;
  overflow: hidden;
}

.ribbon-cell {
  padding: 18px 20px 16px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 96px;
  box-sizing: border-box;
  transition: var(--transition);
}

.ribbon-cell:last-child {
  border-right: none;
}

.ribbon-cell:hover {
  background: var(--bg-hover);
}

.ribbon-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
  display: block;
}

.ribbon-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  margin: 0 0 8px 0;
  display: flex;
  align-items: baseline;
}

.ribbon-sub {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 14px;
  white-space: nowrap;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--status-live);
  font-weight: 500;
  line-height: 1;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-live);
  box-shadow: 0 0 6px rgba(104, 185, 132, 0.6);
  display: inline-block;
  flex-shrink: 0;
}

/* Dashboard Asymmetric Split */
.dashboard-ledger-split {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 24px;
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.panel-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.2px;
}

.panel-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.panel-body {
  padding: 22px;
}

.p-0 {
  padding: 0 !important;
}

/* Editorial Launchpad Cards */
.launchpad-card {
  padding: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.launchpad-card:last-child {
  margin-bottom: 0;
}

.launchpad-card-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.launchpad-card-title i {
  color: var(--accent-gold);
}

.quick-draft-box {
  display: flex;
  gap: 8px;
}

.quick-draft-box input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xs);
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
}

.quick-draft-box input:focus {
  border-color: var(--accent-gold);
}

/* ==========================================================================
   6. TABLES & LISTINGS
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.cms-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.cms-table th {
  background: var(--bg-panel);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-hairline);
  line-height: 1;
  vertical-align: middle;
}

.cms-table td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
  line-height: 1.35;
}

.cms-table tbody tr {
  transition: var(--transition);
}

.cms-table tbody tr:hover td {
  background: rgba(197, 168, 128, 0.03);
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.table-media-thumb {
  width: 48px;
  height: 34px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  display: block;
}

.table-title-cell strong {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 3px 0;
  line-height: 1.3;
}

.table-title-cell span {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: block;
  line-height: 1.2;
}

/* Quiet Luxury Status Indicators (No candy pills) */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  line-height: 1;
  vertical-align: middle;
}

.status-indicator.published {
  color: var(--status-live);
}

.status-indicator.draft {
  color: var(--status-draft);
}

.status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  flex-shrink: 0;
}

.cat-token {
  font-size: 11.5px;
  color: var(--text-secondary);
  background: var(--bg-panel);
  padding: 4px 9px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.table-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  line-height: 1;
}

.table-actions .btn {
  font-size: 11.5px;
}

/* Filter Toolbar */
.toolbar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-panel);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  height: 40px;
  box-sizing: border-box;
  align-items: center;
}

.status-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0 12px;
  height: 32px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

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

.status-tab.active {
  background: var(--bg-hover);
  color: var(--accent-gold);
  font-weight: 600;
}

.tab-count {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 1px 5px;
  background: var(--bg-surface);
  border-radius: 6px;
  line-height: 1;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 480px;
  margin-left: auto;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  height: 40px;
}

.search-input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
  pointer-events: none;
}

.search-input-wrap input {
  width: 100%;
  height: 40px;
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 0 30px 0 32px;
  font-size: 12.5px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  box-sizing: border-box;
}

.search-input-wrap input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px var(--accent-gold-dim);
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
}

/* ==========================================================================
   7. THE ARTICLE STUDIO (Editor View)
   ========================================================================== */
.editor-header {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  position: sticky;
  top: var(--topbar-height);
  z-index: 850;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.editor-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.editor-status-pill,
.editor-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--status-draft);
  line-height: 1;
  background: var(--bg-panel);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.editor-status-pill.published,
.editor-status-indicator.published {
  color: var(--status-live);
}

.editor-status-pill .status-dot,
.editor-status-indicator .status-dot,
.status-dot-sm {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  flex-shrink: 0;
}

.editor-save-state {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1;
}

.editor-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-layout {
  display: grid;
  grid-template-columns: 2.3fr 1fr;
  gap: 24px;
}

.editor-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 28px;
}

.editor-title-input {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.3;
  padding: 10px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  width: 100%;
  box-sizing: border-box;
}

.editor-title-input:focus {
  border-color: var(--accent-gold);
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  line-height: 1.2;
  letter-spacing: 0.3px;
}

.req {
  color: var(--status-danger);
}

.form-input, .form-select {
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 0 13px;
  height: 40px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  width: 100%;
  box-sizing: border-box;
}

.form-textarea {
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  width: 100%;
  box-sizing: border-box;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px var(--accent-gold-dim);
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.35;
}

.char-counter {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  line-height: 1;
}

.char-counter.warning { color: var(--status-draft); }
.char-counter.danger { color: var(--status-danger); }

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.slug-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 40px;
  box-sizing: border-box;
}

.slug-prefix {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding-left: 12px;
  white-space: nowrap;
  line-height: 1;
}

.slug-input-wrap .slug-input,
.slug-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0 12px;
  height: 100%;
  font-size: 12px;
  font-family: var(--font-mono);
  outline: none;
  color: var(--accent-gold);
  line-height: 1;
  box-sizing: border-box;
}

/* WYSIWYG Editor */
.wysiwyg-toolbar {
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 6px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.btn-group {
  display: flex;
  gap: 2px;
  background: var(--bg-surface);
  padding: 2px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.t-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 28px;
  height: 26px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  transition: var(--transition);
}

.t-btn:hover {
  background: var(--bg-hover);
  color: var(--accent-gold);
}

.t-btn.active {
  background: var(--accent-gold);
  color: #12100e;
}

.wysiwyg-content {
  min-height: 460px;
  max-height: 850px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 28px;
  color: var(--text-primary);
  font-size: 15.5px;
  line-height: 1.8;
  outline: none;
}

.wysiwyg-content:focus {
  border-color: var(--accent-gold);
}

.wysiwyg-content h2 {
  font-family: var(--font-serif);
  font-size: 23px;
  color: var(--accent-gold);
  margin: 28px 0 12px;
  line-height: 1.35;
}

.wysiwyg-content h3 {
  font-size: 18px;
  color: var(--text-primary);
  margin: 22px 0 10px;
  line-height: 1.4;
}

.wysiwyg-content p {
  margin-bottom: 16px;
}

.wysiwyg-content ul, .wysiwyg-content ol {
  margin: 12px 0 18px 22px;
}

.wysiwyg-content li {
  margin-bottom: 6px;
}

.wysiwyg-content blockquote {
  border-left: 2px solid var(--accent-gold);
  padding: 12px 20px;
  background: var(--accent-gold-dim);
  font-style: italic;
  margin: 22px 0;
  border-radius: 0 6px 6px 0;
}

.wysiwyg-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 18px 0;
  border: 1px solid var(--border-subtle);
}

.wysiwyg-content a {
  color: var(--accent-gold);
  text-decoration: underline;
}

.raw-html-textarea {
  min-height: 460px;
  width: 100%;
  background: #090807;
  color: #d6be9c;
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 22px;
  border: 1px solid var(--border-hairline);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  outline: none;
  resize: vertical;
}

/* Featured Image Dropzone */
.featured-image-box {
  background: var(--bg-panel);
  border: 1px dashed var(--border-hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-align: center;
  position: relative;
}

.img-preview-container {
  position: relative;
  max-height: 220px;
  overflow: hidden;
}

.img-preview-container img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.remove-img-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid var(--status-danger);
  color: #fca5a5;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.remove-img-btn:hover {
  background: var(--status-danger);
  color: #fff;
}

.upload-dropzone {
  padding: 24px 16px;
}

.drop-icon {
  font-size: 28px;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.drop-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.drop-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.drop-hint {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Tags Chips */
.tags-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  min-height: 40px;
}

.tag-chip {
  background: var(--accent-gold-dim);
  border: 1px solid var(--border-hairline);
  color: var(--accent-gold);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tag-chip-remove {
  cursor: pointer;
  font-size: 9px;
}

.tags-input-container input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 12px;
  flex: 1;
  min-width: 100px;
}

/* Google SERP Preview */
.serp-preview-box {
  background: #191614;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.serp-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.serp-header i {
  color: #ea4335;
}

.serp-card {
  font-family: Arial, sans-serif;
}

.serp-cite {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #bdc1c6;
  margin-bottom: 3px;
}

.serp-favicon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.serp-title {
  color: #8ab4f8;
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.serp-desc {
  font-size: 12px;
  color: #bdc1c6;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   8. MEDIA VAULT & CATEGORY VIEWS
   ========================================================================== */
.media-dropzone {
  background: var(--bg-surface);
  border: 2px dashed var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 38px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.media-dropzone:hover, .media-dropzone.dragover {
  border-color: var(--accent-gold);
  background: var(--accent-gold-dim);
}

.dropzone-big-icon {
  font-size: 38px;
  color: var(--accent-gold);
  margin-bottom: 10px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.media-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  transition: var(--transition);
}

.media-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-gold);
}

.media-thumb-wrap {
  height: 120px;
  overflow: hidden;
  background: #090807;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-card-info {
  padding: 10px;
}

.media-card-name {
  font-size: 11.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.media-card-meta {
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

.media-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

/* Category Manager Grid */
.category-manager-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 22px;
}

/* Profile Grid */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 44px 20px;
}

.empty-icon {
  font-size: 36px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 12.5px;
  color: var(--text-secondary);
  max-width: 380px;
  margin: 0 auto;
}

/* ==========================================================================
   9. MODALS & PREVIEWS
   ========================================================================== */
.cms-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cms-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeInDown 0.22s ease;
}

.modal-sm { width: 100%; max-width: 420px; }
.modal-md { width: 100%; max-width: 650px; }
.preview-modal-card { width: 100%; max-width: 900px; height: 90vh; }

/* Draft Limit Prompt Modal */
.draft-limit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.draft-limit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: var(--transition);
}

.draft-limit-item:hover {
  border-color: var(--accent-gold);
}

.draft-limit-item-info {
  flex: 1;
  min-width: 0;
}

.draft-limit-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.3;
}

.draft-limit-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 3px;
  display: block;
  line-height: 1.2;
}

.draft-limit-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

/* Preview Modal Specifics */
.preview-modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel);
}

.preview-brand-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent-gold);
}

.modal-brand-icon {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-hairline);
}

.preview-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-pill {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background: var(--status-draft-dim);
  color: var(--status-draft);
  font-weight: 500;
}

.preview-modal-scrollable {
  flex: 1;
  overflow-y: auto;
  background: #110f0d;
  padding: 40px 32px;
}

.reader-simulation-wrap {
  max-width: 740px;
  margin: 0 auto;
}

.sim-topic {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--accent-gold);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: inline-block;
}

.sim-title {
  font-family: var(--font-serif);
  font-size: 30px;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 12px;
}

.sim-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sim-banner-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 26px;
}

.sim-banner-img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  display: block;
}

.sim-body {
  font-size: 15.5px;
  line-height: 1.8;
  color: #eae5de;
}

.sim-body h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--accent-gold);
  margin: 26px 0 12px;
}

.sim-body p {
  margin-bottom: 16px;
}

.sim-body ul, .sim-body ol {
  margin: 12px 0 18px 22px;
}

.sim-tags-wrap {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sim-tag-item {
  font-size: 11px;
  color: var(--accent-gold);
  background: var(--accent-gold-dim);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
}

/* Media Picker Modal */
.media-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.media-picker-item {
  height: 95px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  cursor: pointer;
  transition: var(--transition);
}

.media-picker-item:hover {
  border-color: var(--accent-gold);
  transform: scale(1.02);
}

.media-picker-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   10. TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  color: var(--text-primary);
  font-size: 12.5px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  pointer-events: auto;
  animation: slideInUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success {
  border-left: 3px solid var(--status-live);
}

.toast.error {
  border-left: 3px solid var(--status-danger);
}

.toast.info {
  border-left: 3px solid var(--accent-gold);
}

.toast-icon {
  font-size: 14px;
}

.toast.success .toast-icon { color: var(--status-live); }
.toast.error .toast-icon { color: var(--status-danger); }
.toast.info .toast-icon { color: var(--accent-gold); }

/* Keyframe Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   11. RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1120px) {
  .metrics-ribbon {
    grid-template-columns: repeat(3, 1fr);
  }
  .ribbon-cell:nth-child(3) {
    border-right: none;
  }
}

@media (max-width: 1024px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
  .dashboard-ledger-split {
    grid-template-columns: 1fr;
  }
  .category-manager-grid, .profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close-btn {
    display: block;
  }
  .main-wrapper {
    margin-left: 0;
  }
  .mobile-toggle {
    display: block;
  }
  .topbar {
    padding: 0 16px;
  }
  .content-body {
    padding: 18px 16px;
  }
  .metrics-ribbon {
    grid-template-columns: repeat(2, 1fr);
  }
  .ribbon-cell:nth-child(2) {
    border-right: none;
  }
  .form-row-2 {
    grid-template-columns: 1fr;
  }
  .editor-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .editor-header-actions {
    justify-content: flex-end;
  }
  .toolbar-card {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-filters {
    margin-left: 0;
    max-width: 100%;
  }
}

/* ==========================================================================
   DEVELOPER E2E TEST SUITE STYLES
   ========================================================================== */
.e2e-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.e2e-step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: var(--transition);
  position: relative;
}

.e2e-step-card.status-passed {
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.04);
}

.e2e-step-card.status-failed {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.06);
}

.e2e-step-card.status-running {
  border-color: rgba(212, 163, 115, 0.5);
  background: rgba(212, 163, 115, 0.05);
  box-shadow: 0 0 12px rgba(212, 163, 115, 0.15);
}

.e2e-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.e2e-step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.e2e-step-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

.e2e-assertion-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  font-size: 11.5px;
}

.e2e-assertion-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.35;
}

.e2e-assertion-item.passed i {
  color: #4ade80;
}

.e2e-assertion-item.failed i {
  color: var(--status-danger);
}

.e2e-terminal-container {
  background: #0c0a09;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
  font-size: 11.5px;
  overflow: hidden;
}

.e2e-terminal-header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-hairline);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 11px;
}

.e2e-terminal-body {
  padding: 12px 14px;
  max-height: 280px;
  overflow-y: auto;
  line-height: 1.6;
}

.e2e-log-line {
  display: flex;
  gap: 10px;
  margin-bottom: 2px;
  word-break: break-word;
}

.e2e-log-time {
  color: #78716c;
  flex-shrink: 0;
  font-size: 10.5px;
}

.e2e-log-tag {
  font-weight: 700;
  font-size: 10px;
  padding: 0 4px;
  border-radius: 2px;
  flex-shrink: 0;
  line-height: 1.4;
}

.e2e-log-tag.info {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.e2e-log-tag.pass {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.e2e-log-tag.fail {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.e2e-log-tag.warn {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.e2e-log-msg {
  color: #e7e5e4;
  flex: 1;
}

/* Editorial Activity Log Badges */
.badge-act-create {
  background: rgba(212, 163, 115, 0.16);
  color: var(--accent-gold);
  border: 1px solid rgba(212, 163, 115, 0.35);
}
.badge-act-publish {
  background: rgba(74, 222, 128, 0.16);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.35);
}
.badge-act-update {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.badge-act-unpublish {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-act-delete {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge-act-duplicate {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
