:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-soft: #f8fbf9;
  --line: #e6ece8;
  --text: #111827;
  --muted: #667085;
  --brand: #159947;
  --brand-deep: #047a34;
  --brand-soft: #e3f8ea;
  --brand-wash: #f1fbf5;
  --warning: #d58b00;
  --critical: #dc3f45;
  --info: #169b57;
  --blue: #3f8ee8;
  --shadow: 0 14px 34px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 8px 22px rgba(16, 24, 40, 0.06);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --font-display: "Roboto", "Google Sans", "Segoe UI", Arial, sans-serif;
  --font-body: "Roboto", "Google Sans", "Segoe UI", Arial, sans-serif;
  --md-primary: #1a73e8;
  --md-primary-soft: rgba(26, 115, 232, 0.14);
  --md-outline: #c7cdd4;
  --md-outline-hover: #5f6368;
  --md-field-bg: #fff;
  --md-label: #5f6368;
  --md-error: #b3261e;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at 16% 10%, rgba(21, 153, 71, 0.08), transparent 26%),
    radial-gradient(circle at 88% 18%, rgba(63, 142, 232, 0.08), transparent 24%),
    linear-gradient(180deg, #fbfdfc 0%, var(--bg) 42%, #eef4f1 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 42px;
}

.hero {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand badge"
    "nav nav";
  align-items: start;
  gap: 18px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.brand-lockup {
  grid-area: brand;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  margin-top: 5px;
  color: var(--brand);
  font-size: 2rem;
}

.brand-mark + div {
  min-width: 0;
}

.brand-logo {
  display: block;
  width: min(156px, 38vw);
  height: auto;
  margin: 0 0 7px;
  object-fit: contain;
}

.eyebrow,
.section-kicker {
  margin: 0 0 7px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
  font-weight: 700;
  color: #7a8592;
}

.hero h1,
.panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.hero h1 {
  font-size: clamp(1.7rem, 3vw, 2.75rem);
  line-height: 1.05;
}

.hero-copy {
  max-width: 760px;
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.hero-badge {
  grid-area: badge;
  min-width: 168px;
  align-self: stretch;
  padding: 13px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  color: var(--text);
  display: grid;
  align-content: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.92);
}

.hero-badge span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.hero-badge strong {
  font-size: 1.25rem;
}

.hero-badge small {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.hero-weather-summary {
  margin: 2px 0 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text);
  max-width: 210px;
}

.app-body {
  position: relative;
  margin-top: 18px;
}

.app-body.nav-visible {
  margin-top: 18px;
}

.app-nav {
  grid-area: nav;
  position: static;
  left: auto;
  top: auto;
  transform: none;
  width: 100%;
  z-index: auto;
  display: grid;
  grid-template-columns: 58px repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 0;
  margin: 2px 0 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.nav-item {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 54px;
  padding: 8px 10px;
  color: #596273;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
}

.nav-icon {
  margin-bottom: 6px;
  font-size: 1rem;
}

.nav-item.active {
  color: var(--brand);
}

.nav-item.active::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--brand);
}

.panel-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-sidebar-toggle {
  position: relative;
  display: grid;
  place-items: center;
  align-self: center;
  justify-self: center;
  width: 36px;
  height: 36px;
  margin: 0;
  border: 0;
  border-radius: 12px;
  color: #17231f;
  cursor: pointer;
  background: transparent;
}

.nav-sidebar-toggle span,
.nav-sidebar-toggle::before,
.nav-sidebar-toggle::after {
  content: "";
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.nav-sidebar-toggle::before,
.nav-sidebar-toggle::after {
  position: absolute;
}

.nav-sidebar-toggle::before {
  transform: translateY(-6px);
}

.nav-sidebar-toggle::after {
  transform: translateY(6px);
}

.sidebar {
  position: fixed;
  z-index: 50;
  left: 18px;
  top: 18px;
  width: min(30vw, 420px);
  min-width: 320px;
  min-height: calc(100vh - 32px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 10% 4%, rgba(21, 153, 71, 0.12), transparent 24%),
    rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
  transition: width 0.2s ease, min-width 0.2s ease, padding 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 8px 14px;
  border-bottom: 1px solid var(--line);
}

.sidebar-head strong {
  display: block;
  font-size: 1.05rem;
}

.sidebar-close-toggle {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
}

.sidebar-close-toggle:hover {
  background: rgba(255, 255, 255, 0.95);
}

.sidebar-menu {
  display: grid;
  gap: 14px;
  padding-top: 16px;
}

.sidebar-group {
  display: grid;
  gap: 7px;
}

.sidebar-group-title {
  padding: 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.66rem;
  font-weight: 800;
  color: #89929e;
}

.sidebar-link {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 7px 10px;
  border-radius: 15px;
  color: #4b5563;
  text-decoration: none;
  font-weight: 800;
}

.sidebar-link:hover,
.sidebar-link.active {
  color: var(--brand-deep);
  background: var(--brand-wash);
}

.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: var(--brand);
}

