:root {
  --font-primary: 'Manrope', sans-serif;
  --bg-body: #F9FAFB;
  --bg-surface: #FFFFFF;
  --bg-sidebar: #F9FAFB;
  --text-main: #111827;
  --text-muted: #6B7280;
  --color-green: #059669;
  --color-green-light: #D1FAE5;
  --color-red: #DC2626;
  --color-red-light: #FEF2F2;
  --color-dark: #374151;
  --color-border: #E5E7EB;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p {
  margin: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

.text-muted {
  color: var(--text-muted);
}

.text-sm {
  font-size: 0.875rem;
}

.text-xs {
  font-size: 0.75rem;
}

.font-bold {
  font-weight: 700;
}

.font-semibold {
  font-weight: 600;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.btn-dark {
  background: var(--text-main);
  color: white;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: 0.2s;
  font-family: inherit;
  font-size: 0.85rem;
}
.btn-dark:hover {
  background: #1f2937;
}

.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}
.sidebar .brand {
  padding: 0.5rem 0 2.5rem;
}
.sidebar .brand h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1F2937;
}
.sidebar .brand p {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}
.sidebar nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  gap: 0.75rem;
}
.sidebar nav a svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}
.sidebar nav a:hover {
  color: var(--text-main);
}
.sidebar nav a.active {
  color: var(--text-main);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}
.sidebar .sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar .sidebar-footer a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar .sidebar-footer .btn-emergency {
  width: 100%;
  padding: 0.875rem;
  background: var(--color-dark);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-body);
  position: relative;
}
.main-content .topbar {
  padding: 1.25rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.main-content .topbar .page-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.main-content .topbar .page-title h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1F2937;
}
.main-content .topbar .page-title .badge-online {
  background: var(--color-green-light);
  color: var(--color-green);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.main-content .topbar .page-title .badge-online::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  background: var(--color-green);
  border-radius: 50%;
}
.main-content .topbar .topbar-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.main-content .topbar .topbar-actions .search-box {
  position: relative;
}
.main-content .topbar .topbar-actions .search-box input {
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--bg-surface);
  font-family: inherit;
  font-size: 0.875rem;
  width: 240px;
  outline: none;
}
.main-content .topbar .topbar-actions .search-box svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
}
.main-content .topbar .topbar-actions .icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
}
.main-content .topbar .topbar-actions .avatar {
  width: 32px;
  height: 32px;
  background: var(--color-dark);
  border-radius: 50%;
}
.main-content .scrollable-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 2.5rem 2.5rem;
  margin-bottom: 40px;
}
.main-content .dashboard-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  max-width: 1600px;
  width: 100%;
}
.main-content .dashboard-wrapper .grid-col-left, .main-content .dashboard-wrapper .grid-col-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.system-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--bg-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 20;
}

.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  padding: 1.5rem;
}

.metrics-row {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 0;
}

.metric-card {
  background: var(--bg-surface);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}
.metric-card .metric-header {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}
.metric-card .metric-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: #1F2937;
  margin-bottom: 0.5rem;
  line-height: 1;
}
.metric-card .metric-trend {
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.metric-card .metric-trend.positive {
  color: var(--color-green);
}
.metric-card .metric-icon {
  width: 48px;
  height: 48px;
  background: #F3F4F6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.map-container {
  background: #E5E7EB;
  border-radius: var(--radius-lg);
  height: 480px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}
.map-container #liberia-map {
  width: 100%;
  height: 100%;
  z-index: 1;
  border-radius: var(--radius-lg);
}
.map-container .leaflet-bottom.leaflet-right {
  bottom: 80px !important;
  z-index: 500 !important;
}
.map-container .leaflet-control-attribution {
  font-size: 9px !important;
  background: rgba(255, 255, 255, 0.85) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
}
.map-container .map-controls {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.map-container .map-controls .control-group {
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.map-container .map-controls .control-group button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  font-size: 1.25rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-main);
}
.map-container .map-controls .control-group button:hover {
  background: #f1f5f9;
}
.map-container .map-controls .control-group button + button {
  border-top: 1px solid var(--color-border);
}
.map-container .map-overlay-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  border-top: 1px solid var(--color-border);
}
.map-container .map-overlay-bottom .overlay-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}
.map-container .map-overlay-bottom .pill-btn {
  background: var(--bg-body);
  border: 1px solid var(--color-border);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text-main);
}
.map-container .map-overlay-bottom .pill-btn.active {
  background: var(--color-dark);
  color: white;
  border-color: var(--color-dark);
}
.map-container .map-overlay-bottom .pill-btn:hover {
  border-color: #94a3b8;
}
.map-container .map-overlay-bottom .pill-btn.active:hover {
  background: #1e293b;
}
.map-container .map-overlay-bottom .legend-item {
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #475569;
}
.map-container .map-overlay-bottom .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-green);
}
.map-container .map-overlay-bottom .dot.red {
  background: var(--color-red);
}

