/* Bastariya Babu — Editorial Studio 2.0 Design System */
:root {
  --forest: #123629;
  --forest-2: #1A4736;
  --terracotta: #B54D2B;
  --terracotta-dark: #933B1E;
  --gold: #D4A65A;
  --cream: #F5F2EB;
  --surface: #FFFFFF;
  --surface-alt: #FAF8F3;
  --ink: #172520;
  --muted: #5C6B64;
  --border: #E5DFD2;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(18, 54, 41, 0.05);
  --sidebar-w: 248px;
}

[data-theme="dark"] {
  --cream: #0F1915;
  --surface: #16241E;
  --surface-alt: #1C2E27;
  --ink: #EEF3F0;
  --muted: #9CB0A6;
  --border: #273D34;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Mukta', 'Noto Sans Devanagari', 'Inter', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  transition: background 0.2s, color 0.2s;
}

.studio-shell {
  display: flex;
  min-height: 100vh;
}

/* ===== COLLAPSIBLE SIDEBAR 2.0 ===== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--forest);
  color: #E3ECE8;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width 0.22s ease, transform 0.22s ease;
  z-index: 40;
}

.studio-shell.collapsed .sidebar {
  width: 72px;
  padding: 18px 10px;
}
.studio-shell.collapsed .brand-copy,
.studio-shell.collapsed .nav-group-label,
.studio-shell.collapsed .nav-link span {
  display: none;
}
.studio-shell.collapsed .nav-link {
  justify-content: center;
  padding: 10px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
}
.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(212, 166, 90, 0.18);
  border: 1px solid rgba(212, 166, 90, 0.45);
  color: var(--gold);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-copy strong { display: block; font-size: 1.05rem; color: #fff; line-height: 1.15; }
.brand-copy small {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.nav-group-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(227, 236, 232, 0.48);
  padding: 12px 10px 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #D2E0DA;
  text-decoration: none;
  padding: 9px 11px;
  border-radius: 9px;
  margin-bottom: 2px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; stroke-width: 1.9; }
.nav-link:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
.nav-link.active {
  background: rgba(212, 166, 90, 0.18);
  color: #F6DCAB;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar-spacer { flex: 1; }
.sidebar-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 10px;
  margin-top: 12px;
}

/* ===== MAIN WORKSPACE (Tight, Zero Wasted Space) ===== */
.studio-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.studio-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 11px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.icon-btn:hover { border-color: var(--terracotta); color: var(--terracotta); }
.icon-btn svg { width: 18px; height: 18px; }

.studio-content {
  padding: 22px 26px 40px;
  width: 100%;
}

/* Page Header */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head h1 { margin: 0; font-size: 1.55rem; font-weight: 700; line-height: 1.25; }
.page-head p { margin: 2px 0 0; font-size: 0.9rem; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--terracotta); color: #fff; }
.btn-primary:hover { background: var(--terracotta-dark); color: #fff; }
.btn-forest { background: var(--forest); color: #fff; }
.btn-forest:hover { background: var(--forest-2); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--terracotta); color: var(--terracotta); }
.btn-danger { background: #C5292A; color: #fff; }
.btn-danger:hover { background: #A31D1E; color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 0.82rem; border-radius: 7px; }

/* KPI Grid (2x2 or 4-col) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}
.kpi-top svg { width: 17px; height: 17px; color: var(--muted); }
.kpi-val {
  font-family: 'Inter', 'Mukta', sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 6px;
  line-height: 1.1;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.card-sub { font-size: 0.82rem; color: var(--muted); }

/* Dashboard 2-Col Split */
.dash-split {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 18px;
}

.quick-list { display: flex; flex-direction: column; gap: 6px; }
.quick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.quick-item:hover { background: var(--surface-alt); border-color: var(--border); color: var(--terracotta); }
.quick-item-left { display: flex; align-items: center; gap: 10px; }
.quick-item-left svg { width: 17px; height: 17px; color: var(--forest); }

.top-article-row { margin-bottom: 14px; }
.top-article-row:last-child { margin-bottom: 0; }
.top-article-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 5px;
}
.bar-track {
  height: 7px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--forest), #256B52);
  border-radius: 999px;
}

/* Traffic SVG Chart */
.chart-wrap { width: 100%; overflow: hidden; }
.chart-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 8px;
}

/* Article List & Tabs */
.tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.status-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
}
.tab-pill.active, .tab-pill:hover {
  background: var(--surface-alt);
  color: var(--ink);
  border-color: var(--border);
}

