/* ============================================================
   Hindi Portal - Shared Stylesheet
   ============================================================ */

:root {
  /* Color ramps */
  --primary-50: #e8eef7;
  --primary-100: #c5d5ea;
  --primary-200: #97b4d6;
  --primary-300: #6493c0;
  --primary-400: #3b73a8;
  --primary-500: #1f548f;
  --primary-600: #173f70;
  --primary-700: #102d54;
  --primary-800: #0a1d38;
  --primary-900: #061224;

  --accent-50: #fdf3e7;
  --accent-100: #f9e0c0;
  --accent-200: #f3c084;
  --accent-300: #ed9d44;
  --accent-400: #e8831d;
  --accent-500: #c96a0c;
  --accent-600: #a05209;
  --accent-700: #783c06;

  --success-500: #1f9d55;
  --warning-500: #d97706;
  --error-500: #dc2626;

  --neutral-0: #ffffff;
  --neutral-50: #f7f8fa;
  --neutral-100: #eef0f3;
  --neutral-200: #dde1e7;
  --neutral-300: #c2c8d2;
  --neutral-400: #8b94a3;
  --neutral-500: #5f6877;
  --neutral-600: #404a59;
  --neutral-700: #2a323d;
  --neutral-800: #1a2028;
  --neutral-900: #0f141a;

  /* Spacing (8px system) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Typography */
  --font-hindi: "Noto Sans Devanagari", "Mangal", "Nirmala UI", system-ui, sans-serif;
  --font-ui: "Noto Sans Devanagari", system-ui, -apple-system, sans-serif;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-md: 18px;
  --fs-lg: 22px;
  --fs-xl: 28px;
  --fs-2xl: 36px;
  --fs-3xl: 48px;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 20, 26, 0.08);
  --shadow: 0 4px 16px rgba(15, 20, 26, 0.10);
  --shadow-lg: 0 12px 40px rgba(15, 20, 26, 0.16);

  --container: 1200px;
  --transition: 0.22s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

#site-header {
    position: sticky;
    top: 0;
    z-index: 100;
}
/*.site-header {
    background: #fff;
}

.main-nav {
    background: #0b3d63; 
}*/

html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100vw; }

html, body {
    height: 100%;
}

    body.admin-body {
        margin: 0;
        height: 100vh;
        overflow: hidden; /* stop the whole page from scrolling */
    }