.alert-card {
  border-left: 4px solid var(--color-red);
  background: #fef2f2;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
}
.alert-card .alert-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  color: #b91c1c;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.alert-card .alert-header svg {
  width: 14px;
}
.alert-card .alert-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #1e293b;
}
.alert-card .alert-body p {
  font-size: 0.8rem;
  color: #475569;
  margin-bottom: 16px;
  line-height: 1.5;
}
.alert-card .alert-body .btn-dark {
  background: #0f172a;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  margin-right: 8px;
  margin-bottom: 6px;
  transition: 0.2s;
}
.alert-card .alert-body .btn-dark:hover {
  background: #1e293b;
}
.alert-card .alert-body .btn-outline {
  background: white;
  border: 1px solid #cbd5e1;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.7rem;
  color: #334155;
  transition: 0.2s;
  letter-spacing: 0.03em;
}
.alert-card .alert-body .btn-outline:hover {
  background: #f8fafc;
}

.risk-preview {
  background: #f8fafc;
  border-radius: 16px;
  padding: 20px;
  position: relative;
  margin-top: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
}
.risk-preview .radar-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fee2e2, #fecaca);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
}
.risk-preview .radar-circle span {
  color: #b91c1c;
  font-weight: 800;
  font-size: 0.7rem;
  text-transform: uppercase;
}
.risk-preview .tag-tl {
  position: absolute;
  top: 10px;
  left: 14px;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.risk-preview .tag-br {
  position: absolute;
  bottom: 10px;
  right: 14px;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   AGENT INDEX PAGE (FILTERS & TABLE)
   ========================================================================== */
.page-header {
  margin-bottom: 2rem;
}
.page-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1F2937;
  margin-bottom: 0.25rem;
}
.page-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  max-width: 600px;
}

.filter-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}
.filter-section .filter-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.4rem;
}
.filter-section .pill-group {
  display: flex;
  gap: 0.5rem;
  background: #F3F4F6;
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}
.filter-section .pill-group a {
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  transition: 0.2s;
}
.filter-section .pill-group a.active {
  background: white;
  color: #1F2937;
  box-shadow: var(--shadow-sm);
}
.filter-section .pill-group a:hover:not(.active) {
  color: #1F2937;
}
.filter-section .select-dropdown {
  padding: 0.5rem 2rem 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1F2937;
  background-color: white;
  outline: none;
  cursor: pointer;
}

.total-stats-card {
  text-align: right;
}
.total-stats-card .stats-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}
.total-stats-card .stats-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1F2937;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  justify-content: flex-end;
}
.total-stats-card .stats-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: normal;
}

