/* ================================================================
   NewsCMS Admin UI — Light Moderne (Stripe/Notion/Linear style)
   Complete rewrite
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── TOKENS ─────────────────────────────────────────────────── */
:root {
  /* Brand */
  --red:        #e63946;
  --red-light:  #fff0f1;
  --red-dark:   #c1121f;
  --orange:     #ff6b35;
  --blue:       #3b82f6;
  --blue-light: #eff6ff;
  --green:      #10b981;
  --green-light:#ecfdf5;
  --yellow:     #f59e0b;
  --purple:     #8b5cf6;

  /* Neutrals */
  --gray-50:  #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Sidebar */
  --sidebar-w:  248px;
  --sidebar-bg: #ffffff;
  --sidebar-border: var(--gray-200);

  /* Surface */
  --bg:         var(--gray-50);
  --surface:    #ffffff;
  --border:     var(--gray-200);
  --border-focus: var(--red);

  /* Text */
  --text:       var(--gray-900);
  --text-2:     var(--gray-600);
  --text-3:     var(--gray-400);

  /* Misc */
  --topbar-h:   58px;
  --radius:     10px;
  --radius-lg:  14px;
  --radius-full: 999px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-md:  0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
  --shadow-lg:  0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);
  --font:       'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: .18s cubic-bezier(.4,0,.2,1);
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); }
img { max-width: 100%; }
button { font-family: var(--font); }

/* ── LAYOUT ─────────────────────────────────────────────────── */
#cms-wrap { display: flex; min-height: 100vh; }
#cms-main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; transition: margin var(--transition); }
#cms-wrap.sidebar-collapsed #cms-main { margin-left: 60px; }

/* ── SIDEBAR ─────────────────────────────────────────────────── */
#cms-sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: width var(--transition);
  overflow: hidden;
}
#cms-wrap.sidebar-collapsed #cms-sidebar { width: 60px; }
#cms-wrap.sidebar-collapsed .sidebar-logo-text,
#cms-wrap.sidebar-collapsed .nav-label,
#cms-wrap.sidebar-collapsed .nav-section-label,
#cms-wrap.sidebar-collapsed .sidebar-footer-text,
#cms-wrap.sidebar-collapsed .btn-new-post-text { display: none; }

/* Logo */
.sidebar-logo {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 32px; height: 32px;
  background: var(--red);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 1rem;
  flex-shrink: 0;
}
.sidebar-logo img { max-height: 30px; max-width: 140px; object-fit: contain; }
.sidebar-logo-text { font-size: .93rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; }

/* Nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }
.sidebar-nav ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.nav-section { padding: 14px 8px 4px; }
.nav-section-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); white-space: nowrap; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: .845rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
}
.nav-item i { font-size: .9rem; width: 18px; text-align: center; flex-shrink: 0; transition: color var(--transition); }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-badge { background: var(--red); color: white; font-size: .65rem; font-weight: 700; padding: 2px 6px; border-radius: var(--radius-full); min-width: 18px; text-align: center; }
.nav-item:hover { background: var(--gray-100); color: var(--text); }
.nav-item:hover i { color: var(--text); }
.nav-item.active { background: var(--red-light); color: var(--red); font-weight: 600; }
.nav-item.active i { color: var(--red); }

/* Footer */
.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.btn-new-post {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: var(--red);
  color: white;
  border-radius: 8px;
  font-size: .84rem;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
  border: none;
  cursor: pointer;
}
.btn-new-post:hover { background: var(--red-dark); color: white; transform: translateY(-1px); }
.btn-new-post i { font-size: .85rem; flex-shrink: 0; }

/* ── TOPBAR ─────────────────────────────────────────────────── */
#cms-topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
}
#sidebar-toggle {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-2);
  cursor: pointer;
  font-size: .9rem;
  transition: all var(--transition);
  flex-shrink: 0;
}
#sidebar-toggle:hover { background: var(--gray-100); color: var(--text); border-color: var(--gray-300); }

.topbar-left { flex: 1; display: flex; align-items: center; gap: 10px; }
.view-site-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-2);
  transition: all var(--transition);
}
.view-site-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }

