/* ================================================
   Medical Distributors Brazil - Blog Admin V2
   Design System: Professional, Clean, Ghost-inspired
   ================================================ */

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

/* ---- CSS Variables ---- */
:root {
  --primary: #425563;
  --primary-dark: #2e3d49;
  --primary-light: #5a7283;
  --gold: #C19A3F;
  --gold-light: #d4af5a;
  --accent: #6B8A9A;
  --success: #10B981;
  --success-bg: #d1fae5;
  --danger: #EF4444;
  --danger-bg: #fee2e2;
  --warning: #F59E0B;
  --warning-bg: #fef3c7;
  --info: #3B82F6;
  --info-bg: #dbeafe;
  --light-bg: #F5F7FA;
  --sidebar-bg: #1e2d3a;
  --sidebar-hover: #2a3d4d;
  --white: #FFFFFF;
  --text: #2C3E50;
  --text-muted: #5A6C7D;
  --text-light: #8fa0b0;
  --border: #E1E8ED;
  --border-focus: #6B8A9A;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.06);
  --transition: all 0.2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; font-size: 16px; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--light-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button { cursor: pointer; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }

/* ---- Layout ---- */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: var(--transition);
}
.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo .logo-text {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.sidebar-logo .logo-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  font-weight: 400;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.sidebar-logo .logo-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--primary-dark);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 6px;
  letter-spacing: 0.5px;
}
.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}
.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.3);
  padding: 16px 20px 6px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.nav-item.active {
  background: rgba(107, 138, 154, 0.2);
  color: #fff;
  border-left-color: var(--gold);
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,0.4); }
.sidebar-logout {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}
.sidebar-logout:hover { color: var(--danger); }

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Top Bar ---- */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 17px; font-weight: 600; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

/* ---- Page Content ---- */
.page-content { padding: 28px; flex: 1; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 3px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid transparent;
  transition: var(--transition);
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-gold {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.btn-gold:hover:not(:disabled) { background: var(--gold-light); }
.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-success:hover:not(:disabled) { background: #0ea271; }
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover:not(:disabled) { background: var(--light-bg); border-color: var(--accent); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  padding: 6px 10px;
}
.btn-ghost:hover:not(:disabled) { background: var(--light-bg); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 8px; gap: 0; }
.btn-icon svg { width: 16px; height: 16px; }
.btn-loading { pointer-events: none; opacity: 0.7; }
.btn-loading::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text); }
.card-body { padding: 22px; }

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.stat-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.blue { background: #dbeafe; color: #3B82F6; }
.stat-icon.green { background: #d1fae5; color: #10B981; }
.stat-icon.gold { background: #fef3c7; color: var(--gold); }
.stat-icon.purple { background: #ede9fe; color: #7C3AED; }

/* ---- Tables ---- */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--light-bg);
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbfc; }
.td-actions { display: flex; gap: 6px; align-items: center; }

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}
.form-label span { color: var(--danger); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
  outline: none;
  line-height: 1.5;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(107, 138, 154, 0.15);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-light); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A6C7D' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; display: none; }
.form-error.show { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-input.error, .form-select.error, .form-textarea.error { border-color: var(--danger); }
.input-group { position: relative; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.input-icon svg { width: 16px; height: 16px; }
.input-group .form-input { padding-left: 38px; }
.input-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px; }
.input-toggle:hover { color: var(--text); }

/* ---- Badges & Tags ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.badge-published { background: var(--success-bg); color: #065f46; }
.badge-draft { background: #f3f4f6; color: #4B5563; }
.badge-archived { background: #fef3c7; color: #92400e; }
.badge-admin { background: #ede9fe; color: #5B21B6; }
.badge-editor { background: var(--info-bg); color: #1e40af; }
.badge-author { background: var(--success-bg); color: #065f46; }
.badge-dot::before {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%; background: currentColor;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(-12px);
  transition: transform 0.2s ease;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-lg { max-width: 700px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  padding: 4px; border-radius: 6px; transition: var(--transition);
  display: flex; align-items: center;
}
.modal-close:hover { background: var(--light-bg); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
}

/* ---- Toast Notifications ---- */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 380px;
  animation: slideUp 0.3s ease;
  border-left: 4px solid var(--border);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }
.toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }
.toast-message { font-size: 14px; font-weight: 500; color: var(--text); flex: 1; }
.toast-close { background: none; border: none; color: var(--text-muted); padding: 2px; cursor: pointer; }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(8px); } }

