:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: #111827;
  background: #f7fafc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f6f8fb;
}

button {
  font: inherit;
}

.page-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
}

.auth-overlay[hidden] { display: none; }

.auth-card {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 32px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.auth-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #0f5132;
  color: #d8f36c;
  font-size: 1.3rem;
  font-weight: 900;
}

.auth-card h1 { margin: 0; color: #0f172a; font-size: 1.6rem; }
.auth-card p:not(.eyebrow) { margin: 0 0 12px; color: #64748b; line-height: 1.5; }
.reset-heading { margin: 8px 0 0 !important; color: #0f172a !important; font-weight: 900; }
.reset-description { margin: 0 0 6px !important; font-size: .88rem; }
.auth-card label, .staff-form label { color: #334155; font-size: .85rem; font-weight: 800; }
.auth-card input, .staff-form input, .staff-form select { width: 100%; margin: 5px 0 8px; padding: 12px; border: 1px solid #dbe5ef; border-radius: 10px; background: #fff; }
.auth-error { min-height: 20px; color: #b91c1c; font-size: .85rem; font-weight: 700; }
.auth-link { border: 0; background: transparent; color: #047857; cursor: pointer; font-size: .82rem; font-weight: 800; padding: 6px 0; text-align: left; }
.auth-link:hover { color: #065f46; text-decoration: underline; }
.admin-only { display: none; }
.admin-tab { display: none; }
.admin-tab.visible { display: inline-flex; }
.access-columns { display: grid; grid-template-columns: minmax(360px, .82fr) minmax(0, 1.18fr); gap: 18px; align-items: start; }
.access-form-column, .access-users-column { min-width: 0; }
.column-heading { margin: 0 0 12px; }
.column-heading .panel-title { margin-bottom: 4px; }
.staff-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; padding: 28px; border: 1px solid #e5e7eb; border-radius: 18px; background: #fff; box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04); }
.staff-form label { display: flex; flex-direction: column; gap: 5px; }
.staff-form input, .staff-form select { margin: 0; min-height: 46px; font-size: .92rem; }
.staff-form .action-button { grid-column: 1 / -1; min-height: 46px; margin-top: 2px; }
.users-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 12px; padding: 0 0 12px; border-bottom: 1px solid #e5e7eb; }
.institution-users-list { display: grid; gap: 10px; }
.institution-user { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, auto); gap: 18px 24px; align-items: center; padding: 18px 20px; border: 1px solid #e5e7eb; border-radius: 14px; background: #fff; transition: border-color 150ms ease, box-shadow 150ms ease; }
.institution-user:hover { border-color: #b7dfce; box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05); }
.institution-user-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.institution-user-info strong { color: #0f172a; }
.institution-user-info span { color: #64748b; font-size: .85rem; overflow-wrap: anywhere; }
.institution-user-meta { display: grid; grid-template-columns: auto auto; align-items: center; gap: 8px 12px; justify-content: end; }
.institution-user-meta > span:not(.user-status) { color: #475569; font-size: .82rem; font-weight: 700; }
.user-status { padding: 5px 9px; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.user-status.active { background: #dcfce7; color: #166534; }
.user-status.inactive { background: #fee2e2; color: #991b1b; }
.user-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.user-actions button { border: 1px solid #dbe5ef; border-radius: 8px; padding: 8px 10px; background: #fff; color: #475569; cursor: pointer; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.user-actions button:hover { border-color: #10b981; color: #047857; }

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) repeat(4, minmax(160px, 1fr));
  gap: 22px;
  align-items: center;
  margin-bottom: 28px;
  padding: 28px 30px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border-radius: 36px;
  border: 1px solid rgba(220, 227, 235, 0.85);
  box-shadow: 0 32px 60px rgba(15, 23, 42, 0.06);
  position: relative;
}

.logout-button {
  position: absolute;
  right: 30px;
  bottom: 12px;
  border: 1px solid #dbe5ef;
  border-radius: 999px;
  padding: 7px 11px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 800;
}

.logout-button:hover { color: #b91c1c; border-color: #fecaca; }

.brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.topbar-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid rgba(230, 236, 242, 0.8);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  position: relative;
  align-items: flex-start;
}

.stat-card::after {
  content: '';
  position: absolute;
  right: 3px;
  top: 25%;
  transform: translate(-50%);
  bottom: auto;
  width: 8px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.95), rgba(59, 130, 246, 0.95));
  opacity: 0.95;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 18px;
  width: 4px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3b82f6, #16a34a);
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 900;
  color: #101828;
  margin-left: 10px;
}

.stat-label {
  margin-left: 10px;
  font-size: 0.95rem;
  color: #475569;
}

.stat-card--alerts::before { background: #ef4444; }
.stat-card--schools::before { background: #f59e0b; }
.stat-card--trees::before { background: #22c55e; }
.stat-card--users::before { background: #3b82f6; }

.logo {
  font-weight: 900;
  color: #0f172a;
  font-size: 1.7rem;
}

.subtitle {
  color: #475569;
  font-size: 1rem;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.tab-button {
  border: none;
  background: #f3fbf8;
  color: #0f172a;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.tab-button.active,
.tab-button:hover {
  background: #10b981;
  color: white;
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.12);
  transform: translateY(-2px);
}

.tab-icon {
  font-size: 0.95rem;
}

.content {
  display: grid;
  gap: 24px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 2.1fr minmax(320px, 0.95fr);
  gap: 24px;
  align-items: start;
}

.dashboard-grid.has-details {
  grid-template-columns: 2.1fr minmax(220px, 0.28fr) minmax(320px, 0.55fr);
}

.map-panel,
.sidebar-panel,
.detail-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-panel,
.detail-panel {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #eef4f7;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
  padding: 20px 22px 20px 34px;
  position: relative;
}

.detail-panel {
  min-height: 670px;
  display: none;
  max-width: 380px;
}

.detail-panel.open {
  display: flex;
}

.detail-panel .detail-close {
  position: absolute;
  right: 22px;
  top: 22px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.detail-panel .detail-close:hover {
  background: #dbeafe;
}

/* left accent strip */
.sidebar-panel::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background: linear-gradient(180deg,#cfeff6,#b9e6f0);
  border-top-left-radius: 18px;
  border-bottom-left-radius: 18px;
}

.panel-heading.sidebar-heading {
  align-items: flex-start;
}

.panel-heading .panel-title {
  margin-bottom: 6px;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  max-height: calc(100vh - 320px);
  padding-right: 6px;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #0f172a;
}

.panel-caption {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.5;
}

.data-unavailable {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  color: #64748b;
  background: #f8fafc;
  line-height: 1.45;
}

.data-unavailable strong {
  color: #334155;
}

.small-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #166534;
  font-size: 0.85rem;
  font-weight: 700;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.alert-band {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.alert-band--critical {
  background: #fee2e2;
  color: #991b1b;
}

.alerts-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid #e2e8f0;
}

.legend-pill--audio { background: #ecfdf5; color: #065f46; }
.legend-pill--video { background: #eff6ff; color: #1d4ed8; }
.legend-pill--photo { background: #fff7ed; color: #c2410c; }
.legend-pill--text { background: #f8fafc; color: #334155; }

.map-card,
.alerts-panel,
.chart-card,
.list-card,
.export-card {
  background: white;
  border-radius: 26px;
  border: 1px solid #e5e7eb;
  padding: 24px;
}

.map-card {
  min-height: 680px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(229, 235, 241, 0.9);
  background: #ffffff;
}

.sidebar-panel {
  min-height: 670px;
}

.map {
  width: 100%;
  flex: 1;
  height: 100%;
  min-height: 560px;
  border-radius: 26px;
  overflow: hidden;
}

/* Force a visible fixed height to avoid collapsed map containers */
#map {
  height: 640px;
  min-height: 640px;
}

.map-card .panel-title {
  margin-bottom: 12px;
}

.map-card .panel-caption {
  color: #475569;
  margin-bottom: 14px;
}

.map-card .small-chip {
  margin-bottom: 16px;
}


.leaflet-container {
  width: 100%;
  height: 100%;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-select {
  display: none;
  width: 100%;
}

.filter-select select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
}

.dashboard-grid.has-details .filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  width: 100%;
}

.dashboard-grid.has-details .filter-buttons {
  display: none;
}

.dashboard-grid.has-details .filter-select {
  display: block;
}

.dashboard-grid.has-details .alert-card {
  font-size: 0.92rem;
  padding: 10px 12px;
}

.dashboard-grid.has-details .alert-title {
  font-size: 0.92rem;
}

.dashboard-grid.has-details .alert-description {
  -webkit-line-clamp: 2;
}

.filter-button {
  min-width: 0;
  flex: 1 1 auto;
  border: 1px solid #d1d5db;
  background: #f8fafc;
  color: #0f172a;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.filter-button:hover {
  transform: translateY(-1px);
}

.filter-button.active {
  background: #10b981;
  color: white;
  border-color: #10b981;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}


.alert-card {
  display: block;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(235, 241, 246, 0.9);
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  font-size: 0.94rem;
}

.alert-card-head {
  display: block;
}

.alert-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.alert-description {
  color: #374151;
  line-height: 1.4;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* clamp description to 3 lines for compact mini-cards */
.alert-description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.temp-badge {
  margin-left: 10px;
  background: linear-gradient(90deg,#ffeef0,#fff1f6);
  color: #ef4444;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
}

.alert-card.selected {
  border-color: rgba(16,185,129,0.9);
  background: #ecfdf4;
  box-shadow: 0 10px 30px rgba(16,185,129,0.08);
  transform: translateY(-2px);
}

.alert-type .icon { font-size: 0.95rem; }

.severity-badge {
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  color: #ef4444;
}

.alert-card .alert-type {
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  text-transform: uppercase;
}


.severity-critical { background: #fee2e2; color: #b91c1c; }
.severity-high { background: #ffedd5; color: #c2410c; }
.severity-medium { background: #fef3c7; color: #92400e; }
.severity-low { background: #dcfce7; color: #166534; }

.alert-card .severity-badge {
  display: inline-block;
  min-width: 46px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.78rem;
}

.alert-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 0.84rem;
}

.alert-details {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 340px;
}

.alert-details .alert-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-details .alert-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: #0f172a;
}

.alert-details .alert-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  color: #475569;
  font-size: 0.92rem;
}

.alert-details .media-section {
  display: grid;
  gap: 14px;
}

.alert-details .media-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 18px;
  background: #f8fafc;
  padding: 14px;
  border: 1px solid #e2e8f0;
}

.alert-details .media-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #ffffff;
  color: #0f172a;
  font-size: 1.1rem;
}

.alert-details .media-item-content {
  flex: 1;
}

.alert-details .media-item-title {
  font-weight: 800;
  color: #111827;
  margin-bottom: 4px;
}

.alert-details .alert-empty-state {
  color: #475569;
  font-size: 0.96rem;
  line-height: 1.6;
  padding: 24px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px dashed #d1d5db;
}

.alert-details audio,
.alert-details video,
.alert-details img {
  width: 100%;
  border-radius: 18px;
  max-height: 280px;
  object-fit: cover;
}

.alert-details audio,
.alert-details video {
  display: block;
  min-height: 52px;
}

.alert-details audio,
.alert-details video {
  background: #f8fafc;
  display: block;
}

.alert-details .alert-description {
  color: #334155;
  line-height: 1.7;

  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.alert-type.audio { background: #22c55e33; color: #15803d; }
.alert-type.video { background: #3b82f633; color: #1d4ed8; }
.alert-type.photo { background: #f9731633; color: #b45309; }
.alert-type.text { background: #64748b33; color: #0f172a; }

.summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric-card {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 20px 22px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.metric-value {
  display: block;
  font-size: 2rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.metric-label {
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.3;
}

.chart-row {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr 0.7fr;
  gap: 18px;
  align-items: stretch;
}

.chart-card,
.list-card {
  min-width: 0;
  min-height: 390px;
}

.chart-card .panel-title,
.list-card .panel-title {
  min-height: 2.6em;
}

.bars {
  min-height: 0;
  height: 314px;
  overflow-y: auto;
}

.chart-card.small .bars {
  height: 190px;
}

.list-card .simple-list {
  min-height: 190px;
}

.bars {
  min-height: 320px;
  border-radius: 18px;
  background: #f8fafc;
  padding: 16px;
}

.simple-list {
  display: grid;
  gap: 12px;
}

.simple-list .item {
  padding: 14px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 18px;
}

.report-period {
  padding: 8px 12px;
  border: 1px solid #dbe5ef;
  border-radius: 999px;
  color: #475569;
  background: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.export-card {
  display: flex;
  flex-direction: column;
  min-height: 250px;
}

.export-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #047857;
  font-size: 1.3rem;
  font-weight: 900;
}

.export-card p {
  min-height: 54px;
  margin: 0 0 22px;
  color: #475569;
  line-height: 1.5;
}

.report-status {
  min-height: 24px;
  margin-top: 16px;
  color: #047857;
  font-weight: 700;
}

.action-button {
  width: 100%;
  padding: 14px 0;
  border: none;
  border-radius: 16px;
  background: #10b981;
  color: white;
  cursor: pointer;
  font-weight: 800;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.action-button:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(16, 185, 129, 0.22);
}

.action-button:focus-visible {
  outline: 3px solid rgba(16, 185, 129, 0.3);
  outline-offset: 3px;
}

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

  .topbar-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .chart-row,
  .export-grid {
    grid-template-columns: 1fr;
  }

  .access-columns { grid-template-columns: 1fr; }

  .summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card::before {
    top: 16px;
    height: 24px;
  }

  .topbar {
    padding: 24px;
  }

  .logout-button { right: 24px; bottom: 20px; }
}

@media (max-width: 560px) {
  .staff-form { grid-template-columns: 1fr; }
  .staff-form { padding: 20px; }
  .institution-user { grid-template-columns: 1fr; gap: 12px; }
  .institution-user-meta { justify-content: start; }
  .user-actions { width: 100%; }
  .user-actions button { flex: 1; }
  .report-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-row {
    grid-template-columns: 1fr;
  }

  .chart-card,
  .list-card {
    min-height: auto;
  }

  .bars,
  .chart-card.small .bars {
    height: auto;
    max-height: 330px;
  }
}

/* Slide menu (bottom-right hamburger) */
.slide-hamburger {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 14px;
  background: #0f172a;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.2);
  z-index: 2400;
}

.slide-menu {
  position: fixed;
  right: 18px;
  bottom: 90px;
  top: auto;
  width: 620px;
  max-width: calc(100% - 48px);
  max-height: calc(100vh - 90px - 24px);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.12);
  padding: 12px;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: all 180ms ease;
  z-index: 2200;
  overflow: auto;
}

.slide-menu.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.slide-menu-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.slide-menu-close:hover,
.slide-menu-close:focus-visible { background: #f1f5f9; border-color: #cbd5e1; color: #0f172a; outline: none; }

.menu-root { padding: 10px 4px 4px; }
.menu-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 8px 48px 16px 8px; border-bottom: 1px solid #e8eef5; }
.menu-heading strong { display: block; color: #0f172a; font-size: 1rem; }
.menu-kicker { display: block; margin-bottom: 4px; color: #047857; font-size: .68rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.menu-count { margin-top: 3px; padding: 5px 8px; border-radius: 999px; background: #ecfdf5; color: #047857; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.menu-list { display: grid; gap: 8px; padding-top: 14px; }
.slide-menu .menu-item { width: 100%; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 10px; border: 1px solid transparent; border-radius: 14px; background: transparent; color: #0f172a; cursor: pointer; text-align: left; }
.slide-menu .menu-item:hover, .slide-menu .menu-item:focus-visible { border-color: #d9efe5; background: #f0fdf7; outline: none; }
.menu-item-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: #eaf8f0; color: #047857; font-size: 1.15rem; }
.menu-item strong, .menu-item small { display: block; }
.menu-item strong { font-size: .86rem; }
.menu-item small { margin-top: 3px; color: #64748b; font-size: .73rem; font-weight: 600; }
.menu-item-arrow { color: #94a3b8; font-size: 1.35rem; transition: transform 150ms ease, color 150ms ease; }
.menu-item:hover .menu-item-arrow, .menu-item:focus-visible .menu-item-arrow { color: #047857; transform: translateX(2px); }

.admin-panel { padding: 22px; }
.admin-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 0 0 22px; padding-bottom: 18px; border-bottom: 1px solid #e8eef5; }
.admin-panel-header h2 { margin: 3px 0 5px; color: #0f172a; font-size: 1.35rem; line-height: 1.1; }
.admin-panel-header p { margin: 0; max-width: 380px; color: #64748b; font-size: .82rem; line-height: 1.45; }
.admin-panel-kicker { color: #047857; font-size: .68rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.admin-panel-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.admin-search-field { display: block; margin-bottom: 16px; color: #475569; font-size: .74rem; font-weight: 800; }
.admin-search-field .admin-search { margin-top: 6px; }
.admin-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 24px 0 12px; padding-top: 18px; border-top: 1px solid #e8eef5; }
.admin-section-heading strong { color: #0f172a; font-size: .9rem; }
.admin-section-heading span { color: #94a3b8; font-size: .72rem; }
.admin-panel form label { display: flex; flex-direction: column; gap: 5px; color: #475569; font-size: .76rem; font-weight: 800; }
.admin-panel .admin-search {
  width: 100%;
  margin-bottom: 10px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid #dbe5ef;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 600;
}
.admin-panel .list { max-height: 360px; overflow:auto; display:flex; flex-direction:column; gap:8px; }
.admin-panel .inst-card { padding:14px; border-radius:12px; background:#f8fafc; border:1px solid #e6eef6; }
.admin-panel .inst-card:hover { border-color: #b7dfce; background: #f5fcf8; }
.admin-panel form { display:flex; flex-direction:column; gap:8px; }
.admin-panel input, .admin-panel select, .admin-panel textarea { padding:8px 10px; border-radius:8px; border:1px solid #d1d5db; }
.admin-panel textarea { min-height: 76px; resize: vertical; }
.admin-panel .actions { display:flex; gap:8px; margin-top:8px; }
.campaign-form { gap: 16px !important; }
.campaign-form .form-section { display: grid; gap: 12px; padding: 16px; border: 1px solid #e6eef6; border-radius: 14px; background: #fbfdff; }
.form-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid #e8eef5; }
.form-section-heading strong { color: #0f172a; font-size: .88rem; }
.form-section-heading span { color: #94a3b8; font-size: .71rem; text-align: right; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.toggle-field { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid #d9efe5; border-radius: 11px; background: #f0fdf7; cursor: pointer; }
.toggle-field input { width: 18px; height: 18px; flex: 0 0 auto; margin: 0; accent-color: #10b981; }
.toggle-field span { display: grid; gap: 3px; }
.toggle-field small, .field-help { color: #64748b; font-size: .72rem; font-weight: 600; }
.gps-fields { padding: 12px; border-left: 3px solid #10b981; border-radius: 0 10px 10px 0; background: #f8fafc; }
.form-section-institution { background: #f8fafc !important; }
.campaign-actions { justify-content: flex-end; padding-top: 4px; }
.campaign-actions .btn { min-height: 42px; padding-inline: 18px; }
.btn { padding:8px 12px; border-radius:8px; border:none; cursor:pointer; font-weight:700; }
.btn-primary { background:#10b981; color:white; }
.btn-ghost { background:transparent; border:1px solid #e2e8f0; }

/* Sticky header inside slide menu so back button stays visible when scrolling */
.slide-menu .admin-panel .panel-heading {
  position: sticky;
  top: 8px;
  background: #ffffff;
  z-index: 2300;
  padding-top: 6px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  box-shadow: 0 6px 14px rgba(2,6,23,0.04);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

@media (max-width: 680px) {
  .slide-menu { right: 12px; bottom: 82px; width: min(620px, calc(100% - 24px)); max-height: calc(100vh - 100px); }
  .admin-panel { padding: 18px; }
  .admin-panel-header { gap: 12px; }
  .admin-panel-actions { flex-direction: column; align-items: stretch; }
  .admin-panel-actions .btn { white-space: nowrap; }
  .admin-section-heading { display: block; }
  .admin-section-heading span { display: block; margin-top: 4px; }
  .field-grid { grid-template-columns: 1fr; }
  .form-section-heading { display: block; }
  .form-section-heading span { display: block; margin-top: 4px; text-align: left; }
}
