:root {
  --green-dark: #14532d;
  --green: #047857;
  --green-soft: #d1fae5;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gold: #fbbf24;
  --red: #dc2626;
  --blue: #2563eb;
  --shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

html, body {
  min-height: 100%;
}

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--gray-700);
  background: var(--gray-100);
}

.bg-app {
  background: linear-gradient(180deg, #f8fafc 0%, #f3f4f6 100%);
}

.navbar-brand strong,
.brand-title {
  letter-spacing: 0.2px;
}

.hero-gradient {
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.hero-gradient::before,
.hero-gradient::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.hero-gradient::before {
  width: 240px;
  height: 240px;
  top: -60px;
  right: -40px;
}

.hero-gradient::after {
  width: 180px;
  height: 180px;
  bottom: -50px;
  left: -20px;
}

.card-soft,
.stat-card,
.table-card,
.form-card,
.info-card,
.product-card,
.feature-card,
.news-card {
  background: var(--white);
  border: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.history-card,
.region-card,
.chart-card {
  border-radius: 20px;
}

.chart-card canvas {
  max-height: 280px;
}

.card-soft {
  padding: 1.5rem;
}

.stat-card {
  padding: 1.4rem;
  height: 100%;
}

.stat-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 1.4rem;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: #111827;
}

.stat-label {
  color: var(--gray-500);
  font-size: 0.92rem;
}

.sidebar {
  width: 260px;
  background: var(--green-dark);
  min-height: 100vh;
  color: var(--white);
  position: sticky;
  top: 0;
  align-self: flex-start;
}

.sidebar .brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar .menu-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  padding: .8rem 1rem;
  margin: .2rem .75rem;
  border-radius: 14px;
  transition: all .2s ease;
}

.sidebar .menu-link:hover,
.sidebar .menu-link.active,
.sidebar .menu-group.open {
  background: rgba(209, 250, 229, 0.14);
  color: #fff;
}

.sidebar .menu-link.active {
  background: var(--green);
}

.sidebar-nav {
  padding-bottom: 1rem;
}

.menu-group {
  width: calc(100% - 1.5rem);
  margin: .35rem .75rem 0;
  padding: .85rem 1rem;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  transition: all .2s ease;
  text-align: left;
}

.menu-group:hover,
.menu-group.open {
  background: rgba(209, 250, 229, 0.14);
}

.menu-group.open .menu-group-caret {
  transform: rotate(180deg);
}

.menu-group-caret {
  transition: transform .2s ease;
  font-size: .9rem;
}

.submenu-wrap {
  padding: .2rem 0 .45rem 1.2rem;
}

.submenu-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: .2rem .75rem .2rem 1.7rem;
  padding: .7rem .9rem;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: .95rem;
  transition: all .2s ease;
}

.submenu-link:hover,
.submenu-link.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.submenu-link.active {
  background: rgba(255, 255, 255, 0.18);
  font-weight: 600;
}

.admin-shell {
  display: flex;
}

.content-area {
  flex: 1;
  min-width: 0;
}

.topbar {
  min-height: 70px;
  background: var(--white);
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.06);
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}

.topbar-brand-logo,
.navbar-brand-logo,
.login-brand-logo {
  object-fit: contain;
}

.topbar-brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.topbar-brand-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.05;
  color: #111827;
}

.topbar-brand-subtitle {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.05;
}

.navbar-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.login-brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  padding: 8px;
}

.topbar .page-title {
  font-weight: 700;
  color: #111827;
}

.topbar .user-pill {
  border-radius: 999px;
  background: var(--gray-100);
  padding: .45rem .85rem;
  font-size: .92rem;
}

.content-wrap {
  padding: 1.5rem;
}

.table-card table {
  margin-bottom: 0;
}

.table-card thead th {
  background: var(--green-dark);
  color: var(--white);
  border: none;
  font-weight: 600;
}

.table-card tbody tr:hover {
  background: #f8fafc;
}

.badge-soft-success {
  background: #dcfce7;
  color: #166534;
}

.badge-soft-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-soft-danger {
  background: #fee2e2;
  color: #991b1b;
}

