/* ══════════════════════════════════════ */
/* ContentOps — Admin Stylesheet         */
/* ══════════════════════════════════════ */

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --text: #2c3e50;
  --text-muted: #95a5a6;
  --primary: #3498db;
  --primary-dark: #2980b9;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --border: #e0e0e0;
  --nav-bg: #2c3e50;
  --radius: 6px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navigation ── */

.blogsuite-nav {
  background: var(--nav-bg);
  color: white;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  height: 52px;
  gap: 2rem;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
}

.nav-links { display: flex; gap: 0.25rem; flex: 1; }
.nav-links a {
  color: rgba(255,255,255,0.7);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
}
.nav-links a:hover { color: white; background: rgba(255,255,255,0.1); text-decoration: none; }
.nav-links a.active { color: white; background: rgba(255,255,255,0.15); }

.nav-user { display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; }
.user-name { color: rgba(255,255,255,0.9); }
.nav-logout { color: rgba(255,255,255,0.5); font-size: 0.8rem; }
.nav-logout:hover { color: white; }

/* ── Page layout ── */

.page-container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-header h1 { margin: 0; }

/* ── Stats grid ── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.stat-number { font-size: 2rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-warn .stat-number { color: var(--warning); }
.stat-danger .stat-number { color: var(--danger); }
.stat-success .stat-number { color: var(--success); }

/* ── Dashboard grid ── */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1.5rem;
}

/* ── Panels ── */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.panel h2 { font-size: 1rem; margin-bottom: 1rem; color: var(--text); }
.panel-warn { border-left: 4px solid var(--warning); }

/* ── Tables ── */

.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th, .table td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; }
.table tr:hover { background: #f8f9fa; }
.row-danger { background: #fdf0ef; }
.row-danger:hover { background: #fce8e6; }

/* ── Badges ── */

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-submitted { background: #eef2ff; color: #4338ca; }
.badge-approved { background: #f0fdf4; color: #166534; }
.badge-assigned { background: #fef3c7; color: #92400e; }
.badge-draft { background: #f1f5f9; color: #475569; }
.badge-review { background: #dbeafe; color: #1e40af; }
.badge-revision { background: #fef3c7; color: #92400e; }
.badge-published { background: #dcfce7; color: #166534; }
.badge-completed { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fef2f2; color: #991b1b; }
.badge-archived { background: #f1f5f9; color: #64748b; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-paused { background: #f1f5f9; color: #64748b; }
.badge-admin { background: #ede9fe; color: #6d28d9; }
.badge-contributor { background: #e0f2fe; color: #0369a1; }

/* ── Scores ── */

.score { font-weight: 700; font-size: 0.875rem; }
.score-good { color: var(--success); }
.score-ok { color: var(--warning); }
.score-bad { color: var(--danger); }

.score-bar { height: 4px; background: var(--border); border-radius: 2px; margin-top: 0.5rem; }
.score-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.score-fill.score-good { background: var(--success); }
.score-fill.score-ok { background: var(--warning); }
.score-fill.score-bad { background: var(--danger); }

/* ── Tabs ── */

.tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.tab:hover { text-decoration: none; background: var(--surface); color: var(--text); }
.tab.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ── Filter bar ── */

.filter-bar { margin-bottom: 1rem; }
.filter-bar select { padding: 0.4rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.875rem; }

/* ── Cards ── */

.card-list { display: flex; flex-direction: column; gap: 0.75rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.card-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.card-site { font-size: 0.75rem; color: var(--text-muted); }
.card h3 { font-size: 0.95rem; margin-bottom: 0.25rem; }
.card-pitch { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.card-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; gap: 1rem; flex-wrap: wrap; }
.card-notes { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.card-notes .note { font-size: 0.8rem; margin-bottom: 0.25rem; }
.card-actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; }
.card-feedback {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #fef3c7;
  border-radius: var(--radius);
  font-size: 0.85rem;
}

/* ── Activity list ── */

.activity-list { display: flex; flex-direction: column; gap: 0.5rem; }
.activity-item { display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.85rem; }
.activity-item small { color: var(--text-muted); }

/* ── Attention items ── */

.attention-list { display: flex; flex-direction: column; gap: 0.5rem; }
.attention-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.5rem; border-radius: var(--radius); }
.attention-icon {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; font-size: 0.7rem; font-weight: 700; flex-shrink: 0;
}
.attention-overdue { background: #fef2f2; }
.attention-overdue .attention-icon { background: var(--danger); color: white; }
.attention-info { background: #eff6ff; }
.attention-info .attention-icon { background: var(--primary); color: white; }

/* ── Detail list ── */

.detail-list { font-size: 0.875rem; }
.detail-list > div { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }

/* ── Forms ── */

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.25rem; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(52,152,219,0.15);
}
.form-row { display: flex; gap: 0.75rem; }
.checkbox-group { display: flex; flex-direction: column; gap: 0.25rem; }
.checkbox-label { font-size: 0.875rem; cursor: pointer; }
.checkbox-label input { margin-right: 0.5rem; }

.collapsible .collapsible-content { display: none; margin-top: 0.5rem; }
.collapsible.open .collapsible-content { display: block; }
.collapsible label { cursor: pointer; }

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 36px;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.75rem; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #219a52; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: var(--border); color: var(--text); }

/* ── Modal ── */

.modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-content h2 { margin-bottom: 1rem; }

/* ── Editor ── */

.editor-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; }
.editor-main { min-width: 0; }
.editor-sidebar { }

.editor-toolbar {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem;
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}
.editor-toolbar button {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  background: white;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
}
.editor-toolbar button:hover { background: var(--bg); }
.editor-toolbar button.active { background: var(--primary); color: white; border-color: var(--primary); }
.toolbar-sep { width: 1px; background: var(--border); margin: 0 0.25rem; }

.editor-content {
  min-height: 400px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 0.9rem;
  line-height: 1.6;
  outline: none;
  background: white;
}
.editor-content:focus { border-color: var(--primary); }

.editor-source {
  width: 100%;
  min-height: 400px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  resize: vertical;
}

.editor-actions { margin-top: 1rem; }
.editor-meta { margin-top: 0.75rem; color: var(--text-muted); }

/* ── Login ── */

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--nav-bg);
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 380px;
}
.login-card h1 { text-align: center; margin-bottom: 0.25rem; }
.login-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.875rem; }
.error-msg { color: var(--danger); font-size: 0.85rem; text-align: center; margin-top: 0.5rem; }

/* ── Pulsing dots ── */

.pulsing-dots::after {
  content: '';
  animation: pulseDots 1.2s steps(4, end) infinite;
}
@keyframes pulseDots {
  0% { content: '.'; }
  25% { content: '..'; }
  50% { content: '...'; }
  75% { content: '....'; }
}

/* ── Utilities ── */

.muted { color: var(--text-muted); font-size: 0.85rem; }
.text-danger { color: var(--danger); }
code { background: #f1f5f9; padding: 0.15rem 0.35rem; border-radius: 3px; font-size: 0.8em; }

/* ── Responsive ── */

@media (max-width: 768px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .editor-layout { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .blogsuite-nav { flex-wrap: wrap; height: auto; padding: 0.5rem 1rem; }
  .nav-links { order: 3; width: 100%; overflow-x: auto; }
}