/* ---- Auth Pages ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e2d3a 0%, #2a3d4d 50%, #1e2d3a 100%);
  padding: 20px;
}
.auth-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px;
  background: var(--primary);
  border-radius: 12px;
  margin-bottom: 14px;
}
.auth-logo-mark svg { width: 26px; height: 26px; color: #fff; }
.auth-site-name { font-size: 13px; font-weight: 700; color: var(--primary); letter-spacing: 0.5px; text-transform: uppercase; }
.auth-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.auth-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }
.auth-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.auth-link { font-size: 14px; color: var(--primary); font-weight: 500; }
.auth-link:hover { text-decoration: underline; }
.auth-footer-text { font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 20px; }
.remember-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: flex; align-items: center; gap: 8px; }
.alert.alert-error { background: var(--danger-bg); color: #991b1b; border: 1px solid #fca5a5; }
.alert.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid #6ee7b7; }
.alert svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---- Article List ---- */
.article-item {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.article-item:last-child { border-bottom: none; }
.article-item:hover { background: #fafbfc; }
.article-icon {
  width: 36px; height: 36px;
  background: var(--light-bg);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}
.article-icon svg { width: 16px; height: 16px; }
.article-info { flex: 1; min-width: 0; }
.article-title { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.article-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.article-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ---- Editor Layout ---- */
.editor-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--white);
  overflow: hidden;
}
.editor-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.editor-topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.editor-topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.editor-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  overflow: hidden;
}
.editor-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
}
.editor-pane:last-child { border-right: none; }
.pane-header {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  background: var(--light-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.editor-meta-bar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
}
.editor-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.editor-textarea {
  flex: 1;
  border: none;
  outline: none;
  padding: 18px;
  font-family: 'SFMono-Regular', 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  resize: none;
  background: #fdfdfd;
  overflow-y: auto;
}
.editor-textarea::placeholder { color: var(--text-light); }
.preview-pane {
  padding: 24px 28px;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background: var(--white);
}
.preview-pane h1 { font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 16px; margin-top: 28px; line-height: 1.3; }
.preview-pane h1:first-child { margin-top: 0; }
.preview-pane h2 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 12px; margin-top: 24px; }
.preview-pane h3 { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 10px; margin-top: 20px; }
.preview-pane p { margin-bottom: 14px; }
.preview-pane ul, .preview-pane ol { padding-left: 22px; margin-bottom: 14px; }
.preview-pane li { margin-bottom: 5px; }
.preview-pane strong { font-weight: 600; color: var(--primary-dark); }
.preview-pane em { font-style: italic; }
.preview-pane code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: monospace; color: var(--primary); }
.preview-pane pre { background: #1e2d3a; color: #e2e8f0; padding: 18px; border-radius: 8px; overflow-x: auto; margin-bottom: 16px; }
.preview-pane pre code { background: none; color: inherit; padding: 0; }
.preview-pane blockquote { border-left: 3px solid var(--gold); padding-left: 16px; color: var(--text-muted); font-style: italic; margin: 16px 0; }
.preview-pane a { color: var(--primary); text-decoration: underline; }
.preview-pane img { max-width: 100%; border-radius: 8px; margin: 12px 0; }
.preview-pane hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.preview-pane table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.preview-pane table th { background: var(--light-bg); padding: 8px 12px; text-align: left; font-weight: 600; border: 1px solid var(--border); }
.preview-pane table td { padding: 8px 12px; border: 1px solid var(--border); }
.preview-empty { text-align: center; color: var(--text-light); padding: 60px 20px; }
.preview-empty svg { width: 40px; height: 40px; margin-bottom: 12px; opacity: 0.3; }

/* ---- Image Upload ---- */
.image-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--light-bg);
  position: relative;
}
.image-upload-area:hover { border-color: var(--accent); background: #edf2f5; }
.image-upload-area.dragover { border-color: var(--primary); background: #dbeafe; }
.image-upload-area input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-placeholder svg { width: 28px; height: 28px; color: var(--text-light); margin-bottom: 8px; }
.upload-placeholder p { font-size: 13px; color: var(--text-muted); }
.upload-placeholder span { color: var(--primary); font-weight: 500; }
.image-preview-container { position: relative; }
.image-preview-container img { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; }
.image-remove {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.6); color: #fff;
  border: none; border-radius: 50%;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
  font-size: 14px;
}
.image-remove:hover { background: var(--danger); }

/* ---- Status indicator ---- */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-light);
}
.status-dot.online { background: var(--success); }
.status-dot.saved { background: var(--success); }
.status-dot.saving { background: var(--warning); animation: pulse 1s infinite; }
.status-dot.unsaved { background: var(--warning); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.save-status { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .sidebar { width: 60px; }
  .sidebar-logo .logo-text, .sidebar-logo .logo-sub, .sidebar-logo .logo-badge,
  .nav-item span, .nav-section-label, .sidebar-user-info, .nav-badge { display: none; }
  .nav-item { padding: 12px; justify-content: center; }
  .sidebar-footer { padding: 12px; }
  .sidebar-avatar { margin: 0 auto; }
  .main-content { margin-left: 60px; }
}
@media (max-width: 640px) {
  .editor-split { grid-template-columns: 1fr; }
  .editor-pane:first-child { display: none; }
  .page-content { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .modal { margin: 0 16px; }
  .editor-meta-grid { grid-template-columns: 1fr; }
}
