﻿/* ── SIDEBAR LAYOUT ── */
.app-layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; height: 100vh; overflow-y: auto;
}
.sb-header { padding: 18px 16px 14px; border-bottom: 1px solid var(--border); }
.sb-logo { display: flex; align-items: center; gap: 10px; }
.sb-logo img { height: 22px; object-fit: contain; }
.sb-section { padding: 8px 10px; }
.sb-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  padding: 8px 6px 4px; display: block;
}
.sb-btn {
  display: flex; align-items: center; gap: 9px; width: 100%;
  text-align: left; padding: 7px 8px; border-radius: 8px;
  border: none; background: none; font-family: inherit;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  cursor: pointer; transition: all .12s;
}
.sb-btn:hover { background: var(--surface2); color: var(--text); }
.sb-btn.active { background: var(--text); color: white; }
.sb-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.sb-pill {
  margin-left: auto; background: var(--border); color: var(--text-2);
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px;
}
.sb-btn.active .sb-pill { background: rgba(255,255,255,.2); color: white; }
.sb-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); }

.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.main-topbar {
  height: 50px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; flex-shrink: 0;
}
.main-title { font-size: 15px; font-weight: 700; color: var(--text); }
.main-content { flex: 1; overflow-y: auto; padding: 24px; }

/* Keep tab-panel but now inside main-content */
.tab-panel { display: none; max-width: 900px; }
.tab-panel.active { display: block; animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(3px); } to { opacity:1; transform:none; } }

:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --surface2: #f0ede8;
  --border: #e2ddd6;
  --border-strong: #c8c2b8;
  --text: #1a1714;
  --text-2: #4a4540;
  --text-3: #8a8078;
  --accent: #1a1714;
  --accent-hover: #333;
  --green: #2d6a4f;
  --green-bg: #d8f3dc;
  --red: #c0392b;
  --red-bg: #fdecea;
  --blue: #1d4ed8;
  --blue-bg: #eff6ff;
  --amber: #92400e;
  --amber-bg: #fffbeb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 10px 30px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Outfit', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 15px; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }

/* ── HEADER ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo img { height: 28px; object-fit: contain; }
.header-right { display: flex; align-items: center; gap: 12px; }
.status-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 0.75rem; color: var(--text-2); font-weight: 500;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #ccc; flex-shrink: 0; }
.status-dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.2); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* ── TABS ── */
.tabs-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  gap: 0;
  overflow-x: auto;
}
.tab-btn {
  padding: 0 20px;
  height: 44px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  display: flex; align-items: center; gap: 7px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--text); }
.tab-badge {
  background: var(--text); color: white;
  font-size: 0.62rem; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; line-height: 1.6;
}
.tab-btn:not(.active) .tab-badge { background: var(--border-strong); color: var(--text-2); }

/* ── PANEL ── */
.tab-panel { display: none; padding: 32px; max-width: 1200px; margin: 0 auto; }
.tab-panel.active { display: block; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif; font-size: 0.83rem; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.15s; white-space: nowrap;
}
.btn-primary {
  background: var(--text); color: white;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--surface2); border-color: var(--text); }
.btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid transparent; padding: 7px 12px;
}
.btn-ghost:hover { background: var(--surface2); }
.btn-success {
  background: var(--green-bg); color: var(--green);
  border: 1px solid rgba(45,106,79,0.2);
}
.btn-danger {
  background: var(--red-bg); color: var(--red);
  border: 1px solid rgba(192,57,43,0.2);
}
.btn-sm { padding: 6px 12px; font-size: 0.75rem; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
}
.card-sm { padding: 16px; }
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.card-desc { font-size: 0.82rem; color: var(--text-3); line-height: 1.6; margin-bottom: 20px; }

/* ── FORM ── */
.field { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 0.75rem; font-weight: 600; color: var(--text-2); letter-spacing: 0.03em; }
input, textarea, select {
  font-family: 'Outfit', sans-serif; font-size: 0.85rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 13px; outline: none; width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--text); box-shadow: 0 0 0 3px rgba(26,23,20,0.08);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
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 12 12'%3E%3Cpath fill='%238a8078' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field.full { grid-column: 1/-1; }
@media(max-width:640px){ .fields-grid { grid-template-columns: 1fr; } }

/* ── TAGS / BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px;
  font-size: 0.68rem; font-weight: 600;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-gray { background: var(--surface2); color: var(--text-2); border: 1px solid var(--border); }
.badge-dark { background: var(--text); color: white; }

/* ── SECTION HEADER ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-title { font-size: 1.05rem; font-weight: 700; }

/* ── KEYWORDS GRID ── */
.keywords-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.kw-chip {
  padding: 5px 13px; border-radius: 20px;
  border: 1px solid var(--border-strong);
  font-size: 0.78rem; color: var(--text-2);
  cursor: pointer; transition: all 0.15s; background: var(--surface);
}
.kw-chip:hover { border-color: var(--text); color: var(--text); background: var(--surface2); }
.kw-chip.selected { background: var(--text); color: white; border-color: var(--text); }