.sidebar-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 13px;
  color: var(--brand);
  background: #e9f8ef;
  font-size: 0.95rem;
}

.sidebar-link small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.25;
}

.sidebar-collapsed .sidebar {
  width: 42px;
  min-width: 42px;
  min-height: auto;
  left: 34px;
  top: 106px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sidebar-collapsed .sidebar-head {
  padding: 0;
  border-bottom: 0;
}

.sidebar-collapsed .sidebar-head > div,
.sidebar-collapsed .sidebar-close-toggle,
.sidebar-collapsed .sidebar-menu,
.sidebar-collapsed .sidebar-group-title,
.sidebar-collapsed .sidebar-link span:not(.sidebar-icon),
.sidebar-collapsed .sidebar-link small {
  display: none;
}

.sidebar-collapsed .sidebar-link {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 7px;
}

.layout,
.dashboard {
  display: grid;
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.topbar {
  position: relative;
  overflow: hidden;
  min-height: 166px;
  padding: 30px;
  color: #fff;
  border: 0;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.2), transparent 20%),
    linear-gradient(135deg, #17a84f 0%, #07843a 58%, #006b30 100%);
  box-shadow: 0 18px 40px rgba(2, 107, 48, 0.24);
}

.topbar::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 240px;
  height: 240px;
  border: 34px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.topbar .section-kicker,
.topbar .user-meta {
  color: rgba(255, 255, 255, 0.82);
}

.topbar h2 {
  max-width: 720px;
  font-size: clamp(1.6rem, 3vw, 2.45rem);
  line-height: 1.1;
}

.topbar-actions {
  position: relative;
  z-index: 1;
}

.diagnostics-panel {
  margin-top: 14px;
  border-color: rgba(165, 45, 45, 0.25);
  background: #fff5f5;
  color: #8d1f1f;
  font-size: 0.9rem;
}

.panel-heading,
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.topbar-actions,
.user-meta,
.demo-users,
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.user-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.chip-soft {
  color: var(--brand);
  background: var(--brand-soft);
}

.chip-alert {
  color: #fff;
  background: linear-gradient(135deg, #e2474f, #c63138);
}

.auth-form,
.checkin-form {
  display: grid;
  gap: 14px;
}

.auth-subform {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.auth-help-link {
  justify-self: center;
  font-size: 0.88rem;
}

label {
  display: grid;
  gap: 8px;
  color: var(--md-label);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.0125em;
}

label.inline {
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
}

.checkin-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}

.checkin-form .wide,
.checkin-form button,
.checkin-form .feedback,
.details-panel,
.map-panel,
.side-stack,
.lower-grid,
.main-grid {
  grid-column: 1 / -1;
}

input,
select,
textarea,
.demo-user {
  width: 100%;
  min-height: 48px;
  padding: 13px 14px;
  border: 1px solid var(--md-outline);
  border-radius: 4px;
  background: var(--md-field-bg);
  color: var(--text);
  outline: none;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}

select {
  padding-right: 36px;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #7b8088;
  opacity: 1;
  font-weight: 500;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--md-outline-hover);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px var(--md-primary-soft);
}

.display-only-field[readonly] {
  background: #edf1ef;
  color: var(--muted);
  cursor: default;
}

input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
  border-color: var(--md-error);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--md-primary);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(25, 103, 210, 0.1);
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(25, 103, 210, 0.35);
  outline-offset: 2px;
}

.demo-user {
  width: auto;
  cursor: pointer;
  color: var(--brand);
  font-weight: 800;
  background: var(--brand-wash);
}

.btn {
  border: 1px solid transparent;
  border-radius: 0.375rem;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 148px;
  white-space: nowrap;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  transition:
    color 0.15s ease-in-out,
    background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
}

.btn:not(.btn-icon) {
  height: 46px;
  min-height: 46px;
  padding: 0 20px;
}

