/* ============================================================
   MEDICAL NEWS PLATFORM — styles.css
   Theme: Clinical Editorial — authoritative, precise, modern
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400;1,600&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --navy:       #0A1628;
  --navy-mid:   #132240;
  --navy-light: #1E3460;
  --teal:       #00B4D8;
  --teal-dark:  #0096B7;
  --teal-glow:  rgba(0, 180, 216, 0.15);
  --amber:      #F4A225;
  --amber-soft: rgba(244, 162, 37, 0.12);
  --white:      #FFFFFF;
  --off-white:  #F7F9FC;
  --gray-100:   #EEF2F7;
  --gray-200:   #D8E2EF;
  --gray-400:   #8FA3BF;
  --gray-600:   #4A6080;
  --gray-800:   #243450;
  --red:        #E53E3E;
  --green:      #38A169;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', monospace;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm:  0 1px 3px rgba(10,22,40,0.08), 0 1px 2px rgba(10,22,40,0.06);
  --shadow-md:  0 4px 16px rgba(10,22,40,0.10), 0 2px 8px rgba(10,22,40,0.08);
  --shadow-lg:  0 12px 40px rgba(10,22,40,0.14), 0 4px 16px rgba(10,22,40,0.10);
  --shadow-teal: 0 8px 32px rgba(0,180,216,0.18);

  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
  --max-width:  1200px;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--navy);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a  { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); }

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--navy);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 600; }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); font-weight: 600; }
h4 { font-size: 1.125rem; font-weight: 600; }

p { color: var(--gray-800); }

.text-teal   { color: var(--teal); }
.text-amber  { color: var(--amber); }
.text-muted  { color: var(--gray-400); font-size: 0.875rem; }
.text-center { text-align: center; }

/* ── Layout Utilities ──────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Header / Nav ──────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  border-bottom: 1px solid var(--navy-light);
  box-shadow: 0 2px 24px rgba(0,0,0,0.25);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--teal), #0077A8);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-display);
  letter-spacing: -0.5px;
}

.nav-logo-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
}

.nav-logo-text span {
  color: var(--teal);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: var(--gray-200);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background: var(--navy-light);
  color: var(--white);
}

.nav-link.active {
  color: var(--teal);
}

.nav-categories {
  position: relative;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 220px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
  z-index: 200;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-200) transparent;
}
.nav-dropdown::-webkit-scrollbar { width: 4px; }
.nav-dropdown::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 99px; }

.nav-categories:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown a {
  display: block;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-dropdown a:hover {
  background: var(--gray-100);
  color: var(--teal-dark);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 6px;
  color: var(--white);
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all var(--transition);
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links   { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: var(--navy-mid);
    padding: 12px;
    border-bottom: 1px solid var(--navy-light);
  }
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}
.btn-primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  box-shadow: var(--shadow-teal);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--teal);
  border-color: var(--teal);
}
.btn-secondary:hover {
  background: var(--teal-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-400);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--navy);
}

.btn-navy {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn-navy:hover {
  background: var(--navy-light);
  border-color: var(--navy-light);
  transform: translateY(-1px);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}
.btn-danger:hover {
  background: #FFF5F5;
}

.btn-sm { padding: 7px 14px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Badges / Tags ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.badge-teal    { background: var(--teal-glow);  color: var(--teal-dark); }
.badge-amber   { background: var(--amber-soft); color: #B7620A; }
.badge-navy    { background: var(--navy);       color: var(--white); }
.badge-draft   { background: var(--gray-100);   color: var(--gray-600); }
.badge-published { background: rgba(56,161,105,0.12); color: var(--green); }
.badge-archived  { background: var(--gray-100); color: var(--gray-400); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--gray-100);
  color: var(--gray-600);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid var(--gray-200);
  white-space: nowrap;
}

.tag:hover,
.tag.active {
  background: var(--teal-glow);
  color: var(--teal-dark);
  border-color: rgba(0,180,216,0.3);
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(0,180,216,0.2);
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  background: var(--navy);
  position: relative;
  overflow: hidden;
  padding: 80px 0 72px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 80% 50%, rgba(0,180,216,0.12) 0%, transparent 65%),
    radial-gradient(ellipse 50% 80% at 10% 80%, rgba(0,119,168,0.10) 0%, transparent 60%);
  pointer-events: none;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 20px;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--teal);
}

.hero h1 {
  color: var(--white);
  margin-bottom: 20px;
  font-style: italic;
}

.hero h1 em {
  font-style: normal;
  color: var(--teal);
}

.hero-desc {
  color: var(--gray-200);
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 36px;
  font-weight: 300;
  max-width: 560px;
}

.hero-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}

.hero-stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--gray-400);
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ── Featured Article ──────────────────────────────────────── */
.featured-article {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--white);
  border: 1px solid var(--gray-200);
  min-height: 420px;
}

