/* =============================================================================
   Rajyo Darpan Master Panel — Design System
   Vanilla CSS, no frameworks
   ============================================================================= */

/* ── Custom Properties ──────────────────────────────────────────────────── */
:root {
  /* Brand */
  --brand-primary: #4f46e5;
  --brand-primary-dark: #3730a3;
  --brand-primary-light: #818cf8;
  --brand-accent: #06b6d4;
  --brand-danger: #ef4444;
  --brand-warning: #f59e0b;
  --brand-success: #10b981;

  /* Panel surfaces */
  --panel-bg: #0f0f1a;
  --sidebar-bg: #13131f;
  --sidebar-border: rgba(255,255,255,0.07);
  --card-bg: #1a1a2e;
  --card-border: rgba(255,255,255,0.08);
  --card-bg-hover: #1e1e35;
  --input-bg: #0f0f1a;
  --input-border: rgba(255,255,255,0.12);
  --input-border-focus: var(--brand-primary);

  /* Text */
  --text-primary: #f1f1f3;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-accent: var(--brand-primary-light);

  /* Layout */
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 64px;
  --topbar-height: 60px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --glow-primary: 0 0 20px rgba(79,70,229,0.25);
}

/* ── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Inter', 'Hind Siliguri', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--panel-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.bg-panel-bg { background-color: var(--panel-bg); }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--transition-slow);
  overflow: hidden;
}

.sidebar--collapsed { width: var(--sidebar-collapsed-width); }

.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  min-height: 70px;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.sidebar__logo-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.5px;
  box-shadow: var(--glow-primary);
}

.sidebar__logo-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  font-family: 'Hind Siliguri', sans-serif;
}

.sidebar__toggle {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background var(--transition), color var(--transition);
}

.sidebar__toggle:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

.sidebar__nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.sidebar__nav::-webkit-scrollbar { display: none; }

.nav-group {
  padding: 12px 8px 4px;
  overflow: hidden;
}

.nav-group__label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
  width: 100%;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 2px;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-item--active {
  background: rgba(79,70,229,0.2);
  color: var(--brand-primary-light);
}

.nav-item__icon {
  font-size: 16px;
  min-width: 20px;
  text-align: center;
  opacity: 0.8;
}

.nav-item__label {
  font-size: 13.5px;
  font-family: 'Hind Siliguri', sans-serif;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item--logout { color: var(--text-muted); }
.nav-item--logout:hover { color: var(--brand-danger); background: rgba(239,68,68,0.1); }

.sidebar__footer {
  padding: 12px 8px;
  border-top: 1px solid var(--sidebar-border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.user-card__avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
}

.user-card__info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-card__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card__role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Main Content Area ───────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-slow);
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Hind Siliguri', sans-serif;
}

.topbar__left { display: flex; align-items: center; gap: 16px; }
.topbar__right { display: flex; align-items: center; gap: 12px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot--online { background: var(--brand-success); box-shadow: 0 0 8px rgba(16,185,129,0.5); }

/* ── Page Content ────────────────────────────────────────────────────────── */
.page-content { flex: 1; padding: 24px; }