/* ── BRAND CHIPS ── */
.bchip {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 0.72rem; font-weight: 500; color: var(--text-3);
  cursor: pointer; transition: all 0.15s; user-select: none;
}
.bchip:hover { border-color: var(--text); color: var(--text); }
.bchip.active { background: var(--text); color: white; border-color: var(--text); }

/* ── ARTICLE CARDS ── */
.article-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 12px; overflow: hidden;
  transition: box-shadow 0.2s;
}
.article-card:hover { box-shadow: var(--shadow-md); }
.article-header {
  padding: 16px 20px; display: flex;
  align-items: flex-start; justify-content: space-between; gap: 16px;
  cursor: pointer;
}
.article-lang { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; color: var(--text-3); margin-bottom: 4px; text-transform: uppercase; }
.article-title { font-size: 0.95rem; font-weight: 600; line-height: 1.4; margin-bottom: 8px; }
.article-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { background: var(--surface2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 5px; font-size: 0.65rem; color: var(--text-3); }
.article-actions { display: flex; gap: 7px; align-items: center; flex-shrink: 0; }
.article-body { display: none; padding: 0 20px 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.article-body.open { display: block; }
.article-content { font-size: 0.83rem; line-height: 1.8; color: var(--text-2); max-height: 380px; overflow-y: auto; }
.article-content h1,.article-content h2,.article-content h3 { font-weight: 700; color: var(--text); margin: 14px 0 6px; }
.article-content p { margin-bottom: 10px; }
.article-content ul,.article-content ol { margin: 8px 0 10px 20px; }
.article-content a { color: var(--blue); }
.publish-bar { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── HISTORY ROWS ── */
.history-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 18px;
  margin-bottom: 8px; display: flex; align-items: center;
  gap: 14px; flex-wrap: wrap; transition: box-shadow 0.15s;
}
.history-row:hover { box-shadow: var(--shadow); }

/* ── LOADING ── */
.loading-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 48px 40px;
  text-align: center; box-shadow: var(--shadow);
}
.spinner {
  width: 28px; height: 28px; border: 2px solid var(--border);
  border-top-color: var(--text); border-radius: 50%;
  animation: spin 0.7s linear infinite; margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 0.85rem; color: var(--text-2); font-weight: 500; }
.loading-step { font-size: 0.75rem; color: var(--text-3); margin-top: 4px; }

/* ── EMPTY STATE ── */
.empty-state {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 56px 40px;
  text-align: center; box-shadow: var(--shadow);
}
.empty-icon { font-size: 2rem; margin-bottom: 12px; opacity: 0.35; }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-desc { font-size: 0.8rem; color: var(--text-3); }

/* ── INFO BOX ── */
.info-box {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 0.78rem; color: var(--text-2); line-height: 1.6; margin-top: 10px;
}

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── GENERATE CONTROLS ── */
.generate-controls {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
}
.generate-controls .field { flex: 1; min-width: 160px; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--text); color: white;
  border-radius: var(--radius-sm); padding: 11px 18px;
  font-size: 0.8rem; font-weight: 500;
  transform: translateY(80px); opacity: 0;
  transition: all 0.25s; z-index: 999; max-width: 320px;
  box-shadow: var(--shadow-md);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }

/* ── STATS METRICS ── */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 12px; margin-bottom: 20px; }
.metric-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); text-align: center;
}
.metric-value { font-size: 1.8rem; font-weight: 700; margin-bottom: 4px; }
.metric-label { font-size: 0.72rem; color: var(--text-3); font-weight: 500; }

/* ── PLAN CALENDAR ── */
.plan-day {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: box-shadow 0.15s;
}
.plan-day:hover { box-shadow: var(--shadow-md); }
.plan-day.today { border-color: var(--text); box-shadow: 0 0 0 2px rgba(26,23,20,0.1); }
.plan-day.past { opacity: 0.6; }
.plan-day-header {
  padding: 10px 14px; background: var(--surface2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.plan-slot {
  padding: 10px 14px; cursor: pointer; transition: background 0.1s;
  border-bottom: 1px solid var(--border);
}
.plan-slot:last-child { border-bottom: none; }
.plan-slot:hover { background: var(--surface2); }
.plan-slot-time {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.05em;
  margin-bottom: 5px;
}
.plan-slot-keyword { font-size: 0.8rem; font-weight: 500; color: var(--text); line-height: 1.3; margin-bottom: 4px; }
.plan-slot-brand { font-size: 0.68rem; color: var(--text-3); }