/* Base Card & Table Framework */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.data-table th {
  padding: 1rem 1.5rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
  background: #F9FAFB;
}
.data-table td {
  padding: 1rem 1.5rem;
  font-size: 0.85rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border);
}
.data-table tbody tr {
  transition: background-color 0.2s;
}
.data-table tbody tr:hover {
  background-color: #F9FAFB;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Agent Specific Table Cells */
.agent-cell {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.agent-cell .agent-avatar {
  width: 36px;
  height: 36px;
  background: #E0F2FE;
  color: #0369A1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}
.agent-cell .name {
  font-weight: 700;
  color: #1F2937;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}
.agent-cell .meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.county-tag {
  background: #F3F4F6;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #4B5563;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--color-border);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.status-indicator::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.status-indicator.active {
  color: #059669;
}
.status-indicator.active::before {
  background: #10B981;
}
.status-indicator.inactive {
  color: #4B5563;
}
.status-indicator.inactive::before {
  background: #9CA3AF;
}

.sync-info .time {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 0.15rem;
}
.sync-info .status {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.sync-info .status.online {
  color: #059669;
}
.sync-info .status.offline {
  color: #DC2626;
}

.action-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.action-btn:hover {
  background: #F3F4F6;
  color: #1F2937;
}

.pagination-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background: white;
}
.pagination-row .page-info {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.pagination-row .page-controls {
  display: flex;
  gap: 0.25rem;
}
.pagination-row .page-controls button {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4B5563;
  cursor: pointer;
  font-family: inherit;
}
.pagination-row .page-controls button:hover:not(.dots):not(.active) {
  background: #F3F4F6;
}
.pagination-row .page-controls button.active {
  background: #1F2937;
  color: white;
  border-color: #1F2937;
}
.pagination-row .page-controls button.dots {
  border: none;
  background: transparent;
  cursor: default;
}

.floating-widget {
  position: fixed;
  bottom: 2rem;
  left: 16rem; /* Positions safely to the right of the sidebar */
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1000;
  width: 280px;
}
.floating-widget .widget-icon {
  width: 36px;
  height: 36px;
  background: #FEF2F2;
  color: #DC2626;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: -0.5rem;
}
.floating-widget .widget-content .title {
  font-weight: 800;
  color: #1F2937;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}
.floating-widget .widget-content .subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}
.floating-widget .progress-bar {
  width: 100%;
  height: 6px;
  background: #E5E7EB;
  border-radius: 3px;
  overflow: hidden;
}
.floating-widget .progress-bar .fill {
  width: 60%;
  height: 100%;
  background: #DC2626;
  border-radius: 3px;
}

/* ==========================================================================
   AGENT PROVISIONING (NEW) PAGE
   ========================================================================== */
.agent-provisioning-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem 2rem;
  background-color: var(--bg-main);
  min-height: calc(100vh - 100px);
}
.agent-provisioning-container .provisioning-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 550px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.agent-provisioning-container .card-header {
  padding: 2rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.agent-provisioning-container .card-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 0.5rem;
}
.agent-provisioning-container .card-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.agent-provisioning-container .card-header .icon-box {
  width: 48px;
  height: 48px;
  background: #F3F4F6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4B5563;
}
.agent-provisioning-container .provisioning-form {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.agent-provisioning-container .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.agent-provisioning-container .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.agent-provisioning-container .form-group.full-width {
  grid-column: 1/-1;
}
.agent-provisioning-container .form-group label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #4B5563;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.agent-provisioning-container .form-group input[type=text], .agent-provisioning-container .form-group select {
  background: #F3F4F6;
  border: 1px solid transparent;
  padding: 0.85rem 1rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  transition: border-color 0.2s;
  outline: none;
}
.agent-provisioning-container .form-group input[type=text]:focus, .agent-provisioning-container .form-group select:focus {
  border-color: #D1D5DB;
  background: #FFFFFF;
}
.agent-provisioning-container .form-group input[type=text]::placeholder, .agent-provisioning-container .form-group select::placeholder {
  color: #9CA3AF;
  font-weight: 500;
}
.agent-provisioning-container .phone-input-wrapper {
  display: flex;
  background: #F3F4F6;
  border-radius: 6px;
  align-items: center;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.agent-provisioning-container .phone-input-wrapper:focus-within {
  border-color: #D1D5DB;
  background: #FFFFFF;
}
.agent-provisioning-container .phone-input-wrapper .prefix {
  padding: 0.85rem 0.5rem 0.85rem 1rem;
  font-weight: 800;
  color: #4B5563;
}
.agent-provisioning-container .phone-input-wrapper input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  padding-left: 0.5rem !important;
}
.agent-provisioning-container .info-box {
  background: #F3F4F6;
  border-left: 4px solid #9CA3AF;
  padding: 1.25rem;
  border-radius: 4px 8px 8px 4px;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.agent-provisioning-container .info-box .info-icon {
  color: #6B7280;
  margin-top: 0.15rem;
}
.agent-provisioning-container .info-box .info-text strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 0.35rem;
}
.agent-provisioning-container .info-box .info-text p {
  font-size: 0.8rem;
  color: #4B5563;
  line-height: 1.5;
  font-weight: 500;
}
.agent-provisioning-container .form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
}
.agent-provisioning-container .form-actions .btn-cancel {
  font-size: 0.9rem;
  font-weight: 700;
  color: #4B5563;
  text-decoration: none;
}
.agent-provisioning-container .form-actions .btn-cancel:hover {
  color: #111827;
}
.agent-provisioning-container .form-actions .btn-submit {
  background: #4B5563;
  color: #FFFFFF;
  border: none;
  padding: 0.85rem 1.5rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.agent-provisioning-container .form-actions .btn-submit:hover {
  background: #374151;
}

.incident-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.incident-metrics .metric-box {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border: 1px solid var(--color-border);
}
.incident-metrics .metric-box .label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.incident-metrics .metric-box .value {
  font-size: 2.5rem;
  font-weight: 800;
  color: #1F2937;
  line-height: 1;
}
.incident-metrics .metric-box .icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.incident-metrics .metric-box .icon-wrapper.red {
  background: #FEF2F2;
  color: #DC2626;
}
.incident-metrics .metric-box .icon-wrapper.gray {
  background: #F3F4F6;
  color: #4B5563;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.table-toolbar .tabs {
  display: flex;
  gap: 0.5rem;
  background: white;
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}
.table-toolbar .tabs button {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
}
.table-toolbar .tabs button.active {
  background: #F3F4F6;
  color: #1F2937;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid var(--color-border);
}
.status-pill.pending {
  color: #DC2626;
  background: #FEF2F2;
  border-color: #FECACA;
}
.status-pill.pending::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #DC2626;
}
.status-pill.reviewed {
  color: #4B5563;
  background: #F3F4F6;
}
.status-pill.reviewed::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9CA3AF;
}
.status-pill.flagged {
  color: #DC2626;
  background: white;
  border-color: #FECACA;
}

.incident-show-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 2rem;
  height: calc(100vh - 180px);
}
.incident-show-grid .left-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  padding-right: 0.5rem;
}
.incident-show-grid .right-panel {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.info-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.info-card .card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: #1F2937;
  margin-bottom: 1rem;
}
.info-card .card-title svg {
  color: var(--text-muted);
}

