/* ============================================================
   KHSIP Portal — Kerala Health Department Theme v3.0
   Color Scheme: health.kerala.gov.in
   Primary Blue: #0C7CBB | Primary Green: #00B16C
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════
   DESIGN TOKENS — Kerala Health Color Scheme
   ═══════════════════════════════════════════ */
:root {
  /* ── Kerala Health Signature Colors ── */
  --kh-blue:        #0C7CBB;   /* Primary: Kerala Health Blue */
  --kh-blue-dark:   #0a6aa0;
  --kh-blue-light:  #3a9dd4;
  --kh-blue-pale:   rgba(12, 124, 187, 0.08);
  --kh-blue-pale2:  rgba(12, 124, 187, 0.05);

  --kh-green:       #00B16C;   /* Secondary: Kerala Health Green */
  --kh-green-dark:  #009a5e;
  --kh-green-light: #00cc7e;
  --kh-green-pale:  rgba(0, 177, 108, 0.08);

  --kh-olive:       #7C9C32;   /* Accent: Olive-green */
  --kh-olive-pale:  rgba(124, 156, 50, 0.10);

  /* Gradient — the signature Kerala Health gradient */
  --kh-gradient:    linear-gradient(to right, #0C7CBB, #00B16C);
  --kh-gradient-v:  linear-gradient(to bottom, #0C7CBB, #00B16C);
  --kh-gradient-135: linear-gradient(135deg, #0C7CBB, #00B16C);

  /* ── Text & Surfaces ── */
  --navy:           #031b4e;   /* Primary heading/text color */
  --navy-light:     #1a3060;
  --navy-pale:      rgba(3, 27, 78, 0.07);

  /* Light Mode */
  --bg:             #fafafa;   /* Exact Kerala Health bg */
  --bg-2:           #ffffff;
  --card:           #ffffff;
  --text:           #031b4e;   /* Kerala Health dark navy */
  --muted:          #5a6a8a;
  --border:         rgba(12, 124, 187, 0.10);
  --border-md:      rgba(12, 124, 187, 0.20);

  /* Alerts */
  --red:            #dc3545;
  --red-pale:       rgba(220, 53, 69, 0.10);
  --gold:           #ffc107;
  --gold-pale:      rgba(255, 193, 7, 0.12);
  --success:        #00B16C;
  --success-light:  rgba(0, 177, 108, 0.10);
  --orange:         #fd7e14;

  /* Shadows */
  --shadow-xs: 0 1px 4px rgba(12, 124, 187, 0.06);
  --shadow-sm: 0 4px 16px rgba(12, 124, 187, 0.08);
  --shadow-md: 0 8px 32px rgba(12, 124, 187, 0.12);
  --shadow-lg: 0 16px 56px rgba(12, 124, 187, 0.16);
  --shadow-xl: 0 24px 80px rgba(0, 0, 0, 0.16);
  --shadow-blue: 0 8px 28px rgba(12, 124, 187, 0.28);
  --shadow-green: 0 8px 28px rgba(0, 177, 108, 0.28);

  /* Shape */
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Motion */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --spring:     all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Header */
  --header-h: 72px;

  /* Legacy compatibility (used by inline JS styles) */
  --bg-color:      #fafafa;
  --card-bg:       #ffffff;
  --text-color:    #031b4e;
  --text-muted:    #5a6a8a;
  --primary-100:   #e8f4fb;
  --primary-600:   #0a6aa0;
  --primary-700:   #085d8c;
  --primary-800:   #06507a;
  --primary-900:   #031b4e;
  --primary-color: #031b4e;
  --primary-light: #0C7CBB;
  --danger-color:  #dc3545;
  --accent-color:  #00B16C;

  /* Aliases for internal use */
  --teal:       var(--kh-blue);
  --teal-light: var(--kh-blue-light);
  --teal-dark:  var(--kh-blue-dark);
  --teal-pale:  var(--kh-blue-pale);
  --teal-pale2: var(--kh-blue-pale2);
  --gold:       #ffc107;

  /* Missing alias — referenced in page section headings */
  --green-900:  #006644;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg:         #0a0f1e;
  --bg-2:       #0d1528;
  --card:       #111c35;
  --text:       #e8edf8;
  --muted:      #8a9bb8;
  --border:     rgba(12, 124, 187, 0.15);
  --border-md:  rgba(12, 124, 187, 0.25);

  --bg-color:      #0a0f1e;
  --card-bg:       #111c35;
  --text-color:    #e8edf8;
  --text-muted:    #8a9bb8;
  --primary-100:   #111c35;
  --primary-color: #e8edf8;
  --primary-light: #3a9dd4;
  --danger-color:  #f87171;
  --accent-color:  #00cc7e;

  /* Dark-mode overrides for missing aliases */
  --green-900: #00cc7e;
  --navy:          #e8edf8;
  --navy-light:    #b0bdd4;
  --navy-pale:     rgba(232, 237, 248, 0.08);
}

/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box; margin: 0; padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  color: var(--text);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 { color: #e8edf8; }

a { text-decoration: none; color: inherit; }

/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */
.app-container { display: flex; flex-direction: column; min-height: 100vh; }
.main-wrapper  { display: flex; flex-direction: column; flex: 1; }

.page-content {
  max-width: 1280px; width: 100%;
  margin: 0 auto; padding: 36px 28px; flex-grow: 1;
}

/* ═══════════════════════════════════════════
   HEADER — Kerala Health Blue Gradient
   ═══════════════════════════════════════════ */
.iria-header {
  height: var(--header-h);
  background: var(--bg-2);
  border-bottom: 1px solid rgba(12, 124, 187, 0.12);
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 16px rgba(12, 124, 187, 0.08);
  display: flex; align-items: center;
  padding: 0 28px; transition: var(--transition);
}

/* Kerala Health signature gradient top bar */
.iria-header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--kh-gradient);
}

[data-theme="dark"] .iria-header {
  background: rgba(10, 15, 30, 0.95);
  border-bottom-color: rgba(12, 124, 187, 0.2);
  box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}

.header-main-bar {
  display: flex; align-items: center;
  justify-content: space-between; width: 100%; gap: 16px;
}

.header-logos {
  display: flex; align-items: center;
  gap: 10px; cursor: pointer; flex-shrink: 0;
}

.gov-logo { height: 46px; width: auto; object-fit: contain; }

.header-title-block { display: flex; flex-direction: column; }

.gov-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px; font-weight: 800;
  color: var(--kh-blue); line-height: 1.15; letter-spacing: -0.01em;
}

[data-theme="dark"] .gov-title { color: var(--kh-blue-light); }

.gov-subtitle { font-size: 10px; color: var(--muted); font-weight: 500; margin-top: 1px; }

/* ── Navigation — Kerala Health Blue navbar ── */
.header-nav { flex: 1; min-width: 0; display: flex; justify-content: center; }

.nav-menu {
  display: flex; list-style: none; gap: 3px; align-items: center;
}

.nav-menu li a {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 13px; font-size: 13px; font-weight: 600;
  color: var(--navy); border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); white-space: nowrap;
}

