/* ==========================================================================
   Press Nepal — Full Web Application Master Stylesheet (Official Brand Colors)
   ========================================================================== */

:root {
  --primary: #003893;
  --primary-hover: #002766;
  --primary-light: #ebf2ff;
  --red: #dc143c;
  --red-hover: #b80f32;
  --red-light: #fde8ec;
  --paper: #f4f7fc;
  --white: #ffffff;
  --line: #c0d1f0;
  --line-dark: rgba(0, 56, 147, 0.18);
  --ink: #001d4a;
  --ink-muted: #4a607a;
  --shadow-sm: 0 2px 8px rgba(0, 56, 147, 0.06);
  --shadow-md: 0 10px 30px rgba(0, 56, 147, 0.1);
  --shadow-lg: 0 20px 50px rgba(0, 56, 147, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.app-body {
  margin: 0;
  background-color: #f8fafd;
  background-image: 
    radial-gradient(at 90% 10%, rgba(220, 20, 60, 0.05) 0px, transparent 40%),
    radial-gradient(at 10% 20%, rgba(0, 56, 147, 0.05) 0px, transparent 40%),
    radial-gradient(at 50% 90%, rgba(0, 56, 147, 0.04) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "DM Sans", "Noto Sans Devanagari", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   App Top Navigation Bar
   -------------------------------------------------------------------------- */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 56, 147, 0.1);
  box-shadow: 0 4px 20px rgba(0, 56, 147, 0.03);
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 72px;
  padding: 0 max(4vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
}

.brand-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #003893 0%, #dc143c 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 56, 147, 0.25);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1.5px solid rgba(192, 209, 240, 0.6);
}

.brand-badge.mini {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.app-brand:hover .brand-badge {
  transform: scale(1.12) rotate(-6deg);
  box-shadow: 0 10px 24px rgba(220, 20, 60, 0.35);
  border-color: #c0d1f0;
}

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

.brand-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, #003893 0%, #dc143c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #003893;
  box-shadow: 0 0 0 0 rgba(0, 56, 147, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 56, 147, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 56, 147, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 56, 147, 0); }
}

.app-nav {
  display: flex;
  gap: 32px;
}

.nav-link {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s ease;
  position: relative;
  padding: 4px 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switch {
  display: flex;
  background: rgba(0, 56, 147, 0.06);
  padding: 3px;
  border-radius: 20px;
}

.lang-btn {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 56, 147, 0.2);
}

.btn-primary-outline {
  background: rgba(0, 56, 147, 0.06);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  padding: 8px 18px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary-outline:hover {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 56, 147, 0.25);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   App Hero & KPI Section
   -------------------------------------------------------------------------- */
.app-hero {
  padding: clamp(40px, 4.5vw, 60px) clamp(20px, 4vw, 48px) 44px;
  max-width: 1400px;
  margin: 0 auto 36px;
  width: 100%;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(0, 56, 147, 0.1);
}

.hero-header {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 48px;
  align-items: center;
}

.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #003893;
  font-weight: 800;
  margin-bottom: 16px;
  background: #ebf2ff;
  border: 1.5px solid rgba(0, 56, 147, 0.2);
  padding: 6px 16px;
  border-radius: 99px;
  box-shadow: 0 2px 8px rgba(0, 56, 147, 0.04);
}

h1 {
  font-size: clamp(38px, 4.8vw, 64px);
  line-height: 1.08;
  letter-spacing: -.035em;
  margin: 0 0 18px;
  font-weight: 800;
  color: #001d4a;
}

h1 .hero-navy {
  color: #001d4a;
}

h1 .hero-red {
  color: #dc143c;
}

.hero-text-col > p {
  color: #4a607a;
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 32px;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary-main {
  background: linear-gradient(135deg, #001d4a 0%, #003893 45%, #dc143c 100%);
  color: #ffffff;
  padding: 14px 28px;
  text-decoration: none;
  border-radius: 99px;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0, 56, 147, 0.35);
}

.btn-primary-main:hover {
  background: linear-gradient(135deg, #dc143c 0%, #003893 60%, #001d4a 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px rgba(220, 20, 60, 0.4);
}

.updated-tag {
  font-size: 13px;
  color: #4a607a;
  font-weight: 600;
  background: #ffffff;
  padding: 8px 18px;
  border-radius: 99px;
  border: 1px solid rgba(0, 56, 147, 0.14);
  box-shadow: 0 2px 8px rgba(0, 56, 147, 0.04);
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.kpi-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 24px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1.5px solid rgba(0, 56, 147, 0.14);
  box-shadow: 0 6px 20px rgba(0, 56, 147, 0.05);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0, 56, 147, 0.12);
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: none;
  background: #ebf2ff;
  border: 1px solid #c0d1f0;
}

/* Live Websites KPI Card (Brand Blue #003893) */
.kpi-card.live-kpi {
  background: #ffffff;
  border: 1.5px solid #003893;
  box-shadow: 0 8px 24px rgba(0, 56, 147, 0.08);
}

.kpi-card.live-kpi .kpi-icon {
  background: #ebf2ff;
  border: 1px solid #c0d1f0;
}

.kpi-card.live-kpi .kpi-data strong {
  color: #003893;
  font-size: 34px;
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi-card.live-kpi .kpi-data span {
  color: #003893;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 5px;
}

/* Offline Records KPI Card (Crimson Red #DC143C) */
.kpi-card.offline-kpi {
  background: #ffffff;
  border: 1.5px solid #dc143c;
  box-shadow: 0 8px 24px rgba(220, 20, 60, 0.1);
}

.kpi-card.offline-kpi .kpi-icon {
  background: #fde8ec;
  border: 1px solid #f9b8c4;
}

.kpi-card.offline-kpi .kpi-data strong {
  color: #dc143c;
  font-size: 34px;
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi-card.offline-kpi .kpi-data span {
  color: #dc143c;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 5px;
}

/* Districts KPI Card (Brand Blue) */
.kpi-card.district-kpi {
  background: #ffffff;
  border: 1.5px solid #003893;
  box-shadow: 0 8px 24px rgba(0, 56, 147, 0.08);
}

.kpi-card.district-kpi .kpi-icon {
  background: #ebf2ff;
  border: 1px solid #c0d1f0;
}

.kpi-card.district-kpi .kpi-data strong {
  color: #003893;
  font-size: 34px;
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi-card.district-kpi .kpi-data span {
  color: #003893;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 5px;
}

/* Provinces KPI Card (Crimson Red) */
.kpi-card.province-kpi {
  background: #ffffff;
  border: 1.5px solid #dc143c;
  box-shadow: 0 8px 24px rgba(220, 20, 60, 0.1);
}

.kpi-card.province-kpi .kpi-icon {
  background: #fde8ec;
  border: 1px solid #f9b8c4;
}

.kpi-card.province-kpi .kpi-data strong {
  color: #dc143c;
  font-size: 34px;
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi-card.province-kpi .kpi-data span {
  color: #dc143c;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 5px;
}

.kpi-data strong {
  display: block;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
}

.kpi-data span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
  margin-top: 5px;
  display: block;
}

/* --------------------------------------------------------------------------
   Interactive Map Section
   -------------------------------------------------------------------------- */
.app-map-section {
  padding: 12px clamp(20px, 4vw, 48px) 44px;
  max-width: 1400px;
  margin: 0 auto 36px;
  width: 100%;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(0, 56, 147, 0.15);
}

.section-title-wrap {
  margin-bottom: 28px;
}

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

.section-title-wrap h2 {
  font-size: clamp(28px, 3.2vw, 40px);
  margin: 0 0 8px 0;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--ink);
}

.section-subtitle {
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  max-width: 680px;
}

.map-explorer-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
  background: #001b48;
  border: 1px solid #003893;
}

.map-sidebar {
  padding: 28px 24px;
  background: linear-gradient(155deg, #001b48 0%, #003893 65%, #001b48 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid rgba(192, 209, 240, 0.2);
}

.sidebar-tag {
  color: #fde8ec;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.map-sidebar h3 {
  color: #ffffff !important;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 10px 0;
}

.map-sidebar p {
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 20px 0;
}

.selected-province-info {
  background: rgba(255, 255, 255, 0.1);
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.info-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: .06em;
  display: block;
}

.info-count {
  display: block;
  font-size: 13px;
  color: #fde8ec;
  margin-top: 2px;
  font-weight: 700;
}

.selected-province-info strong {
  font-size: 19px;
  color: #ffffff;
  display: block;
  margin-top: 2px;
}

.btn-glass {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 9px 18px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-glass:hover {
  background: #dc143c;
  border-color: #dc143c;
  color: #ffffff !important;
}

.map-canvas-wrap {
  background: radial-gradient(circle at 55% 48%, rgba(0, 56, 147, 0.3), transparent 40%), linear-gradient(145deg, #001b48, #002d75 65%, #001438);
  position: relative;
  padding: 32px 36px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 460px;
  width: 100%;
  box-sizing: border-box;
}

.nepal-map {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.nepal-map svg {
  width: 100%;
  height: auto;
  max-height: 600px;
  filter: drop-shadow(0 14px 36px rgba(0, 0, 0, 0.55));
}

.map-region path {
  fill: #00296b;
  stroke: #4075c7;
  stroke-width: 1.5;
  transition: fill 0.25s ease, stroke 0.25s ease, filter 0.25s ease;
  cursor: pointer;
}

.map-region:hover path,
.map-region:focus path {
  fill: #003893;
  stroke: #ffffff;
  stroke-width: 2;
  filter: drop-shadow(0 6px 14px rgba(0, 56, 147, 0.5));
}

.map-region.active path {
  fill: #dc143c;
  stroke: #ffffff;
  stroke-width: 3;
  filter: drop-shadow(0 8px 24px rgba(220, 20, 60, 0.65));
}

.map-region text {
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 700;
  fill: #ffffff;
  stroke: none !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.95));
  pointer-events: none;
}

.map-region .map-count {
  font-size: 11px;
  font-weight: 500;
  fill: #d9e3ff;
  stroke: none !important;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.95));
  pointer-events: none;
}

.map-region.active .map-count {
  fill: #ffffff;
  font-weight: 700;
}

.map-legend {
  position: absolute;
  bottom: 16px;
  left: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-legend span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc143c;
}

/* Quick Province Selector Cards Grid */
.province-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .province-overview {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .province-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

.province-card {
  background: #ffffff;
  border: 1px solid #c0d1f0;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 74px;
  cursor: pointer;
  text-align: left;
  gap: 6px;
  box-sizing: border-box;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 56, 147, 0.04);
  min-width: 0;
}

.province-card:hover {
  background: #ffffff;
  border-color: #dc143c;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(220, 20, 60, 0.15);
}

.prov-card-header {
  width: 100%;
  min-width: 0;
}

.prov-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.prov-card-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.prov-count {
  font-size: 20px;
  font-weight: 800;
  color: #003893;
  line-height: 1;
  letter-spacing: -0.02em;
}

.prov-unit {
  font-size: 10px;
  color: var(--ink-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.province-card.active {
  background: linear-gradient(135deg, #003893 0%, #dc143c 100%) !important;
  border-color: #003893 !important;
  box-shadow: 0 8px 24px rgba(0, 56, 147, 0.35) !important;
}

.province-card.active .prov-name {
  color: #ffffff !important;
}

.province-card.active .prov-count {
  color: #ffffff !important;
}

.province-card.active .prov-unit {
  color: #fde8ec !important;
}

/* --------------------------------------------------------------------------
   App Directory & Filter Controls Section
   -------------------------------------------------------------------------- */
.app-directory-section {
  padding: clamp(40px, 5vw, 64px) clamp(20px, 4vw, 48px);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.directory-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.directory-header h2 {
  font-size: clamp(26px, 3.5vw, 42px);
  margin: 0;
  font-weight: 800;
  letter-spacing: -.03em;
}

.view-toggle-wrap {
  display: flex;
  background: #ebf2ff;
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
  border: 1px solid #c0d1f0;
}

.view-btn {
  border: 0;
  background: transparent;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-btn.active {
  background: var(--white);
  color: #003893;
  box-shadow: 0 2px 6px rgba(0, 56, 147, 0.12);
}

/* App Filter Bar */
.app-filter-bar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 12px;
  background: #ebf2ff;
  border: 1px solid #c0d1f0;
  padding: 16px;
  border-radius: 16px;
  align-items: center;
  position: sticky;
  top: 72px;
  z-index: 30;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.search-input-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 56, 147, 0.15);
}

.search-input-wrap svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.2;
  flex: none;
}

.search-input-wrap input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
}

.filter-select-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-select-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 56, 147, 0.15);
}

.filter-select-wrap label {
  font-size: 10px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  margin-bottom: 2px;
}

.filter-select-wrap select {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.btn-clear {
  border: 0;
  background: rgba(0, 56, 147, 0.08);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.btn-clear:hover:not(:disabled) {
  background: var(--primary);
  color: #ffffff;
}

.btn-clear:disabled {
  opacity: 0.4;
  background: transparent;
  cursor: not-allowed;
}

/* Result Bar */
.app-result-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 4px 14px;
}

.result-counter {
  font-size: 14px;
  color: var(--ink-muted);
}

.result-counter strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.btn-download {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Data Table & Grid Card Views
   -------------------------------------------------------------------------- */
.table-container {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: auto;
  box-shadow: var(--shadow-sm);
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.app-table th {
  text-align: left;
  background: #001b48;
  color: #ffffff;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 16px 20px;
  font-weight: 700;
  border-bottom: 2px solid #003893;
}

.app-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.app-table th.sortable:hover {
  background: #002766;
  color: #ffffff;
}

.app-table th .sort-icon {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.app-table th.sortable:hover .sort-icon {
  opacity: 1;
  color: #fde8ec;
}

.app-table th.active-sort {
  background: #002766;
  color: #ffffff;
}

.app-table th.active-sort .sort-icon {
  opacity: 1;
  color: #dc143c;
  font-weight: 800;
}

.app-table td {
  padding: 16px 20px;
  border-bottom: 1px solid #eef2f9;
  font-size: 14px;
  vertical-align: middle;
}

.app-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.app-table tbody tr:hover {
  background: #ebf2ff;
}

.app-table td:first-child {
  font-family: monospace;
  font-size: 13px;
  color: var(--ink-muted);
  width: 60px;
}

.app-table td strong {
  display: inline;
  font-size: 14px;
  color: inherit;
}

.table-site-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.table-site-link:hover {
  color: #003893;
  text-decoration: underline;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 20px;
  background: #ebf2ff;
  color: #003893;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #c0d1f0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}

.pill-live {
  background: #ebf2ff !important;
  color: #003893 !important;
  border: 1px solid #c0d1f0 !important;
}

.pill-live .status-dot {
  background: #003893;
  box-shadow: 0 0 6px rgba(0, 56, 147, 0.8);
}

.pill-dead {
  background: #fde8ec !important;
  color: #dc143c !important;
  border: 1px solid #f9b8c4 !important;
}

.pill-dead .status-dot {
  background: #dc143c;
  box-shadow: 0 0 6px rgba(220, 20, 60, 0.8);
}

.pill-filter {
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.pill-filter:hover {
  background: #003893 !important;
  color: #ffffff !important;
  border-color: #003893 !important;
  box-shadow: 0 4px 12px rgba(0, 56, 147, 0.25);
  transform: translateY(-1px);
}

.pill-filter:hover .status-dot {
  background: #ffffff !important;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9) !important;
}

.pill-outline {
  display: inline-block;
  border-radius: 20px;
  border: 1px solid #c0d1f0;
  color: var(--ink-muted);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
}

.btn-table-action {
  background: #ebf2ff;
  border: 1px solid #c0d1f0;
  color: #003893;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-table-action:hover {
  background: linear-gradient(135deg, #003893 0%, #dc143c 100%);
  border-color: #dc143c;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(220, 20, 60, 0.35);
}

/* Grid Cards Layout */
.media-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.media-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.media-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.media-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.media-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
}

.media-card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--ink);
}

.media-card-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.media-card-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.media-card-footer {
  margin-top: auto;
  border-top: 1px solid #eef2f9;
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reg-date {
  font-size: 11px;
  color: var(--ink-muted);
}

.card-btn {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

/* Empty State */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--line);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.empty-state strong {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
}

.empty-state span {
  color: var(--ink-muted);
  font-size: 14px;
}

.load-more-wrap {
  margin-top: 32px;
  text-align: center;
}

.btn-load-more {
  background: var(--white);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  padding: 14px 32px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-load-more:hover {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 56, 147, 0.25);
}

.source-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 780px;
  margin-top: 24px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.app-footer {
  padding: 32px max(4vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-muted);
  border-top: 1px solid var(--line);
  background: var(--white);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Detail Dialog Modal
   -------------------------------------------------------------------------- */
dialog.app-dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;
  max-width: 580px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

dialog.app-dialog[open] {
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

dialog::backdrop {
  background: rgba(0, 27, 72, 0.65);
  backdrop-filter: blur(6px);
}

.dialog-close-btn {
  position: absolute;
  right: 18px;
  top: 16px;
  border: 0;
  background: rgba(0, 0, 0, 0.05);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-muted);
  transition: all 0.2s ease;
}

.dialog-close-btn:hover {
  background: var(--ink);
  color: #ffffff;
}

.detail-inner {
  padding: 40px;
}

.detail-inner .tag {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.detail-inner h3 {
  font-size: 30px;
  margin: 10px 0 6px;
}

.modal-site-btn {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  margin-top: 4px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

.detail-grid span {
  display: block;
  color: var(--ink-muted);
  font-size: 11px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
}

.detail-grid p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.source-warning {
  margin-top: 24px;
  background: var(--paper);
  padding: 16px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.5;
  border: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints & Device Adaptations
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero-header {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .map-explorer-card {
    grid-template-columns: 1fr;
  }
  .map-sidebar {
    padding: 28px 20px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }
  .app-filter-bar {
    grid-template-columns: 1fr 1fr;
    top: 64px;
  }
  .search-input-wrap {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .topbar-inner {
    padding: 0 16px;
    height: 64px;
  }
  .app-nav {
    display: none;
  }
  .hero-actions {
    gap: 12px;
  }
  .btn-primary-main {
    width: 100%;
    justify-content: center;
  }
  .section-title-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .app-filter-bar {
    grid-template-columns: 1fr;
    position: relative;
    top: 0;
  }
  .search-input-wrap {
    grid-column: span 1;
  }
  .btn-clear {
    width: 100%;
  }
  .directory-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .app-result-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .app-footer {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
  .map-canvas-wrap {
    padding: 20px 14px 40px;
    min-height: 340px;
  }
  dialog.app-dialog {
    max-height: 88vh;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .province-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .province-card {
    padding: 12px 10px;
    min-height: 68px;
  }
  .prov-count {
    font-size: 18px;
  }
  .media-cards-grid {
    grid-template-columns: 1fr;
  }
  .detail-inner {
    padding: 24px 18px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .detail-inner h3 {
    font-size: 22px;
  }
  .topbar-actions {
    gap: 8px;
  }
  .btn-primary-outline {
    padding: 6px 12px;
    font-size: 11px;
  }
}
