/* =====================================================
   admin/assets/admin.css
   অ্যাডমিন প্যানেলের ডিজাইন সিস্টেম — ফ্রন্টএন্ড থেকে সম্পূর্ণ আলাদা
   (একই ব্র্যান্ড কালার ব্যবহার করা হয়েছে, কিন্তু ড্যাশবোর্ড-ধর্মী লেআউট)
   ===================================================== */

:root {
  --a-ink: #171A21;
  --a-ink-soft: #3B3F4A;
  --a-sidebar-bg: #14171F;
  --a-sidebar-hover: #1F2430;
  --a-primary: #1F6F5C;
  --a-primary-dark: #144537;
  --a-primary-light: #E7F1EE;
  --a-accent: #E5A03B;
  --a-bg: #F4F5F3;
  --a-line: #E3E4E0;
  --a-muted: #6B6F76;
  --a-danger: #C0392B;
  --a-danger-light: #FBEAE8;
  --sidebar-width: 260px;
  --font-body: 'Inter', 'Hind Siliguri', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
}

* { box-sizing: border-box; }
body { font-family: var(--font-body); background: var(--a-bg); color: var(--a-ink-soft); margin: 0; }
a { text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--a-accent); outline-offset: 2px;
}

.admin-wrapper { display: flex; min-height: 100vh; }