.nav-menu li a i { font-size: 11px; opacity: 0.6; transition: opacity 0.2s ease; }

.nav-menu li a:hover {
  color: var(--kh-blue);
  background: var(--kh-blue-pale);
}

.nav-menu li a:hover i { opacity: 1; }

/* Active nav: Kerala Health Blue */
.nav-menu li.active a {
  background: var(--kh-gradient);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(12, 124, 187, 0.35);
}

.nav-menu li.active a i { opacity: 1; }

/* ── Header Actions ── */
.header-actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; position: relative; z-index: 10;
}

.lang-toggle-btn {
  background: var(--kh-gradient);
  color: #fff; border: none; padding: 7px 12px;
  border-radius: 8px; font-size: 12px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 5px;
  transition: var(--transition); font-family: 'Plus Jakarta Sans', sans-serif;
  box-shadow: 0 4px 12px rgba(12, 124, 187, 0.3);
  white-space: nowrap; min-width: 82px; justify-content: center;
  overflow: hidden;
}

.lang-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(12, 124, 187, 0.45);
}

.theme-toggle, .menu-toggle {
  background: none; border: none; cursor: pointer;
  font-size: 16px; color: var(--muted);
  padding: 8px; border-radius: 8px; transition: var(--transition);
}

.theme-toggle:hover, .menu-toggle:hover {
  color: var(--kh-blue); background: var(--kh-blue-pale);
}

.menu-toggle { display: none; }

.user-profile { background: none; border: none; cursor: pointer; padding: 0; }

.user-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--kh-gradient);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  box-shadow: 0 4px 14px rgba(12, 124, 187, 0.35);
  cursor: pointer; transition: var(--spring);
}

.user-avatar:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 24px rgba(12, 124, 187, 0.50);
}

/* ═══════════════════════════════════════════
   PAGE HERO (non-home pages)
   ═══════════════════════════════════════════ */
.hero-section {
  position: relative; overflow: hidden;
  background: var(--kh-gradient);
  border-radius: var(--radius-xl); padding: 56px;
  margin-bottom: 36px; box-shadow: var(--shadow-lg);
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 28px;
}

.hero-section::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.15) 0%, transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(0,0,0,0.12) 0%, transparent 40%);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: rgba(255,255,255,0.3);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

.hero-text { flex: 1; min-width: 300px; position: relative; }

.hero-tagline {
  font-size: 11px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px;
}

.hero-tagline::before {
  content: ''; width: 24px; height: 2px;
  background: rgba(255,255,255,0.7); border-radius: 2px;
}

.hero-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 38px; font-weight: 800; color: #fff;
  line-height: 1.15; margin-bottom: 18px; letter-spacing: -0.03em;
}

.hero-description {
  font-size: 15px; color: rgba(255,255,255,0.88);
  margin-bottom: 30px; line-height: 1.7; max-width: 560px;
}

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-img-wrapper {
  flex: 0 0 260px; display: flex; justify-content: center; position: relative;
}

.hero-logo {
  max-width: 200px; max-height: 180px;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.3));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.btn-primary {
  background: var(--kh-gradient);
  color: #fff; padding: 12px 26px; border-radius: 8px;
  border: none; font-weight: 700; font-size: 13.5px;
  cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(12, 124, 187, 0.35);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(12, 124, 187, 0.50);
}

.btn-outline {
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08); color: #fff;
  padding: 10px 26px; border-radius: 8px; font-weight: 600;
  font-size: 13.5px; cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.8); transform: translateY(-2px);
}

/* ═══════════════════════════════════════════
   LEADERSHIP CARDS
   ═══════════════════════════════════════════ */
.leadership-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px; margin-bottom: 36px;
}

@media(max-width: 1100px) {
  .leadership-grid { grid-template-columns: repeat(2, 1fr); }
}

@media(max-width: 640px) {
  .leadership-grid { grid-template-columns: 1fr; }
}

.message-card {
  background: var(--card); border-radius: var(--radius-xl);
  padding: 32px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border); display: flex;
  gap: 22px; align-items: flex-start;
  transition: var(--transition); position: relative; overflow: hidden;
}

.message-card::before {
  content: '\201C';
  position: absolute; top: -16px; right: 16px;
  font-size: 110px; font-family: Georgia, 'Times New Roman', serif;
  color: rgba(12, 124, 187, 0.06); line-height: 1;
  pointer-events: none; user-select: none;
}

/* Kerala Health gradient top stripe */
.message-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--kh-gradient);
}

