/* ==========================================================================
   AutoBlogForge LLC — Dashboard stylesheet
   Loaded only on dashboard.html, on top of style.css
   ========================================================================== */

body.dash { background: var(--bg-alt); }

.dash-shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.dash-side {
  background: var(--pine-900);
  color: #c4d6cc;
  padding: var(--sp-5) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.dash-side .logo { color: #fff; }
.dash-side .logo em { color: var(--brass-400); }

.dash-nav { display: grid; gap: 3px; }
.dash-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: #b4c9be;
  font-size: var(--fs-sm);
  font-weight: 500;
}
.dash-nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; text-decoration: none; }
.dash-nav a.active { background: var(--pine-600); color: #fff; }
.dash-nav a .ico {
  width: 20px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.85;
}
.dash-nav-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6f8a7c;
  padding: 0 12px;
  margin: var(--sp-4) 0 var(--sp-2);
}

.quota {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  background: rgba(255, 255, 255, 0.04);
  margin-top: auto;
}
.quota strong { color: #fff; font-size: var(--fs-sm); display: block; margin-bottom: 4px; }
.quota p { font-size: var(--fs-xs); color: #9db4a9; margin-bottom: var(--sp-3); }
.meter {
  height: 7px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: var(--sp-3);
}
.meter > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--pine-400), var(--brass-400));
  border-radius: inherit;
  transition: width 400ms ease;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.05);
}
.user-chip .avatar { background: var(--brass-500); color: #22180a; }
.user-chip b { color: #fff; font-size: var(--fs-sm); display: block; line-height: 1.3; }
.user-chip span { font-size: var(--fs-xs); color: #93aa9d; }

/* --------------------------------------------------------------------------
   Main area
   -------------------------------------------------------------------------- */
.dash-main { padding: var(--sp-5) var(--sp-6) var(--sp-8); min-width: 0; }

.dash-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}
.dash-top h1 { font-size: var(--fs-2xl); margin-bottom: 2px; }
.dash-top p { color: var(--text-soft); font-size: var(--fs-sm); }
.dash-top .tools { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }

.dash-burger {
  display: none;
  width: 40px; height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  position: relative;
}
.dash-burger span {
  position: absolute;
  left: 10px;
  width: 18px; height: 2px;
  background: var(--text);
}
.dash-burger span:nth-child(1) { top: 13px; }
.dash-burger span:nth-child(2) { top: 18px; }
.dash-burger span:nth-child(3) { top: 23px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-6); }
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.kpi .label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.kpi b { font-family: var(--font-display); font-size: var(--fs-2xl); letter-spacing: -0.03em; display: block; }
.kpi .delta { font-size: var(--fs-xs); color: var(--ok); font-family: var(--font-mono); }
.kpi .delta.flat { color: var(--text-soft); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-5);
}
.panel-head {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.panel-head h2 { font-size: var(--fs-md); margin: 0; }
.panel-body { padding: var(--sp-5); }
.panel-body.tight { padding: 0; }

.filter-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.filter-row .input { width: auto; min-width: 190px; padding: 9px 12px; }
.filter-row select.input { min-width: 150px; }

.doc-row {
  display: grid;
  grid-template-columns: 1fr 130px 120px 118px;
  gap: var(--sp-4);
  align-items: center;
  padding: 14px var(--sp-5);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.doc-row:last-child { border-bottom: 0; }
.doc-row .title { font-weight: 600; }
.doc-row .sub { font-size: var(--fs-xs); color: var(--text-soft); font-family: var(--font-mono); }
.doc-row .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.doc-row .row-actions button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 5px 9px;
  font-size: var(--fs-xs);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-mono);
}
.doc-row .row-actions button:hover { border-color: var(--brand); color: var(--brand); }

.status {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  display: inline-block;
  border: 1px solid transparent;
}
.status.draft { background: var(--bg-alt); color: var(--text-soft); border-color: var(--line); }
.status.review { background: var(--accent-soft); color: var(--brass-600); }
.status.published { background: var(--brand-soft); color: var(--pine-700); }
[data-theme="dark"] .status.review { color: var(--brass-400); }
[data-theme="dark"] .status.published { color: var(--pine-300); }

.dash-gen { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.dash-gen .output { max-height: 360px; padding: var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-md); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }

.empty-state {
  text-align: center;
  padding: var(--sp-7) var(--sp-5);
  color: var(--text-soft);
  font-size: var(--fs-sm);
}
.empty-state b { display: block; color: var(--text); font-family: var(--font-display); font-size: var(--fs-md); margin-bottom: 6px; }

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 14, 0.5);
  display: none;
  z-index: 95;
}
.scrim.show { display: block; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-gen, .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .dash-shell { grid-template-columns: 1fr; }
  .dash-side {
    position: fixed;
    left: 0; top: 0;
    width: 264px;
    z-index: 100;
    transform: translateX(-104%);
    transition: transform 240ms ease;
  }
  .dash-side.open { transform: translateX(0); }
  .dash-burger { display: block; }
  .dash-main { padding: var(--sp-5) var(--sp-4) var(--sp-7); }
  .doc-row { grid-template-columns: 1fr auto; row-gap: 8px; }
  .doc-row .row-actions { grid-column: 2; }
}

@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
}