.topbar-breadcrumb { font-size: .82rem; color: var(--text-3); }
.topbar-breadcrumb span { color: var(--text); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-2);
  font-size: .9rem;
  cursor: pointer;
  background: none;
  transition: all var(--transition);
  position: relative;
}
.topbar-icon-btn:hover { background: var(--gray-100); color: var(--text); }
.topbar-icon-btn .badge-dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; background: var(--red); border-radius: 50%; border: 1.5px solid white; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: none;
  transition: all var(--transition);
  position: relative;
  margin-left: 4px;
}
.topbar-user:hover { background: var(--gray-100); border-color: var(--gray-300); }
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 7px;
  object-fit: cover;
}
.user-avatar-placeholder {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--red), var(--orange));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem;
  font-weight: 700;
}
.user-name { font-size: .82rem; font-weight: 600; color: var(--text); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: .68rem; color: var(--text-3); }
.topbar-caret { font-size: .65rem; color: var(--text-3); margin-left: 2px; }

.topbar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: 6px;
  display: none;
  z-index: 500;
}
.topbar-user.open .topbar-dropdown { display: block; }
.topbar-dropdown .dd-header { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.topbar-dropdown .dd-name { font-size: .83rem; font-weight: 600; }
.topbar-dropdown .dd-email { font-size: .72rem; color: var(--text-3); }
.topbar-dropdown a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-2);
  transition: all var(--transition);
}
.topbar-dropdown a:hover { background: var(--gray-100); color: var(--text); }
.topbar-dropdown a i { width: 16px; font-size: .85rem; color: var(--text-3); }
.topbar-dropdown a:hover i { color: var(--text-2); }
.topbar-dropdown a.danger { color: #dc2626; }
.topbar-dropdown a.danger i { color: #dc2626; }
.topbar-dropdown a.danger:hover { background: #fef2f2; }
.dd-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── CONTENT ─────────────────────────────────────────────────── */
#cms-content { padding: 28px 32px; flex: 1; max-width: 1400px; }

/* ── PAGE HEADER ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.page-header-left h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.3px; color: var(--text); }
.page-header-left .subtitle { font-size: .83rem; color: var(--text-3); margin-top: 3px; }
.page-header-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── STAT CARDS ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card.red::before   { background: linear-gradient(90deg, var(--red), var(--orange)); }
.stat-card.blue::before  { background: linear-gradient(90deg, var(--blue), #60a5fa); }
.stat-card.green::before { background: linear-gradient(90deg, var(--green), #34d399); }
.stat-card.yellow::before{ background: linear-gradient(90deg, var(--yellow), #fbbf24); }
.stat-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.stat-card.red   .stat-icon { background: var(--red-light);   color: var(--red); }
.stat-card.blue  .stat-icon { background: var(--blue-light);  color: var(--blue); }
.stat-card.green .stat-icon { background: var(--green-light); color: var(--green); }
.stat-card.yellow .stat-icon { background: #fffbeb;           color: var(--yellow); }
.stat-trend { font-size: .72rem; font-weight: 600; padding: 3px 7px; border-radius: var(--radius-full); }
.stat-trend.up   { background: var(--green-light); color: var(--green); }
.stat-trend.down { background: #fef2f2; color: #dc2626; }
.stat-number { font-size: 1.75rem; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.stat-label { font-size: .77rem; color: var(--text-3); font-weight: 500; }

/* ── CARDS ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-header h3 {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-header h3 i { color: var(--text-3); font-size: .85rem; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--gray-50); }

/* ── TABLES ──────────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border); }
th {
  padding: 10px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-3);
  background: var(--gray-50);
  white-space: nowrap;
}
td { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); font-size: .845rem; vertical-align: middle; }
tbody tr { transition: background var(--transition); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }
.col-actions { width: 1%; white-space: nowrap; }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .845rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-sm { padding: 5px 11px; font-size: .78rem; border-radius: 7px; }
.btn-lg { padding: 11px 22px; font-size: .92rem; }
.btn-xl { padding: 13px 28px; font-size: 1rem; border-radius: 10px; }

.btn-primary { background: var(--red); color: white; box-shadow: 0 1px 3px rgba(230,57,70,.3); }
.btn-primary:hover { background: var(--red-dark); color: white; box-shadow: 0 4px 12px rgba(230,57,70,.35); }

.btn-secondary { background: white; color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); color: var(--text); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--gray-100); color: var(--text); }

.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: #059669; color: white; }

.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; color: white; }

.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 7px;
  font-size: .85rem;
}
.btn-icon:hover { background: var(--gray-100); color: var(--text); border-color: var(--gray-300); }
.btn-icon.danger:hover { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }

/* ── BADGES ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .2px;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.badge-published { background: var(--green-light); color: #065f46; }
.badge-published::before { background: var(--green); }
.badge-draft     { background: var(--gray-100);   color: var(--gray-600); }
.badge-draft::before { background: var(--gray-400); }
.badge-scheduled { background: #fffbeb; color: #92400e; }
.badge-scheduled::before { background: var(--yellow); }
.badge-admin     { background: #f5f3ff; color: #5b21b6; }
.badge-admin::before { background: var(--purple); }
.badge-editor    { background: var(--blue-light); color: #1e40af; }
.badge-editor::before { background: var(--blue); }
.badge-pending   { background: #fffbeb; color: #92400e; }
.badge-pending::before { background: var(--yellow); }
.badge-approved  { background: var(--green-light); color: #065f46; }
.badge-approved::before { background: var(--green); }
.badge-spam      { background: #fef2f2; color: #991b1b; }
.badge-spam::before { background: #dc2626; }

/* ── ALERTS ──────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: .845rem;
  border: 1px solid transparent;
}
.alert-success { background: var(--green-light); border-color: #a7f3d0; color: #065f46; }
.alert-danger   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning  { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info     { background: var(--blue-light); border-color: #bfdbfe; color: #1e40af; }
.alert-dismissible { justify-content: space-between; }
.alert-close { background: none; border: none; cursor: pointer; color: inherit; opacity: .5; font-size: 1.1rem; padding: 0; line-height: 1; }
.alert-close:hover { opacity: 1; }

/* ── FORMS ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-hint { font-size: .75rem; color: var(--text-3); margin-top: 5px; line-height: 1.5; }
.form-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.form-label-row label { margin-bottom: 0; }

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .875rem;
  font-family: var(--font);
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.form-control::placeholder { color: var(--text-3); }
.form-control:hover { border-color: var(--gray-300); }
.form-control:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(230,57,70,.1); }
.form-control:disabled { background: var(--gray-100); color: var(--text-3); cursor: not-allowed; }
textarea.form-control { resize: vertical; min-height: 90px; line-height: 1.6; }
select.form-control { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }

/* Input group */
.input-group { position: relative; display: flex; align-items: center; }
.input-group-icon { position: absolute; left: 12px; color: var(--text-3); font-size: .85rem; pointer-events: none; }
.input-group .form-control { padding-left: 36px; }

/* Toggle switch */
.form-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.form-switch-input { position: relative; }
.form-switch-input input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 38px; height: 22px;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--transition);
  cursor: pointer;
  flex-shrink: 0;
}
.switch-track::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
input:checked ~ .switch-track { background: var(--green); }
input:checked ~ .switch-track::after { transform: translateX(16px); }
.switch-label { font-size: .845rem; font-weight: 500; color: var(--text-2); }

/* Char counter */
.char-counter { font-size: .72rem; color: var(--text-3); }

/* ── EDITOR LAYOUT ───────────────────────────────────────────── */
.editor-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.sidebar-panel .card { margin-bottom: 14px; }
.sidebar-panel .card-body { padding: 16px; }
.sidebar-panel .card-footer { padding: 12px 16px; }

/* ── QUILL ───────────────────────────────────────────────────── */
.ql-toolbar.ql-snow {
  border: 1.5px solid var(--border) !important;
  border-bottom: none !important;
  border-radius: 8px 8px 0 0 !important;
  background: var(--gray-50);
  padding: 8px 12px !important;
}
.ql-container.ql-snow {
  border: 1.5px solid var(--border) !important;
  border-radius: 0 0 8px 8px !important;
  font-family: var(--font) !important;
  font-size: .9rem !important;
  min-height: 380px;
}
.ql-editor { min-height: 380px; line-height: 1.75; }
.ql-toolbar .ql-stroke { stroke: var(--text-2); }
.ql-toolbar .ql-fill { fill: var(--text-2); }
.ql-toolbar button:hover .ql-stroke { stroke: var(--red) !important; }
.ql-toolbar button:hover .ql-fill { fill: var(--red) !important; }

/* ── MEDIA GRID ──────────────────────────────────────────────── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
.media-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  background: var(--gray-50);
}
.media-item:hover { border-color: var(--red); box-shadow: 0 0 0 3px rgba(230,57,70,.1); }
.media-item.selected { border-color: var(--red); background: var(--red-light); }
.media-item img { width: 100%; height: 118px; object-fit: cover; display: block; }
.media-item .media-info { padding: 8px 10px; }
.media-item .media-name { font-size: .72rem; color: var(--text-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.media-item .media-size { font-size: .68rem; color: var(--text-3); margin-top: 2px; }
.media-item .media-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity var(--transition);
}
.media-item:hover .media-overlay { opacity: 1; }

/* ── TAG INPUT ───────────────────────────────────────────────── */
#tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  min-height: 42px;
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: text;
}
#tag-wrap:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(230,57,70,.1); }
#tag-text-input { border: none; outline: none; font-size: .845rem; font-family: var(--font); color: var(--text); background: transparent; flex: 1; min-width: 100px; }
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 10px;
  background: var(--red-light);
  color: var(--red-dark);
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 600;
}
.tag-pill button { background: none; border: none; cursor: pointer; color: inherit; padding: 0; line-height: 1; font-size: .85rem; opacity: .6; }
.tag-pill button:hover { opacity: 1; }