.btn-primary {
  color: #fff;
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.btn-secondary {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

.btn-info {
  color: #000;
  background-color: #0dcaf0;
  border-color: #0dcaf0;
}

.btn-confirm {
  color: #fff;
  background-color: #0b2f6b;
  border-color: #0b2f6b;
}

.btn-danger {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}

.btn-primary:hover,
.btn-primary:focus {
  color: #fff;
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

.btn-secondary:hover,
.btn-secondary:focus {
  color: #fff;
  background-color: #5c636a;
  border-color: #565e64;
}

.btn-info:hover,
.btn-info:focus {
  color: #000;
  background-color: #31d2f2;
  border-color: #25cff2;
}

.btn.voice-listening {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}

.btn-confirm:hover,
.btn-confirm:focus {
  color: #fff;
  background-color: #082653;
  border-color: #08224a;
}

.btn-danger:hover,
.btn-danger:focus {
  color: #fff;
  background-color: #bb2d3b;
  border-color: #b02a37;
}

.btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.btn:disabled,
.btn.disabled {
  pointer-events: none;
  opacity: 0.65;
}

.kpis {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.kpi-card {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 112px;
  padding: 22px 24px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--info);
}

.kpi-warning::before {
  background: var(--warning);
}

.kpi-critical::before {
  background: var(--critical);
}

.kpi-safe::before {
  background: #22c55e;
}

.kpi-card strong {
  display: block;
  margin-top: 6px;
  font-size: 2.15rem;
  line-height: 1;
  color: var(--info);
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.kpi-warning strong {
  color: var(--warning);
}

.kpi-critical strong {
  color: var(--critical);
}

.kpi-safe strong {
  color: #22a85a;
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  color: var(--info);
  background: var(--brand-wash);
  font-size: 1rem;
}

.server-services-panel {
  display: grid;
  gap: 16px;
}

.server-services-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.server-service-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.server-service-main {
  display: flex;
  gap: 12px;
  align-items: center;
}

.server-service-main h4 {
  margin: 0;
  font-size: 1rem;
}

.server-service-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.server-service-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--brand);
  background: var(--brand-soft);
}

.service-warning .server-service-icon {
  color: #996400;
  background: #fff4d6;
}

.service-critical .server-service-icon {
  color: var(--critical);
  background: #ffe8e8;
}

.server-service-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.server-maintenance-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.server-maintenance-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  flex-wrap: wrap;
}

.server-maintenance-heading h4 {
  margin: 2px 0 0;
  font-size: 1rem;
}

.server-maintenance-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.server-maintenance-actions .btn {
  gap: 6px;
}

.server-maintenance-output {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #cfe0d7;
  border-radius: 12px;
  background: #f7fbf9;
}

.server-maintenance-output pre {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 0.78rem/1.45 Consolas, "Courier New", monospace;
}

.server-maintenance-output .server-service-log-heading h4 {
  color: var(--text);
}

.server-maintenance-output .server-service-log-heading span {
  color: var(--muted);
}

.server-service-log {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0b1220;
  color: #d7e2f0;
  box-shadow: var(--shadow-soft);
}

.server-service-log-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}

.server-service-log-heading h4 {
  margin: 0;
  color: #ffffff;
  font-size: 0.98rem;
}

.server-service-log-heading span {
  color: #9fb0c5;
  font-size: 0.78rem;
}

.server-service-log pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 0.78rem/1.45 Consolas, "Courier New", monospace;
}

.kpi-warning .kpi-icon {
  color: var(--warning);
  background: #fff7e7;
}

.kpi-critical .kpi-icon {
  color: var(--critical);
  background: #fff0f1;
}

.main-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 0.95fr);
}

.map-panel {
  background: linear-gradient(180deg, #ffffff 0%, #fbfefd 100%);
}

.movement-panel {
  display: grid;
  gap: 16px;
}

.movement-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.movement-controls label {
  min-width: 0;
  font-size: 0.78rem;
}

.movement-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 14px;
  align-items: stretch;
}

.movement-map-shell {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #eef6f2;
}

.movement-map {
  width: 100%;
  height: 100%;
  min-height: 520px;
}

.movement-side {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  min-height: 520px;
}

