:root {
  /* Theme: White + Green + Brown */
  --bg0: #f6faf7;
  --bg1: #ffffff;

  --card: rgba(255, 255, 255, 0.82);
  --stroke: rgba(18, 46, 32, 0.12);

  --text: #0f1f16;
  --muted: rgba(15, 31, 22, 0.68);

  --brand: #1aa36b; /* green */
  --brand2: #6b4f2a; /* brown */
  --brandSoft: rgba(26, 163, 107, 0.1);

  --danger: #e11d48;
  --info: #0284c7;
  --success: #16a34a;

  --shadow: 0 18px 55px rgba(12, 26, 18, 0.14);
  --radius: 18px;
}

/* Ghi đè hoàn toàn */
:root {
  color-scheme: light;
}

body {
  background: #f8fafc !important;
  color: #0f172a !important;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  background: radial-gradient(
      1000px 500px at 10% 10%,
      rgba(26, 163, 107, 0.16),
      transparent 55%
    ),
    radial-gradient(
      900px 500px at 90% 20%,
      rgba(107, 79, 42, 0.12),
      transparent 55%
    ),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  color: var(--text);
}

/* --------------------
   Bootstrap tweaks
---------------------*/
.text-muted {
  color: var(--muted) !important;
}
.navbar-light .navbar-nav .nav-link {
  color: rgba(15, 31, 22, 0.76);
}
.navbar-light .navbar-nav .nav-link:hover {
  color: rgba(15, 31, 22, 0.95);
}
.navbar-light .navbar-brand {
  color: var(--text);
}
.navbar-light .navbar-toggler {
  border-color: rgba(15, 31, 22, 0.15);
}

.form-control,
.form-select,
.input-group-text {
  border-color: rgba(15, 31, 22, 0.14);
  border-radius: 14px;
}
.form-control:focus,
.form-select:focus {
  border-color: rgba(26, 163, 107, 0.45);
  box-shadow: 0 0 0 0.2rem rgba(26, 163, 107, 0.12);
}

.btn-brand {
  background: linear-gradient(135deg, var(--brand), rgba(26, 163, 107, 0.85));
  border: none;
  color: white;
  box-shadow: 0 12px 28px rgba(26, 163, 107, 0.22);
}
.btn-brand:hover {
  filter: brightness(1.02);
}
.btn-outline-brand {
  border: 1px solid rgba(26, 163, 107, 0.4);
  color: rgba(15, 31, 22, 0.88);
  background: rgba(255, 255, 255, 0.72);
}
.btn-outline-brand:hover {
  background: rgba(26, 163, 107, 0.08);
  border-color: rgba(26, 163, 107, 0.55);
}
.btn-brand-soft {
  border: 1px solid rgba(15, 31, 22, 0.1);
  background: rgba(255, 255, 255, 0.75);
}
.btn-brand-soft:hover {
  background: rgba(26, 163, 107, 0.08);
}

/* --------------------
   Top nav
---------------------*/
.nav-glass {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(15, 31, 22, 0.1);
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(26, 163, 107, 0.12);
}
.brand-logo-sm {
  border-radius: 12px;
  overflow: hidden;
  display: inline-flex;
  box-shadow: 0 10px 20px rgba(26, 163, 107, 0.12);
}
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(26, 163, 107, 0.14);
  border: 1px solid rgba(26, 163, 107, 0.22);
  font-weight: 800;
  color: rgba(15, 31, 22, 0.9);
  font-size: 12px;
}

/* --------------------
   Hero
---------------------*/
.hero {
  position: relative;
  overflow: hidden;
  padding-top: 10px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(15, 31, 22, 0.12);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
}
.pill .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.12);
}
.text-gradient {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* personalized bar */
.personal-bar {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 14px;
}
@media (max-width: 992px) {
  .personal-bar {
    grid-template-columns: 1fr;
  }
}
.personal-left {
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(15, 31, 22, 0.1);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}
.hello-title {
  font-weight: 800;
  font-size: 18px;
}
.hello-sub {
  font-size: 13px;
  margin-top: 2px;
}
.search-wrap {
  margin-top: 12px;
}
.live-alert {
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(15, 31, 22, 0.1);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}
.live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.live-title {
  font-weight: 800;
}
.live-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(26, 163, 107, 0.35);
  background: rgba(26, 163, 107, 0.1);
  color: rgba(15, 31, 22, 0.86);
}
.live-body {
  margin-top: 10px;
  font-size: 14px;
  color: rgba(15, 31, 22, 0.86);
  min-height: 64px;
  padding: 10px;
  border-radius: 14px;
  border: 1px dashed rgba(15, 31, 22, 0.18);
  background: rgba(26, 163, 107, 0.06);
}
.live-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
@media (max-width: 420px) {
  .live-actions {
    grid-template-columns: 1fr;
  }
}