.message-card:hover {
  transform: translateY(-6px); box-shadow: var(--shadow-md);
  border-color: rgba(12, 124, 187, 0.2);
}

.leader-photo {
  width: 76px; height: 76px; border-radius: 14px;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid rgba(12, 124, 187, 0.2);
  box-shadow: 0 4px 16px rgba(12, 124, 187, 0.15);
}

.message-content { flex-grow: 1; }

.leader-quote {
  font-style: italic; font-size: 13.5px; line-height: 1.78;
  color: var(--muted); margin-bottom: 16px; padding-left: 14px;
  border-left: 3px solid rgba(12, 124, 187, 0.3);
}

[data-theme="dark"] .leader-quote {
  border-left-color: rgba(12, 124, 187, 0.5);
  color: #b0bdd4;
}

.leader-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px; font-weight: 700; color: var(--text);
}

[data-theme="dark"] .leader-name { color: #e8edf8; }

.leader-title {
  font-size: 11px; color: var(--kh-blue); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  display: block; margin-top: 4px;
}

/* ═══════════════════════════════════════════
   SECTION HEADER
   ═══════════════════════════════════════════ */
.section-header { margin-bottom: 32px; }

.section-kicker {
  font-size: 11px; text-transform: uppercase;
  color: var(--kh-blue); font-weight: 700; letter-spacing: 2px;
  display: block; margin-bottom: 6px;
}

.section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 28px; color: var(--text);
  position: relative; padding-bottom: 14px;
  display: inline-block; letter-spacing: -0.02em; font-weight: 800;
}

.section-title::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 48px; height: 3px;
  background: var(--kh-gradient); border-radius: 2px;
}

/* ═══════════════════════════════════════════
   KPI CARDS
   ═══════════════════════════════════════════ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; margin-bottom: 36px;
}

.kpi-card {
  background: var(--card); border-radius: var(--radius-lg);
  padding: 24px; display: flex; align-items: center; gap: 18px;
  box-shadow: var(--shadow-xs); border: 1px solid var(--border);
  transition: var(--transition); position: relative; overflow: hidden;
}

.kpi-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: var(--kh-gradient); transform: scaleX(0);
  transform-origin: left; transition: transform 0.35s ease;
}

.kpi-card:hover::after { transform: scaleX(1); }
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.kpi-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--kh-blue-pale); color: var(--kh-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}

.kpi-icon.teal   { background: var(--kh-blue-pale2); color: var(--kh-blue); }
.kpi-icon.yellow { background: var(--gold-pale);      color: #9a7500; }
.kpi-icon.danger { background: var(--red-pale);       color: var(--red); }

.kpi-content { flex-grow: 1; }

.kpi-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}

.kpi-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 28px; font-weight: 800; color: var(--text);
  line-height: 1; margin-bottom: 6px;
}

.kpi-trend {
  font-size: 11.5px; font-weight: 600; display: flex; align-items: center; gap: 4px;
}

.kpi-trend.up   { color: var(--kh-green); }
.kpi-trend.down { color: var(--red); }

/* ═══════════════════════════════════════════
   CHARTS
   ═══════════════════════════════════════════ */
.charts-grid {
  display: grid; grid-template-columns: 2fr 1fr;
  gap: 24px; margin-bottom: 36px;
}

@media(max-width: 992px) { .charts-grid { grid-template-columns: 1fr; } }

.chart-card {
  background: var(--card); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-xs); border: 1px solid var(--border);
}

.chart-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}

.chart-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}

.chart-title::before {
  content: ''; width: 4px; height: 18px;
  background: var(--kh-gradient); border-radius: 2px;
}

.chart-select {
  padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border);
  font-size: 12px; background: var(--bg); color: var(--text);
  outline: none; cursor: pointer;
}

.chart-container { position: relative; height: 300px; width: 100%; }

/* ═══════════════════════════════════════════
   PILLAR CARDS
   ═══════════════════════════════════════════ */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px; margin-bottom: 40px;
}

.pillar-card {
  background: var(--card); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-xs); border: 1px solid var(--border);
  transition: var(--transition); position: relative; overflow: hidden;
}

.pillar-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--kh-gradient);
}