/* ── FEATURED IMAGE ──────────────────────────────────────────── */
.featured-img-wrap {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition);
  cursor: pointer;
}
.featured-img-wrap:hover { border-color: var(--red); }
.featured-img-wrap.has-image { border-style: solid; border-color: var(--border); }
.featured-img-wrap img { width: 100%; max-height: 180px; object-fit: cover; display: block; }
.featured-img-placeholder { text-align: center; padding: 24px; color: var(--text-3); }
.featured-img-placeholder i { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.featured-img-placeholder span { font-size: .78rem; }

/* ── PUBLISH BOX ─────────────────────────────────────────────── */
.publish-actions { display: flex; gap: 8px; }
.status-indicator { display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-dot.published { background: var(--green); }
.status-dot.draft     { background: var(--gray-400); }
.status-dot.scheduled { background: var(--yellow); }

/* ── COLOR PICKERS ───────────────────────────────────────────── */
.color-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.color-row:last-child { border-bottom: none; }
.color-row-label { flex: 1; }
.color-row-label .label { font-size: .84rem; font-weight: 600; }
.color-row-label .hint { font-size: .72rem; color: var(--text-3); margin-top: 1px; }
.color-input-wrap { display: flex; align-items: center; gap: 8px; }
.color-swatch { width: 36px; height: 36px; border-radius: 8px; border: 1.5px solid var(--border); cursor: pointer; padding: 2px; overflow: hidden; appearance: none; }
.color-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.color-swatch::-webkit-color-swatch { border: none; border-radius: 5px; }
.color-hex { width: 86px; padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 7px; font-size: .8rem; font-family: 'Courier New', monospace; text-transform: uppercase; }
.color-hex:focus { border-color: var(--red); outline: none; }

/* ── TEMPLATE CARDS ──────────────────────────────────────────── */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.template-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}
.template-card:hover { border-color: var(--red); box-shadow: var(--shadow-md); }
.template-card.active { border-color: var(--red); box-shadow: 0 0 0 3px rgba(230,57,70,.15); }
.template-preview { height: 150px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; position: relative; overflow: hidden; }
.template-preview.blog    { background: linear-gradient(135deg, #fff5f5, #fee2e2); }
.template-preview.sport   { background: linear-gradient(135deg, #0a0a0a, #1a1e26); }
.template-preview.culture { background: linear-gradient(135deg, #1a0033, #2d0057); }
.template-preview.jeune   { background: linear-gradient(135deg, #ff6b6b, #feca57); }
.template-preview .preview-lines { position: absolute; inset: 0; padding: 16px; }
.preview-bar { height: 4px; border-radius: 2px; margin-bottom: 5px; }
.template-info { padding: 14px 16px; border-top: 1px solid var(--border); background: white; }
.template-info h4 { font-size: .9rem; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.template-info p { font-size: .75rem; color: var(--text-3); margin-top: 4px; }
.template-info .template-actions { margin-top: 12px; }

/* ── ADS POSITIONS ───────────────────────────────────────────── */
.ads-pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; margin-bottom: 24px; }
.ads-pos-card {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: white;
}
.ads-pos-card:hover { border-color: var(--red); border-style: solid; }
.ads-pos-card.has-ad { border-style: solid; border-color: var(--green); background: var(--green-light); }
.ads-pos-icon { font-size: 1.5rem; margin-bottom: 8px; }
.ads-pos-name { font-size: .8rem; font-weight: 700; color: var(--text); }
.ads-pos-size { font-size: .7rem; color: var(--text-3); margin-top: 3px; }

/* ── MENU BUILDER ────────────────────────────────────────────── */
.menu-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.menu-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: grab;
  transition: all var(--transition);
}
.menu-list-item:hover { border-color: var(--gray-300); box-shadow: var(--shadow-sm); }
.menu-list-item .drag-handle { color: var(--gray-300); font-size: .8rem; cursor: grab; }
.menu-list-item .item-info { flex: 1; }
.menu-list-item .item-label { font-size: .84rem; font-weight: 600; }
.menu-list-item .item-meta { font-size: .72rem; color: var(--text-3); margin-top: 2px; }
.menu-location-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--text-3);
}

/* ── ACTIVITY FEED ───────────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; }
.activity-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--gray-100); transition: background var(--transition); }
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--gray-50); }
.activity-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: .8rem; flex-shrink: 0; }
.activity-text { flex: 1; min-width: 0; }
.activity-text p { font-size: .82rem; color: var(--text); line-height: 1.5; }
.activity-text p strong { font-weight: 600; }
.activity-text p a { color: var(--text); font-weight: 600; }
.activity-text p a:hover { color: var(--red); }
.activity-time { font-size: .72rem; color: var(--text-3); margin-top: 3px; }

/* ── QUICK ACTIONS ───────────────────────────────────────────── */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 24px; }
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 14px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  color: var(--text-2);
  font-size: .82rem;
  font-weight: 600;
}
.quick-action:hover { border-color: var(--red); color: var(--red); transform: translateY(-2px); box-shadow: var(--shadow); }
.quick-action .qa-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: all var(--transition); }
.quick-action:hover .qa-icon { transform: scale(1.1); }

/* ── FILTER BAR ──────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.status-tabs { display: flex; gap: 2px; background: var(--gray-100); border-radius: var(--radius); padding: 3px; }
.status-tab {
  padding: 5px 14px;
  border-radius: 7px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  text-decoration: none;
}
.status-tab:hover { color: var(--text); }
.status-tab.active { background: white; color: var(--text); box-shadow: var(--shadow-sm); }
.filter-sep { width: 1px; height: 28px; background: var(--border); }

/* ── DASHBOARD CONTENT ───────────────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.popular-rank { display: flex; align-items: flex-start; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--gray-100); transition: background var(--transition); }
.popular-rank:last-child { border-bottom: none; }
.popular-rank:hover { background: var(--gray-50); }
.rank-num { font-size: .85rem; font-weight: 800; color: var(--text-3); min-width: 22px; }
.rank-num.top { color: var(--red); }
.rank-body { flex: 1; min-width: 0; }
.rank-title { font-size: .83rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-title a { color: inherit; }
.rank-title a:hover { color: var(--red); }
.rank-meta { font-size: .72rem; color: var(--text-3); margin-top: 3px; }
.rank-views { font-size: .75rem; font-weight: 700; color: var(--text-3); white-space: nowrap; }

/* Post title in table */
.post-title-wrap { display: flex; align-items: flex-start; gap: 10px; }
.post-thumb { width: 46px; height: 36px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--gray-200); }
.post-title-link { font-size: .845rem; font-weight: 600; color: var(--text); line-height: 1.4; }
.post-title-link:hover { color: var(--red); }
.post-title-tags { margin-top: 3px; }

/* ── AVATAR ──────────────────────────────────────────────────── */
.avatar-lg { width: 76px; height: 76px; border-radius: 16px; object-fit: cover; border: 2px solid var(--border); }
.avatar-lg-placeholder { width: 76px; height: 76px; border-radius: 16px; background: linear-gradient(135deg, var(--red), var(--orange)); color: white; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 700; }

/* ── PAGINATION ──────────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; padding: 16px; }
.page-link { padding: 7px 12px; border: 1.5px solid var(--border); border-radius: 7px; font-size: .8rem; font-weight: 600; color: var(--text-2); transition: all var(--transition); cursor: pointer; }
.page-link:hover { border-color: var(--red); color: var(--red); }
.page-link.active { background: var(--red); color: white; border-color: var(--red); }

/* ── LOGIN ───────────────────────────────────────────────────── */
body.login-page { background: var(--gray-50); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap { width: 100%; max-width: 400px; }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-icon { width: 52px; height: 52px; background: linear-gradient(135deg, var(--red), var(--orange)); border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: white; font-size: 1.4rem; margin-bottom: 14px; box-shadow: 0 8px 24px rgba(230,57,70,.3); }
.login-logo h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.5px; }
.login-logo p { font-size: .85rem; color: var(--text-3); margin-top: 4px; }
.login-card { background: white; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-md); }
.login-card .form-group { margin-bottom: 16px; }
.btn-login { width: 100%; padding: 11px; font-size: .92rem; font-weight: 700; background: linear-gradient(135deg, var(--red), var(--orange)); color: white; border: none; border-radius: 9px; cursor: pointer; font-family: var(--font); transition: all var(--transition); box-shadow: 0 4px 14px rgba(230,57,70,.3); }
.btn-login:hover { box-shadow: 0 6px 20px rgba(230,57,70,.4); transform: translateY(-1px); }
.login-footer { text-align: center; font-size: .78rem; color: var(--text-3); margin-top: 20px; }

/* ── UTILITIES ───────────────────────────────────────────────── */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-3 { margin-bottom: 16px; }
.text-muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-danger { color: #dc2626; }
.text-success { color: var(--green); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-xs { font-size: .72rem; }
.fs-sm { font-size: .78rem; }
.w-100 { width: 100%; }
.hr { height: 1px; background: var(--border); margin: 18px 0; border: none; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: 12px; opacity: .3; }
.empty-state p { font-size: .85rem; }
.empty-state a { margin-top: 16px; display: inline-flex; }
.section-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); margin-bottom: 10px; display: block; }

/* ── MODAL ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  display: none;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.modal-header h3 { font-size: .92rem; font-weight: 700; }
.modal-close { width: 30px; height: 30px; border: none; background: var(--gray-100); border-radius: 7px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .9rem; color: var(--text-2); transition: all var(--transition); }
.modal-close:hover { background: var(--gray-200); }
.modal-body { flex: 1; overflow-y: auto; padding: 20px; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1200px) { .form-grid { grid-template-columns: 1fr 300px; } .editor-layout { grid-template-columns: 1fr 300px; } .dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 1024px) { #cms-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); } #cms-wrap.sidebar-open #cms-sidebar { transform: translateX(0); } #cms-main { margin-left: 0 !important; } .form-grid { grid-template-columns: 1fr; } .editor-layout { grid-template-columns: 1fr; } }
@media (max-width: 768px) { #cms-content { padding: 20px 16px; } .stats-grid { grid-template-columns: 1fr 1fr; } .form-row { grid-template-columns: 1fr; } .page-header { flex-direction: column; } }
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; } }