.featured-article-body {
  padding: 48px 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.featured-article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.featured-article h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 16px;
  line-height: 1.25;
}

.featured-article h2 a:hover { color: var(--teal-dark); }

.featured-article-summary {
  color: var(--gray-600);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 32px;
  flex: 1;
}

.featured-article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.featured-article-img {
  position: relative;
  overflow: hidden;
  background: var(--gray-100);
}

.featured-article-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.featured-article:hover .featured-article-img img {
  transform: scale(1.03);
}

.featured-article-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  font-size: 72px;
  opacity: 0.3;
}

/* ── Article Grid ──────────────────────────────────────────── */
.articles-section {
  padding: 72px 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
}

.section-title span {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  font-family: var(--font-body);
  color: var(--gray-400);
  margin-bottom: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.article-card {
  display: flex;
  flex-direction: column;
}

.article-card-img {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--gray-100);
  position: relative;
}

.article-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-card:hover .article-card-img img {
  transform: scale(1.05);
}

.article-card-img-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: linear-gradient(135deg, var(--navy-mid), var(--navy-light));
  opacity: 0.6;
}

.article-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.article-card-title {
  font-size: 1.125rem;
  margin-bottom: 10px;
  line-height: 1.35;
}

.article-card-title a {
  transition: color var(--transition);
}

.article-card-title a:hover {
  color: var(--teal-dark);
}

.article-card-summary {
  color: var(--gray-600);
  font-size: 0.9rem;
  line-height: 1.65;
  margin-bottom: 20px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
  font-size: 0.8125rem;
  color: var(--gray-400);
}

.article-card-author {
  display: flex;
  align-items: center;
  gap: 6px;
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--navy-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ── Filters Bar ───────────────────────────────────────────── */
.filters-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0;
  position: sticky;
  top: 68px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.filters-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filters-inner::-webkit-scrollbar { display: none; }

.filter-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-400);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: 4px;
}

/* ── Single Article ────────────────────────────────────────── */
.article-hero {
  background: var(--navy);
  padding: 64px 0 0;
  position: relative;
}

.article-hero-content {
  position: relative;
  z-index: 1;
  padding-bottom: 56px;
  max-width: 760px;
}

.article-hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.article-hero h1 {
  color: var(--white);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 20px;
  line-height: 1.2;
}

.article-hero-summary {
  color: var(--gray-200);
  font-size: 1.1rem;
  line-height: 1.7;
  font-weight: 300;
}

.article-hero-img-wrap {
  position: relative;
  margin-top: 48px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
  aspect-ratio: 21/9;
  max-height: 480px;
}

.article-hero-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  padding: 64px 0;
  align-items: start;
}

.article-body {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

/* Article rich content styles */
.article-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--gray-800);
}

.article-content h2 {
  font-size: 1.5rem;
  margin: 40px 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gray-100);
}

.article-content h3 {
  font-size: 1.2rem;
  margin: 32px 0 12px;
}

.article-content p { margin-bottom: 20px; }