.evidence-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.5rem;
  height: 180px;
}
.evidence-grid .main-photo {
  background: #E5E7EB;
  border-radius: 8px;
  overflow: hidden;
}
.evidence-grid .main-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.evidence-grid .side-photos {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.evidence-grid .side-photos .photo, .evidence-grid .side-photos .more-box {
  flex: 1;
  background: #E5E7EB;
  border-radius: 8px;
  overflow: hidden;
}
.evidence-grid .side-photos .photo img, .evidence-grid .side-photos .more-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.evidence-grid .side-photos .more-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #F3F4F6;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px dashed var(--color-border);
}

.advisory-form {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
}
.advisory-form .form-group {
  margin-bottom: 1.5rem;
}
.advisory-form label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: #1F2937;
  margin-bottom: 0.5rem;
}
.advisory-form textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--color-border);
  background: #F9FAFB;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 100px;
  outline: none;
}
.advisory-form textarea:focus {
  border-color: #9CA3AF;
}
.advisory-form .helper-text {
  display: block;
  text-align: right;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.advisory-form .radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.advisory-form .radio-group .radio-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  background: white;
  transition: 0.2s;
}
.advisory-form .radio-group .radio-card:hover {
  border-color: #9CA3AF;
}
.advisory-form .radio-group .radio-card input[type=radio] {
  margin-top: 0.25rem;
  accent-color: #1F2937;
}
.advisory-form .radio-group .radio-card .title {
  font-weight: 700;
  color: #1F2937;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}
.advisory-form .radio-group .radio-card .desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.advisory-form .radio-group .radio-card:has(input:checked) {
  background: #F3F4F6;
  border-color: #1F2937;
}

.advisory-actions {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background: #F9FAFB;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.advisory-actions .flex-btns {
  display: flex;
  gap: 0.5rem;
}
.advisory-actions .btn-draft {
  flex: 1;
  padding: 0.8rem;
  background: #E5E7EB;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  color: #4B5563;
  cursor: pointer;
}
.advisory-actions .btn-publish {
  flex: 2;
  padding: 0.8rem;
  background: linear-gradient(180deg, #4B5563 0%, #1F2937 100%);
  border: none;
  border-radius: 8px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.advisory-actions .disclaimer {
  font-size: 0.6rem;
  text-align: center;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

#location-map .leaflet-layer {
  filter: grayscale(100%);
}

.gis-fullscreen-wrapper {
  grid-column: 1/-1;
  margin: 0 -2.5rem -2.5rem -2.5rem;
  height: calc(100vh - 115px);
  display: flex;
  overflow: hidden;
  background: var(--bg-surface);
  border-top: 1px solid var(--color-border);
}
.gis-fullscreen-wrapper.sidebar-hidden .gis-sidebar {
  margin-right: -400px;
  box-shadow: none;
}
.gis-fullscreen-wrapper .gis-map-area {
  flex: 1;
  position: relative;
  height: 100%;
}
.gis-fullscreen-wrapper .gis-map-area #advanced-gis-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}
.gis-fullscreen-wrapper .gis-map-area .county-area-label {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #1F2937;
  font-weight: 800;
  font-size: 1.15rem;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9), 0 0 10px rgba(255, 255, 255, 0.7), -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  pointer-events: none;
}
.gis-fullscreen-wrapper .gis-map-area .county-area-label::before {
  display: none !important;
}
.gis-fullscreen-wrapper .gis-map-area .map-floating-filters {
  position: absolute;
  top: 1.5rem;
  left: 4.5rem;
  z-index: 1000;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.gis-fullscreen-wrapper .gis-map-area .map-floating-filters form {
  display: flex;
  gap: 0.5rem;
}
.gis-fullscreen-wrapper .gis-map-area .map-floating-filters .filter-pill, .gis-fullscreen-wrapper .gis-map-area .map-floating-filters .toggle-sidebar-btn {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  font-family: inherit;
}
.gis-fullscreen-wrapper .gis-map-area .map-floating-filters .filter-pill:hover, .gis-fullscreen-wrapper .gis-map-area .map-floating-filters .toggle-sidebar-btn:hover {
  background: #F9FAFB;
  border-color: #D1D5DB;
}
.gis-fullscreen-wrapper .gis-map-area .map-floating-filters select.filter-pill {
  appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='[http://www.w3.org/2000/svg](http://www.w3.org/2000/svg)' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  outline: none;
}
.gis-fullscreen-wrapper .gis-map-area .map-floating-filters select.filter-pill.active-filter {
  background-color: #E0F2FE;
  color: #0369A1;
  border-color: #BAE6FD;
}
.gis-fullscreen-wrapper .gis-map-area .gis-controls {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.gis-fullscreen-wrapper .gis-map-area .gis-controls .gis-btn-group {
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
}
.gis-fullscreen-wrapper .gis-map-area .gis-controls .gis-btn-group button {
  width: 40px;
  height: 40px;
  background: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  transition: background 0.2s;
}
.gis-fullscreen-wrapper .gis-map-area .gis-controls .gis-btn-group button:hover {
  background: #F3F4F6;
}
.gis-fullscreen-wrapper .gis-map-area .gis-controls .gis-btn-group button + button {
  border-top: 1px solid var(--color-border);
}
.gis-fullscreen-wrapper .gis-map-area .floating-farm-card {
  position: absolute;
  bottom: 2.5rem;
  left: 1.5rem;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 320px;
  border: 1px solid var(--color-border);
  transition: opacity 0.3s, transform 0.3s;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}
.gis-fullscreen-wrapper .gis-map-area .floating-farm-card.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.gis-fullscreen-wrapper .gis-map-area .floating-farm-card .farm-icon-box {
  width: 48px;
  height: 48px;
  background: #E5E7EB;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.gis-fullscreen-wrapper .gis-sidebar {
  width: 400px;
  background: white;
  height: 100%;
  z-index: 10;
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--color-border);
  transition: margin-right 0.3s ease;
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-scroll-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .section-title {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .stat-grid .stat-box {
  background: #F3F4F6;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .stat-grid .stat-box .val {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1F2937;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .stat-grid .stat-box .lbl {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .impact-metric {
  margin-bottom: 1.25rem;
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .impact-metric:last-child {
  margin-bottom: 0;
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .impact-metric .metric-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .impact-metric .metric-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .impact-metric .metric-number.danger {
  color: var(--color-red);
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .impact-metric .metric-number.success {
  color: var(--color-green);
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .impact-metric .metric-unit {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .impact-metric .metric-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .impact-metric .progress-bar-container {
  width: 100%;
  height: 8px;
  background: #E5E7EB;
  border-radius: 4px;
  overflow: hidden;
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .impact-metric .progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .impact-metric .progress-fill.danger {
  background: var(--color-red);
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .impact-metric .progress-fill.success {
  background: var(--color-green);
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .evidence-photo {
  width: 100%;
  height: 160px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.gis-fullscreen-wrapper .gis-sidebar .sidebar-section .evidence-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gis-fullscreen-wrapper .gis-sidebar .incident-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.gis-fullscreen-wrapper .gis-sidebar .incident-list .incident-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: white;
  cursor: pointer;
  transition: 0.2s;
  text-decoration: none;
}
.gis-fullscreen-wrapper .gis-sidebar .incident-list .incident-item:hover {
  border-color: #9CA3AF;
  background: #F9FAFB;
}
.gis-fullscreen-wrapper .gis-sidebar .incident-list .incident-item .icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #FEF2F2;
  color: #DC2626;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.gis-fullscreen-wrapper .gis-sidebar .incident-list .incident-item .info {
  flex: 1;
}
.gis-fullscreen-wrapper .gis-sidebar .incident-list .incident-item .info .title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 0.15rem;
}
.gis-fullscreen-wrapper .gis-sidebar .incident-list .incident-item .info .loc {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}
.gis-fullscreen-wrapper .gis-sidebar .conditions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.gis-fullscreen-wrapper .gis-sidebar .conditions-grid .condition-item .c-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  font-weight: 600;
}
.gis-fullscreen-wrapper .gis-sidebar .conditions-grid .condition-item .c-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.gis-fullscreen-wrapper .gis-sidebar .conditions-grid .condition-item .c-value svg {
  color: #9CA3AF;
  width: 16px;
}
.gis-fullscreen-wrapper .gis-sidebar .warning-alert {
  background: var(--color-red-light);
  border: 1px solid #FECACA;
  border-radius: 8px;
  padding: 0.8rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  color: #B91C1C;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}
.gis-fullscreen-wrapper .gis-sidebar .action-btn-full {
  width: 100%;
  padding: 0.85rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  transition: 0.2s;
}
.gis-fullscreen-wrapper .gis-sidebar .action-btn-full.btn-dispatch {
  background: #4B5563;
  color: white;
  border: none;
}
.gis-fullscreen-wrapper .gis-sidebar .action-btn-full.btn-dispatch:hover {
  background: #374151;
}
.gis-fullscreen-wrapper .gis-sidebar .action-btn-full.btn-deploy {
  background: #E5E7EB;
  color: var(--text-main);
  border: none;
}
.gis-fullscreen-wrapper .gis-sidebar .action-btn-full.btn-deploy:hover {
  background: #D1D5DB;
}
.gis-fullscreen-wrapper .active-tool {
  background: #E0F2FE !important;
  color: #0369A1 !important;
  border-color: #BAE6FD !important;
}
.gis-fullscreen-wrapper .leaflet-control-attribution {
  display: none;
}

:root {
  --font-primary: 'Manrope', sans-serif;
  --color-primary-dark: #1B4332;
  --color-surface: #FFFFFF;
  --color-background: #F4F5F7;
  --elevation-1: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.material-symbols-outlined {
  font-display: swap;
}

/* --- Core Container --- */
.lm-container {
  grid-column: 1/-1;
  background-color: #F8F9FA !important;
  min-height: calc(100vh - 60px);
  margin: -2.5rem;
  padding: 2.5rem 3rem;
  font-family: "Inter", system-ui, sans-serif;
  color: #111827;
}

/* --- Headers & Layout --- */
.lm-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 2.5rem;
  width: 100%;
}

.lm-header-left {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.lm-back-btn {
  margin-top: 0.25rem;
  color: #4B5563;
  text-decoration: none;
  display: flex;
}

.lm-title-group h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #111827;
  margin: 0 0 0.25rem 0;
}

.lm-title-group p {
  font-size: 0.85rem;
  color: #6B7280;
  margin: 0;
}

/* --- Buttons --- */
.lm-btn-publish {
  background-color: #4B5563 !important;
  color: #ffffff !important;
  border: none !important;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* --- Tab Navigation --- */
.lm-tab-navigation {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #E5E7EB;
  padding-bottom: 1rem;
}

.lm-tab {
  background: transparent;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.lm-tab.active-tab {
  color: #111827;
  background-color: #F3F4F6;
}

.lm-tab.inactive-tab {
  color: #9CA3AF;
}

/* --- Grids & Cards --- */
.lm-grid {
  display: grid !important;
  grid-template-columns: 1fr 1.1fr;
  gap: 2rem;
  max-width: 1200px;
}

.lm-card {
  background-color: #ffffff !important;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid #E5E7EB;
  display: block;
}

.lm-card-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Form Elements --- */
.lm-form-group {
  margin-bottom: 1.5rem;
}

.lm-label {
  display: block !important;
  font-size: 0.75rem;
  font-weight: 800;
  color: #4B5563;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.lm-input, .lm-textarea {
  display: block;
  width: 100% !important;
  background-color: #F9FAFB !important;
  border: 1px solid #D1D5DB !important;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  color: #111827;
  box-sizing: border-box;
  outline: none;
}

.lm-textarea {
  min-height: 140px;
  resize: vertical;
}

/* --- Learning Objectives --- */
.lm-objective-row {
  display: flex !important;
  align-items: center !important;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #F3F4F6;
}

.lm-objective-row:last-child {
  border-bottom: none;
}

.lm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #D1D5DB;
  flex-shrink: 0;
}

.lm-dot.active {
  background-color: #4B5563;
}

.lm-obj-input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  outline: none;
  font-size: 0.95rem;
  color: #111827;
  padding: 0.25rem 0;
}

.lm-btn-add {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #F3F4F6 !important;
  color: #4B5563;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: 0.2s;
  flex-shrink: 0;
}

.lm-btn-add:hover {
  background-color: #E5E7EB !important;
}

/* --- Media Assembly Grid --- */
.lm-media-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.lm-media-block {
  margin-bottom: 1rem;
  display: block;
  width: 100%;
}

.lm-media-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 1rem;
}

.lm-media-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #111827;
}

/* --- AI Buttons --- */
.lm-btn-ai {
  display: flex !important;
  align-items: center;
  gap: 0.4rem;
  background-color: #ffffff !important;
  border: 1px solid #E5E7EB !important;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #4B5563 !important;
  cursor: pointer;
  transition: 0.2s;
}

.lm-btn-ai:hover {
  background-color: #F5F3FF !important;
  color: #6D28D9 !important;
  border-color: #C4B5FD !important;
}

/* --- Dropzones --- */
.lm-dropzone {
  border: 2px dashed #D1D5DB !important;
  background-color: #F9FAFB !important;
  border-radius: 12px;
  height: 180px;
  position: relative;
  overflow: hidden;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  width: 100%;
}

.lm-dropzone:hover {
  background-color: #F3F4F6 !important;
  border-color: #9CA3AF !important;
}

.dz-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  pointer-events: none;
}

[data-media-preview-target=previewContainer] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

[data-media-preview-target=previewContainer] video,
[data-media-preview-target=previewContainer] img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* --- Step Footer & Next Button --- */
.lm-step-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.lm-btn-next {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #ffffff;
  border: 1px solid #D1D5DB;
  color: #111827;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

/* --- Utilities --- */
.hidden {
  display: none !important;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-background);
  color: #333;
}

.inline-form-error {
  color: #DC2626;
  font-size: 0.75rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  text-align: center;
}

.media-generation-error {
  border-color: #DC2626;
  color: #DC2626;
  text-align: center;
  padding: 1rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
}
.dashboard-grid .metric-card {
  background: var(--color-surface);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: var(--elevation-1);
}
.dashboard-grid .metric-card h3 {
  font-size: 0.875rem;
  color: #666;
  text-transform: uppercase;
}
.dashboard-grid .metric-card .value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.training-hub-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 4rem 2rem;
  min-height: calc(100vh - 80px);
  background-color: var(--bg-surface);
}

.ai-header-block {
  text-align: center;
  margin-bottom: 3rem;
  width: 100%;
}
.ai-header-block .ai-icon-container {
  width: 64px;
  height: 64px;
  background-color: #f5f5dc;
  color: white;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}
.ai-header-block h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  font-family: "Manrope", sans-serif;
}
.ai-header-block p {
  font-size: 1rem;
  color: #6B7280;
  font-weight: 500;
}

.ai-prompt-box {
  width: 100%;
  max-width: 850px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  border: 1px solid #E5E7EB;
  overflow: hidden;
  transition: all 0.3s ease;
  margin-bottom: 2rem;
}
.ai-prompt-box:focus-within {
  border-color: #111827;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}
.ai-prompt-box .prompt-textarea {
  width: 100%;
  min-height: 140px;
  padding: 1.5rem;
  border: none;
  outline: none;
  resize: none;
  font-size: 1.1rem;
  font-family: inherit;
  color: #111827;
  background: transparent;
}
.ai-prompt-box .prompt-textarea::placeholder {
  color: #9CA3AF;
}
.ai-prompt-box .prompt-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: white;
  border-top: 1px solid transparent;
}
.ai-prompt-box .prompt-actions .btn-attach {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  color: #6B7280;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.ai-prompt-box .prompt-actions .btn-attach:hover {
  background: #F3F4F6;
  color: #111827;
}
.ai-prompt-box .prompt-actions .btn-submit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #111827;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: background 0.2s, transform 0.1s;
}
.ai-prompt-box .prompt-actions .btn-submit:hover {
  background: #374151;
}
.ai-prompt-box .prompt-actions .btn-submit:active {
  transform: scale(0.98);
}

.secondary-action-link {
  width: 100%;
  max-width: 850px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: white;
  border: 2px solid #F3F4F6;
  border-radius: 16px;
  text-decoration: none;
  color: #111827;
  font-weight: 700;
  font-size: 1.05rem;
  transition: all 0.2s ease;
  margin-bottom: 2rem;
}
.secondary-action-link .link-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.secondary-action-link .link-content .icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #F3F4F6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  transition: all 0.2s;
}
.secondary-action-link .arrow-icon {
  color: #9CA3AF;
  transition: all 0.2s;
}
.secondary-action-link:hover {
  border-color: #111827;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.secondary-action-link:hover .link-content .icon-circle {
  background: #111827;
  color: white;
}
.secondary-action-link:hover .arrow-icon {
  color: #111827;
  transform: translateX(4px);
}

.recent-sessions-container {
  width: 100%;
  max-width: 850px;
  margin-top: 2rem;
}
.recent-sessions-container .sessions-header {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}
.recent-sessions-container .session-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  text-decoration: none;
  transition: 0.2s;
}
.recent-sessions-container .session-card:hover {
  border-color: #9CA3AF;
  background: #F9FAFB;
}
.recent-sessions-container .session-card .session-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.recent-sessions-container .session-card .session-info .session-icon {
  color: #6B7280;
}
.recent-sessions-container .session-card .session-info .title {
  font-weight: 700;
  color: #1F2937;
  font-size: 0.95rem;
}
.recent-sessions-container .session-card .session-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.chat-interface-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 80px); /* Height minus top header */
  position: relative;
  background-color: var(--bg-main);
}

.chat-history-area {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2rem 10rem 2rem; /* Extra padding at bottom for input area */
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.chat-context-header {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1rem;
}
.chat-context-header .icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4B5563;
}
.chat-context-header .title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1F2937;
  font-family: "Manrope", sans-serif;
}
.chat-context-header .subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

