/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(194,65,12,0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(194,65,12,0.04) 0%, transparent 50%);
}
.login-box {
  width: 100%; max-width: 420px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 48px 40px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  font-family: var(--font-display); font-size: 1.8rem;
  color: var(--accent); text-align: center; margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.login-tagline {
  text-align: center; color: var(--ink-muted);
  font-size: 0.85rem; margin-bottom: 36px;
}
.login-error {
  background: var(--red-pale); color: var(--red);
  border: 1px solid #FECACA; border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 0.85rem; margin-bottom: 16px;
}

/* ── App Shell ── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
  grid-column: 1 / -1;
  background: #fff; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 50;
}
.topbar-logo {
  font-family: var(--font-display); font-size: 1.3rem;
  color: var(--accent); letter-spacing: -0.02em;
  text-decoration: none;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--ink-muted);
}
.topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600;
}
.topbar-site-selector {
  padding: 6px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.85rem;
  font-family: var(--font-body); background: var(--cream);
  color: var(--ink); cursor: pointer; outline: none;
}
.topbar-site-selector:focus { border-color: var(--accent); }

/* ── Sidebar ── */
.sidebar {
  background: var(--ink);
  padding: 20px 0;
  display: flex; flex-direction: column;
  position: sticky; top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
}
.sidebar-section-label {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: #78716C;
  padding: 16px 20px 6px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: #A8A29E;
  font-size: 0.875rem; font-weight: 400;
  cursor: pointer; text-decoration: none;
  transition: all 0.15s; border-left: 3px solid transparent;
  border-radius: 0;
}
.sidebar-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.sidebar-item.active {
  color: #fff; background: rgba(194,65,12,0.15);
  border-left-color: var(--accent);
}
.sidebar-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-item-badge {
  margin-left: auto; background: var(--accent);
  color: #fff; font-size: 0.68rem; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
}
.sidebar-bottom { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.08); }

/* ── Main Content ── */
.main-content {
  padding: 32px;
  overflow-y: auto;
  height: calc(100vh - var(--topbar-height));
  background: var(--cream);
}
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px;
}
.page-title { font-family: var(--font-display); font-size: 1.8rem; color: var(--ink); }
.page-subtitle { color: var(--ink-muted); font-size: 0.9rem; margin-top: 4px; }

/* ── Article Type Picker ── */
.type-picker {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-bottom: 32px;
}
.type-card {
  background: #fff; border: 2px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 24px 20px;
  cursor: pointer; transition: all 0.2s; text-align: center;
}
.type-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.type-card.selected { border-color: var(--accent); background: var(--accent-pale); }
.type-card-icon { font-size: 2rem; margin-bottom: 10px; }
.type-card-name { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); }
.type-card-desc { font-size: 0.78rem; color: var(--ink-muted); margin-top: 4px; }

/* ── Publisher Layout ── */
.publisher-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
.publisher-main { display: flex; flex-direction: column; gap: 20px; }
.publisher-sidebar-panel { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 20px; }

/* ── Section cards in publisher ── */
.section-card {
  background: #fff; border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.section-card-header {
  padding: 14px 20px; background: var(--cream);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 0.875rem; color: var(--ink-light);
}
.section-card-header svg { width: 16px; height: 16px; color: var(--accent); }
.section-card-body { padding: 20px; }

/* ── Checklist panel ── */
.checklist-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}
.checklist-item:last-child { border-bottom: none; }
.checklist-icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.7rem; font-weight: 700; }
.check-pass { background: var(--green-pale); color: var(--green); }
.check-fail { background: var(--red-pale); color: var(--red); }
.check-warn { background: var(--amber-pale); color: var(--amber); }
.check-idle { background: var(--cream-dark); color: var(--ink-muted); }
.checklist-label { flex: 1; color: var(--ink-light); }
.checklist-label.has-issue { color: var(--red); }
.checklist-label.has-warn { color: var(--amber); }