body {
  font-family: var(--font-hindi);
  color: var(--neutral-800);
  background: var(--neutral-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: var(--fs-base); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { line-height: 1.25; color: var(--neutral-900); font-weight: 700; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
.section-title {
  font-size: var(--fs-lg);
  color: var(--primary-700);
  padding-bottom: var(--sp-2);
  border-bottom: 3px solid var(--accent-400);
  display: inline-block;
  margin-bottom: var(--sp-5);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: var(--transition);
  border: 1px solid transparent;
}
.btn-primary { background: var(--primary-600); color: #fff; }
.btn-primary:hover { background: var(--primary-700); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-accent { background: var(--accent-400); color: #fff; }
.btn-accent:hover { background: var(--accent-500); }
.btn-outline { background: transparent; border-color: var(--neutral-300); color: var(--neutral-700); }
.btn-outline:hover { border-color: var(--primary-500); color: var(--primary-600); }
.btn-danger { background: var(--error-500); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-xs); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header {
  background: #fff;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) 0;
  gap: var(--sp-4);
  flex-wrap: nowrap;
  overflow: hidden;
}
.logo-wrap { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; }
.logo-img { height: 56px; width: auto; }
.logo-text { font-size: var(--fs-lg); font-weight: 700; color: var(--primary-700); line-height: 1.2; white-space: nowrap; }
.logo-text small { display: block; font-size: var(--fs-xs); color: var(--neutral-500); font-weight: 500; }
.header-actions { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; }
.header-date { font-size: var(--fs-xs); color: var(--neutral-500); white-space: nowrap; }

/* ---------- Banner ---------- */
.banner {
  width: 100%;
  height: 320px;
  overflow: hidden;
  position: relative;
  background: var(--primary-800);
}
.banner-slides { display: flex; height: 100%; transition: transform 0.6s ease; }
.banner-slide { min-width: 100%; height: 100%; position: relative; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; }
.banner-slide .banner-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: var(--sp-8) var(--sp-6);
  background: linear-gradient(transparent, rgba(6, 18, 36, 0.85));
  color: #fff;
}
.banner-slide .banner-caption h2 { color: #fff; font-size: var(--fs-xl); }
.banner-dots {
  position: absolute; bottom: var(--sp-4); right: var(--sp-6);
  display: flex; gap: var(--sp-2);
}
.banner-dots button {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.5); transition: var(--transition);
}
.banner-dots button.active { background: var(--accent-400); width: 28px; border-radius: 6px; }

/* ---------- Navigation ---------- */
.main-nav {
  background: var(--primary-700);
  position: relative;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}
.nav-list {
  display: flex;
  list-style: none;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-width: 100%;
}
.nav-list::-webkit-scrollbar { display: none; }
.nav-list li { flex-shrink: 0; }
.nav-list li a {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: var(--transition);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.nav-list li a:hover { background: var(--primary-800); }
.nav-list li a.active { border-bottom-color: var(--accent-400); background: var(--primary-800); }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--sp-3);
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger span {
  width: 26px; height: 3px; background: #fff; border-radius: 2px;
  transition: var(--transition);
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(6px, 7px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(6px, -7px); }

/* ---------- Home Layout ---------- */
.home-grid {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: var(--sp-6);
  padding: var(--sp-6) 0;
}
.main-content { min-width: 0; }
.sidebar { min-width: 0; }

/* Featured article */
.featured-article {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.featured-article .featured-img {
  width: 100%; height: 360px; object-fit: cover; border-radius: var(--radius);
}
.featured-article .featured-tag {
  display: inline-block; background: var(--accent-400); color: #fff;
  padding: 4px 12px; border-radius: 20px; font-size: var(--fs-xs); font-weight: 600;
  margin-bottom: var(--sp-2);
}
.featured-article h2 { font-size: var(--fs-xl); margin-bottom: var(--sp-2); }
.featured-article h2 a:hover { color: var(--primary-600); }
.featured-article .article-meta { font-size: var(--fs-xs); color: var(--neutral-500); margin-bottom: var(--sp-3); }

/* Article card grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-5);
}
.article-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.article-card .card-img { width: 100%; height: 200px; object-fit: cover; }
.article-card .card-body { padding: var(--sp-4); flex: 1; display: flex; flex-direction: column; }
.article-card .card-cat {
  font-size: var(--fs-xs); color: var(--accent-500); font-weight: 600;
  text-transform: uppercase; margin-bottom: var(--sp-2);
}
.article-card h3 { font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.article-card h3 a:hover { color: var(--primary-600); }
.article-card .card-desc {
  font-size: var(--fs-sm); color: var(--neutral-600); margin-bottom: var(--sp-3);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card .card-meta { font-size: var(--fs-xs); color: var(--neutral-400); margin-top: auto; }
.read-more {
  color: var(--primary-600); font-weight: 600; font-size: var(--fs-sm);
  display: inline-flex; align-items: center; gap: 4px;
}
.read-more:hover { color: var(--accent-500); gap: 8px; }

/* ---------- Sidebar ---------- */
.sidebar-block {
  background: #fff;
  border-radius: var(--radius);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.sidebar-block h3 {
  font-size: var(--fs-md); color: var(--primary-700);
  padding-bottom: var(--sp-2); margin-bottom: var(--sp-4);
  border-bottom: 2px solid var(--neutral-200);
}
.social-links { display: flex; flex-direction: column; gap: var(--sp-3); }
.social-link {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3); border-radius: var(--radius-sm);
  background: var(--neutral-50); transition: var(--transition);
  font-weight: 600; font-size: var(--fs-sm);
}
.social-link:hover { background: var(--primary-50); transform: translateX(4px); }
.social-link .social-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.social-link.twitter .social-icon { background: #000; }
.social-link.facebook .social-icon { background: #1877f2; }
.social-link.website .social-icon { background: var(--primary-600); }

/* Ads */
.ad-item {
  display: block; margin-bottom: var(--sp-3);
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--neutral-200); transition: var(--transition);
}
.ad-item:hover { box-shadow: var(--shadow); transform: scale(1.02); }
.ad-item img { width: 100%; height: 120px; object-fit: cover; }
.ad-item .ad-label { padding: var(--sp-2); font-size: var(--fs-xs); color: var(--neutral-500); }

/* ---------- Category Page ---------- */
.page-header {
  background: var(--primary-700);
  color: #fff;
  padding: var(--sp-8) 0;
  display:none;
}
.page-header h1 { color: #fff; font-size: var(--fs-2xl); }
.page-header .breadcrumb { font-size: var(--fs-sm); color: var(--primary-100); margin-top: var(--sp-2); }
.page-header .breadcrumb a:hover { color: var(--accent-300); }

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
  padding: var(--sp-6) 0;
}
.filters {
  display: flex; gap: var(--sp-3); flex-wrap: wrap;
  padding: var(--sp-4) 0; margin-bottom: var(--sp-4);
  align-items: center;
}
.filters input, .filters select {
  padding: var(--sp-3) var(--sp-4); border: 1px solid var(--neutral-300);
  border-radius: var(--radius-sm); background: #fff;
}
.filters input { flex: 1; min-width: 200px; }

/* ---------- Article Detail ---------- */
.article-detail { padding: var(--sp-8) 0; }
.article-detail-header { margin-bottom: var(--sp-5); }
.article-detail-header .cat-badge {
  display: inline-block; background: var(--accent-400); color: #fff;
  padding: 4px 14px; border-radius: 20px; font-size: var(--fs-xs); font-weight: 600;
  margin-bottom: var(--sp-3);
}
.article-detail-header h1 { font-size: var(--fs-3xl); margin-bottom: var(--sp-3); line-height: 1.2; }
.article-meta-row {
  display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap;
  font-size: var(--fs-sm); color: var(--neutral-500);
  padding-bottom: var(--sp-4); border-bottom: 1px solid var(--neutral-200);
  margin-bottom: var(--sp-5);
}
.article-hero-img {
  width: 100%; height: 420px; object-fit: cover; border-radius: var(--radius-lg);
  margin-bottom: var(--sp-6);
}
.article-content { font-size: var(--fs-md); line-height: 1.8; color: var(--neutral-700); }
.article-content p { margin-bottom: var(--sp-4); }

/* Gallery */
.gallery { margin: var(--sp-6) 0; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-3);
}
.gallery-item {
  width: 100%; height: 140px; object-fit: cover; border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--transition);
}
.gallery-item:hover { transform: scale(1.04); box-shadow: var(--shadow); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(6, 18, 36, 0.92);
  display: none; align-items: center; justify-content: center; z-index: 1000;
  padding: var(--sp-6);
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90%; max-height: 85vh; border-radius: var(--radius); }
.lightbox-close {
  position: absolute; top: var(--sp-4); right: var(--sp-6);
  color: #fff; font-size: 36px; cursor: pointer;
}

/* PDF attachment */
.pdf-attachment {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: var(--error-500); color: #fff; padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-sm); font-weight: 600; margin: var(--sp-4) 0;
}
.pdf-attachment:hover { background: #b91c1c; }

/* Share */
.share-row { display: flex; gap: var(--sp-3); align-items: center; margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--neutral-200); }
.share-btn {
  width: 40px; height: 40px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; color: #fff; transition: var(--transition);
}
.share-btn:hover { transform: translateY(-2px); }
.share-btn.twitter { background: #000; }
.share-btn.facebook { background: #1877f2; }
.share-btn.whatsapp { background: #25d366; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--primary-900); color: var(--neutral-300);
  padding: var(--sp-10) 0 var(--sp-5);
  margin-top: var(--sp-10);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--sp-8);
  margin-bottom: var(--sp-8);
}
.footer-brand .logo-text { color: #fff; }
.footer-brand p { margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--neutral-400); line-height: 1.7; }
.footer-col h4 { color: #fff; font-size: var(--fs-md); margin-bottom: var(--sp-4); }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: var(--sp-2); }
.footer-col ul li a { font-size: var(--fs-sm); color: var(--neutral-400); transition: var(--transition); }
.footer-col ul li a:hover { color: var(--accent-300); padding-left: 4px; }
.footer-social { display: flex; gap: var(--sp-3); margin-top: var(--sp-4); }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%; background: var(--primary-800);
  display: flex; align-items: center; justify-content: center; color: #fff; transition: var(--transition);
}
.footer-social a:hover { background: var(--accent-400); }
.footer-bottom {
  border-top: 1px solid var(--primary-800);
  padding-top: var(--sp-5); text-align: center;
  font-size: var(--fs-xs); color: var(--neutral-500);
}

/* ---------- Empty / Loading ---------- */
.loading, .empty-state { text-align: center; padding: var(--sp-10); color: var(--neutral-500); }
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--neutral-200);
  border-top-color: var(--primary-600); border-radius: 50%;
  margin: 0 auto var(--sp-3); animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-banner {
  background: #fee2e2; color: #991b1b; padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm); margin-bottom: var(--sp-4); font-size: var(--fs-sm);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(6, 18, 36, 0.6);
  display: none; align-items: center; justify-content: center; z-index: 900;
  padding: var(--sp-4);
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg); padding: var(--sp-6);
  max-width: 420px; width: 100%; box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(20px); } }
.modal h3 { margin-bottom: var(--sp-3); }
.modal p { color: var(--neutral-600); margin-bottom: var(--sp-5); }
.modal-actions { display: flex; gap: var(--sp-3); justify-content: flex-end; }

/* ============================================================
   ADMIN STYLES
   ============================================================ */
.admin-body { background: var(--neutral-100); }
.admin-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
  padding: var(--sp-4);
}
.admin-login-card {
  background: #fff; border-radius: var(--radius-lg); padding: var(--sp-10);
  width: 100%; max-width: 400px; box-shadow: var(--shadow-lg);
}
.admin-login-card .logo-text { text-align: center; margin-bottom: var(--sp-2); display: block; }
.admin-login-card h1 { text-align: center; font-size: var(--fs-xl); margin-bottom: var(--sp-2); }
.admin-login-card .sub { text-align: center; color: var(--neutral-500); margin-bottom: var(--sp-6); font-size: var(--fs-sm); }

.admin-layout { display: flex; height: 100vh; }
.admin-sidebar {
    width: 250px;
    background: var(--primary-900);
    color: #fff;
    padding: var(--sp-5) 0;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    height: 100vh; /* full height */
    flex-shrink: 0; /* don't let it get squeezed */
    position: sticky; /* stays put even if a parent scrolls */
    top: 0;
    overflow-y: auto; /* in case the nav list itself is long */
    display: flex;
    flex-direction: column;
}
.admin-sidebar .admin-brand { padding: 0 var(--sp-5) var(--sp-5); border-bottom: 1px solid var(--primary-800); }
.admin-sidebar .admin-brand .logo-text { color: #fff; font-size: var(--fs-md); }
.admin-sidebar .admin-brand small { color: var(--neutral-400); font-size: var(--fs-xs); }
.admin-nav {
    /*list-style: none;
    padding: var(--sp-4) 0;*/
    flex: 1;
}
.admin-nav li a {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5); color: var(--neutral-300);
  font-size: var(--fs-sm); font-weight: 500; transition: var(--transition);
  border-left: 3px solid transparent;
}
.admin-nav li a:hover { background: var(--primary-800); color: #fff; }
.admin-nav li a.active { background: var(--primary-800); color: #fff; border-left-color: var(--accent-400); }
.admin-nav li a svg { width: 18px; height: 18px; flex-shrink: 0; }

/*.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }*/

.admin-main {
    flex: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* the child below scrolls, not this */
    min-width: 0; /* prevents flex overflow issues with wide tables */
    flex-shrink: 0;
}

.admin-topbar {
  background: #fff; padding: var(--sp-4) var(--sp-6);
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 50;
}
.admin-topbar h1 { font-size: var(--fs-lg); }
.admin-topbar .admin-user { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm); }
/*.admin-content { padding: var(--sp-6); flex: 1; }*/
.admin-content {
    flex: 1;
    overflow-y: auto; /* <-- ONLY this scrolls */
    padding: 24px; /* keep/adjust to whatever padding you already use */
}
.admin-card {
  background: #fff; border-radius: var(--radius); padding: var(--sp-6);
  box-shadow: var(--shadow-sm); margin-bottom: var(--sp-5);
}
.admin-card h2 { font-size: var(--fs-md); margin-bottom: var(--sp-4); color: var(--primary-700); }

/* Dashboard stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); margin-bottom: var(--sp-6); }
.stat-card {
  background: #fff; border-radius: var(--radius); padding: var(--sp-5);
  box-shadow: var(--shadow-sm); border-left: 4px solid var(--primary-500);
}
.stat-card.accent { border-left-color: var(--accent-400); }
.stat-card.success { border-left-color: var(--success-500); }
.stat-card.warning { border-left-color: var(--warning-500); }
.stat-card .stat-label { font-size: var(--fs-xs); color: var(--neutral-500); margin-bottom: var(--sp-2); }
.stat-card .stat-value { font-size: var(--fs-2xl); font-weight: 700; color: var(--neutral-900); }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-group { margin-bottom: var(--sp-4); }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  display: block; font-size: var(--fs-sm); font-weight: 600;
  color: var(--neutral-700); margin-bottom: var(--sp-2);
}
.form-group label .req { color: var(--error-500); }
.form-control {
  width: 100%; padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--neutral-300); border-radius: var(--radius-sm);
  background: #fff; transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px var(--primary-50); }
textarea.form-control { min-height: 120px; resize: vertical; }
.form-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-5); }

/* Image preview */
.image-preview-wrap { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-3); }
.image-preview { position: relative; width: 100px; height: 100px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--neutral-200); }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-preview .remove-img {
  position: absolute; top: 2px; right: 2px; background: rgba(220,38,38,0.9);
  color: #fff; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}

/* Table */
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: var(--sp-3) var(--sp-4); text-align: left;
  border-bottom: 1px solid var(--neutral-200); font-size: var(--fs-sm);
}
.admin-table th { background: var(--neutral-50); color: var(--neutral-600); font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; }
.admin-table tr:hover { background: var(--neutral-50); }
.admin-table .row-img { width: 50px; height: 50px; object-fit: cover; border-radius: var(--radius-sm); }
.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: var(--fs-xs); font-weight: 600;
}
.status-active { background: #dcfce7; color: #166534; }
.status-inactive { background: #fee2e2; color: #991b1b; }
.action-btns { display: flex; gap: var(--sp-2); }
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.icon-btn.edit { background: var(--primary-50); color: var(--primary-600); }
.icon-btn.edit:hover { background: var(--primary-100); }
.icon-btn.delete { background: #fee2e2; color: var(--error-500); }
.icon-btn.delete:hover { background: #fecaca; }
.icon-btn svg { width: 16px; height: 16px; }

.admin-filters {
  display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); align-items: center;
}
.admin-filters .form-control { width: auto; min-width: 180px; }

.admin-toggle { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.admin-toggle button {
  padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-sm);
  background: var(--neutral-100); color: var(--neutral-600); font-weight: 600; font-size: var(--fs-sm);
}
.admin-toggle button.active { background: var(--primary-600); color: #fff; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .home-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .featured-article .featured-img { height: 280px; }
  .article-hero-img { height: 320px; }
  .article-detail-header h1 { font-size: var(--fs-2xl); }
}

@media (max-width: 768px) {
  .main-nav { overflow: visible; }
  .nav-inner { overflow: visible; }
  .nav-list {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: var(--primary-700);
    box-shadow: var(--shadow); z-index: 50;
    overflow-y: auto; max-height: 70vh;
  }
  .nav-list.open { display: flex; overflow-x: hidden; }
  .nav-list li { width: 100%; }
  .nav-list li a { border-bottom: none; border-left: 3px solid transparent; padding: var(--sp-3) var(--sp-5); }
  .nav-list li a.active { border-left-color: var(--accent-400); border-bottom: none; }
  .hamburger { display: flex; }
  .header-top { flex-wrap: wrap; }
  .header-date { display: none; }
  .banner { height: 220px; }
  .article-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .stats-grid { grid-template-columns: 1fr; }
  body.admin-body { height: auto; min-height: 100vh; overflow-y: auto; }
  .admin-layout { flex-direction: column; height: auto; min-height: 100vh; }
  .admin-sidebar {
    width: 100%; height: auto; position: relative;
    display: none;
  }
  .admin-sidebar.open { display: block; max-height: 70vh; overflow-y: auto; }
  .admin-mobile-toggle { display: flex !important; }
  .admin-main { height: auto; min-height: 100vh; flex-shrink: 1; }
  .admin-content { padding: var(--sp-4); }
  .admin-topbar { padding: var(--sp-3) var(--sp-4); }
  .featured-article .featured-img { height: 220px; }
  .article-hero-img { height: 240px; }
  .article-detail-header h1 { font-size: var(--fs-xl); }
  .page-header h1 { font-size: var(--fs-xl); }
}

@media (max-width: 480px) {
  .logo-text { font-size: var(--fs-md); }
  .logo-img { height: 44px; }
  .banner { height: 180px; }
  .container { padding: 0 var(--sp-3); }
  .header-actions .btn { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-xs); }
  .logo-badge { width: 44px; height: 44px; }
}

.admin-mobile-toggle {
  display: none; align-items: center; gap: var(--sp-2);
  background: var(--primary-700); color: #fff;
  padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-weight: 600;
}

/* ---------- Logo Badge ---------- */
.logo-badge {
  width: 52px; height: 52px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
  color: #fff; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: var(--shadow);
}
.logo-badge-sm { width: 40px; height: 40px; border-radius: var(--radius-sm); }


/* Featured carousel (home page top slider) */
.featured-carousel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: var(--sp-6);
}

.featured-slides {
    display: flex;
    transition: transform 0.6s ease;
}

.featured-slide {
    min-width: 100%;
    position: relative;
}

    .featured-slide img {
        width: 100%;
        height: 360px;
        object-fit: cover;
        display: block;
    }

.featured-slide-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: var(--sp-4);
    background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0));
}

    .featured-slide-caption .featured-tag {
        display: inline-block;
        background: var(--accent-400);
        color: #fff;
        padding: 4px 12px;
        border-radius: 20px;
        font-size: var(--fs-xs);
        font-weight: 600;
        margin-bottom: var(--sp-2);
    }

    .featured-slide-caption h2 {
        font-size: var(--fs-xl);
        margin-bottom: var(--sp-2);
    }

        .featured-slide-caption h2 a {
            color: #fff;
        }

            .featured-slide-caption h2 a:hover {
                color: var(--accent-400);
            }

    .featured-slide-caption .article-meta {
        font-size: var(--fs-xs);
        color: #eee;
        margin-bottom: var(--sp-3);
    }

    .featured-slide-caption .read-more {
        color: #fff;
        text-decoration: underline;
    }

.featured-dots {
    position: absolute;
    bottom: var(--sp-3);
    right: var(--sp-4);
    display: flex;
    gap: 6px;
}

    .featured-dots button {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        border: none;
        background: rgba(255,255,255,0.5);
        cursor: pointer;
        padding: 0;
    }

        .featured-dots button.active {
            background: var(--accent-400);
            width: 28px;
            border-radius: 6px;
        }

@media (max-width: 768px) {
    .featured-slide img {
        height: 220px;
    }
}