/* mini cards */
.card-glass,
.modal-glass {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 31, 22, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.mini-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(15, 31, 22, 0.1);
  background: rgba(255, 255, 255, 0.72);
}
.mini-card-light {
  background: rgba(255, 255, 255, 0.85);
}
.mini-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(26, 163, 107, 0.1);
  border: 1px solid rgba(26, 163, 107, 0.18);
  font-weight: 900;
}

/* hero stats */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 992px) {
  .hero-stats {
    grid-template-columns: 1fr;
  }
}
.hero-stat {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 31, 22, 0.1);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(12, 26, 18, 0.1);
}
.hero-stat .kpi {
  font-size: 12px;
  color: var(--muted);
}
.hero-stat .val {
  font-size: 20px;
  font-weight: 900;
  margin-top: 4px;
}
.hero-stat .sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* --------------------
   Sections
---------------------*/
.section {
  padding: 70px 0;
}
.section-soft {
  background: linear-gradient(
    180deg,
    rgba(26, 163, 107, 0.06),
    rgba(255, 255, 255, 0)
  );
  border-top: 1px solid rgba(15, 31, 22, 0.08);
}
.section-title {
  max-width: 860px;
}

/* chips */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 31, 22, 0.1);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  color: var(--muted);
}
.chip-primary {
  border-color: rgba(26, 163, 107, 0.28);
  color: rgba(15, 31, 22, 0.8);
}
.chip-success {
  border-color: rgba(22, 163, 74, 0.28);
  color: rgba(15, 31, 22, 0.8);
}
.chip-danger {
  border-color: rgba(225, 29, 72, 0.22);
  color: rgba(15, 31, 22, 0.8);
}

/* divider */
.divider {
  border-color: rgba(15, 31, 22, 0.1) !important;
}

/* Map */
.map {
  height: 420px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(15, 31, 22, 0.1);
}
@media (max-width: 768px) {
  .map {
    height: 340px;
  }
}

/* Leaflet controls on light bg */
.leaflet-control-zoom a {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(15, 31, 22, 0.12);
  color: rgba(15, 31, 22, 0.86);
}
.leaflet-control-zoom a:hover {
  background: rgba(26, 163, 107, 0.08);
}

/* Segmented basemap switch */
.segmented {
  display: inline-flex;
  border: 1px solid rgba(15, 31, 22, 0.12);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  overflow: hidden;
}
.seg-btn {
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: rgba(15, 31, 22, 0.84);
  font-weight: 700;
  font-size: 13px;
}
.seg-btn:hover {
  background: rgba(26, 163, 107, 0.08);
}
.seg-btn.active {
  background: rgba(26, 163, 107, 0.14);
  color: rgba(15, 31, 22, 0.92);
}

/* Legend */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(15, 31, 22, 0.1);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  padding: 10px 12px;
}
.legend-item {
  display: flex;
  gap: 8px;
  align-items: center;
}
.legend-swatch {
  width: 16px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 31, 22, 0.14);
  background: rgba(15, 31, 22, 0.1);
}
.swatch-risk {
  background: linear-gradient(
    90deg,
    rgba(34, 197, 94, 0.35),
    rgba(250, 204, 21, 0.35),
    rgba(225, 29, 72, 0.3)
  );
}
.swatch-rain {
  background: rgba(2, 132, 199, 0.25);
}
.swatch-geo {
  background: rgba(22, 163, 74, 0.18);
}

/* subcards + lists */
.subcard {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 31, 22, 0.1);
  border-radius: 16px;
  padding: 12px;
}
.alerts {
  display: grid;
  gap: 10px;
  max-height: 210px;
  overflow: auto;
  padding-right: 6px;
}
.alert-item {
  border: 1px solid rgba(15, 31, 22, 0.1);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  padding: 10px 12px;
}
.alert-item .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.badge-soft {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 31, 22, 0.12);
  background: rgba(26, 163, 107, 0.08);
  color: rgba(15, 31, 22, 0.82);
  font-weight: 800;
}
.badge-high {
  border-color: rgba(225, 29, 72, 0.22);
}
.badge-med {
  border-color: rgba(2, 132, 199, 0.2);
}
.badge-low {
  border-color: rgba(22, 163, 74, 0.22);
}