.article-content a {
  color: var(--teal-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-content ul, .article-content ol {
  margin: 0 0 20px 24px;
  list-style: revert;
}

.article-content li { margin-bottom: 8px; }

.article-content blockquote {
  margin: 32px 0;
  padding: 20px 24px;
  border-left: 4px solid var(--teal);
  background: var(--teal-glow);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--navy-mid);
}

.article-content code {
  font-family: var(--font-mono);
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.article-content pre {
  background: var(--navy);
  padding: 20px 24px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 24px;
}

.article-content pre code {
  background: none;
  color: var(--gray-200);
  padding: 0;
}

.article-content img {
  width: 100%;
  border-radius: var(--radius-md);
  margin: 24px 0;
}

.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 100px;
}

.sidebar-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.sidebar-card h4 {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
}

.author-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.author-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--navy-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.related-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
  transition: opacity var(--transition);
}

.related-item:last-child { border-bottom: none; }
.related-item:hover { opacity: 0.75; }

.related-item-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--gray-100);
}

.related-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--navy);
  transition: color var(--transition);
}

.related-item:hover .related-item-title { color: var(--teal-dark); }

.related-item-date {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ── Dashboard ─────────────────────────────────────────────── */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 68px);
}

.dashboard-sidebar {
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--gray-600);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dash-nav-item:hover {
  background: var(--gray-100);
  color: var(--navy);
}

.dash-nav-item.active {
  background: var(--teal-glow);
  color: var(--teal-dark);
  font-weight: 600;
}

.dash-nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.dash-nav-section {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray-400);
  padding: 16px 14px 8px;
}

.dashboard-main {
  padding: 40px;
  overflow-y: auto;
  background: var(--off-white);
}

.dash-panel { display: none; }
.dash-panel.active { display: block; }

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.dash-header h2 {
  font-size: 1.6rem;
}

.dash-header p {
  color: var(--gray-400);
  margin-top: 4px;
  font-size: 0.875rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.stat-card-icon.teal  { background: var(--teal-glow); }
.stat-card-icon.amber { background: var(--amber-soft); }
.stat-card-icon.navy  { background: rgba(10,22,40,0.08); }
.stat-card-icon.green { background: rgba(56,161,105,0.10); }

.stat-card-num {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--gray-400);
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* Articles Table */
.articles-table-wrap {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.articles-table {
  width: 100%;
  border-collapse: collapse;
}

.articles-table th {
  background: var(--gray-100);
  padding: 12px 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--gray-600);
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.articles-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
  color: var(--navy);
  vertical-align: middle;
}

.articles-table tr:last-child td { border-bottom: none; }

.articles-table tr:hover td {
  background: var(--off-white);
}

.table-title-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.table-title-cell strong {
  font-weight: 600;
  color: var(--navy);
}

.table-title-cell small {
  color: var(--gray-400);
  font-size: 0.8rem;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full { grid-column: 1 / -1; }

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.3px;
}

.form-label .required {
  color: var(--red);
  margin-left: 3px;
}

.form-input,
.form-textarea,
.form-select {
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--navy);
  background: var(--white);
  transition: all var(--transition);
  outline: none;
  width: 100%;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--gray-400);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--gray-400);
}

.form-error {
  font-size: 0.8rem;
  color: var(--red);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  flex-wrap: wrap;
}

/* Image upload zone */
.upload-zone {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--off-white);
}

.upload-zone:hover,
.upload-zone.dragging {
  border-color: var(--teal);
  background: var(--teal-glow);
}

.upload-zone-icon { font-size: 2rem; margin-bottom: 12px; }

.upload-zone-text {
  font-size: 0.875rem;
  color: var(--gray-600);
}

.upload-zone-text strong {
  color: var(--teal-dark);
}

.upload-preview {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16/7;
}

.upload-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.upload-preview-remove {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background var(--transition);
}

.upload-preview-remove:hover { background: var(--red); }

