/* BIBLEE CHAT BLOG — Admin Panel */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #080e14;
  --surface: #0f1923;
  --surface2: #162030;
  --surface3: #1c2a3a;
  --gold: #c9a84c;
  --gold-light: #e4c87a;
  --gold-dim: rgba(201,168,76,0.15);
  --gold-border: rgba(201,168,76,0.25);
  --white: #ffffff;
  --text: rgba(255,255,255,0.88);
  --muted: rgba(255,255,255,0.45);
  --faint: rgba(255,255,255,0.12);
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --blue: #60a5fa;
  --border: rgba(255,255,255,0.07);
}

body { background: var(--bg); color: var(--text); font-family: 'DM Sans', sans-serif; min-height: 100vh; }

/* ── LOGIN ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--gold-border);
  padding: 48px 40px 40px;
}

.login-icon {
  text-align: center;
  font-size: 2.5rem;
  color: var(--gold);
  margin-bottom: 20px;
  filter: drop-shadow(0 0 16px rgba(201,168,76,0.35));
}

.login-card h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--white);
  text-align: center;
  margin-bottom: 4px;
}

.login-badge {
  text-align: center;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 32px;
}

.login-error {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.3);
  color: var(--red);
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: 20px;
  display: none;
}

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.field input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--white);
  padding: 11px 14px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus { border-color: var(--gold); }
.field input::placeholder { color: rgba(255,255,255,0.2); }

.login-submit {
  width: 100%;
  margin-top: 8px;
  background: var(--gold);
  color: #080e14;
  border: none;
  padding: 13px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s;
}
.login-submit:hover { background: var(--gold-light); }

/* ── DASHBOARD ── */
.dashboard { display: none; min-height: 100vh; }

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 220px;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sb-logo {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--border);
}

.sb-cross { font-size: 20px; color: var(--gold); }
.sb-name { font-family: 'Playfair Display', serif; font-size: 13px; color: var(--white); font-weight: 700; line-height: 1.2; }
.sb-badge { font-size: 8px; letter-spacing: 3px; color: var(--gold); font-weight: 600; }

.sb-nav { flex: 1; padding: 12px 0; }

.sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
}
.sb-link:hover { color: var(--text); background: var(--faint); }
.sb-link.active { color: var(--gold); border-left-color: var(--gold); background: var(--gold-dim); }
.sb-icon { width: 16px; text-align: center; font-size: 14px; }

.sb-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sb-view-site {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
  transition: color 0.2s;
}
.sb-view-site:hover { color: var(--gold); }

.sb-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}
.sb-logout:hover { border-color: rgba(248,113,113,0.4); color: var(--red); background: rgba(248,113,113,0.06); }

/* Main */
.main-area { margin-left: 220px; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-family: 'Playfair Display', serif; font-size: 16px; color: var(--white); font-weight: 700; }

.scheduler-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4b5563;
  transition: background 0.3s;
}
.pill-dot.on { background: var(--green); box-shadow: 0 0 6px rgba(52,211,153,0.5); }
.pill-dot.off { background: var(--red); }

/* Tabs */
.tab-content { display: none; padding: 28px; flex: 1; }
.tab-content.active { display: block; }

/* Stats row */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--gold); }

.stat-val { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 900; color: var(--gold); line-height: 1; margin-bottom: 6px; }
.stat-lbl { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title { font-size: 13px; font-weight: 600; color: var(--white); letter-spacing: 0.3px; }
.panel-body { padding: 20px; }

/* Recent posts list */
.post-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.post-row:last-child { border-bottom: none; }
.post-row-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.post-row-title { flex: 1; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-row-date { font-size: 11px; color: var(--muted); white-space: nowrap; }
.post-row-link { font-size: 11px; color: var(--gold); font-weight: 600; text-decoration: none; white-space: nowrap; }
.post-row-link:hover { color: var(--gold-light); }

/* Scheduler panel */
.sched-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.sched-info-label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 5px; }
.sched-info-val { font-size: 14px; font-weight: 600; color: var(--white); }

/* Toggle */
.toggle {
  width: 48px; height: 26px;
  background: #2a3a4a;
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
  flex-shrink: 0;
}
.toggle.on { background: var(--gold); }
.toggle-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.toggle.on .toggle-knob { transform: translateX(22px); }

.toggle-row { display: flex; align-items: center; gap: 12px; }
.toggle-label { font-size: 12px; font-weight: 600; color: var(--muted); }

.time-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.chip {
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
}

/* Generate button */
.gen-area { display: flex; flex-direction: column; gap: 14px; }
.gen-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold);
  color: #080e14;
  border: none;
  padding: 13px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  align-self: flex-start;
}
.gen-btn:hover { background: var(--gold-light); }
.gen-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.gen-result {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  display: none;
}
.gen-result.ok { background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.2); color: var(--green); }
.gen-result.err { background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.2); color: var(--red); }

/* Posts table */
.tbl-wrap { overflow-x: auto; }
table.ptbl { width: 100%; border-collapse: collapse; }
table.ptbl th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
table.ptbl td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.ptbl tr:last-child td { border-bottom: none; }
table.ptbl tr:hover td { background: rgba(255,255,255,0.02); }

.tbl-empty { text-align: center; color: var(--muted); padding: 40px; font-size: 13px; }

.act-btns { display: flex; gap: 6px; }
.act-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  border: none;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.act-view { background: var(--gold-dim); color: var(--gold); }
.act-view:hover { background: rgba(201,168,76,0.25); }
.act-del { background: rgba(248,113,113,0.1); color: var(--red); }
.act-del:hover { background: rgba(248,113,113,0.2); }

.pagination { display: flex; gap: 6px; justify-content: center; padding: 16px 0 0; }
.pg-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.pg-btn:hover, .pg-btn.active { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold); }

/* Logs */
.log-box {
  background: #040a10;
  border: 1px solid var(--border);
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 2;
  padding: 16px;
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
}
.log-line { display: flex; gap: 10px; }
.log-ts { color: rgba(255,255,255,0.2); }
.log-lvl-info { color: var(--blue); font-weight: 600; }
.log-lvl-ok { color: var(--green); font-weight: 600; }
.log-lvl-err { color: var(--red); font-weight: 600; }
.log-lvl-warn { color: var(--amber); font-weight: 600; }
.log-msg { color: rgba(255,255,255,0.65); }
.log-empty { color: rgba(255,255,255,0.2); font-style: italic; text-align: center; padding: 40px 0; }

/* Buttons */
.btn-sm {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-sm:hover { border-color: var(--gold-border); color: var(--gold); background: var(--gold-dim); }

/* Modal */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--gold-border);
  padding: 32px;
  max-width: 380px;
  width: 100%;
}
.modal h3 { font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--white); margin-bottom: 10px; }
.modal p { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 24px; }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; }

/* Loading */
.loading-state { text-align: center; color: var(--muted); padding: 32px; font-size: 13px; }