/* ── Alert / Flash Messages ─────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 13.5px;
  position: relative;
  animation: slideDown 0.3s ease;
}

.alert--success { background: rgba(16,185,129,0.15); color: #6ee7b7; border-bottom: 1px solid rgba(16,185,129,0.2); }
.alert--error { background: rgba(239,68,68,0.15); color: #fca5a5; border-bottom: 1px solid rgba(239,68,68,0.2); }
.alert--warning { background: rgba(245,158,11,0.15); color: #fcd34d; border-bottom: 1px solid rgba(245,158,11,0.2); }
.alert__close { margin-left: auto; opacity: 0.6; font-size: 18px; padding: 0 4px; }
.alert__close:hover { opacity: 1; }

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

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Hind Siliguri', sans-serif;
}

.card-body { padding: 20px; }

/* ── Stat Cards ─────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}

.stat-card:hover {
  border-color: rgba(79,70,229,0.3);
  transform: translateY(-1px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  opacity: 0;
  transition: opacity var(--transition);
}

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

.stat-card__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  font-family: 'Hind Siliguri', sans-serif;
}

.stat-card__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card__sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-card__icon {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 24px;
  opacity: 0.15;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
}
.btn--primary:hover { background: var(--brand-primary-dark); }

.btn--secondary {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
  border-color: var(--card-border);
}
.btn--secondary:hover { background: rgba(255,255,255,0.12); }

.btn--danger { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.3); }
.btn--danger:hover { background: rgba(239,68,68,0.25); }

.btn--success { background: rgba(16,185,129,0.15); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
.btn--success:hover { background: rgba(16,185,129,0.25); }

.btn--sm { padding: 5px 10px; font-size: 12px; }
.btn--lg { padding: 12px 24px; font-size: 15px; }
.btn--icon { padding: 7px; min-width: 34px; justify-content: center; }

.btn:disabled, .btn[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn--ai {
  background: linear-gradient(135deg, rgba(79,70,229,0.3), rgba(6,182,212,0.2));
  color: var(--brand-primary-light);
  border-color: rgba(79,70,229,0.4);
}

.btn--ai:hover {
  background: linear-gradient(135deg, rgba(79,70,229,0.45), rgba(6,182,212,0.35));
  box-shadow: var(--glow-primary);
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
}

thead { background: rgba(255,255,255,0.03); }

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13.5px;
  color: var(--text-secondary);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.025); }

.td-title {
  color: var(--text-primary);
  font-weight: 500;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'Hind Siliguri', sans-serif;
}

/* ── Status Badges ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge--draft { background: rgba(156,163,175,0.15); color: #9ca3af; }
.badge--review { background: rgba(245,158,11,0.15); color: #fcd34d; }
.badge--ready { background: rgba(6,182,212,0.15); color: #67e8f9; }
.badge--publishing { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.badge--published { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.badge--archived { background: rgba(107,114,128,0.15); color: #6b7280; }
.badge--failed { background: rgba(239,68,68,0.15); color: #fca5a5; }
.badge--completed { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.badge--breaking { background: rgba(239,68,68,0.2); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }

/* ── Form Elements ───────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Hind Siliguri', sans-serif;
}

.form-label span.required { color: var(--brand-danger); margin-left: 3px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Hind Siliguri', 'Inter', sans-serif;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

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

.form-error {
  color: #fca5a5;
  font-size: 12px;
  margin-top: 4px;
}

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

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select option { background: #1a1a2e; }

/* ── Toggle / Checkbox ───────────────────────────────────────────────────── */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
  transition: background var(--transition);
  flex-shrink: 0;
}

.toggle input { display: none; }

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}

.toggle input:checked ~ span { background: var(--brand-primary); }
input:checked + .toggle::after { transform: translateX(18px); }

/* Custom checkbox toggle */
.form-checkbox-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-checkbox-toggle input[type="checkbox"] {
  width: 40px;
  height: 22px;
  appearance: none;
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
  cursor: pointer;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}

.form-checkbox-toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}

.form-checkbox-toggle input[type="checkbox"]:checked {
  background: var(--brand-primary);
}

.form-checkbox-toggle input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  border-top: 1px solid var(--card-border);
}

.pagination a, .pagination span {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: all var(--transition);
}

.pagination a:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
  text-decoration: none;
}

.pagination .active span {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
}

/* ── Auth Page ───────────────────────────────────────────────────────────── */
.auth-body {
  background: var(--panel-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background-image:
    radial-gradient(ellipse at 10% 20%, rgba(79,70,229,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(6,182,212,0.1) 0%, transparent 50%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.auth-card__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.auth-card__logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  box-shadow: var(--glow-primary);
}

.auth-card__brand {
  display: flex;
  flex-direction: column;
}

.auth-card__brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Hind Siliguri', sans-serif;
}

.auth-card__brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-card__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-family: 'Hind Siliguri', sans-serif;
}

.auth-card__sub { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }

/* ── Article Editor ───────────────────────────────────────────────────────── */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

.editor-main { display: flex; flex-direction: column; gap: 20px; }
.editor-sidebar { display: flex; flex-direction: column; gap: 16px; }

.editor-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.editor-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--card-border);
  background: rgba(255,255,255,0.02);
}

.editor-section__title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.editor-section__body { padding: 16px; }