/* ── Auth Modal ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,22,40,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 48px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96) translateY(12px);
  transition: all var(--transition);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  text-align: center;
  margin-bottom: 32px;
}

.modal-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--teal), var(--navy-light));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 20px;
}

.modal h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.modal-subtitle {
  color: var(--gray-400);
  font-size: 0.9rem;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-divider {
  text-align: center;
  color: var(--gray-400);
  font-size: 0.8rem;
  margin: 8px 0;
  position: relative;
}

.modal-divider::before,
.modal-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 20px);
  height: 1px;
  background: var(--gray-200);
}
.modal-divider::before { left: 0; }
.modal-divider::after  { right: 0; }

/* ── Alerts / Toasts ───────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.toast {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.875rem;
  animation: slideInRight 0.3s ease forwards;
  border-left: 4px solid var(--teal);
}

.toast.error  { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
.toast.warning { border-left-color: var(--amber); }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-msg  { flex: 1; line-height: 1.4; color: var(--navy); }
.toast-close {
  background: none; border: none;
  color: var(--gray-400); cursor: pointer;
  font-size: 1rem; padding: 0; flex-shrink: 0;
}

@keyframes slideInRight {
  from { transform: translateX(24px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Alert Banners ─────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-info    { background: var(--teal-glow);     border-left: 4px solid var(--teal);  color: var(--navy-mid); }
.alert-error   { background: #FFF5F5; border-left: 4px solid var(--red);   color: #742A2A; }
.alert-success { background: rgba(56,161,105,0.10); border-left: 4px solid var(--green); color: #1C4532; }

/* ── Loading States ────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.skeleton-text  { height: 16px; margin-bottom: 8px; }
.skeleton-title { height: 28px; margin-bottom: 12px; }
.skeleton-img   { aspect-ratio: 16/9; }

.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(0,180,216,0.2);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-lg {
  width: 40px; height: 40px;
  border-width: 4px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 16px;
  color: var(--gray-400);
  font-size: 0.9rem;
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--gray-400);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.125rem;
  color: var(--gray-600);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 320px;
  margin: 0 auto 24px;
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: var(--gray-400);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand h3 {
  font-family: var(--font-display);
  color: var(--white);
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--gray-400);
}

.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 16px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  font-size: 0.875rem;
  color: var(--gray-400);
  transition: color var(--transition);
}

.footer-col a:hover { color: var(--teal); }

.footer-bottom {
  border-top: 1px solid var(--navy-light);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.footer-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-pulse::before {
  content: '';
  display: block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

/* ── Login Page ────────────────────────────────────────────── */
.login-page {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  position: relative;
  overflow: hidden;
  padding: 40px 24px;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 20% 40%, rgba(0,180,216,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 70% at 80% 70%, rgba(0,119,168,0.08) 0%, transparent 60%);
}

.login-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 52px 48px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
}

/* ── Pagination ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 0;
}

.page-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--navy);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.page-btn:hover { border-color: var(--teal); color: var(--teal-dark); }
.page-btn.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Scroll Animations ─────────────────────────────────────── */
[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .featured-article { grid-template-columns: 1fr; }
  .featured-article-img { aspect-ratio: 16/7; order: -1; }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  .hero { padding: 56px 0 48px; }
  .hero-stats { gap: 24px; }
  .articles-section { padding: 48px 0; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-sidebar { display: none; }
  .dashboard-main { padding: 24px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { padding: 36px 28px; }
  .footer-grid { grid-template-columns: 1fr; }
  .article-body { padding: 28px 24px; }
  .featured-article-body { padding: 28px 24px; }
}

@media (max-width: 480px) {
  .articles-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .toast-container { left: 16px; right: 16px; max-width: none; }
}

/* ── Utility animations ────────────────────────────────────── */
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--gray-200);
  margin: 24px 0;
}

/* ── Read time ─────────────────────────────────────────────── */
.read-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--gray-400);
}

.dot-sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--gray-400);
  display: inline-block;
}