.article-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
}
.article-row-card:last-child { border-bottom: none; }
.article-row-left { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.article-row-title { font-weight: 600; font-size: 0.98rem; color: var(--ink); text-decoration: none; display: block; }
.article-row-title:hover { color: var(--terracotta); }
.article-row-meta { font-size: 0.82rem; color: var(--muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.dot-badge { font-weight: 600; font-size: 0.8rem; }
.dot-pub { color: #16794B; }
.dot-draft { color: #B45309; }
.dot-sched { color: #1D4ED8; }

/* Notion / Gutenberg Editor */
.editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) 330px;
  gap: 20px;
  align-items: start;
}
.notion-title {
  width: 100%;
  border: none !important;
  background: transparent !important;
  font-size: 1.75rem !important;
  font-weight: 700;
  padding: 6px 0 12px !important;
  color: var(--ink);
  box-shadow: none !important;
}
.notion-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
}
.notion-toolbar button {
  background: transparent;
  border: none;
  padding: 6px 9px;
  border-radius: 7px;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: 'Inter', 'Mukta', sans-serif;
}
.notion-toolbar button:hover { background: var(--surface); color: var(--terracotta); }
.notion-body {
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  line-height: 1.8;
  font-size: 1rem;
}
.word-bar {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 8px;
}

/* Forms */
label { display: block; font-size: 0.85rem; font-weight: 600; margin: 12px 0 5px; color: var(--ink); }
label:first-child { margin-top: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="datetime-local"], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.92rem;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(18, 54, 41, 0.12);
}

.seo-score-val {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--forest);
}
.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  background: var(--surface-alt);
}
.upload-preview {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
  display: none;
}
.upload-preview.has-img { display: block; }

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}
.media-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.media-card img { width: 100%; height: 135px; object-fit: cover; display: block; }
.media-card-body { padding: 10px; font-size: 0.8rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { font-size: 0.8rem; color: var(--muted); font-weight: 600; background: var(--surface-alt); }

.alert { padding: 11px 15px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; font-size: 0.9rem; }
.alert-success { background: #E3F5EA; color: #14532D; border: 1px solid #B7E4C7; }
.alert-error { background: #FDECEC; color: #991B1B; border: 1px solid #F5C2C7; }

.login-box { max-width: 410px; margin: 76px auto; background: var(--surface); padding: 30px; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow); }

@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-split, .editor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); }
  .studio-shell.mobile-open .sidebar { transform: translateX(0); }
  .studio-content { padding: 16px; }
}
/* Editorial Studio 3.0 */
:root{--radius:18px;--shadow:0 8px 28px rgba(18,54,41,.07)}
.sidebar{background:linear-gradient(155deg,#143f32,#08281f 75%)}
.nav-link.active{background:linear-gradient(90deg,rgba(212,166,90,.24),rgba(36,105,76,.35));box-shadow:inset 3px 0 #d4a65a}
.studio-topbar{box-shadow:0 2px 18px rgba(18,54,41,.06)}
.kpi-card{background:linear-gradient(145deg,var(--surface),var(--surface-alt));border-top:3px solid #287b59;transition:transform .18s,box-shadow .18s}.kpi-card:nth-child(even){border-top-color:#b56b31}.kpi-card:hover{transform:translateY(-2px)}.bb-kpi-link{text-decoration:none;color:var(--ink)}.bb-kpis{grid-template-columns:repeat(auto-fit,minmax(145px,1fr))}.quick-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}.quick-item{border:1px solid var(--border);border-radius:12px;padding:14px;background:var(--surface-alt)}
.bb-builder{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,300px);gap:18px;align-items:start}.bb-builder label{display:block;margin:10px 0;font-weight:600}.bb-builder label input,.bb-builder label textarea,.bb-builder label select{display:block;width:100%;margin-top:5px}.bb-builder aside .btn{margin:8px 0;width:100%}.bb-actions{display:flex;align-items:center;flex-wrap:wrap;gap:7px}.bb-actions form{display:inline-flex;gap:6px;flex-wrap:wrap}.bb-tools{margin:12px 0}.bb-visual,#bbContent{min-height:260px;width:100%;padding:18px;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--ink);overflow-wrap:anywhere}.bb-visual img{max-width:100%;height:auto}.bb-visual:focus{outline:2px solid #287b59}#bbPreview{display:block;width:100%;max-width:100%;height:400px;margin:10px auto;border:1px solid var(--border);border-radius:12px;background:white}.bb-table{overflow-x:auto}.bb-table table{width:100%;border-collapse:collapse}.bb-table th,.bb-table td{padding:14px;text-align:left;border-bottom:1px solid var(--border)}.bb-builder [hidden]{display:none!important}@media(max-width:900px){.bb-builder{grid-template-columns:1fr}}@media(max-width:480px){.bb-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.bb-table th,.bb-table td{padding:8px}.topbar-right{flex-wrap:wrap}}
.bb-chart{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:clamp(5px,2vw,28px);padding:15px 0}.bb-chart-col{text-align:center;min-width:0}.bb-chart-track{height:135px;display:flex;align-items:flex-end;justify-content:center;border-bottom:1px solid var(--border);margin:6px 0}.bb-chart-bar{width:64%;background:linear-gradient(0deg,#15513b,#45a77e);border-radius:9px 9px 0 0}.bb-chart-col small{color:var(--muted)}