/* ── Image upload zone ── */
.image-upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-md);
  padding: 24px; text-align: center; cursor: pointer;
  transition: all 0.2s; background: var(--cream);
}
.image-upload-zone:hover, .image-upload-zone.dragover {
  border-color: var(--accent); background: var(--accent-pale);
}
.image-upload-zone .icon { font-size: 1.8rem; margin-bottom: 8px; }
.image-upload-zone p { font-size: 0.85rem; color: var(--ink-muted); }
.image-preview {
  position: relative; border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border-light);
}
.image-preview img { width: 100%; height: 160px; object-fit: cover; display: block; }
.image-preview-remove {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.6); color: #fff;
  border: none; border-radius: 50%; width: 26px; height: 26px;
  cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center;
}

/* ── Rich editor toolbar ── */
.editor-toolbar {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--border-light);
  background: var(--cream); border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.toolbar-btn {
  padding: 5px 8px; background: none; border: none;
  border-radius: 4px; cursor: pointer; color: var(--ink-muted);
  font-size: 0.85rem; font-family: var(--font-body);
  transition: all 0.1s; display: flex; align-items: center; gap: 4px;
}
.toolbar-btn:hover { background: var(--cream-dark); color: var(--ink); }
.toolbar-btn.active { background: var(--accent-light); color: var(--accent); }
.toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.editor-area {
  min-height: 400px; padding: 20px;
  outline: none; font-size: 0.95rem; line-height: 1.8;
  border: 1.5px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: #fff;
}
.editor-area:focus { border-color: var(--accent); }
.editor-area h1 { font-size: 1.6rem; margin: 16px 0 8px; }
.editor-area h2 { font-size: 1.3rem; margin: 14px 0 6px; }
.editor-area h3 { font-size: 1.1rem; margin: 12px 0 5px; }
.editor-area h4 { font-size: 1rem; margin: 10px 0 4px; }
.editor-area p { margin: 8px 0; }
.editor-area ul, .editor-area ol { margin: 8px 0 8px 24px; }
.editor-area a { color: var(--accent); }
.editor-area blockquote { border-left: 3px solid var(--border); padding-left: 16px; color: var(--ink-muted); margin: 12px 0; }

/* ── Slug preview ── */
.slug-preview {
  font-family: monospace; font-size: 0.8rem;
  background: var(--cream-dark); padding: 8px 12px;
  border-radius: var(--radius-sm); color: var(--ink-muted);
  word-break: break-all;
}
.slug-preview span { color: var(--accent); font-weight: 600; }

/* ── Progress bar ── */
.progress-bar { height: 4px; background: var(--border-light); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.3s; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(28,25,23,0.5);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: var(--radius-lg);
  padding: 32px; max-width: 560px; width: 90%;
  box-shadow: var(--shadow-lg); animation: fadeIn 0.2s ease;
}
.modal-title { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 16px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ── Settings page ── */
.settings-grid { display: grid; grid-template-columns: 220px 1fr; gap: 32px; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav-item {
  padding: 9px 14px; border-radius: var(--radius-sm);
  font-size: 0.875rem; cursor: pointer; color: var(--ink-muted);
  transition: all 0.15s;
}
.settings-nav-item:hover { background: var(--cream-dark); color: var(--ink); }
.settings-nav-item.active { background: var(--accent-pale); color: var(--accent); font-weight: 500; }
.site-card {
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  padding: 18px; display: flex; align-items: center; gap: 14px;
  transition: border-color 0.15s;
}
.site-card:hover { border-color: var(--ink-muted); }
.site-card.connected { border-color: var(--green); }
.site-favicon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--cream-dark); display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.site-info { flex: 1; }
.site-name { font-weight: 600; font-size: 0.9rem; }
.site-url { font-size: 0.78rem; color: var(--ink-muted); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .publisher-grid { grid-template-columns: 1fr; }
  .publisher-sidebar-panel { position: static; }
}
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .main-content { padding: 16px; }
  .type-picker { grid-template-columns: 1fr; }
}