/* Color-coded pillar variants */
.pillar-card.p1::before { background: linear-gradient(90deg, #0C7CBB, #00B16C); }
.pillar-card.p2::before { background: linear-gradient(90deg, #00B16C, #7C9C32); }
.pillar-card.p3::before { background: linear-gradient(90deg, #0a6aa0, #0C7CBB); }
.pillar-card.p4::before { background: linear-gradient(90deg, #7C9C32, #00B16C); }
.pillar-card.p5::before { background: linear-gradient(90deg, #026f5f, #00B16C); }
.pillar-card.p6::before { background: linear-gradient(90deg, #0C7CBB, #026f5f); }

.pillar-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }

.pillar-num {
  font-size: 11px; text-transform: uppercase; color: var(--kh-blue);
  font-weight: 700; letter-spacing: 1.2px; display: block; margin-bottom: 6px;
}

.pillar-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 10px;
}

[data-theme="dark"] .pillar-title { color: #e8edf8; }

.pillar-desc { font-size: 13.5px; color: var(--muted); line-height: 1.65; margin-bottom: 20px; }

.pillar-stats {
  display: flex; justify-content: space-between;
  border-top: 1px solid var(--border); padding-top: 16px; margin-top: 8px;
}

.pillar-stat-item { text-align: center; }

.pillar-stat-val {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px; font-weight: 800; color: var(--text); display: block;
}

[data-theme="dark"] .pillar-stat-val { color: #e8edf8; }
.pillar-stat-lbl { font-size: 11px; color: var(--muted); }

/* ═══════════════════════════════════════════
   DETAIL CARD
   ═══════════════════════════════════════════ */
.detail-card {
  background: var(--card); border-radius: var(--radius-xl);
  padding: 40px; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}

/* ═══════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════ */
.tab-nav {
  display: flex; border-bottom: 2px solid var(--border);
  margin-bottom: 24px; gap: 4px; overflow-x: auto;
}

.tab-btn {
  background: none; border: none; padding: 10px 20px;
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  color: var(--muted); border-bottom: 3px solid transparent;
  white-space: nowrap; transition: var(--transition);
  margin-bottom: -2px; font-family: 'Plus Jakarta Sans', sans-serif;
}

.tab-btn:hover { color: var(--kh-blue); }

.tab-btn.active {
  color: var(--kh-blue); border-bottom-color: var(--kh-blue); font-weight: 700;
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════ */
.data-table-container {
  overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border);
}

.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.data-table th {
  background: rgba(12, 124, 187, 0.05); color: var(--text);
  padding: 14px 16px; font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.6px;
  border-bottom: 2px solid rgba(12, 124, 187, 0.15);
}

.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: rgba(12, 124, 187, 0.04); }
.data-table tbody tr:last-child td { border-bottom: none; }

[data-theme="dark"] .data-table th {
  background: rgba(12, 124, 187, 0.15);
  color: #e8edf8;
}
[data-theme="dark"] .data-table tbody tr:hover { background: rgba(12, 124, 187, 0.12); }

/* ═══════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════ */
.badge {
  display: inline-block; padding: 4px 11px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; font-family: 'Plus Jakarta Sans', sans-serif;
}

.badge.success { background: var(--success-light);            color: var(--kh-green-dark); }
.badge.warning { background: var(--gold-pale);                color: #856404; }
.badge.danger  { background: var(--red-pale);                 color: var(--red); }
.badge.info    { background: var(--kh-blue-pale);             color: var(--kh-blue); }

/* ═══════════════════════════════════════════
   GIS MAP
   ═══════════════════════════════════════════ */
#map-container { height: 440px; border-radius: var(--radius); overflow: hidden; }

/* ═══════════════════════════════════════════
   ADMIN FORMS
   ═══════════════════════════════════════════ */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media(max-width: 992px) { .admin-grid { grid-template-columns: 1fr; } }

.admin-card { border: 1px solid var(--border); }

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block; font-size: 12.5px; font-weight: 700;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 7px;
}

.form-control {
  width: 100%; padding: 10px 14px; border-radius: 8px;
  border: 1.5px solid rgba(12, 124, 187, 0.30); background: #ffffff;
  color: #031b4e; font-size: 13.5px; outline: none;
  transition: var(--transition); font-family: 'Inter', sans-serif;
}
[data-theme="dark"] .form-control {
  background: #1a2a4a; color: #e8edf8;
  border-color: rgba(12, 124, 187, 0.40);
}

.form-control:focus {
  border-color: var(--kh-blue);
  box-shadow: 0 0 0 3px rgba(12, 124, 187, 0.12);
}

.btn-block { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════
   FOOTER — Kerala Health Dark
   ═══════════════════════════════════════════ */
.portal-footer {
  background: linear-gradient(180deg, #031b4e 0%, #020e2d 100%);
  color: rgba(255, 255, 255, 0.82); padding: 72px 40px 40px;
  position: relative; overflow: hidden;
}

/* Kerala Health gradient top line */
.portal-footer::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--kh-gradient);
}

/* Blue glow */
.portal-footer::after {
  content: '';
  position: absolute; top: -100px; right: -100px;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(12,124,187,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.footer-top {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 40px; margin-bottom: 40px;
  max-width: 1280px; margin-left: auto; margin-right: auto; position: relative;
}

@media(max-width: 768px) { .footer-top { grid-template-columns: 1fr; gap: 28px; } }

.footer-col h4 {
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12.5px; font-weight: 800; margin-bottom: 20px;
  text-transform: uppercase; letter-spacing: 1.5px;
  position: relative; display: inline-block; padding-bottom: 8px;
}

.footer-col h4::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  height: 2px; width: 32px;
  background: var(--kh-gradient); border-radius: 2px;
}

.footer-col p { font-size: 13.5px; line-height: 1.85; color: rgba(255,255,255,0.6); }

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

.footer-col ul li a {
  color: rgba(255,255,255,0.6); font-size: 13px;
  transition: all 0.2s ease; display: flex; align-items: center; gap: 8px;
}

.footer-col ul li a:hover { color: var(--kh-green-light); transform: translateX(5px); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07); padding-top: 28px; margin-top: 20px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px; font-size: 12.5px;
  max-width: 1280px; margin-left: auto; margin-right: auto;
  color: rgba(255,255,255,0.5); position: relative;
}

.footer-links { display: flex; gap: 20px; }
.footer-links a { color: rgba(255,255,255,0.5); transition: var(--transition); font-size: 12px; }
.footer-links a:hover { color: var(--kh-green-light); }

/* ═══════════════════════════════════════════
   ALERT BANNERS
   ═══════════════════════════════════════════ */
.alert-container {
  max-width: 1280px; width: 100%;
  margin: 20px auto 0; padding: 0 28px;
}

.alert-success {
  background: rgba(0, 177, 108, 0.08); border-left: 4px solid var(--kh-green); color: var(--kh-green-dark);
}

.alert-danger {
  background: var(--red-pale); border-left: 4px solid var(--red); color: var(--red);
}

/* ═══════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════ */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(3, 27, 78, 0.55); z-index: 2000;
  justify-content: center; align-items: center;
  backdrop-filter: blur(10px);
}

.modal-content {
  background: var(--card); border-radius: var(--radius-xl);
  max-width: 520px; width: 90%; padding: 36px;
  box-shadow: var(--shadow-xl); border: 1px solid var(--border);
}

.close-modal {
  position: absolute; top: 14px; right: 14px;
  font-size: 20px; cursor: pointer;
  background: none; border: none; color: var(--muted);
}

/* ═══════════════════════════════════════════
   RESPONSIVE — NAVBAR
   ═══════════════════════════════════════════ */
@media(max-width: 1300px) {
  .nav-menu li a { padding: 5px 8px; font-size: 11.5px; }
  .nav-menu li a i { display: none; }
  .nav-menu { gap: 2px; }
}

/* Malayalam nav — items are wider, compress aggressively */
[data-lang="ml"] .nav-menu li a {
  padding: 4px 6px; font-size: 10px;
}
[data-lang="ml"] .nav-menu li a i { display: none; }
[data-lang="ml"] .nav-menu { gap: 1px; }

/* Trigger mobile menu at 1200px instead of 992px specifically for Malayalam to prevent overlap */
@media(max-width: 1200px) {
  body[data-lang="ml"] .iria-header { padding: 0 16px; }
  body[data-lang="ml"] .menu-toggle { display: flex; }
  body[data-lang="ml"] .header-nav { display: none; }
  body[data-lang="ml"] .header-nav.active {
    display: flex; position: absolute;
    top: var(--header-h); left: 0; width: 100%;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(24px);
    border-bottom: 3px solid transparent;
    border-image: var(--kh-gradient) 1;
    box-shadow: 0 16px 40px rgba(12, 124, 187, 0.15);
    padding: 16px; z-index: 999;
  }
  body[data-lang="ml"] [data-theme="dark"] .header-nav.active { background: rgba(10,15,30,0.97); }
  body[data-lang="ml"] .nav-menu { flex-direction: column; gap: 4px; width: 100%; }
  body[data-lang="ml"] .nav-menu li a { width: 100%; padding: 12px 14px; font-size: 14px; }
  body[data-lang="ml"] .nav-menu li a i { display: inline; }
}

@media(max-width: 992px) {
  .iria-header { padding: 0 16px; }
  .menu-toggle { display: flex; }
  .header-nav { display: none; }
  .header-nav.active {
    display: flex; position: absolute;
    top: var(--header-h); left: 0; width: 100%;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(24px);
    border-bottom: 3px solid transparent;
    border-image: var(--kh-gradient) 1;
    box-shadow: 0 16px 40px rgba(12, 124, 187, 0.15);
    padding: 16px; z-index: 999;
  }
  [data-theme="dark"] .header-nav.active { background: rgba(10,15,30,0.97); }
  .nav-menu { flex-direction: column; gap: 4px; width: 100%; }
  .nav-menu li a { width: 100%; padding: 12px 14px; font-size: 14px; }
  .nav-menu li a i { display: inline; }
  .hero-section { padding: 40px 28px; }
  .hero-title { font-size: 26px; }
  .hero-img-wrapper { display: none; }
  .page-content { padding: 24px 16px; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media(max-width: 768px) {
  .leadership-grid { grid-template-columns: 1fr; }
  .pillars-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════
   HOME PAGE — HERO
   ═══════════════════════════════════════════ */
.home-hero-container {
  position: relative; height: 520px; overflow: hidden;
  display: flex; align-items: center; color: #ffffff;
  background: var(--kh-gradient); margin-bottom: 0;
  /* Full-bleed breakout */
  width: 100vw; left: 50%; margin-left: -50vw; margin-right: -50vw; margin-top: -36px;
}

/* Kerala Health gradient overlay on video */
.home-hero-container::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    125deg,
    rgba(3, 27, 78, 0.88) 0%,
    rgba(12, 124, 187, 0.55) 55%,
    rgba(0, 177, 108, 0.25) 100%
  );
  z-index: 2;
}

/* Left white accent stripe */
.home-hero-container::after {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: rgba(255,255,255,0.25); z-index: 15;
}

.hero-video-bg {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; object-fit: cover; z-index: 1;
}

.home-hero-content-wrapper {
  max-width: 1280px; width: 100%; margin: 0 auto;
  padding: 0 40px; box-sizing: border-box;
  position: relative; z-index: 5;
}

.home-hero__inner { position: relative; max-width: 680px; }

.home-hero__badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: 7px 18px; border-radius: 30px; margin-bottom: 24px;
  backdrop-filter: blur(8px); animation: heroFadeUp 0.7s ease 0.1s both;
}

.home-hero__title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 52px; font-weight: 900; color: #ffffff;
  line-height: 1.08; margin-bottom: 18px; letter-spacing: -2px;
  animation: heroFadeUp 0.7s ease 0.25s both;
}

.home-hero__sub {
  font-size: 17px; color: rgba(255,255,255,0.90); line-height: 1.68;
  margin-bottom: 36px; font-weight: 400; max-width: 560px;
  animation: heroFadeUp 0.7s ease 0.40s both;
}

.home-hero__cta {
  display: flex; gap: 14px; flex-wrap: wrap;
  animation: heroFadeUp 0.7s ease 0.55s both;
}

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

.btn-hero-outline {
  border: 2px solid rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.10); color: #ffffff;
  padding: 12px 26px; border-radius: 8px; font-weight: 700;
  font-size: 13.5px; cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
  backdrop-filter: blur(8px); font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn-hero-outline:hover {
  background: rgba(255,255,255,0.20); border-color: rgba(255,255,255,0.80);
  transform: translateY(-2px);
}

.home-hero__logo-wrap {
  width: 180px; display: flex; justify-content: center;
  position: relative; z-index: 5;
}

.home-hero__logo {
  max-width: 100%; max-height: 160px;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.3));
  animation: floatLogo 4s ease-in-out infinite;
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ═══════════════════════════════════════════
   HOME PAGE — STATS STRIP
   Kerala Health Blue-Green Dark Card
   ═══════════════════════════════════════════ */
.stats-strip {
  display: flex; align-items: center; justify-content: space-around;
  background: linear-gradient(135deg, #031b4e 0%, #0a3570 100%);
  border-radius: var(--radius-lg); padding: 28px 20px;
  margin-bottom: 52px; margin-top: 32px;
  border: 1px solid rgba(12, 124, 187, 0.2);
  box-shadow: 0 20px 60px rgba(3, 27, 78, 0.25),
              inset 0 1px 0 rgba(12, 124, 187, 0.2);
  position: relative; overflow: hidden;
}

/* Kerala Health gradient glow on top */
.stats-strip::before {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%; height: 2px;
  background: var(--kh-gradient);
  border-radius: 0 0 2px 2px;
}

.stat-item { text-align: center; flex: 1; padding: 8px 12px; position: relative; }

.stat-num {
  display: block; font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 36px; font-weight: 800; color: #ffffff;
  line-height: 1; margin-bottom: 6px;
}

.stat-lbl {
  font-size: 11px; text-transform: uppercase;
  color: rgba(255,255,255,0.80); font-weight: 600; letter-spacing: 1px;
}

.stat-sep { width: 1px; height: 44px; background: rgba(255,255,255,0.10); flex-shrink: 0; }

/* ═══════════════════════════════════════════
   HOME PAGE — ABOUT SECTION
   ═══════════════════════════════════════════ */
.home-about {
  display: grid; grid-template-columns: 1fr 1.3fr;
  gap: 56px; align-items: center; margin-bottom: 64px;
  padding: 52px 56px;
  background: linear-gradient(135deg, rgba(12,124,187,0.04) 0%, rgba(0,177,108,0.02) 100%);
  border-radius: var(--radius-xl); border: 1px solid rgba(12, 124, 187, 0.08);
  position: relative; overflow: hidden;
}

/* Kerala Health gradient left accent */
.home-about::before {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0; width: 4px;
  background: var(--kh-gradient); border-radius: 4px 0 0 4px;
}

.home-about__img-col {
  position: relative; border-radius: var(--radius-lg);
  overflow: hidden; height: 320px;
  box-shadow: 0 24px 64px rgba(12, 124, 187, 0.14),
              0 0 0 1px rgba(12, 124, 187, 0.10);
}

.home-about__img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-about__img-col:hover .home-about__img { transform: scale(1.05); }

.home-about__heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 26px; color: var(--text); font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.25;
}

[data-theme="dark"] .home-about__heading { color: #e8edf8; }

.home-about__rule {
  width: 56px; height: 3px;
  background: var(--kh-gradient); margin: 14px 0 18px; border-radius: 2px;
}

.home-about__body { font-size: 14.5px; line-height: 1.78; color: var(--muted); }

/* ═══════════════════════════════════════════
   HOME PAGE — SERVICE TILES
   ═══════════════════════════════════════════ */
.home-services { margin-bottom: 64px; }

.home-services__header { text-align: center; margin-bottom: 40px; }

.home-services__title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 30px; color: var(--text); font-weight: 800;
  margin-top: 6px; letter-spacing: -0.025em;
}

[data-theme="dark"] .home-services__title { color: #e8edf8; }

.home-services__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}

.svc-tile {
  background: var(--card); border-radius: var(--radius-lg);
  padding: 32px 28px; border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
  position: relative; overflow: hidden; cursor: pointer;
  text-decoration: none; color: inherit;
}

/* Kerala Health ghost number */
.svc-tile__num {
  position: absolute; top: 14px; right: 20px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 54px; font-weight: 900;
  color: rgba(12, 124, 187, 0.055);
  line-height: 1; pointer-events: none;
  transition: color 0.35s ease; user-select: none;
}

.svc-tile:hover .svc-tile__num { color: rgba(12, 124, 187, 0.12); }

/* Kerala Health gradient top bar on hover */
.svc-tile::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--kh-gradient);
  transform: scaleX(0); transform-origin: left; transition: transform 0.35s ease;
}

.svc-tile:hover::before { transform: scaleX(1); }

.svc-tile:hover {
  transform: translateY(-8px);
  border-color: rgba(12, 124, 187, 0.22);
  box-shadow: 0 24px 60px rgba(12, 124, 187, 0.13),
              0 0 0 1px rgba(12, 124, 187, 0.08);
}

.svc-tile__icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: rgba(12, 124, 187, 0.09); color: var(--kh-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 20px;
  transition: all 0.35s ease; position: relative; z-index: 1;
}

.svc-tile:hover .svc-tile__icon {
  background: var(--kh-gradient); color: #ffffff;
  box-shadow: 0 8px 24px rgba(12, 124, 187, 0.40); transform: scale(1.08);
}

.svc-tile__title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px; font-weight: 700; color: var(--text);
  margin-bottom: 10px; position: relative; z-index: 1;
}

[data-theme="dark"] .svc-tile__title { color: #e8edf8; }

.svc-tile__desc {
  font-size: 13px; color: var(--muted); line-height: 1.6;
  margin-bottom: 20px; flex-grow: 1; position: relative; z-index: 1;
}

.svc-tile__link {
  font-size: 12.5px; font-weight: 700; color: var(--kh-blue);
  display: inline-flex; align-items: center; gap: 5px;
  transition: var(--transition); position: relative; z-index: 1;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.svc-tile:hover .svc-tile__link { color: var(--kh-green-dark); gap: 8px; }

/* ═══════════════════════════════════════════
   HOME PAGE — NEWS & QUICK LINKS
   ═══════════════════════════════════════════ */
.home-news-row {
  display: grid; grid-template-columns: 1.4fr 1fr;
  gap: 24px; margin-bottom: 64px;
}

.home-news-col, .home-quick-col {
  background: var(--card); border-radius: var(--radius-lg);
  padding: 28px; border: 1px solid var(--border); box-shadow: var(--shadow-xs);
}

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

.home-section-head__title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}

.home-section-head__title i { color: var(--kh-blue); }

.home-section-head__more {
  font-size: 11px; font-weight: 700; color: var(--kh-blue);
  text-transform: uppercase; letter-spacing: 0.5px; transition: var(--transition);
}

.home-section-head__more:hover { color: var(--kh-green-dark); }

.news-list { display: flex; flex-direction: column; }

.news-item {
  padding: 13px 0; border-bottom: 1px solid var(--border);
  transition: all 0.2s ease;
}

.news-item:last-child { border-bottom: none; }
.news-item:hover { padding-left: 6px; }

.news-item__title {
  font-size: 13px; font-weight: 600; margin-top: 7px; margin-bottom: 4px;
  color: var(--text); line-height: 1.45; transition: color 0.2s ease;
}

.news-item:hover .news-item__title { color: var(--kh-blue); }

.news-item__date {
  font-size: 10.5px; color: var(--muted);
  display: flex; align-items: center; gap: 4px;
}

.quick-links { display: grid; grid-template-columns: 1fr; gap: 8px; }

.quick-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  background: var(--bg); border-radius: var(--radius);
  border: 1px solid transparent; transition: var(--transition);
  color: var(--text); text-decoration: none;
}

.quick-link:hover {
  transform: translateX(6px);
  border-color: rgba(12, 124, 187, 0.18);
  background: rgba(12, 124, 187, 0.05); box-shadow: var(--shadow-xs);
}

.quick-link__icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

.quick-link strong {
  display: block; font-size: 13px; font-weight: 700;
  color: var(--text); font-family: 'Plus Jakarta Sans', sans-serif;
}

.quick-link small { display: block; font-size: 10.5px; color: var(--muted); }

/* ═══════════════════════════════════════════
   HOME PAGE — LEADERSHIP
   ═══════════════════════════════════════════ */
.home-leadership { margin-bottom: 20px; }

/* ═══════════════════════════════════════════
   SCROLL REVEAL ANIMATIONS
   ═══════════════════════════════════════════ */
.reveal {
  opacity: 0; transform: translateY(32px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.revealed { opacity: 1; transform: translateY(0); }

/* Staggered service tiles */
.home-services__grid .svc-tile {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.5s ease, transform 0.5s ease,
              border-color 0.35s ease, box-shadow 0.35s cubic-bezier(0.4,0,0.2,1),
              background-color 0.25s ease;
}
.home-services__grid .svc-tile.revealed { opacity: 1; transform: translateY(0); }
.home-services__grid .svc-tile:nth-child(1) { transition-delay: 0ms; }
.home-services__grid .svc-tile:nth-child(2) { transition-delay: 80ms; }
.home-services__grid .svc-tile:nth-child(3) { transition-delay: 160ms; }
.home-services__grid .svc-tile:nth-child(4) { transition-delay: 240ms; }
.home-services__grid .svc-tile:nth-child(5) { transition-delay: 320ms; }
.home-services__grid .svc-tile:nth-child(6) { transition-delay: 400ms; }

/* ═══════════════════════════════════════════
   HOME RESPONSIVE
   ═══════════════════════════════════════════ */
@media(max-width: 992px) {
  .home-hero-container { height: auto; min-height: 420px; margin-top: -24px; }
  .home-hero-content-wrapper { padding: 52px 24px; }
  .home-hero__inner { max-width: 100%; }
  .home-hero__title { font-size: 36px; letter-spacing: -1px; }
  .home-hero__logo-wrap { width: 130px; }
  .stats-strip { flex-wrap: wrap; gap: 0; padding: 20px 16px; margin-top: 24px; margin-bottom: 40px; }
  .stat-item { flex: 1 1 45%; padding: 14px 8px; }
  .stat-sep { display: none; }
  .home-about { grid-template-columns: 1fr; gap: 24px; padding: 32px 28px; margin-bottom: 48px; }
  .home-about__img-col { height: 220px; }
  .home-services__grid { grid-template-columns: 1fr 1fr; }
  .home-news-row { grid-template-columns: 1fr; gap: 20px; }
}

@media(max-width: 640px) {
  .home-hero__title { font-size: 28px; letter-spacing: -0.5px; }
  .home-hero__sub { font-size: 15px; }
  .home-services__grid { grid-template-columns: 1fr; }
  .stat-num { font-size: 28px; }
}

/* ═══════════════════════════════════════════
   ADMIN DASHBOARD — Specialized Layout
   (Preserved from original for compatibility)
   ═══════════════════════════════════════════ */
body.admin-mode-active { background-color: #f4f7fa; }
body.admin-mode-active .iria-header,
body.admin-mode-active .portal-footer { display: none !important; }
body.admin-mode-active .page-content { padding: 0 !important; max-width: 100% !important; margin: 0 !important; }

.admin-db-container { display: flex; min-height: 100vh; background-color: #f0f4f8; font-family: 'Inter', sans-serif; }
[data-theme="dark"] .admin-db-container { background-color: #0d1528; }

.admin-db-sidebar { width: 250px; background-color: var(--primary-900); color: #fff; display: flex; flex-direction: column; flex-shrink: 0; }

.admin-db-sidebar-header { padding: 20px; display: flex; align-items: center; gap: 12px; background-color: #ffffff; border-bottom: 3px solid var(--kh-blue); }
.admin-db-sidebar-header img { height: 40px; }
.admin-db-sidebar-header div { color: var(--kh-blue); font-weight: 700; font-size: 14px; line-height: 1.2; }
.admin-db-sidebar-header span { font-size: 8px; color: #4a5a72; font-weight: 500; }

.admin-db-nav { padding: 10px 0; flex: 1; overflow-y: auto; }
.admin-db-nav a { display: flex; align-items: center; padding: 12px 20px; color: rgba(255,255,255,0.70); text-decoration: none; font-size: 13px; font-weight: 600; gap: 12px; border-left: 4px solid transparent; transition: all 0.2s; }
.admin-db-nav a:hover, .admin-db-nav a.active { background-color: rgba(12, 124, 187, 0.2); color: #ffffff; border-left-color: var(--kh-green); }
.admin-db-nav a i { width: 16px; text-align: center; }

.admin-db-subnav { padding-left: 48px; display: flex; flex-direction: column; margin-top: -5px; margin-bottom: 5px; }
.admin-db-subnav a { padding: 8px 0; font-size: 11px; font-weight: 500; border: none; border-left: none; }
.admin-db-subnav a:hover { background-color: transparent; color: #ffffff; }

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

.admin-db-header { height: 60px; background: var(--kh-gradient); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.1); }
.admin-db-header-title { font-size: 15px; font-weight: 600; }
.admin-db-header-actions { display: flex; align-items: center; gap: 20px; }
.admin-db-user { display: flex; align-items: center; gap: 10px; font-size: 12px; }

.admin-db-content { padding: 24px; overflow-y: auto; flex: 1; }

.admin-db-title-area { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; }
.admin-db-title-area h1 { font-size: 22px; font-weight: 700; color: var(--kh-blue); margin-bottom: 4px; }
.admin-db-title-area p { font-size: 12px; color: var(--muted); }
.admin-db-date { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.admin-db-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }

.admin-kpi-card { background: var(--card, #fff); border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid var(--border); display: flex; flex-direction: column; }
.admin-kpi-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.admin-kpi-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; }
.admin-kpi-info h4 { font-size: 10px; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; font-weight: 700; }
.admin-kpi-info span { font-size: 20px; font-weight: 700; color: var(--kh-blue); }
.admin-kpi-link { margin-top: auto; font-size: 11px; color: var(--kh-blue); text-decoration: none; font-weight: 600; display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); }

.admin-db-grid-middle { display: grid; grid-template-columns: 1fr 1.2fr 1.2fr; gap: 16px; margin-bottom: 16px; }
@media(max-width: 1024px) { .admin-db-grid-middle { grid-template-columns: 1fr; } }

.admin-db-panel { background: var(--card, #fff); border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid var(--border); }
.admin-panel-title { font-size: 14px; font-weight: 700; color: var(--kh-blue); margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }

.admin-db-grid-bottom { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }

.admin-list-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; font-size: 12px; }
.admin-list-item i { color: var(--kh-green); margin-top: 2px; }
.admin-list-item p { color: var(--kh-blue); font-weight: 500; margin-bottom: 2px; }
.admin-list-item span { color: var(--muted); font-size: 10px; }

.admin-db-footer { background: var(--kh-gradient); color: rgba(255,255,255,0.7); padding: 12px 24px; font-size: 11px; display: flex; justify-content: space-between; align-items: center; }

/* Media Gallery & Lightbox Styles */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 15px;
}

.gallery-folder-card {
  background: var(--card, #ffffff);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.gallery-folder-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.folder-cover-wrap {
  position: relative;
  height: 180px;
  overflow: hidden;
}

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

.gallery-folder-card:hover .folder-cover-img {
  transform: scale(1.06);
}

.folder-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 15, 30, 0.8) 0%, rgba(10, 15, 30, 0.1) 60%, transparent 100%);
  display: flex;
  align-items: flex-end;
  padding: 12px;
}

.folder-badge {
  background: var(--primary-color);
  color: #ffffff;
  padding: 4px 10px;
  font-size: 11.5px;
  border-radius: 20px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.folder-details {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.folder-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 12px;
  line-height: 1.45;
}

.folder-action-btn {
  background: transparent;
  border: none;
  color: var(--primary-color);
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-top: auto;
  align-self: flex-start;
  transition: color 0.2s ease;
}

.folder-action-btn i {
  transition: transform 0.3s ease;
}

.gallery-folder-card:hover .folder-action-btn {
  color: var(--primary-light);
}

.gallery-folder-card:hover .folder-action-btn i {
  transform: translateX(5px);
}

/* Photo Grid View */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 15px;
}

.photo-card {
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.photo-img-wrap {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.photo-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.photo-card:hover .photo-thumb-img {
  transform: scale(1.08);
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(12, 124, 187, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.photo-card:hover .photo-overlay {
  opacity: 1;
}

.photo-overlay i {
  color: #ffffff;
  font-size: 24px;
}

/* Lightbox Modal Styles */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(8, 12, 24, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease;
}

.lightbox-backdrop.active {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 25px;
  right: 30px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 44px;
  font-weight: 300;
  cursor: pointer;
  line-height: 0.5;
  transition: color 0.2s, transform 0.2s;
  z-index: 100000;
}

.lightbox-close:hover {
  color: var(--gold-light, #ffd700);
  transform: scale(1.1);
}

.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 20px;
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  z-index: 100000;
}

.lightbox-prev:hover, .lightbox-next:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--gold-light, #ffd700);
  border-color: var(--gold-light, #ffd700);
}

.lightbox-prev { left: 40px; }
.lightbox-next { right: 40px; }

@media (max-width: 768px) {
  .lightbox-prev { left: 15px; }
  .lightbox-next { right: 15px; }
  .lightbox-prev, .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

.lightbox-content-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 80%;
  max-height: 80%;
  text-align: center;
}

.lightbox-content-wrap img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: lightboxZoom 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes lightboxZoom {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.lightbox-caption {
  color: #ffffff;
  margin-top: 20px;
  font-size: 15.5px;
  font-weight: 500;
  max-width: 600px;
  line-height: 1.5;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.lightbox-counter {
  color: rgba(255, 255, 255, 0.5);
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
}
