/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f0f4f8;
  color: #1e293b;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { border: none; background: none; cursor: pointer; font: inherit; color: inherit; }
iframe { border: none; }

/* === Sidebar === */
.sidebar {
  width: 260px;
  background: #0f172a;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.logo-icon { width: 40px; height: 40px; flex-shrink: 0; }
.logo-title { font-size: 1rem; font-weight: 700; color: #fff; line-height: 1.2; }
.logo-subtitle { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; }
.sidebar-toggle { display: none; color: #94a3b8; padding: 0.25rem; }
.sidebar-toggle:hover { color: #fff; }

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #94a3b8;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #e2e8f0; }
.nav-item.active { background: #0ea5e9; color: #fff; }
.nav-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.75rem;
  color: #64748b;
}

/* === Main Content === */
.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.menu-btn { display: none; }
.topbar-title h2 { font-size: 1.15rem; font-weight: 600; }
.topbar-actions { margin-left: auto; }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.status-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #16a34a;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 1.5rem;
}

/* Sections */
.section { display: none; }
.section.active { display: block; }

/* === Cards Grid === */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.card-highlight { display: flex; align-items: flex-start; gap: 1rem; }
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-icon svg { width: 22px; height: 22px; }
.card-icon.blue   { background: #eff6ff; color: #2563eb; }
.card-icon.green  { background: #f0fdf4; color: #16a34a; }
.card-icon.purple { background: #faf5ff; color: #9333ea; }
.card-icon.orange { background: #fff7ed; color: #ea580c; }
.card-body { flex: 1; }
.card-label { display: block; font-size: 0.75rem; color: #64748b; margin-bottom: 0.2rem; }
.card-value { display: block; font-size: 1.15rem; color: #0f172a; margin-bottom: 0.15rem; }
.card-detail { display: block; font-size: 0.78rem; color: #94a3b8; }

/* === Panel === */
.panel {
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
}
.panel-header h3 { font-size: 1rem; font-weight: 600; }
.panel-body { padding: 1.25rem; }
.panel-body p { line-height: 1.7; color: #475569; margin-bottom: 0.75rem; }
.panel-body h4 { margin: 1rem 0 0.5rem; font-size: 0.95rem; }
.panel-body ul { padding-left: 1.25rem; list-style: disc; }
.panel-body li { color: #475569; line-height: 1.7; margin-bottom: 0.3rem; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}
.btn-primary { background: #0ea5e9; color: #fff; }
.btn-primary:hover { background: #0284c7; }
.btn-outline { background: transparent; border: 1px solid #e2e8f0; color: #475569; }
.btn-outline:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-large { padding: 0.75rem 1.5rem; font-size: 0.95rem; }

/* === Map === */
.map-preview {
  position: relative;
  height: 350px;
  border-radius: 0 0 0.75rem 0.75rem;
  overflow: hidden;
}
.map-preview iframe { width: 100%; height: 100%; }
.map-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.map-preview:hover .map-overlay { opacity: 1; }

.map-fullscreen {
  height: calc(100vh - 120px);
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.map-fullscreen iframe { width: 100%; height: 100%; }

/* === Info Grid === */
.info-grid { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.info-item { display: flex; align-items: flex-start; gap: 0.75rem; }
.info-icon { width: 24px; height: 24px; flex-shrink: 0; color: #0ea5e9; margin-top: 0.2rem; }
.info-item strong { display: block; font-size: 0.9rem; margin-bottom: 0.15rem; }
.info-item p { margin: 0; font-size: 0.85rem; }

/* === Data Table === */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
}
.data-table th { font-weight: 600; color: #475569; background: #f8fafc; }
.data-table td { color: #334155; }
.data-table tr:last-child td { border-bottom: none; }

/* === Reports === */
.report-list { display: flex; flex-direction: column; gap: 0.75rem; }
.report-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
}
.report-icon { flex-shrink: 0; }
.report-icon svg { width: 32px; height: 32px; color: #0ea5e9; }
.report-body { flex: 1; }
.report-body strong { display: block; margin-bottom: 0.25rem; }
.report-body p { font-size: 0.85rem; color: #64748b; margin: 0; }
.report-date { display: inline-block; margin-top: 0.35rem; font-size: 0.75rem; color: #94a3b8; }

/* === Resources === */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.resource-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  transition: all 0.2s;
}
.resource-card:hover { background: #eff6ff; border-color: #93c5fd; }
.resource-card svg { width: 32px; height: 32px; color: #0ea5e9; }
.resource-card strong { font-size: 0.9rem; }
.resource-card span { font-size: 0.8rem; color: #64748b; }

/* === Responsive === */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.2);
  }
  .sidebar-toggle { display: block; }
  .main-content { margin-left: 0; }
  .menu-btn { display: block; }
  .map-preview { height: 250px; }
  .map-fullscreen { height: calc(100vh - 100px); }
  .content-area { padding: 1rem; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .report-item { flex-direction: column; align-items: flex-start; }
}