.btn-green {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.btn-green:hover {
  background: #03654f;
  border-color: #03654f;
  color: #fff;
}

.btn-outline-green {
  border-color: var(--green);
  color: var(--green);
}

.btn-outline-green:hover {
  background: var(--green);
  color: #fff;
}

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #111827;
}

.btn-danger-custom {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn-blue-custom {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.section-title {
  font-weight: 800;
  color: #111827;
}

.facility-panel {
  background: #d3dece;
  border-radius: 24px;
  border: 1px solid rgba(20, 83, 45, 0.08);
}

.facility-compact-card {
  background: #f9faf7;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.facility-compact-image {
  min-height: 170px;
}

.facility-compact-image img {
  width: 100%;
  height: 100%;
  min-height: 170px;
  object-fit: cover;
  display: block;
}

.facility-compact-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.05;
}

.facility-compact-text {
  font-size: .88rem;
  line-height: 1.42;
  text-align: justify;
  margin-bottom: 0;
}

.activity-panel {
  background: #d3dece;
  border-radius: 24px;
  border: 1px solid rgba(20, 83, 45, 0.08);
}

.activity-item {
  background: #f9faf7;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.activity-date-box {
  background: #f97316;
  color: #111827;
  min-height: 160px;
}

.activity-date-day {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.1;
}

.activity-date-month,
.activity-date-year {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.15;
}

.activity-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #111827;
  text-transform: none;
}

.activity-text {
  font-size: .92rem;
  line-height: 1.45;
  margin-bottom: 0;
}

.news-panel {
  background: #d3dece;
  border-radius: 24px;
  border: 1px solid rgba(20, 83, 45, 0.08);
}

.news-compact-card {
  background: #f9faf7;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.news-compact-image {
  min-height: 190px;
}

.news-compact-image img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  display: block;
}

.news-compact-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.08;
}

.news-compact-text {
  font-size: .9rem;
  line-height: 1.42;
  margin-bottom: 0;
}

.report-panel {
  background: #d3dece;
  border-radius: 24px;
  border: 1px solid rgba(20, 83, 45, 0.08);
}

.report-compact-card {
  background: #f9faf7;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.report-compact-image {
  background: #fff;
  padding: .5rem .5rem 0;
}

.report-compact-image img {
  width: 100%;
  aspect-ratio: 1 / 0.82;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  display: block;
}

.report-date-badge {
  position: absolute;
  right: .9rem;
  bottom: .9rem;
  background: #f97316;
  color: #111827;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.05;
  padding: .35rem .45rem;
  border-radius: 8px;
  text-align: center;
  min-width: 52px;
  box-shadow: 0 6px 14px rgba(249, 115, 22, 0.25);
}

.report-compact-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.1;
}

.report-compact-text {
  font-size: .88rem;
  line-height: 1.38;
  margin-bottom: 0;
}

.product-panel {
  background: #d3dece;
  border-radius: 24px;
  border: 1px solid rgba(20, 83, 45, 0.08);
}

.product-compact-card {
  background: #f9faf7;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.product-compact-image {
  padding: .75rem .75rem 0;
}

.product-compact-image img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  display: block;
}

.product-compact-title {
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.08;
}

.product-price {
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
}

.location-panel {
  background: #d3dece;
  border-radius: 24px;
  border: 1px solid rgba(20, 83, 45, 0.08);
}

.location-map-frame {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  overflow: hidden;
  background: #f8fafc;
}

.location-map-canvas {
  width: 100%;
  height: 420px;
}

.location-map-empty {
  min-height: 420px;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
  font-weight: 600;
}

.public-navbar {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.06);
}

.footer-dark {
  background: var(--green-dark);
  color: #fff;
}

.login-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.login-card {
  width: min(100%, 460px);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.24);
}

.form-control,
.form-select,
.form-control:focus,
.form-select:focus {
  border-radius: 14px;
  border-color: var(--gray-300);
  box-shadow: none;
}

.form-label {
  font-weight: 600;
  color: #111827;
}

.alert {
  border-radius: 14px;
}

@media (max-width: 991px) {
  .sidebar {
    position: static;
    width: 100%;
    min-height: auto;
  }

  .admin-shell {
    flex-direction: column;
  }
}