@keyframes chatBounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
/* Ensure the layout matches the screenshot precisely */
.chat-message .message-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #444748;
  margin-bottom: 0.5rem;
}
.chat-message .message-meta .sender-name {
  font-family: "Manrope", sans-serif;
  font-weight: 600;
}
.chat-message.user .message-meta {
  justify-content: flex-end;
}
.chat-message.ai .message-meta {
  justify-content: flex-start;
}

.chat-message-user {
  align-items: flex-end;
}

.chat-message-user .message-meta {
  flex-direction: row-reverse;
}

.chat-message-user .message-bubble {
  background: #f1edec;
  color: #1c1b1b;
  border-top-right-radius: 4px;
}

.chat-message-ai {
  align-items: flex-start;
}

.chat-message-ai .message-bubble {
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(118, 119, 119, 0.04);
  border-top-left-radius: 4px;
  /* Fixed: removed width:100% to prevent full-width bubbles */
  max-width: 85%;
  padding: 1rem 1.25rem; /* consistent with user bubble */
}

.chat-context-header .icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ebe7e7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5d5f5f;
}

.chat-context-header .title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1c1b1b;
}

.chat-context-header .subtitle {
  font-size: 0.85rem;
  color: #444748;
  font-weight: 400;
}

/* Restored Chat Message Styles - Fixed alignment */
.chat-message {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #444748;
  margin-bottom: 0.25rem;
}