/* ---------- সাইডবার ---------- */
.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--a-sidebar-bg);
  color: rgba(255,255,255,0.75);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform 0.3s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 1.4rem 1.3rem;
  color: #fff; font-weight: 700; font-size: 1.05rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .brand-mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--a-primary);
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}
.sidebar-nav { flex-grow: 1; padding: 1rem 0.8rem; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.68);
  font-size: 0.93rem; font-weight: 500;
}
.sidebar-nav a svg { flex-shrink: 0; width: 18px; height: 18px; }
.sidebar-nav a:hover { background: var(--a-sidebar-hover); color: #fff; }
.sidebar-nav a.active { background: var(--a-primary); color: #fff; }
.sidebar-footer { padding: 1rem 0.8rem 1.3rem; border-top: 1px solid rgba(255,255,255,0.08); }
.logout-link { display: flex; align-items: center; gap: 10px; padding: 0.7rem 0.9rem; color: rgba(255,255,255,0.6); border-radius: var(--radius-sm); font-size: 0.93rem; }
.logout-link:hover { background: rgba(198,60,60,0.15); color: #ff8f80; }

/* ---------- মেইন এরিয়া ---------- */
.admin-main { margin-left: var(--sidebar-width); flex-grow: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
  background: #fff; border-bottom: 1px solid var(--a-line);
  padding: 1rem 1.6rem;
  display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 1020;
}
.admin-page-title { font-size: 1.25rem; font-weight: 700; color: var(--a-ink); margin: 0; flex-grow: 1; }
.admin-topbar-right { display: flex; align-items: center; gap: 1rem; font-size: 0.88rem; white-space: nowrap; }
.topbar-link { color: var(--a-primary); font-weight: 500; }
.topbar-admin-name { color: var(--a-muted); }
.sidebar-toggle-btn { background: none; border: none; color: var(--a-ink); padding: 0.3rem; }
.admin-content { padding: 1.6rem; flex-grow: 1; }

/* ---------- স্ট্যাট কার্ড ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.2rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border: 1px solid var(--a-line); border-radius: var(--radius-md); padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1rem; }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--a-primary-light); color: var(--a-primary); flex-shrink: 0; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--a-ink); line-height: 1.2; }
.stat-label { font-size: 0.85rem; color: var(--a-muted); }

/* ---------- প্যানেল/কার্ড ---------- */
.admin-panel { background: #fff; border: 1px solid var(--a-line); border-radius: var(--radius-md); padding: 1.5rem; margin-bottom: 1.5rem; }
.admin-panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; flex-wrap: wrap; gap: 0.8rem; }
.admin-panel-heading h2 { font-size: 1.1rem; font-weight: 700; color: var(--a-ink); margin: 0; }

/* ---------- টেবিল ---------- */
.table { color: var(--a-ink-soft); margin-bottom: 0; }
.table thead th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--a-muted); border-bottom: 2px solid var(--a-line); font-weight: 600; padding: 0.8rem 0.9rem; white-space: nowrap; }
.table td { padding: 0.85rem 0.9rem; vertical-align: middle; border-bottom: 1px solid var(--a-line); }
.table-responsive { border-radius: var(--radius-md); }
.table-thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.table-thumb-placeholder { width: 52px; height: 52px; border-radius: 8px; background: var(--a-primary-light); color: var(--a-primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; flex-shrink: 0; }
.cell-title { font-weight: 600; color: var(--a-ink); }
.cell-sub { font-size: 0.82rem; color: var(--a-muted); }

/* ---------- ব্যাজ ---------- */
.badge-status { padding: 0.32rem 0.7rem; border-radius: 999px; font-size: 0.76rem; font-weight: 600; display: inline-block; }
.badge-published { background: #E7F1EE; color: #144537; }
.badge-draft { background: #F1EADD; color: #8A6116; }
.badge-pending { background: #FCEFDB; color: #8A6116; }
.badge-approved { background: #E7F1EE; color: #144537; }

/* ---------- বাটন ---------- */
.btn-admin-primary { background: var(--a-primary); border: 1px solid var(--a-primary); color: #fff; font-weight: 600; }
.btn-admin-primary:hover { background: var(--a-primary-dark); border-color: var(--a-primary-dark); color: #fff; }
.btn-outline-admin { border: 1px solid var(--a-line); color: var(--a-ink-soft); background: #fff; }
.btn-outline-admin:hover { border-color: var(--a-primary); color: var(--a-primary); background: var(--a-primary-light); }
.btn-danger-soft { background: var(--a-danger-light); color: var(--a-danger); border: 1px solid #F3D2CD; font-weight: 600; }
.btn-danger-soft:hover { background: #F3D2CD; color: #8f291d; }
.action-icon-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--a-line); background: #fff; color: var(--a-ink-soft); }
.action-icon-btn:hover { border-color: var(--a-primary); color: var(--a-primary); background: var(--a-primary-light); }
.action-icon-btn.danger:hover { border-color: #F3D2CD; color: var(--a-danger); background: var(--a-danger-light); }
.action-group { display: flex; gap: 6px; }

/* ---------- ফর্ম ---------- */
.form-label { font-weight: 600; color: var(--a-ink); font-size: 0.9rem; }
.form-control, .form-select { border: 1px solid var(--a-line); border-radius: var(--radius-sm); padding: 0.55rem 0.8rem; }
.form-control:focus, .form-select:focus { border-color: var(--a-primary); box-shadow: 0 0 0 3px var(--a-primary-light); }
.form-hint { font-size: 0.8rem; color: var(--a-muted); margin-top: 0.3rem; }
.form-section-title { font-size: 0.95rem; font-weight: 700; color: var(--a-ink); margin: 1.6rem 0 1rem; padding-top: 1.2rem; border-top: 1px solid var(--a-line); }
.form-section-title:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.thumb-preview-wrap { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.thumb-preview { width: 220px; max-width: 100%; aspect-ratio: 16/10; border-radius: var(--radius-md); object-fit: cover; border: 1px solid var(--a-line); background: var(--a-primary-light); display: block; }

/* ---------- ফিল্টার ট্যাব (posts.php, comments.php) ---------- */
.filter-tabs { display: flex; gap: 8px; margin-bottom: 1.3rem; flex-wrap: wrap; }
.filter-tab { padding: 0.42rem 0.95rem; border-radius: 999px; font-size: 0.85rem; font-weight: 500; border: 1px solid var(--a-line); color: var(--a-ink-soft); background: #fff; }
.filter-tab:hover { border-color: var(--a-primary); color: var(--a-primary); }
.filter-tab.active { background: var(--a-primary); border-color: var(--a-primary); color: #fff; }

/* ---------- এম্পটি স্টেট ---------- */
.admin-empty { text-align: center; padding: 3rem 1rem; color: var(--a-muted); }
.admin-empty svg { color: var(--a-line); margin-bottom: 0.8rem; }

/* ---------- লগইন / সেটাপ স্ক্রিন ---------- */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #14171F 0%, #1F6F5C 140%); padding: 1.5rem; }
.auth-card { background: #fff; border-radius: 18px; padding: 2.4rem; width: 100%; max-width: 400px; box-shadow: 0 30px 60px rgba(0,0,0,0.28); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 0.5rem; font-weight: 700; font-size: 1.25rem; color: var(--a-ink); font-family: var(--font-body); }
.auth-brand .brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--a-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.auth-subtitle { color: var(--a-muted); font-size: 0.9rem; margin-bottom: 1.7rem; }
.auth-footer-note { text-align: center; font-size: 0.82rem; color: rgba(255,255,255,0.7); margin-top: 1.3rem; }
.auth-footer-note a { color: #fff; text-decoration: underline; }

/* ---------- মোবাইল রেসপন্সিভ ---------- */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1035; }

@media (max-width: 991px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-backdrop.show { display: block; }
}

@media (max-width: 575px) {
  .admin-content { padding: 1.1rem; }
  .admin-topbar { padding: 0.85rem 1.1rem; }
  .topbar-admin-name { display: none; }
}
