/* =========================
   BLOGSEO ADMIN - LIGHT THEME
========================= */
:root {
  --bg: #f5f7fb;
  --bg-soft: #eef2f7;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #111827;
  --primary-soft: #334155;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --success-soft: #dcfce7;
  --warning-soft: #fef3c7;
  --danger-soft: #fee2e2;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12);
  --radius: 20px;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 24rem),
    radial-gradient(circle at top right, rgba(148, 163, 184, 0.12), transparent 20rem),
    linear-gradient(180deg, #f8fafc 0%, #f3f6fb 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: var(--accent); }
a:hover { color: #1d4ed8; }

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

.sidebar {
  width: 290px;
  position: fixed;
  inset: 0 auto 0 0;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 8px 0 30px rgba(15,23,42,0.04);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 24px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.brand:hover { color: var(--text); }

.brand-logo {
  display: block;
  width: 56px;
  height: auto;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand strong {
  font-size: 1.02rem;
  line-height: 1.15;
}

.brand small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav a {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--primary-soft);
  text-decoration: none;
  border: 1px solid transparent;
  font-weight: 600;
  transition: all .2s ease;
}

.side-nav a:hover,
.side-nav a:focus {
  background: var(--panel-soft);
  border-color: var(--line);
  color: var(--text);
  transform: translateX(2px);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.theme-toggle label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  cursor: pointer;
  color: var(--primary-soft);
  font-weight: 600;
}

.theme-toggle-icon {
  width: 24px;
  text-align: center;
}

.theme-toggle input[type="checkbox"] {
  margin-left: auto;
  width: 18px;
  height: 18px;
}

.sidebar-user {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.sidebar-user a {
  display: block;
  font-size: .86rem;
  text-decoration: none;
  color: var(--muted);
  margin-top: 2px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #111827, #475569);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.main-content {
  margin-left: 290px;
  width: calc(100% - 290px);
  padding: 32px;
}

#flash-zone .alert {
  border-radius: 14px;
  border: 1px solid transparent;
  box-shadow: var(--shadow);
}

.card,
.glass-card,
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  color: var(--text);
}

.card,
.glass-card {
  overflow: hidden;
}

.login-body {
  display: flex;
  align-items: center;
}

.login-card {
  padding: 28px;
}

.login-logo {
  width: min(220px, 72%);
  height: auto;
  margin: 0 auto 10px;
  display: block;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-hover-bg: #f8fafc;
  --bs-table-border-color: var(--line);
  margin-bottom: 0;
}

.table thead th {
  color: var(--muted);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom-width: 1px;
}

.table td,
.table th {
  vertical-align: middle;
}

.form-label {
  font-weight: 700;
  color: var(--text);
}

.form-control,
.form-select,
textarea.form-control {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 14px;
  padding: 0.75rem 0.95rem;
}

.form-control:focus,
.form-select:focus {
  background: #fff;
  border-color: rgba(37, 99, 235, .45);
  box-shadow: 0 0 0 .25rem rgba(37, 99, 235, .12);
  color: var(--text);
}

.form-control::placeholder { color: #94a3b8; }
.form-select option { color: var(--text); }
textarea.form-control { min-height: 112px; }
.form-control.tall { min-height: 170px; }
.form-text,
.text-muted,
.small-muted,
p {
  color: var(--muted) !important;
}

.btn {
  border-radius: 14px;
  font-weight: 700;
}

.btn-primary {
  background: linear-gradient(135deg, #111827, #334155);
  border: 0;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #0f172a, #1e293b);
}

.btn-glow {
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.btn-outline-light {
  border-color: var(--line-strong);
  color: var(--text);
  background: #fff;
}

.btn-outline-light:hover,
.btn-outline-light:focus {
  border-color: #94a3b8;
  background: var(--panel-soft);
  color: var(--text);
}

.badge {
  border-radius: 999px;
  font-weight: 700;
}

.text-bg-dark {
  color: var(--text) !important;
  background: #e2e8f0 !important;
}

.text-bg-primary {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
}

.text-bg-success {
  background: #dcfce7 !important;
  color: #15803d !important;
}

.text-bg-secondary {
  background: #e2e8f0 !important;
  color: #475569 !important;
}

.text-bg-warning {
  background: #fef3c7 !important;
  color: #a16207 !important;
}

.text-bg-danger {
  background: #fee2e2 !important;
  color: #b91c1c !important;
}

.text-bg-info {
  background: #e0f2fe !important;
  color: #0369a1 !important;
}

.section-title {
  font-size: .76rem;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 26px 0 12px;
  font-weight: 800;
}

.tip-card,
.article-preview {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
}

.tip-card {
  height: 100%;
  padding: 16px;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
}

.article-preview {
  max-height: 680px;
  overflow: auto;
  padding: 1.35rem;
}

.actions-cell { white-space: nowrap; }
.code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .88rem;
  white-space: pre-wrap;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.image-preview {
  border-radius: 18px;
  border: 1px solid var(--line);
}

.loader { display: none; }
.is-loading .loader { display: inline-block; }
.is-loading .btn-label { display: none; }

.display-6 {
  font-size: 2.2rem;
}

pre, code {
  color: var(--text);
}

.container {
  max-width: 1200px;
}

/* DARK MODE */
body.dark-mode {
  --bg: #0b1020;
  --bg-soft: #111827;
  --panel: rgba(15, 23, 42, 0.96);
  --panel-soft: rgba(15, 23, 42, 0.72);
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(148, 163, 184, 0.35);
  --text: #e8eefc;
  --muted: #94a3b8;
  --primary: #7c3aed;
  --primary-soft: #cbd5e1;
  --accent: #67e8f9;
  --accent-soft: rgba(103, 232, 249, 0.15);
  --shadow: 0 24px 80px rgba(0,0,0,.26);
  --shadow-lg: 0 24px 80px rgba(0,0,0,.36);
  background:
    radial-gradient(circle at 15% 0%, rgba(124,58,237,.35), transparent 34%),
    radial-gradient(circle at 85% 12%, rgba(6,182,212,.25), transparent 30%),
    linear-gradient(140deg,#050816,#08111f 48%,#0b1020);
}

body.dark-mode .sidebar,
body.dark-mode .brand,
body.dark-mode .sidebar-user,
body.dark-mode .theme-toggle,
body.dark-mode .btn-outline-light {
  background: rgba(15, 23, 42, 0.72);
}

body.dark-mode .brand,
body.dark-mode .sidebar-user,
body.dark-mode .theme-toggle,
body.dark-mode .card,
body.dark-mode .glass-card,
body.dark-mode .login-card,
body.dark-mode .tip-card,
body.dark-mode .article-preview,
body.dark-mode .code-box,
body.dark-mode .table {
  border-color: var(--line);
}

body.dark-mode .side-nav a {
  color: #cbd5e1;
}

body.dark-mode .side-nav a:hover,
body.dark-mode .side-nav a:focus {
  background: rgba(255,255,255,.06);
  color: #fff;
}

body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode textarea.form-control,
body.dark-mode .btn-outline-light,
body.dark-mode .theme-toggle,
body.dark-mode .code-box {
  background: rgba(255,255,255,.05);
  color: var(--text);
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
  background: rgba(255,255,255,.07);
  border-color: rgba(103,232,249,.65);
  box-shadow: 0 0 0 .25rem rgba(103,232,249,.12);
}

body.dark-mode .table {
  --bs-table-hover-bg: rgba(255,255,255,.04);
}

body.dark-mode .text-bg-dark {
  color: #e5e7eb !important;
  background: rgba(255,255,255,.08) !important;
}

body.dark-mode .btn-primary {
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
}

body.dark-mode .btn-primary:hover,
body.dark-mode .btn-primary:focus {
  background: linear-gradient(135deg, #6d28d9, #0891b2);
}

body.dark-mode .btn-outline-light {
  color: #e2e8f0;
}

body.dark-mode .brand-logo,
body.dark-mode .login-logo {
  filter: invert(1) brightness(1.5);
}

body, .card, .glass-card, .sidebar, .main-content, .btn, .form-control, .form-select {
  transition: background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

@media (max-width: 991px) {
  .app-shell { display: block; }
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 20px;
  }
  .brand-logo { width: 48px; }
}