.movement-playback {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.movement-playback input[type="range"] {
  min-width: 0;
}

.movement-current {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #cfe0d7;
  border-radius: 12px;
  background: #f7fbf9;
  color: var(--muted);
  font-size: 0.86rem;
}

.movement-current strong {
  color: var(--text);
  font-size: 0.98rem;
}

.movement-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.movement-point-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.movement-point-item:hover {
  border-color: #9ccdb6;
  background: #f7fbf9;
}

.movement-point-item span,
.movement-point-item small {
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .movement-controls,
  .movement-layout {
    grid-template-columns: 1fr;
  }

  .movement-map-shell,
  .movement-map,
  .movement-side {
    min-height: 360px;
  }

  .movement-playback {
    grid-template-columns: 1fr 1fr;
  }

  .movement-playback input[type="range"] {
    grid-column: 1 / -1;
  }
}

.filters {
  margin-top: 10px;
}

.filters label {
  min-width: 138px;
  font-size: 0.78rem;
}

.map-jemaah-search {
  display: grid;
  grid-template-columns: minmax(240px, 340px) auto;
  gap: 6px 8px;
  align-items: end;
}

.map-jemaah-search label {
  grid-column: 1 / -1;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.map-jemaah-search-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.map-jemaah-search-controls input {
  min-height: 48px;
}

.map-jemaah-search-status {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
}

.operations-map {
  position: relative;
  height: 880px;
  min-height: 880px;
  margin-top: 14px;
  border: 1px solid #dce8e1;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 42%, rgba(21, 153, 71, 0.08), transparent 24%),
    linear-gradient(135deg, #eafff0, #edf7ff);
}

.operations-map::before,
.operations-map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.operations-map::before {
  background:
    linear-gradient(90deg, rgba(21, 153, 71, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(21, 153, 71, 0.06) 1px, transparent 1px);
  background-size: 82px 82px;
}

.operations-map::after {
  background:
    radial-gradient(circle at 48% 45%, rgba(21, 153, 71, 0.18), transparent 9%),
    radial-gradient(circle at 52% 45%, rgba(255, 255, 255, 0.54), transparent 12%);
}

.map-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  z-index: 1;
}

.map-fallback-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.fallback-point {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.fallback-point.checkpoint {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #fef3c7;
  box-shadow: 0 0 0 2px #fff7ed, 0 0 0 3px rgba(145, 101, 25, 0.32);
}

.fallback-point.group {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.86rem;
  font-weight: 800;
  color: #102315;
  box-shadow: 0 10px 20px rgba(7, 30, 16, 0.18);
}

.fallback-point.group.info {
  background: #d9fbe6;
  box-shadow: 0 0 0 2px #ffffff, 0 10px 20px rgba(7, 30, 16, 0.18);
}

.fallback-point.group.warning {
  background: #ffe7b3;
  box-shadow: 0 0 0 2px #ffffff, 0 10px 20px rgba(126, 72, 15, 0.18);
}

.fallback-point.group.critical {
  background: #ffd5d5;
  box-shadow: 0 0 0 2px #ffffff, 0 10px 20px rgba(146, 31, 31, 0.2);
}

.fallback-point.poi {
  width: 24px;
  height: 24px;
  opacity: 0.5;
  border-radius: 999px;
  background: #dff7ee;
  box-shadow: 0 0 0 2px #ffffff, 0 10px 20px rgba(7, 30, 16, 0.18);
}

.fallback-label {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(12, 29, 18, 0.1);
  color: #17301f;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.map-layer .ol-viewport {
  border-radius: 18px;
}

.map-layer .ol-control button {
  border-radius: 999px;
  background: rgba(3, 117, 53, 0.9);
}

.map-layer .ol-control button:hover {
  background: rgba(2, 97, 44, 1);
}

.map-layer .ol-zoom {
  display: none;
}

.map-zoom-control {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: inline-grid;
  grid-template-columns: 34px minmax(82px, auto) 34px;
  align-items: center;
  min-height: 34px;
  overflow: hidden;
  border: 1px solid rgba(220, 229, 225, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 26px rgba(16, 24, 40, 0.12);
}

.map-zoom-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: var(--brand-deep);
  background: transparent;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
}

.map-zoom-btn:hover {
  background: rgba(13, 128, 61, 0.1);
}

.map-zoom-btn:disabled {
  cursor: not-allowed;
  color: #98a6a0;
  background: transparent;
}

.map-zoom-value {
  min-width: 82px;
  padding: 0 9px;
  border-right: 1px solid rgba(220, 229, 225, 0.95);
  border-left: 1px solid rgba(220, 229, 225, 0.95);
  color: #21302b;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.map-popup {
  position: absolute;
  transform: translate(-50%, calc(-100% - 18px));
  min-width: 220px;
  max-width: 280px;
  padding: 14px 16px;
  border: 1px solid #dce8e1;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.map-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #17231f;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 14px rgba(16, 24, 40, 0.1);
}

.map-popup-close:hover {
  background: rgba(255, 255, 255, 0.9);
}

.map-popup-inline {
  position: static;
  transform: none;
  min-width: 0;
  max-width: 280px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.map-popup h3 {
  margin: 0 28px 6px 0;
  font-size: 1rem;
}

.map-popup p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.map-popup-action,
.map-drilldown-control {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.map-popup-action {
  margin-top: 10px;
  padding: 8px 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
}

.map-popup::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.4);
  border-right: 1px solid #dce8e1;
  border-bottom: 1px solid #dce8e1;
  transform: translateX(-50%) rotate(45deg);
}

.map-popup-inline::after {
  display: none;
}

.google-jemaah-photo-marker {
  position: relative;
  width: 48px;
  height: 58px;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.28));
  transform: translateY(-2px);
}

.google-jemaah-photo-marker::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 15px;
  height: 15px;
  background: var(--marker-fill, #0b5f2d);
  border-right: 2px solid var(--marker-stroke, #fff);
  border-bottom: 2px solid var(--marker-stroke, #fff);
  transform: translateX(-50%) rotate(45deg);
}

.google-jemaah-photo-marker img {
  position: relative;
  z-index: 1;
  display: block;
  width: 42px;
  height: 42px;
  margin: 0 auto;
  object-fit: cover;
  border: 3px solid var(--marker-stroke, #fff);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px var(--marker-fill, #0b5f2d);
}

.google-poi-marker {
  width: 44px;
  height: 44px;
  opacity: 0.5;
  display: grid;
  place-items: center;
  border: 3px solid #ffffff;
  border-radius: 50%;
  color: #ffffff;
  background: var(--poi-color, #0b8f4d);
  box-shadow: 0 7px 16px rgba(7, 30, 16, 0.26);
  font-size: 1.1rem;
  position: relative;
}

.google-poi-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 14px;
  height: 14px;
  background: var(--poi-color, #0b8f4d);
  border-right: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
  transform: translateX(-50%) rotate(45deg);
  z-index: -1;
}

.google-poi-marker.image {
  overflow: hidden;
  padding: 0;
  background: #ffffff;
}

.google-poi-marker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gm-style .gm-style-iw-c {
  background: rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px !important;
  box-shadow: var(--shadow) !important;
}

.gm-style .gm-style-iw-d {
  background: transparent !important;
}

.gm-style .gm-style-iw-tc::after {
  background: rgba(255, 255, 255, 0.4) !important;
}

.marker,
.checkpoint {
  position: absolute;
  transform: translate(-50%, -50%);
}

.checkpoint,
.marker,
.marker small {
  display: none;
}

.map-legend {
  position: absolute;
  left: 18px;
  bottom: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid rgba(220, 229, 225, 0.95);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  z-index: 2;
  box-shadow: 0 14px 26px rgba(16, 24, 40, 0.12);
  font-size: 0.84rem;
  font-weight: 700;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #21302b;
  background: #f8fbfa;
}

.map-drilldown-control {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  padding: 10px 14px;
  color: var(--brand-deep);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.legend-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 0.62rem;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.legend-dot.info {
  background: var(--info);
}

.legend-item-info {
  border: 1px solid rgba(22, 155, 87, 0.2);
}

.legend-dot.warning {
  background: var(--warning);
}

.legend-item-warning {
  border: 1px solid rgba(213, 139, 0, 0.2);
}

.legend-dot.critical {
  background: var(--critical);
}

.legend-item-critical {
  border: 1px solid rgba(220, 63, 69, 0.2);
}

.side-stack,
.lower-grid {
  display: grid;
  gap: 18px;
}

.lower-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.95fr);
}

.list-stack {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.updates-group-picker {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  max-width: 280px;
  font-size: 0.78rem;
  font-weight: 700;
}

.updates-group-picker select {
  min-height: 42px;
}

.list-item {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.list-item h3,
.details-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.list-item p,
.details-card p,
.details-empty,
.feedback {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.status-row,
.meta-row,
.actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.pill.info {
  color: var(--info);
  background: rgba(21, 153, 71, 0.1);
}

.pill.warning {
  color: var(--warning);
  background: rgba(213, 139, 0, 0.12);
}

.pill.critical {
  color: var(--critical);
  background: rgba(220, 63, 69, 0.12);
}

.details-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.details-card {
  min-width: 0;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.details-side-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.profile-form-card {
  grid-column: 1 / -1;
}

.profile-form {
  margin-top: 12px;
}

.profile-form label {
  font-weight: 800;
}

.details-panel,
.checkin-panel {
  grid-column: 1 / -1;
}

.details-active-checkpoint-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.details-active-checkpoint-form label {
  display: grid;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--md-label);
}

.details-active-checkpoint-form select,
.details-active-checkpoint-form input {
  min-height: 48px;
  padding: 13px 14px;
  border: 1px solid var(--md-outline);
  border-radius: 4px;
  background: var(--md-field-bg);
}

.details-active-checkpoint-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.details-group-picker {
  display: grid;
  gap: 6px;
  justify-items: start;
  width: fit-content;
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--md-label);
}

.details-group-picker select {
  width: min(260px, calc(100vw - 64px));
  min-height: 42px;
}

.jemaah-card {
  grid-column: auto;
}

.details-escalation-card {
  grid-column: auto;
  max-height: min(640px, 72vh);
  overflow: hidden;
}

.details-escalation-list {
  max-height: calc(min(640px, 72vh) - 42px);
  overflow-y: auto;
  padding-right: 4px;
}

.profile-panel {
  scroll-margin-top: 120px;
}

.jemaah-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.jemaah-search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  margin: 0 0 12px;
}

.jemaah-search-label {
  grid-column: 1 / -1;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.jemaah-search-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.jemaah-search-input {
  flex: 1 1 auto;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.jemaah-search-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  color: var(--text);
  background: #fff;
}

.jemaah-search-meta {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  align-self: center;
}

.jemaah-list {
  display: grid;
  gap: 10px;
  min-height: 720px;
  max-height: 820px;
  overflow: auto;
  padding-right: 4px;
}

.jemaah-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.jemaah-row strong {
  display: block;
  margin-bottom: 4px;
}

.jemaah-row .pill {
  flex: 0 0 auto;
}

.jemaah-info-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  box-shadow: 0 14px 28px rgba(12, 47, 30, 0.08);
}

.jemaah-info-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.jemaah-avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 8px 18px rgba(12, 47, 30, 0.14);
  background: var(--surface-soft);
}

.jemaah-avatar-fallback {
  display: inline-grid;
  place-items: center;
  color: var(--brand-deep);
  font-weight: 900;
  border: 1px solid var(--line);
}

.popup-avatar {
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
}

.jemaah-picture-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  margin-top: -4px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #fff;
}

.jemaah-picture-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.jemaah-picture-preview-img {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 8px 18px rgba(12, 47, 30, 0.14);
}

.jemaah-info-title strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.jemaah-info-title p,
.jemaah-info-meta p {
  margin: 0;
}

.jemaah-info-title {
  display: grid;
  gap: 4px;
}

.jemaah-info-meta {
  display: grid;
  gap: 8px;
  color: var(--text-muted);
}

.jemaah-info-meta p {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.jemaah-info-meta i {
  color: var(--brand);
  margin-top: 2px;
  width: 14px;
  text-align: center;
}

.jemaah-reverse-address span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.jemaah-info-note {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.jemaah-info-note strong {
  color: var(--text);
}

.jemaah-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.jemaah-map-btn {
  min-width: 220px;
  justify-content: center;
  gap: 8px;
}

.jemaah-tag-btn {
  min-width: 170px;
  justify-content: center;
  gap: 8px;
}

.jemaah-manager-panel {
  scroll-margin-top: 16px;
}

.manager-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.4fr);
  gap: 18px;
  margin-top: 16px;
  align-items: start;
}

.manager-list-card,
.jemaah-form {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
}

.manager-list-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.manager-jemaah-list {
  display: grid;
  flex: 1 1 auto;
  gap: 10px;
  min-height: 0;
  max-height: none;
  margin-top: 14px;
  overflow-y: auto;
  padding-right: 4px;
}

.manager-search-bar {
  margin-top: 12px;
}

.import-tools {
  display: grid;
  gap: 10px;
  padding: 14px;
  margin-top: 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.import-tools-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.btn-linkish {
  text-decoration: none;
}

.manager-jemaah-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.manager-jemaah-row strong {
  display: block;
  margin-bottom: 4px;
}

.jemaah-latest-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.jemaah-latest-note span {
  color: var(--text);
  font-weight: 800;
}

.manager-row-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.manager-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.jemaah-form {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}

.jemaah-form .wide,
.jemaah-form .form-title-row,
.jemaah-form .form-actions {
  grid-column: 1 / -1;
}

.field-pair {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-pair label {
  min-width: 0;
}

.form-title-row,
.form-actions {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: center;
}

.incident-toggle {
  color: var(--brand-deep);
  font-weight: 700;
  min-height: 38px;
}

.form-help {
  margin: -2px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

.checkin-schedule-range {
  display: block;
  margin-top: -2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.45;
}

.ai-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.ai-form {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.general-alert-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.general-alert-form .wide,
.general-alert-form .form-actions,
.general-alert-form .feedback {
  grid-column: 1 / -1;
}

.ai-response {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  white-space: pre-wrap;
  line-height: 1.6;
}

.weather-panel {
  margin-top: 18px;
}

.weather-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.weather-card {
  padding: 16px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
  align-content: start;
}

.weather-card h4,
.weather-card p {
  margin: 0;
}

.weather-card-top {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.weather-card-head {
  display: grid;
  gap: 6px;
}

.weather-visual {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(11, 20, 48, 0.1);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 255, 0.9));
}

.weather-visual i {
  font-size: 2rem;
}

.weather-condition {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
}

.weather-sun i,
.weather-clear i {
  color: #f08c00;
}

.weather-fair i {
  color: #2f9e44;
}

.weather-cloud i {
  color: #5c7cfa;
}

.weather-rain i {
  color: #1971c2;
}

.weather-haze i {
  color: #7950f2;
}

.weather-raw {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.84rem;
  color: var(--muted);
  word-break: break-word;
}

.form-title-row h3 {
  margin: 0;
}

.admin-master-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
  align-items: start;
}

.admin-master-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.admin-master-tab {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.admin-master-tab:hover {
  border-color: var(--brand);
}

.admin-master-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.admin-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  align-items: stretch;
}

.admin-card h3 {
  margin: 0;
}

.admin-list {
  display: grid;
  flex: 1 1 auto;
  gap: 8px;
  min-height: 180px;
  max-height: min(42vh, 420px);
  overflow: auto;
}

.admin-list-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.admin-list-item.is-inactive {
  background: #f1f3f2;
  border-color: #d6dcda;
}

.admin-list-item.is-inactive strong,
.admin-list-item.is-inactive p {
  color: #68716e;
}

.admin-list-item p {
  margin: 3px 0 0;
  color: var(--muted);
}

.admin-list-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.stage-sort-control {
  display: inline-grid;
  grid-template-columns: 32px minmax(34px, auto) 32px;
  align-items: center;
  justify-items: center;
  gap: 4px;
  padding: 0 4px;
}

.stage-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  cursor: pointer;
}

.stage-sort-btn:hover:not(:disabled),
.stage-sort-btn:focus-visible:not(:disabled) {
  background: rgba(21, 153, 71, 0.1);
  border-color: rgba(21, 153, 71, 0.18);
  color: var(--brand-deep);
}

.stage-sort-btn:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.42;
}

.stage-sort-number {
  min-width: 28px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.admin-form {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  margin-top: auto;
}

.admin-form button,
.admin-form .inline,
.admin-form .form-actions,
.admin-form .wide {
  grid-column: 1 / -1;
}

.admin-inline-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-form > .btn,
.checkin-form > .btn,
.jemaah-form > .btn,
.form-actions .btn {
  justify-self: start;
  align-self: end;
  width: auto;
}

.login-panel .form-actions {
  justify-content: center;
}

.admin-form .schedule-row .btn-icon {
  grid-column: auto;
}

.schedule-editor {
  display: grid;
  gap: 8px;
  width: 100%;
}

.checkpoint-flow-editor h4,
.schedule-subtitle {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0;
}

.schedule-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}

.schedule-add-row .btn {
  min-width: 190px;
}

.schedule-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  width: 100%;
}

.checkpoint-edit-row {
  grid-template-columns: minmax(72px, 0.45fr) repeat(2, minmax(0, 1fr)) auto;
  align-items: center;
}

.stage-edit-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: center;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  border: none;
  box-shadow: none;
}

.btn-icon:hover {
  filter: brightness(1.05);
}

#adminGroupStageScheduleSelect,
#adminGroupCheckpointScheduleSelect,
#adminGroupScheduleGroupSelect {
  width: 100%;
}

.schedule-empty {
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
}

.checkpoint-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 18px 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  overflow-x: auto;
}