.message-meta .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #5d5f5f;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  overflow: hidden;
}

.message-meta .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-bubble {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  max-width: 85%;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #1c1b1b;
}

.message-bubble p {
  margin-bottom: 1rem;
}

.message-bubble p:last-child {
  margin-bottom: 0;
}

.message-bubble strong {
  font-weight: 700;
  color: #1c1b1b;
}

.message-bubble ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.message-bubble li {
  margin-bottom: 0.5rem;
}

/* Persistent Input Area */
.chat-persistent-input {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  background: rgba(252, 248, 248, 0.8);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(196, 199, 200, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chat-persistent-input .input-wrapper {
  width: 100%;
  max-width: 900px;
  background: #e5e2e1;
  border: 2px solid transparent;
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  padding: 0.5rem;
  transition: all 0.2s;
}

.chat-persistent-input .input-wrapper:focus-within {
  border-color: rgba(93, 95, 95, 0.2);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chat-persistent-input textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  padding: 0.75rem 0.5rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1c1b1b;
  background: transparent;
  min-height: 44px;
  max-height: 200px;
}

.chat-persistent-input .btn-tool {
  background: transparent;
  border: none;
  padding: 0.5rem;
  color: #444748;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

.chat-persistent-input .btn-tool:hover {
  background: #ebe7e7;
  color: #1c1b1b;
}

.chat-persistent-input .btn-send {
  background: #5d5f5f;
  color: #ffffff;
  border: none;
  padding: 0.5rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  transition: 0.2s;
}

.chat-persistent-input .btn-send:hover {
  background: rgba(93, 95, 95, 0.9);
}

.chat-persistent-input .disclaimer {
  font-size: 0.65rem;
  color: #444748;
  font-weight: 500;
  margin-top: 0.5rem;
  text-align: center;
}

/* Bouncing Dots Loading Animation */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.25rem 0.5rem;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background-color: #8c8f8f;
  border-radius: 50%;
  animation: chatBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes chatBounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