/* Risk box */
.risk-box {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(15, 31, 22, 0.1);
  background: rgba(255, 255, 255, 0.72);
}
.risk-score {
  width: 110px;
  border-radius: 14px;
  border: 1px solid rgba(26, 163, 107, 0.18);
  background: rgba(26, 163, 107, 0.08);
  padding: 10px;
  text-align: center;
}
.risk-score .score {
  font-weight: 900;
  font-size: 28px;
}
.risk-score .label {
  font-size: 12px;
}
.risk-meta {
  flex: 1;
}

/* Places */
.my-places-box {
  border: 1px dashed rgba(15, 31, 22, 0.16);
  background: rgba(26, 163, 107, 0.05);
  border-radius: 16px;
  padding: 12px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-btn {
  border: none;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 31, 22, 0.1);
  font-size: 12px;
  font-weight: 700;
  color: rgba(15, 31, 22, 0.84);
}
.chip-btn:hover {
  background: rgba(26, 163, 107, 0.1);
}
.list-stack {
  display: grid;
  gap: 10px;
}
.place-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(15, 31, 22, 0.1);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.72);
}
.place-row .meta {
  font-size: 12px;
  color: var(--muted);
}
.place-actions {
  display: flex;
  gap: 8px;
}

/* Accordion */
.accordion-item {
  border: 1px solid rgba(15, 31, 22, 0.1);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 16px !important;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(12, 26, 18, 0.1);
}
.accordion-item + .accordion-item {
  margin-top: 12px;
}
.accordion-button {
  background: rgba(255, 255, 255, 0.82);
  color: rgba(15, 31, 22, 0.92);
  font-weight: 800;
}
.accordion-button:not(.collapsed) {
  background: rgba(26, 163, 107, 0.1);
  color: rgba(15, 31, 22, 0.92);
}
.accordion-button:focus {
  box-shadow: 0 0 0 0.2rem rgba(26, 163, 107, 0.12);
}
.accordion-body {
  background: rgba(255, 255, 255, 0.82);
}

/* Metric cards */
.metric-card {
  border: 1px solid rgba(15, 31, 22, 0.1);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 16px;
  padding: 12px;
}
.metric-val {
  font-size: 22px;
  font-weight: 900;
}

/* Footer */
.footer {
  border-top: 1px solid rgba(15, 31, 22, 0.1);
  background: rgba(255, 255, 255, 0.76);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
}
@media (max-width: 768px) {
  .footer-links {
    justify-content: flex-start;
  }
}
.footer-link {
  color: rgba(15, 31, 22, 0.78);
  text-decoration: none;
  font-weight: 700;
}
.footer-link:hover {
  color: rgba(15, 31, 22, 0.95);
}
.social {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
@media (max-width: 768px) {
  .social {
    justify-content: flex-start;
  }
}
.social-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(26, 163, 107, 0.08);
  border: 1px solid rgba(26, 163, 107, 0.18);
  color: rgba(15, 31, 22, 0.86);
  text-decoration: none;
}
.social-btn:hover {
  background: rgba(26, 163, 107, 0.14);
}
.social-text {
  font-weight: 900;
}

/* Modal */
.modal-glass {
  background: rgba(16, 27, 20, 0.92);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-glass .text-muted {
  color: rgba(255, 255, 255, 0.65) !important;
}
.modal-glass .form-control {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: white;
}
.modal-glass .form-control::placeholder {
  color: rgba(255, 255, 255, 0.55);
}
.modal-glass .btn-outline-brand {
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(26, 163, 107, 0.45);
}
.modal-glass .btn-outline-brand:hover {
  background: rgba(26, 163, 107, 0.12);
}
.modal-glass .btn-brand {
  box-shadow: none;
}

/* Report preview */
.report-preview {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Pulse */
.pulse {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #16a34a;
  box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.18);
}
/* =========================
   Logo PNG
========================= */

.logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}

.logo-img-sm {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}