/* ── Platform Selector ───────────────────────────────────────────────────── */
.platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.platform-card {
  position: relative;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition);
  background: rgba(255,255,255,0.02);
}

.platform-card:hover { border-color: rgba(79,70,229,0.4); background: rgba(79,70,229,0.05); }
.platform-card--selected { border-color: var(--brand-primary); background: rgba(79,70,229,0.1); }
.platform-card--disabled { opacity: 0.4; cursor: not-allowed; }

.platform-card input[type="checkbox"] {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 16px;
  height: 16px;
  accent-color: var(--brand-primary);
}

.platform-card__name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  font-family: 'Hind Siliguri', sans-serif;
}

.platform-card__status {
  font-size: 10px;
  color: var(--text-muted);
}

.platform-card__icon { font-size: 22px; margin-bottom: 6px; }

/* ── AI Panel ────────────────────────────────────────────────────────────── */
.ai-panel {
  background: linear-gradient(135deg, rgba(79,70,229,0.08), rgba(6,182,212,0.05));
  border: 1px solid rgba(79,70,229,0.2);
  border-radius: var(--radius);
  padding: 16px;
}

.ai-panel__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-panel__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-primary-light);
}

.ai-panel__badge {
  font-size: 10px;
  background: rgba(79,70,229,0.2);
  color: var(--brand-primary-light);
  padding: 2px 7px;
  border-radius: 100px;
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.ai-loading__dot {
  width: 6px; height: 6px;
  background: var(--brand-primary-light);
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}

.ai-loading__dot:nth-child(2) { animation-delay: 0.2s; }
.ai-loading__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* ── Search Bar ──────────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.search-input-wrap__icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  padding-left: 34px;
}

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Hind Siliguri', sans-serif;
}

.page-header__sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state__icon { font-size: 40px; margin-bottom: 16px; opacity: 0.4; }
.empty-state__title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; font-family: 'Hind Siliguri', sans-serif; }
.empty-state__sub { font-size: 13px; margin-bottom: 20px; }

/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal__title { font-size: 16px; font-weight: 600; color: var(--text-primary); font-family: 'Hind Siliguri', sans-serif; }
.modal__close { color: var(--text-muted); font-size: 20px; padding: 2px 6px; }
.modal__close:hover { color: var(--text-primary); }
.modal__body { padding: 22px; }
.modal__footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--card-border); }

/* ── Dashboard Charts placeholder ───────────────────────────────────────── */
.chart-placeholder {
  height: 200px;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 20px,
    rgba(255,255,255,0.03) 20px,
    rgba(255,255,255,0.03) 21px
  ),
  repeating-linear-gradient(
    0deg,
    transparent,
    transparent 20px,
    rgba(255,255,255,0.03) 20px,
    rgba(255,255,255,0.03) 21px
  );
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* ── Tag Input ───────────────────────────────────────────────────────────── */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(79,70,229,0.15);
  color: var(--brand-primary-light);
  border: 1px solid rgba(79,70,229,0.3);
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
}

.tag__remove {
  cursor: pointer;
  opacity: 0.6;
  font-size: 14px;
  line-height: 1;
}
.tag__remove:hover { opacity: 1; }

/* ── Char Counter ────────────────────────────────────────────────────────── */
.char-counter {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 3px;
}

.char-counter--warn { color: var(--brand-warning); }
.char-counter--danger { color: var(--brand-danger); }

/* ── Publish Status Row ──────────────────────────────────────────────────── */
.publish-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--card-border);
  gap: 10px;
}

.publish-row + .publish-row { margin-top: 8px; }

.publish-row__platform { display: flex; align-items: center; gap: 8px; }
.publish-row__name { font-size: 13px; font-weight: 500; color: var(--text-primary); font-family: 'Hind Siliguri', sans-serif; }
.publish-row__actions { display: flex; gap: 6px; }

/* ── Utility ─────────────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.text-success { color: var(--brand-success); }
.text-danger { color: var(--brand-danger); }
.text-accent { color: var(--brand-primary-light); }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.w-full { width: 100%; }
.hidden { display: none; }
.divider { height: 1px; background: var(--card-border); margin: 16px 0; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .editor-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { width: var(--sidebar-collapsed-width); }
  .main-content { margin-left: var(--sidebar-collapsed-width); }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .platform-grid { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
}