.checkpoint-flow-step {
  display: grid;
  grid-template-columns: 34px minmax(110px, 1fr) 42px;
  grid-template-rows: 34px auto;
  align-items: center;
  min-width: 178px;
}

.checkpoint-flow-node {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #153568;
  border-radius: 999px;
  background: #eaf2ff;
  color: #153568;
  font-size: 11px;
  font-weight: 900;
  box-shadow: inset 0 0 0 5px #6e96d8;
}

.checkpoint-flow-step.is-passed .checkpoint-flow-node {
  border-color: #0f7a3a;
  background: #e8f9ef;
  color: #0f7a3a;
  box-shadow: inset 0 0 0 5px #60c982;
}

.checkpoint-flow-label {
  grid-column: 1 / span 2;
  grid-row: 2;
  padding-top: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.checkpoint-flow-label span,
.checkpoint-flow-label small {
  display: block;
}

.checkpoint-flow-label small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.checkpoint-flow-arrow {
  grid-column: 2 / span 2;
  grid-row: 1;
  position: relative;
  height: 2px;
  min-width: 72px;
  background: #3268d8;
}

.checkpoint-flow-step.is-passed .checkpoint-flow-arrow {
  background: #16a34a;
}

.checkpoint-flow-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #3268d8;
  transform: translateY(-50%);
}

.checkpoint-flow-step.is-passed .checkpoint-flow-arrow::after {
  border-left-color: #16a34a;
}

.details-checkpoint-flow {
  margin-bottom: 16px;
}

.details-checkpoint-flow .checkpoint-flow {
  padding: 12px;
}

.details-checkpoint-flow .checkpoint-flow-step {
  min-width: 168px;
}

.admin-toggle-list {
  display: grid;
  gap: 10px;
}

#adminPortalSettingsToggles {
  grid-column: 1 / -1;
  width: 100%;
}

.admin-toggle-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.portal-setting-row {
  display: grid;
  gap: 8px;
  width: 100%;
}

.portal-setting-row input[data-setting-title] {
  width: 100%;
}

#adminPortalSettingsToggles .admin-toggle-item {
  width: 100%;
}

.timeline-entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.timeline-entry:last-child {
  border-bottom: 0;
}

.btn-mini {
  min-width: 0;
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.76rem;
}

.feedback {
  min-height: 24px;
}

@media (max-width: 980px) {
  .sidebar {
    width: min(82vw, 360px);
    min-width: min(82vw, 360px);
  }

  .sidebar-collapsed .sidebar {
    width: 42px;
    min-width: 42px;
  }

  .main-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .topbar {
    align-items: stretch;
  }

  .operations-map,
  .map-layer {
    height: 340px;
    min-height: 340px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: 100%;
    padding: 0 0 24px;
  }

  .hero {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 16px;
  }

  .hero-copy {
    display: none;
  }

  .brand-mark {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    font-size: 1.55rem;
  }

  .brand-logo {
    width: min(118px, 44vw);
    margin-bottom: 5px;
  }

  .hero h1 {
    font-size: 1.2rem;
    letter-spacing: -0.03em;
  }

  .hero-badge {
    min-width: 88px;
    padding: 10px;
    border-radius: 14px;
  }

  .hero-badge strong {
    font-size: 0.9rem;
  }

  .hero-badge small {
    font-size: 0.68rem;
  }

  .hero-weather-summary {
    font-size: 0.68rem;
    max-width: 120px;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "badge"
      "nav";
  }

  .app-nav {
    width: 100%;
    margin: 0;
    grid-template-columns: 52px repeat(4, minmax(0, 1fr));
    border-radius: 16px;
  }

  .nav-sidebar-toggle {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .nav-item {
    min-height: 62px;
    font-size: 0.72rem;
  }

  .app-body {
    margin-top: 12px;
  }

  .sidebar {
    left: 10px;
    top: 10px;
    width: calc(100vw - 20px);
    min-width: auto;
    max-height: calc(100vh - 20px);
    overflow: auto;
    border-radius: 18px;
  }

  .sidebar-collapsed .sidebar {
    left: 22px;
    top: 96px;
    width: 42px;
    min-width: 42px;
    overflow: visible;
  }

  .sidebar-head {
    padding: 6px 4px 12px;
  }

  .sidebar-menu {
    grid-template-columns: 1fr;
  }

  .sidebar-link {
    min-height: 48px;
  }

  .layout,
  .dashboard {
    gap: 12px;
  }

  .panel {
    margin: 0 12px;
    padding: 18px;
    border-radius: 18px;
  }

  .topbar {
    min-height: 174px;
    padding: 26px;
  }

  .topbar h2 {
    font-size: 1.65rem;
  }

  .topbar-actions {
    align-self: end;
  }

  .kpis {
    margin: 0 12px;
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 108px;
  }

  .checkin-form {
    grid-template-columns: 1fr;
  }

  .general-alert-form {
    grid-template-columns: 1fr;
  }

  .filters label {
    min-width: calc(50% - 6px);
  }

  .map-jemaah-search {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .jemaah-card,
  .details-escalation-card {
    grid-column: auto;
  }

  .jemaah-list {
    min-height: 420px;
    max-height: 560px;
  }

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

  .details-group-picker {
    min-width: 0;
    width: 100%;
  }

  .jemaah-row {
    display: grid;
  }

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

  .jemaah-map-btn,
  .jemaah-tag-btn {
    width: 100%;
    min-width: 0;
  }

  .manager-layout,
  .jemaah-form,
  .admin-master-grid,
  .admin-form {
    grid-template-columns: 1fr;
  }

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

  .checkpoint-edit-row {
    grid-template-columns: 1fr;
    align-items: center;
  }

  .checkpoint-edit-row .btn-icon {
    align-self: center;
    justify-self: end;
  }

  .manager-row-top,
  .form-title-row,
  .form-actions {
    display: grid;
  }
}
