:root {
  --bg: #f1f7eb;
  --panel: #fcfff9;
  --panel-soft: #f5fbef;
  --sidebar: #e1efd4;
  --text: #26301d;
  --muted: #6c7b5e;
  --green: #669439;
  --green-soft: #d8eac7;
  --green-pale: #edf7e4;
  --red: #d90d21;
  --red-soft: #ffe6e7;
  --red-pale: #fff5f4;
  --blue: #5c6d86;
  --blue-soft: #edf3f8;
  --border: #d9e7cb;
  --shadow: 0 12px 36px rgba(48, 74, 22, .11);
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input { font: inherit; }

button {
  border: 0;
  cursor: pointer;
  background: transparent;
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 18px 24px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid rgba(89, 122, 56, .16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  overflow: hidden;
  border: 1px solid rgba(48, 78, 19, .22);
  border-radius: 13px;
  background: #304a16;
  box-shadow: 0 8px 18px rgba(48, 78, 19, .15);
}

.sidebar-brand-mark img,
.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.sidebar-brand-copy {
  min-width: 0;
}

.brand strong {
  display: block;
  font-size: 15px;
  color: #3c5b1d;
  letter-spacing: .08em;
  line-height: 1;
}

.brand span {
  display: block;
  margin-top: 5px;
  font-size: 6px;
  color: #829470;
  line-height: 1.25;
  letter-spacing: .02em;
}

.side-nav { margin-top: 38px; }

.nav-btn,
.side-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  color: #6b795d;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}

.nav-btn {
  padding: 12px 13px;
  font-size: 11px;
  font-weight: 700;
}

.nav-btn:hover,
.nav-btn.active {
  background: #fafff5;
  color: #496b27;
  box-shadow: 0 8px 18px rgba(48, 74, 22, .07);
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  font-size: 14px;
}

.side-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.side-link {
  padding: 4px 0;
  font-size: 11px;
}

.side-link:hover { color: var(--green); transform: translateX(2px); }

.main-content {
  padding: 28px 32px 28px 22px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.search-box {
  width: min(322px, 50vw);
  height: 33px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border-radius: 999px;
  background: #e3eed9;
  color: #7a8c69;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
  color: var(--text);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-btn {
  position: relative;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 14px;
  transition: background .18s ease, transform .18s ease;
}

.icon-btn:hover { background: #e2eed6; transform: translateY(-1px); }
.icon-btn.has-dot::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 2px var(--bg);
}

.profile {
  padding-left: 8px;
  text-align: right;
  line-height: 1.1;
}
.profile strong { display: block; font-size: 10px; }
.profile span { font-size: 8px; color: #9aaaa2; }

.page { display: none; }
.page.active { display: block; animation: fadeIn .22s ease both; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 9px;
  border-radius: 5px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .04em;
}

.pill.green { color: #3b5a1c; background: #c2dfa6; }
.pill.red { color: #a60717; background: #ffe1e4; }
.pill.blue { color: #31536f; background: #e8f2ff; }
.pill.purple { color: #5e45a7; background: #eee9ff; }

h1 {
  margin: 9px 0 5px;
  font-size: 35px;
  line-height: 1;
  letter-spacing: -.04em;
}

.hero-row p,
.simple-page p {
  max-width: 410px;
  margin: 0;
  color: #57645e;
  font-size: 14px;
  line-height: 1.38;
}

.dashboard-tools {
  padding-top: 52px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.date-filter,
.history-filter { position: relative; }
.date-btn {
  min-width: 104px;
  height: 30px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 999px;
  background: #dbe8cf;
  color: #2f3d21;
  font-size: 11px;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease;
}
.date-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 14px rgba(11, 67, 36, .08); }
.history-btn {
  background: #3b5a1c;
  color: #fafff6;
}
.date-menu {
  position: absolute;
  z-index: 15;
  right: 0;
  top: 38px;
  width: 160px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow);
}
.date-menu button {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #52625b;
}
.date-menu button:hover { background: var(--green-pale); color: var(--green); }
.history-menu {
  position: absolute;
  z-index: 22;
  right: 0;
  top: 38px;
  width: min(430px, calc(100vw - 30px));
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 22px 54px rgba(48, 74, 22, .18);
}
.history-menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 2px 12px;
  border-bottom: 1px solid var(--border);
}
.history-menu-head span {
  display: block;
  color: var(--green);
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .08em;
}
.history-menu-head strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}
.history-menu-head > button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-pale);
  color: var(--green);
  font-size: 18px;
}
.history-list {
  max-height: 350px;
  overflow-y: auto;
}
.history-item {
  width: 100%;
  padding: 13px 3px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.history-item:hover { background: #fafff6; }
.history-status {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: #71a53f;
  box-shadow: 0 0 0 4px rgba(113, 165, 63, .1);
}
.history-status.warning {
  background: #d90d21;
  box-shadow: 0 0 0 4px rgba(217, 13, 33, .09);
}
.history-item-copy { min-width: 0; }
.history-item-copy strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-item-copy > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}
.history-metrics {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.history-metrics span {
  padding: 4px 6px;
  border-radius: 999px;
  background: var(--green-pale);
  color: #50653c;
  font-size: 7px;
  font-weight: 850;
}
.history-duration {
  color: var(--green);
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}
.history-view-all {
  width: 100%;
  padding: 12px 10px 1px;
  color: var(--green);
  font-size: 9px;
  font-weight: 950;
}
.history-view-all:hover { text-decoration: underline; }

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

.dashboard-sensor-state {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 64px;
  margin-bottom: 17px;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  border: 1px solid #c8dbb5;
  border-radius: 13px;
  background: #e8f3de;
}
.sensor-state-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9ca891;
  box-shadow: 0 0 0 4px rgba(108, 123, 94, .1);
}
.dashboard-sensor-copy {
  min-width: 0;
  overflow: hidden;
}
.dashboard-sensor-copy strong {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  white-space: normal;
}
.dashboard-sensor-copy p {
  display: block;
  margin-top: 3px;
  margin-bottom: 0;
  max-width: none;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  overflow-wrap: break-word;
}
.dashboard-sensor-state button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  background: var(--green);
  color: white;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}
.dashboard-sensor-state.ready {
  border-color: #b1d092;
  background: #edf7e4;
}
.dashboard-sensor-state.ready .sensor-state-dot {
  background: #71a53f;
  box-shadow: 0 0 0 4px rgba(113, 165, 63, .14);
}
.dashboard-sensor-state.ready button { display: none; }
body[data-drone-data="waiting"] .stat-card .bars { opacity: .24; }

.stat-card,
.panel,
.mini-card,
.chart-card,
.list-panel {
  background: var(--panel);
  border: 1px solid rgba(221, 232, 226, .9);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(20, 47, 32, .02);
}

.stat-card {
  height: 126px;
  padding: 22px 20px 17px;
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.stat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.stat-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 800;
}
.danger .stat-icon,
.critical .stat-icon { color: var(--red); background: var(--red-soft); }
.success .stat-icon { color: var(--green); background: var(--green-soft); }
.neutral .stat-icon { color: var(--blue); background: var(--blue-soft); }

.stat-label {
  display: block;
  margin-top: 1px;
  font-size: 8px;
  font-weight: 900;
  color: var(--red);
  text-align: right;
}
.success .stat-label { color: var(--green); }
.neutral .stat-label { color: #6c7390; }

.stat-value {
  position: absolute;
  top: 36px;
  right: 20px;
  font-size: 22px;
  letter-spacing: -.04em;
}
.stat-title {
  display: block;
  margin-top: 27px;
  font-size: 11px;
  font-weight: 800;
  color: #43524c;
}

.bars {
  position: absolute;
  left: 20px;
  right: 16px;
  bottom: 14px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 6px;
  height: 25px;
}
.bars i { display: block; border-radius: 1px; opacity: .85; }
.bars i:nth-child(1) { height: 13px; }
.bars i:nth-child(2) { height: 18px; }
.bars i:nth-child(3) { height: 16px; }
.bars i:nth-child(4) { height: 21px; }
.bars i:nth-child(5) { height: 14px; }
.bars i:nth-child(6) { height: 25px; }
.danger-bars i,
.critical-bars i { background: #ffd1cf; }
.danger-bars .strong,
.critical-bars .strong { background: var(--red); opacity: 1; }
.success-bars i { background: #c6dfae; }
.success-bars .strong { background: var(--green); opacity: 1; }
.neutral-bars i { background: #e8eef4; }
.neutral-bars .strong { background: #59677d; opacity: 1; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 16px;
  align-items: start;
}

.panel { padding: 22px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.panel h2,
.panel h3 { margin: 0; }
.panel h2 { font-size: 18px; letter-spacing: -.02em; }
.panel h3 { font-size: 12px; }

.legend {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 8px;
  font-weight: 800;
  color: #65726d;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  background: #f2f7f4;
  border-radius: 999px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.green-dot { background: #71a53f; }
.red-dot { background: var(--red); }

.map-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #dfe6de;
  aspect-ratio: 1.51 / 1;
}
.map-waiting-state {
  min-height: 360px;
  aspect-ratio: 1.51 / 1;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 28px;
  border: 1px dashed #adc892;
  border-radius: 14px;
  background:
    linear-gradient(rgba(252, 255, 249, .84), rgba(252, 255, 249, .84)),
    repeating-linear-gradient(45deg, #d8eac7 0, #d8eac7 1px, transparent 1px, transparent 16px);
  text-align: center;
}
.camera-waiting-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 13px;
  border-radius: 16px;
  background: #d8eac7;
  color: var(--green);
  font-size: 24px;
}
.map-waiting-state strong { font-size: 14px; }
.map-waiting-state p {
  max-width: 390px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.map-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.marker {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, .9);
  animation: pulse 1.8s ease infinite;
}
.marker.pest { background: #71a53f; }
.marker.disease { background: var(--red); }
.marker:hover { transform: translate(-50%, -50%) scale(1.35); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); }
  65% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.right-column { display: grid; gap: 16px; }
.dashboard-side-waiting {
  min-height: 220px;
  display: grid;
  align-content: center;
}
.dashboard-side-waiting > span {
  color: var(--green);
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .07em;
}
.dashboard-side-waiting > strong {
  margin-top: 7px;
  font-size: 13px;
}
.dashboard-side-waiting p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}
.health-card {
  min-height: 143px;
  padding: 22px 20px 18px;
  border-radius: 14px;
  background: #3b5a1c;
  color: white;
  box-shadow: 0 15px 26px rgba(48, 74, 22, .2);
  transition: transform .18s ease, box-shadow .18s ease;
}
.health-card:hover { transform: translateY(-2px); box-shadow: 0 18px 32px rgba(48, 74, 22, .25); }
.leaf-icon {
  display: block;
  font-size: 24px;
  transform: rotate(-26deg);
  opacity: .92;
}
.health-card h3 { margin: 15px 0 6px; font-size: 15px; }
.health-card p { margin: 0; font-size: 10px; line-height: 1.45; color: rgba(255,255,255,.78); }
.progress {
  position: relative;
  width: calc(100% - 35px);
  height: 4px;
  margin-top: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,.35);
}
.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: white;
}
.health-card > strong {
  float: right;
  margin-top: -8px;
  font-size: 10px;
}

.alerts-panel { padding: 18px 18px 14px; }
.alerts-panel h3 { margin-bottom: 13px; }
.alert-item {
  width: 100%;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 8px 0;
  text-align: left;
  border-radius: 8px;
}
.alert-item:hover { background: #f8fbf9; }
.alert-item span { display: grid; gap: 2px; }
.alert-item strong { font-size: 10px; line-height: 1.2; }
.alert-item small { font-size: 8px; color: #8b9993; }
.view-all {
  width: 100%;
  margin-top: 10px;
  padding: 14px 0 3px;
  border-top: 1px solid var(--border);
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
}
.view-all:hover { text-decoration: underline; }

.simple-page {
  max-width: 920px;
  padding: 10px 0;
}
.simple-page h1 { margin-bottom: 10px; }
.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.mini-card {
  min-height: 120px;
  padding: 24px;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease;
}
.mini-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.mini-card strong { display: block; margin-bottom: 8px; font-size: 28px; letter-spacing: -.04em; }
.mini-card span { color: var(--muted); font-size: 13px; font-weight: 700; }
.list-panel { max-width: 520px; margin-top: 24px; padding: 18px 22px; }
.coffee-threat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}
.threat-panel {
  min-width: 0;
  padding: 20px 22px;
  border: 1px solid rgba(221, 232, 226, .9);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(20, 47, 32, .02);
}
.threat-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}
.threat-panel-head h2 {
  margin: 5px 0 0;
  font-size: 17px;
  letter-spacing: -.02em;
}
.threat-kicker {
  color: var(--green);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .08em;
}
.disease-list .threat-kicker { color: var(--red); }
.threat-count {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--green-pale);
  color: var(--green);
  font-size: 8px;
  font-weight: 900;
}
.disease-list .threat-count {
  background: var(--red-pale);
  color: var(--red);
}
.threat-panel .alert-item {
  padding: 12px 9px;
  transition: background .18s ease, transform .18s ease;
}
.threat-panel .alert-item:hover {
  background: var(--green-pale);
  transform: translateX(2px);
}
.disease-list .alert-item:hover { background: var(--red-pale); }
.threat-panel .alert-item strong { font-size: 11px; }
.threat-panel .alert-item small {
  margin-top: 2px;
  font-size: 8px;
  line-height: 1.35;
}
.chart-card { margin-top: 24px; padding: 26px; max-width: 640px; }
.large-bars { display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 18px; height: 240px; }
.large-bars i { display: block; border-radius: 8px 8px 0 0; background: #c6dfae; }
.large-bars i:nth-child(1) { height: 38%; }
.large-bars i:nth-child(2) { height: 54%; }
.large-bars i:nth-child(3) { height: 45%; }
.large-bars i:nth-child(4) { height: 72%; }
.large-bars i:nth-child(5) { height: 63%; }
.large-bars i:nth-child(6) { height: 81%; }
.large-bars i:nth-child(7) { height: 92%; background: var(--green); }

.land-page { max-width: 1080px; }
.land-waiting-state {
  margin-top: 24px;
  padding: 46px 24px;
  border: 1px dashed #adc892;
  border-radius: 18px;
  background: linear-gradient(135deg, #fafff6, #e4f1d7);
  text-align: center;
}
.gps-waiting-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 15px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #d8eac7;
  color: var(--green);
  font-size: 28px;
}
.land-waiting-kicker {
  color: var(--green);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .09em;
}
.land-waiting-state h2,
.land-track-card h2 {
  margin: 7px 0;
  font-size: 20px;
  letter-spacing: -.025em;
}
.land-waiting-state p {
  max-width: 470px;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.land-waiting-state .drone-primary-btn { padding: 0 18px; }
.land-gps-strip {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, 1fr);
  gap: 1px;
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--border);
}
.land-gps-strip > div {
  min-width: 0;
  padding: 15px 16px;
  background: var(--panel);
}
.land-gps-strip > div:first-child {
  position: relative;
  padding-left: 35px;
}
.land-gps-strip span,
.land-sync-head span,
.land-coordinate-box span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .05em;
}
.land-gps-strip strong,
.land-sync-head strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gps-live-dot {
  position: absolute;
  left: 16px;
  top: 18px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #71a53f;
  box-shadow: 0 0 0 4px rgba(113, 165, 63, .14);
  animation: pulse 1.8s ease infinite;
}
.land-sync-head {
  margin-top: 16px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}
.land-sync-head button { padding: 0 17px; }
.land-track-card {
  margin-top: 16px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
}
.land-track-card p {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.land-coordinate-box {
  flex: 0 0 auto;
  min-width: 210px;
  padding: 15px;
  border-radius: 12px;
  background: #29351e;
  color: #e3f1d5;
}
.land-coordinate-box strong {
  display: block;
  margin-top: 7px;
  font-size: 13px;
}

.drone-page { max-width: 1080px; }
.drone-status-strip {
  display: grid;
  grid-template-columns: 1.35fr repeat(4, 1fr);
  gap: 1px;
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--border);
}
.drone-status-strip > div {
  min-width: 0;
  padding: 15px 16px;
  background: var(--panel);
}
.drone-status-strip span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.drone-status-strip strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drone-status-strip > div:first-child {
  position: relative;
  padding-left: 34px;
}
.drone-status-dot {
  position: absolute;
  left: 16px;
  top: 18px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9ca891;
  box-shadow: 0 0 0 4px rgba(108, 123, 94, .1);
}
.drone-status-dot.online {
  background: #71a53f;
  box-shadow: 0 0 0 4px rgba(113, 165, 63, .14);
}
.drone-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 16px;
  margin-top: 16px;
}
.drone-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(48, 74, 22, .02);
}
.drone-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.drone-card-head h2 {
  margin: 5px 0 0;
  font-size: 18px;
  letter-spacing: -.025em;
}
.drone-card-kicker {
  color: var(--green);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .08em;
}
.simulation-badge,
.admin-control-badge,
.flight-state {
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--green-pale);
  color: var(--green);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .04em;
}
.connection-card { grid-row: span 2; }
.drone-field {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}
.drone-field > span {
  color: #50653c;
  font-size: 10px;
  font-weight: 900;
}
.drone-field input,
.drone-field select {
  width: 100%;
  min-height: 43px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: 0;
  background: #fafff6;
  color: var(--text);
  font: inherit;
  font-size: 12px;
}
.drone-field input:focus,
.drone-field select:focus {
  border-color: #8ab95c;
  box-shadow: 0 0 0 4px rgba(73, 107, 39, .1);
}
.drone-button-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}
.drone-primary-btn,
.drone-secondary-btn,
.flight-actions button,
.altitude-actions button {
  min-height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 900;
}
.drone-primary-btn {
  background: var(--green);
  color: white;
}
.drone-secondary-btn,
.flight-actions button,
.altitude-actions button {
  background: var(--green-pale);
  color: var(--green);
}
.drone-primary-btn:hover,
.drone-secondary-btn:hover,
.flight-actions button:hover,
.altitude-actions button:hover { transform: translateY(-1px); }
.connection-note {
  margin: 16px 0 0 !important;
  padding: 12px;
  border-radius: 11px;
  background: #f3faed;
  color: var(--muted) !important;
  font-size: 10px !important;
  line-height: 1.45 !important;
}
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.telemetry-grid > div {
  padding: 13px;
  border-radius: 11px;
  background: var(--panel-soft);
}
.telemetry-grid span,
.drone-command-log > span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.telemetry-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 13px;
}
.drone-command-log { margin-top: 15px; }
#droneCommandLog {
  height: 92px;
  margin-top: 8px;
  padding: 10px 12px;
  overflow-y: auto;
  border-radius: 11px;
  background: #29351e;
  color: #e3f1d5;
}
#droneCommandLog p {
  margin: 0 0 6px;
  font-size: 9px;
  line-height: 1.35;
}
#droneCommandLog time { color: #aed686; font-weight: 900; }
.flight-actions,
.altitude-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.altitude-actions {
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
}
.direction-pad {
  width: 190px;
  margin: 18px auto;
  display: grid;
  grid-template-columns: repeat(3, 58px);
  grid-template-rows: repeat(3, 45px);
  gap: 7px;
  justify-content: center;
}
.direction-pad button {
  border-radius: 11px;
  background: #d8eac7;
  color: #3b5a1c;
  font-size: 18px;
  font-weight: 950;
}
.direction-pad button:hover { background: #c6dfae; }
.direction-pad .up { grid-column: 2; }
.direction-pad .left { grid-column: 1; grid-row: 2; }
.direction-pad .center { grid-column: 2; grid-row: 2; font-size: 8px; }
.direction-pad .right { grid-column: 3; grid-row: 2; }
.direction-pad .down { grid-column: 2; grid-row: 3; }
.emergency-btn {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  border-radius: 11px;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 950;
}

.mobile-nav { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 24, 15, .36);
  backdrop-filter: blur(4px);
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(430px, 100%);
  padding: 25px;
  border-radius: 20px;
  background: white;
  box-shadow: 0 24px 60px rgba(0, 30, 12, .22);
  position: relative;
  animation: modalIn .2s ease both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f2f6f4;
  font-size: 21px;
}
.modal-card h2 { margin: 0 34px 8px 0; font-size: 24px; letter-spacing: -.03em; }
.modal-card p { margin: 0 0 18px; line-height: 1.5; color: #5c6863; font-size: 14px; }
.modal-extra {
  margin: 10px 0 18px;
  display: grid;
  gap: 8px;
}
.modal-extra button,
.modal-extra label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7fbf8;
  color: #43524c;
  font-size: 13px;
  font-weight: 700;
}
.primary-btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--green);
  color: white;
  font-weight: 900;
}
.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(30px);
  padding: 12px 16px;
  border-radius: 999px;
  background: #173424;
  color: white;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 860px) {
  body { background: #f1f7eb; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content {
    padding: 13px 15px 96px;
    min-height: 100vh;
  }
  .topbar {
    margin-bottom: 16px;
    gap: 8px;
  }
  .search-box {
    width: 151px;
    height: 34px;
    padding: 0 8px;
    background: transparent;
  }
  .search-box input { font-size: 10px; }
  .top-actions { gap: 8px; }
  .profile { display: none; }
  .icon-btn { width: 32px; height: 32px; }
  .hero-row {
    display: block;
    margin-bottom: 24px;
  }
  .pill { padding: 6px 9px; }
  h1 { font-size: 27px; margin-top: 12px; }
  .hero-row p,
  .simple-page p { max-width: 185px; font-size: 12px; line-height: 1.35; }
  .dashboard-tools {
    padding-top: 10px;
    justify-content: flex-start;
  }
  .date-btn { height: 31px; min-width: 96px; font-size: 10px; margin-top: 0; }
  .date-menu { left: auto; right: 0; top: 38px; }
  .history-menu {
    position: fixed;
    left: 15px;
    right: 15px;
    top: 92px;
    width: auto;
    max-height: calc(100vh - 180px);
  }
  .history-list { max-height: calc(100vh - 285px); }
  .dashboard-sensor-state {
    grid-template-columns: auto 1fr;
    align-items: start;
  }
  .dashboard-sensor-state button {
    grid-column: 1 / -1;
    width: 100%;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 25px;
  }
  .stat-card {
    height: 142px;
    padding: 24px 22px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(15, 48, 29, .04);
  }
  .stat-icon { width: 28px; height: 28px; }
  .stat-label { font-size: 7px; }
  .stat-value { top: 43px; right: 22px; font-size: 20px; }
  .stat-title { margin-top: 33px; font-size: 10px; }
  .bars { left: 22px; right: 22px; bottom: 19px; height: 20px; gap: 4px; }
  .dashboard-grid { display: block; }
  .panel { padding: 18px 16px; border-radius: 8px; }
  .panel-head { margin-bottom: 27px; }
  .panel h2 { font-size: 17px; }
  .legend { gap: 6px; font-size: 7px; }
  .legend span { padding: 4px 7px; }
  .map-wrap { aspect-ratio: 1 / 1.05; border-radius: 13px; }
  .map-waiting-state { min-height: 315px; aspect-ratio: 1 / 1.05; }
  .right-column { margin-top: 15px; gap: 0; }
  .health-card { display: none; }
  .alerts-panel { margin-top: 0; padding: 20px 16px 17px; }
  .alerts-panel h3 { font-size: 11px; margin-bottom: 13px; }
  .alert-item { grid-template-columns: 8px 1fr; gap: 10px; padding: 8px 0; }
  .alert-item strong { font-size: 9px; }
  .alert-item small { font-size: 7px; }
  .view-all { margin-top: 13px; padding-top: 14px; font-size: 9px; }
  .simple-page { padding-top: 42px; }
  .simple-page p { max-width: 285px; }
  .mini-grid { grid-template-columns: 1fr; gap: 14px; }
  .list-panel { padding: 16px; }
  .coffee-threat-grid { grid-template-columns: 1fr; gap: 14px; }
  .threat-panel { padding: 18px 16px; }
  .threat-panel .alert-item strong { font-size: 10px; }
  .threat-panel .alert-item small { font-size: 8px; }
  .large-bars { height: 190px; gap: 9px; }
  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    height: 66px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    border-top: 1px solid #d9e7cb;
    background: #fcfff9;
    box-shadow: 0 -10px 25px rgba(48, 74, 22, .07);
  }
  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 7px;
    font-weight: 800;
    color: #91a1aa;
  }
  .mobile-nav-btn span { font-size: 16px; line-height: 1; }
  .mobile-nav-btn.active { color: var(--green); }
  .drone-status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drone-status-strip > div:first-child { grid-column: 1 / -1; }
  .drone-layout { grid-template-columns: 1fr; }
  .connection-card { grid-row: auto; }
  .drone-card { padding: 18px 16px; }
  .drone-button-row { grid-template-columns: 1fr; }
  .direction-pad { width: 100%; }
  .land-gps-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .land-gps-strip > div:first-child { grid-column: 1 / -1; }
  .land-sync-head { grid-template-columns: 1fr; gap: 12px; }
  .land-track-card { display: grid; }
  .land-coordinate-box { min-width: 0; width: 100%; }
  .toast { bottom: 82px; max-width: calc(100vw - 28px); text-align: center; }
}

@media (min-width: 861px) and (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .right-column { grid-template-columns: 1fr 1fr; }
  .dashboard-sensor-state {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .dashboard-sensor-state button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* Auth, register, dan paket user */
.app-shell[hidden],
.mobile-nav[hidden],
.auth-screen[hidden] { display: none !important; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 17% 20%, rgba(144, 196, 93, .24), transparent 31%),
    radial-gradient(circle at 92% 80%, rgba(59, 90, 28, .14), transparent 30%),
    linear-gradient(120deg, #e3f1d5 0%, #f6fbf2 46%, #d8eac7 100%);
}

.auth-orb {
  position: absolute;
  border: 1px solid rgba(59, 90, 28, .14);
  border-radius: 50%;
  pointer-events: none;
}
.auth-orb-one { width: 224px; height: 224px; right: 11%; top: 8%; }
.auth-orb-two { width: 450px; height: 450px; right: -13%; bottom: -18%; }

.auth-card {
  width: min(536px, 100%);
  position: relative;
  z-index: 1;
  padding: 32px 38px 36px;
  border-radius: 28px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(199, 220, 179, .95);
  box-shadow: 0 28px 80px rgba(48, 74, 22, .17);
  backdrop-filter: blur(16px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  overflow: hidden;
  border: 1px solid rgba(48, 78, 19, .22);
  border-radius: 19px;
  background: #304a16;
  box-shadow: 0 15px 28px rgba(48, 78, 19, .18);
}

.auth-brand .brand-copy strong {
  display: block;
  color: #3c5b1d;
  font-size: 25px;
  line-height: 1;
  letter-spacing: .14em;
}

.auth-brand .brand-copy span {
  display: block;
  margin-top: 7px;
  color: #8a9993;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .01em;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  margin-bottom: 22px;
  border-radius: 16px;
  background: #e7f2dc;
}

.auth-tab {
  min-height: 38px;
  border-radius: 12px;
  color: #697871;
  font-size: 13px;
  font-weight: 900;
}
.auth-tab.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 8px 18px rgba(48, 74, 22, .09);
}

.auth-form { display: none; }
.auth-form.active { display: block; animation: fadeIn .22s ease both; }
.auth-form h1 { font-size: 40px; margin: 16px 0 10px; }
.auth-form p {
  margin: 0 0 24px;
  color: #65716c;
  font-size: 15px;
  line-height: 1.45;
}

.field-label {
  display: block;
  margin: 14px 0 8px;
  color: #43524c;
  font-size: 13px;
  font-weight: 900;
}

.auth-input {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid #d5e3c8;
  border-radius: 17px;
  outline: 0;
  background: #fafff6;
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
  transition: border .18s ease, box-shadow .18s ease, background .18s ease;
}
.auth-input:focus {
  border-color: #8ab95c;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(73, 107, 39, .12);
}
select.auth-input { appearance: none; }

.password-field { position: relative; }
.password-field .auth-input { padding-right: 62px; }
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 44px;
  height: 42px;
  transform: translateY(-50%);
  border-radius: 14px;
  background: #e7f2dc;
  color: #50653c;
  font-weight: 900;
}
.password-toggle:hover { background: #d8eac7; }

.auth-primary,
.auth-secondary {
  width: 100%;
  min-height: 60px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  font-size: 15px;
  font-weight: 950;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.auth-primary {
  margin-top: 18px;
  background: var(--green);
  color: #fff;
  box-shadow: 0 14px 28px rgba(48, 74, 22, .18);
}
.auth-primary:hover { transform: translateY(-1px); box-shadow: 0 18px 35px rgba(48, 74, 22, .23); }
.auth-secondary {
  margin-top: 14px;
  background: #e8f3de;
  color: var(--green);
}
.auth-secondary:hover { background: #d8eac7; }
.auth-privacy {
  margin: 18px 0 0 !important;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f3faed;
  font-size: 12px !important;
  font-weight: 750;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  color: #5b6963;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}
.check-row input { margin-top: 2px; accent-color: var(--green); }

.role-badge {
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: #d8eac7;
  color: var(--green);
  font-size: 10px;
  font-weight: 950;
  white-space: nowrap;
}
.role-badge:hover { background: #c6dfae; }
body[data-role="admin"] .user-only { display: none; }
body[data-role="user"] .admin-only { display: none !important; }
@media (max-width: 860px) {
  body[data-role="user"] .mobile-nav { grid-template-columns: repeat(5, 1fr); }
}
body[data-role="user"] .health-card { background: #47602f; }
body[data-role="user"] .health-card::after,
body[data-role="user"] .stat-card::after {
  content: "READ ONLY";
  position: absolute;
  right: 14px;
  bottom: 11px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .75);
  color: #52625b;
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .04em;
}
body[data-role="user"] .health-card::after {
  background: rgba(255,255,255,.18);
  color: rgba(255,255,255,.82);
}
body[data-role="user"][data-paid="false"] .main-content::before {
  content: "Akun user belum aktif. Pilih paket dan lakukan pembayaran untuk membuka data monitoring.";
  display: block;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #f4d79b;
  border-radius: 13px;
  background: #fff9eb;
  color: #805d08;
  font-size: 12px;
  font-weight: 850;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.price-card {
  min-height: 175px;
  padding: 22px;
  border: 1px solid rgba(221, 232, 226, .9);
  border-radius: 18px;
  background: #fff;
  text-align: left;
  box-shadow: 0 1px 0 rgba(20, 47, 32, .02);
  transition: transform .18s ease, box-shadow .18s ease, border .18s ease;
}
.price-card:hover {
  transform: translateY(-3px);
  border-color: #a0c978;
  box-shadow: var(--shadow);
}
.price-card span {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: #e7f2dc;
  color: var(--green);
  font-size: 10px;
  font-weight: 950;
}
.price-card strong {
  display: block;
  margin: 18px 0 10px;
  font-size: 25px;
  letter-spacing: -.04em;
}
.price-card small {
  color: #64726c;
  font-size: 12px;
  line-height: 1.45;
}
.price-card.featured {
  background: #3b5a1c;
  color: #fff;
}
.price-card.featured span { background: rgba(255,255,255,.17); color: #fff; }
.price-card.featured small { color: rgba(255,255,255,.78); }
.payment-summary {
  display: grid;
  gap: 3px;
  padding: 14px;
  border-radius: 14px;
  background: #e7f2dc;
}
.payment-summary strong { font-size: 15px; }
.payment-summary span { color: var(--green); font-weight: 950; }

@media (max-width: 860px) {
  .auth-screen { padding: 14px; place-items: start center; }
  .auth-card {
    width: 100%;
    margin-top: 12px;
    padding: 26px 22px 28px;
    border-radius: 24px;
  }
  .auth-brand { gap: 13px; margin-bottom: 23px; }
  .brand-mark { width: 52px; height: 52px; }
  .auth-form h1 { font-size: 32px; }
  .auth-form p { font-size: 13px; }
  .auth-input { min-height: 56px; border-radius: 15px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .pricing-grid { grid-template-columns: 1fr; }
  .role-badge { display: none; }
  body[data-role="user"] .stat-card::after { right: 12px; bottom: 9px; }
}
.health-card { position: relative; overflow: hidden; }

/* =========================================================
   SCARAB Professional UI — visual refresh
   Menjaga seluruh struktur dan hook JavaScript tetap utuh.
   ========================================================= */

:root {
  --bg: #f1f5ee;
  --panel: #ffffff;
  --panel-soft: #f6faf3;
  --sidebar: #1d2b0f;
  --text: #232a1d;
  --muted: #6c7464;
  --green: #669439;
  --green-soft: #d9eac9;
  --green-pale: #eef6e6;
  --red: #cf2940;
  --red-soft: #fde8eb;
  --red-pale: #fff5f6;
  --blue: #506c82;
  --blue-soft: #eaf1f5;
  --border: #e2e9dc;
  --border-strong: #cfd9c5;
  --shadow: 0 18px 50px rgba(40, 57, 23, .08);
  --shadow-hover: 0 22px 54px rgba(40, 57, 23, .13);
  --radius: 20px;
}

html {
  background: var(--bg);
  scrollbar-color: #aabc98 #e7eee1;
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 92% 5%, rgba(157, 189, 126, .11), transparent 26rem),
    var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid rgba(112, 155, 70, .26);
  outline-offset: 3px;
}

::selection {
  background: #c0d8a8;
  color: #1c290f;
}

.app-shell {
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  z-index: 20;
  padding: 28px 20px 22px;
  background:
    radial-gradient(circle at 15% 3%, rgba(255, 255, 255, .09), transparent 15rem),
    linear-gradient(180deg, #243513 0%, #18240d 100%);
  border-right: 0;
  color: #fff;
  box-shadow: 12px 0 35px rgba(24, 37, 11, .08);
}

.brand {
  gap: 13px;
  padding: 0 7px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.sidebar-brand-mark {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  border-color: rgba(255, 255, 255, .14);
  border-radius: 16px;
  background: #304a16;
  box-shadow: 0 12px 25px rgba(0, 0, 0, .2);
}

.brand strong {
  color: #fff;
  font-size: 17px;
  letter-spacing: .12em;
}

.brand span {
  margin-top: 6px;
  color: rgba(255, 255, 255, .52);
  font-size: 9px;
  letter-spacing: .03em;
}

.side-nav {
  margin-top: 25px;
  display: grid;
  gap: 7px;
}

.nav-btn,
.side-link {
  gap: 13px;
  border-radius: 13px;
  color: rgba(255, 255, 255, .62);
}

.nav-btn {
  min-height: 48px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .005em;
}

.nav-btn:hover,
.nav-btn.active {
  background: rgba(255, 255, 255, .11);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
  transform: translateX(2px);
}

.nav-btn.active::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: #bbe195;
  box-shadow: 0 0 0 5px rgba(187, 225, 149, .11);
}

.nav-icon {
  width: 24px;
  height: 24px;
  font-size: 17px;
  opacity: .9;
}

.side-footer {
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .09);
}

.side-link {
  min-height: 40px;
  padding: 0 13px;
  font-size: 12px;
}

.side-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .07);
  transform: none;
}

.side-link span {
  width: 22px;
  text-align: center;
  font-size: 16px;
}

.main-content {
  min-width: 0;
  padding: 0 38px 48px;
  overflow: visible;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 18;
  min-height: 76px;
  margin: 0 -38px 30px;
  padding: 0 38px;
  border-bottom: 1px solid rgba(214, 222, 206, .8);
  background: rgba(241, 245, 238, .86);
  backdrop-filter: blur(18px);
}

.search-box {
  width: clamp(210px, 24vw, 320px);
  flex: 0 1 320px;
  height: 44px;
  gap: 11px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: #fff;
  color: #808c74;
  box-shadow: 0 5px 18px rgba(40, 57, 23, .045);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.search-box:focus-within {
  border-color: #b9cda6;
  box-shadow: 0 0 0 4px rgba(76, 111, 41, .07);
}

.search-box > span {
  font-size: 17px;
}

.search-box input {
  font-size: 13px;
}

.top-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .75);
  font-size: 16px;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  background: #fff;
  transform: translateY(-1px);
}

.icon-btn.has-dot::after {
  top: 7px;
  right: 7px;
  box-shadow: 0 0 0 3px #fff;
}

.role-badge {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #cddfbb;
  background: #e5f2d8;
  font-size: 10px;
  letter-spacing: .04em;
}

.profile {
  min-width: 115px;
  padding-left: 8px;
  line-height: 1.25;
}

.profile strong {
  font-size: 12px;
}

.profile span {
  font-size: 10px;
  color: #838c7b;
}

.page {
  width: min(100%, 1460px);
  margin: 0 auto;
}

.page.active {
  animation: professionalFade .32s ease both;
}

@keyframes professionalFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-row {
  align-items: flex-end;
  margin-bottom: 26px;
}

.pill {
  min-height: 27px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 9px;
  letter-spacing: .1em;
}

.pill.green {
  color: #4b7026;
  background: #d8eac7;
}

h1 {
  margin: 13px 0 9px;
  font-size: clamp(36px, 4vw, 52px);
  line-height: .98;
  letter-spacing: -.055em;
}

.hero-row p,
.simple-page p {
  max-width: 620px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.dashboard-tools {
  padding-top: 0;
  gap: 10px;
}

.date-btn {
  min-width: 132px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: #3e4c31;
  font-size: 12px;
  box-shadow: 0 5px 16px rgba(40, 57, 23, .04);
}

.date-btn:hover {
  border-color: #b7cca3;
  box-shadow: 0 10px 24px rgba(40, 57, 23, .08);
}

.history-btn {
  border-color: #3f5d22;
  background: #3f5d22;
  color: #fff;
  box-shadow: 0 8px 22px rgba(48, 73, 23, .17);
}

.date-menu {
  top: 50px;
  width: 190px;
  padding: 8px;
  border-radius: 15px;
}

.date-menu button {
  padding: 12px;
  border-radius: 10px;
  font-size: 12px;
}

.history-menu {
  top: 50px;
  width: min(460px, calc(100vw - 40px));
  padding: 17px;
  border-radius: 20px;
  box-shadow: 0 28px 70px rgba(32, 48, 17, .2);
}

.history-menu-head {
  padding: 2px 2px 15px;
}

.history-menu-head span,
.dashboard-side-waiting > span {
  font-size: 9px;
}

.history-menu-head strong {
  margin-top: 5px;
  font-size: 16px;
}

.history-item {
  padding: 15px 5px;
}

.history-item-copy strong {
  font-size: 12px;
}

.history-item-copy > span,
.history-metrics span {
  font-size: 9px;
}

.history-duration {
  font-size: 10px;
}

.history-view-all {
  padding-top: 14px;
  font-size: 10px;
}

.dashboard-sensor-state {
  min-height: 76px;
  margin-bottom: 22px;
  padding: 15px 18px;
  gap: 15px;
  border-color: #cfdfbf;
  border-radius: 17px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .42), transparent),
    #e6f1db;
}

.sensor-state-dot {
  width: 11px;
  height: 11px;
  box-shadow: 0 0 0 6px rgba(108, 123, 94, .1);
}

.dashboard-sensor-copy strong {
  font-size: 14px;
}

.dashboard-sensor-copy p {
  margin-top: 4px;
  font-size: 12px;
}

.dashboard-sensor-state button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 11px;
  font-size: 11px;
  box-shadow: 0 8px 18px rgba(48, 74, 22, .13);
}

.stats-grid {
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card,
.panel,
.mini-card,
.chart-card,
.list-panel,
.threat-panel,
.drone-card,
.price-card {
  border-color: var(--border);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 4px 18px rgba(40, 57, 23, .035);
}

.stat-card {
  height: 174px;
  padding: 21px 21px 18px;
  border-radius: 18px;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: #718d55;
  opacity: .55;
}

.stat-card.danger::before,
.stat-card.critical::before {
  background: var(--red);
}

.stat-card.neutral::before {
  background: var(--blue);
}

.stat-card:hover,
.mini-card:hover,
.price-card:hover {
  border-color: #cbdabd;
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 19px;
}

.stat-label {
  margin-top: 5px;
  font-size: 9px;
  letter-spacing: .06em;
}

.stat-value {
  top: 58px;
  right: 21px;
  font-size: 28px;
}

.stat-title {
  margin-top: 33px;
  font-size: 13px;
}

.bars {
  left: 21px;
  right: 21px;
  bottom: 18px;
  height: 27px;
  gap: 7px;
}

.bars i {
  border-radius: 4px 4px 2px 2px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 20px;
}

.panel {
  padding: 25px;
  border-radius: 20px;
}

.panel-head {
  margin-bottom: 22px;
}

.panel h2 {
  font-size: 22px;
}

.panel h3 {
  font-size: 15px;
}

.legend {
  gap: 8px;
  font-size: 10px;
}

.legend span {
  padding: 7px 10px;
  background: #f4f7f1;
}

.dot {
  width: 8px;
  height: 8px;
}

.map-wrap,
.map-waiting-state {
  border-radius: 16px;
}

.map-waiting-state {
  min-height: 420px;
  border-color: #bcd2a7;
}

.camera-waiting-icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  font-size: 27px;
}

.map-waiting-state strong {
  font-size: 17px;
}

.map-waiting-state p {
  margin-top: 9px;
  font-size: 12px;
}

.right-column {
  gap: 20px;
}

.dashboard-side-waiting {
  min-height: 250px;
  padding: 28px;
  background:
    radial-gradient(circle at 85% 15%, rgba(112, 155, 70, .11), transparent 9rem),
    #fff;
}

.dashboard-side-waiting > strong {
  margin-top: 9px;
  font-size: 17px;
  line-height: 1.3;
}

.dashboard-side-waiting p {
  margin-top: 10px;
  font-size: 12px;
}

.health-card {
  min-height: 236px;
  padding: 27px 25px 23px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 255, 255, .17), transparent 13rem),
    linear-gradient(145deg, #4c7028, #324c19);
}

.leaf-icon {
  font-size: 28px;
}

.health-card h3 {
  margin: 19px 0 8px;
  font-size: 19px;
}

.health-card p {
  font-size: 12px;
  line-height: 1.6;
}

.progress {
  margin-top: 28px;
}

.health-card > strong {
  font-size: 12px;
}

.alerts-panel {
  padding: 23px 22px 17px;
}

.alerts-panel h3 {
  margin-bottom: 14px;
}

.alert-item {
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 11px;
  padding: 11px 8px;
}

.alert-item:hover {
  background: #f6faf2;
}

.alert-item strong {
  font-size: 11px;
}

.alert-item small {
  font-size: 9px;
  line-height: 1.4;
}

.view-all {
  font-size: 10px;
}

.simple-page {
  max-width: 1180px;
  padding: 12px 0 30px;
}

.simple-page h1 {
  margin-bottom: 12px;
}

.mini-grid {
  gap: 18px;
  margin-top: 30px;
}

.mini-card {
  min-height: 154px;
  padding: 27px;
  border-radius: 18px;
}

.mini-card strong {
  margin-bottom: 12px;
  font-size: 34px;
}

.mini-card span {
  font-size: 13px;
}

.coffee-threat-grid {
  gap: 20px;
  margin-top: 30px;
}

.threat-panel {
  padding: 26px;
  border-radius: 20px;
}

.threat-panel-head {
  margin-bottom: 12px;
  padding-bottom: 19px;
}

.threat-panel-head h2 {
  font-size: 20px;
}

.threat-kicker,
.threat-count {
  font-size: 9px;
}

.threat-panel .alert-item {
  padding: 15px 10px;
}

.threat-panel .alert-item strong {
  font-size: 13px;
}

.threat-panel .alert-item small {
  font-size: 10px;
}

.chart-card {
  max-width: none;
  margin-top: 30px;
  padding: 32px;
  border-radius: 20px;
}

.large-bars {
  height: 340px;
  gap: clamp(12px, 2vw, 28px);
}

.large-bars i {
  border-radius: 10px 10px 3px 3px;
  background: linear-gradient(180deg, #b9d49f, #daeaca);
}

.land-waiting-state {
  margin-top: 30px;
  padding: 70px 28px;
  border-color: #c0d5ac;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 20%, rgba(113, 157, 70, .1), transparent 17rem),
    #fff;
}

.gps-waiting-icon {
  width: 70px;
  height: 70px;
  border-radius: 21px;
  font-size: 31px;
}

.land-waiting-state h2,
.land-track-card h2 {
  font-size: 23px;
}

.land-waiting-state p {
  font-size: 13px;
}

.land-gps-strip,
.drone-status-strip {
  margin-top: 30px;
  border-radius: 18px;
}

.land-gps-strip > div,
.drone-status-strip > div {
  padding: 19px 18px;
}

.land-gps-strip span,
.land-sync-head span,
.land-coordinate-box span,
.drone-status-strip span {
  font-size: 9px;
}

.land-gps-strip strong,
.land-sync-head strong,
.drone-status-strip strong {
  font-size: 13px;
}

.land-sync-head,
.land-track-card {
  margin-top: 18px;
  padding: 20px;
  border-radius: 18px;
}

.drone-page {
  max-width: 1180px;
}

.drone-layout {
  gap: 20px;
  margin-top: 20px;
}

.drone-card {
  padding: 27px;
  border-radius: 20px;
}

.drone-card-head h2 {
  font-size: 21px;
}

.drone-card-kicker,
.simulation-badge,
.admin-control-badge,
.flight-state {
  font-size: 9px;
}

.drone-field {
  gap: 8px;
  margin-top: 16px;
}

.drone-field > span {
  font-size: 11px;
}

.drone-field input,
.drone-field select {
  min-height: 48px;
  padding: 0 15px;
  border-radius: 12px;
  background: #fafcf8;
  font-size: 13px;
}

.drone-button-row {
  margin-top: 20px;
}

.drone-primary-btn,
.drone-secondary-btn,
.flight-actions button,
.altitude-actions button {
  min-height: 44px;
  border-radius: 11px;
  font-size: 11px;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.drone-primary-btn:hover {
  filter: brightness(.94);
  box-shadow: 0 9px 20px rgba(48, 74, 22, .15);
}

.connection-note {
  margin-top: 19px !important;
  padding: 15px;
  border-radius: 13px;
  font-size: 11px !important;
}

.telemetry-grid {
  gap: 12px;
}

.telemetry-grid > div {
  padding: 16px;
  border: 1px solid #e6eedf;
  border-radius: 13px;
}

.telemetry-grid span,
.drone-command-log > span {
  font-size: 9px;
}

.telemetry-grid strong {
  font-size: 15px;
}

#droneCommandLog {
  height: 122px;
  padding: 13px 14px;
  border-radius: 13px;
}

#droneCommandLog p {
  font-size: 10px;
}

.direction-pad {
  width: 226px;
  grid-template-columns: repeat(3, 68px);
  grid-template-rows: repeat(3, 51px);
  gap: 8px;
}

.direction-pad button {
  border-radius: 13px;
}

.emergency-btn {
  min-height: 47px;
  border-radius: 12px;
}

.pricing-grid {
  gap: 20px;
  margin-top: 30px;
}

.price-card {
  min-height: 230px;
  padding: 28px;
  border-radius: 20px;
}

.price-card strong {
  margin: 24px 0 13px;
  font-size: 31px;
}

.price-card small {
  font-size: 13px;
}

.modal {
  z-index: 80;
  background: rgba(21, 31, 12, .52);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(500px, 100%);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 23px;
  box-shadow: 0 32px 90px rgba(19, 29, 10, .3);
}

.modal-close {
  top: 17px;
  right: 17px;
  width: 36px;
  height: 36px;
  background: #eff5ea;
}

.modal-card h2 {
  margin-right: 42px;
  font-size: 27px;
}

.modal-card p {
  font-size: 14px;
}

.modal-extra {
  gap: 9px;
  margin: 14px 0 20px;
}

.modal-extra button,
.modal-extra label {
  min-height: 48px;
  padding: 12px 15px;
  border: 1px solid #e6eede;
  background: #f7faf4;
}

.modal-card.modal-card-map {
  width: min(720px, 100%);
}

.history-archive {
  display: grid;
  gap: 12px;
}

.archive-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e3eed8;
  border-radius: 16px;
  background: #fafff6;
  color: #394a28;
  font-size: 12px;
  font-weight: 900;
}

.archive-map-head span {
  color: #657b4f;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.archive-map-head strong {
  font-size: 15px;
}

.archive-map-wrap {
  position: relative;
  overflow: hidden;
  min-height: 285px;
  aspect-ratio: 1.72 / 1;
  border: 1px solid #ddead0;
  border-radius: 20px;
  background:
    linear-gradient(rgba(42, 61, 23, .05), rgba(42, 61, 23, .18)),
    #d4e5c4;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .46);
}

.archive-map-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(1.04) contrast(1.05);
}

.archive-marker-layer {
  position: absolute;
  inset: 0;
}

.archive-marker {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .78);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 8px rgba(220, 10, 33, .14), 0 10px 22px rgba(31, 45, 17, .28);
}

.archive-marker.pest {
  background: #71a53f;
}

.archive-marker.disease {
  background: var(--red);
}

.archive-marker-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  width: max-content;
  max-width: 210px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 999px;
  background: rgba(31, 45, 17, .88);
  color: #fafff6;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  transform: translateX(-50%);
  box-shadow: 0 10px 24px rgba(23, 35, 12, .26);
  pointer-events: none;
}

.archive-marker-label::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  border: 5px solid transparent;
  border-top-color: rgba(31, 45, 17, .88);
  transform: translateX(-50%);
}

.archive-map-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #5e6f4d;
  font-size: 11px;
  font-weight: 800;
}

.archive-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #e3eed8;
  border-radius: 999px;
  background: #fafff6;
}

.archive-detection-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-detection-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e6eede;
  border-radius: 14px;
  background: #f7faf4;
  color: #424d38;
  font-size: 12px;
  font-weight: 800;
}

.archive-detection-list span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-btn {
  min-height: 48px;
}

.toast {
  padding: 13px 18px;
  background: #1f2d11;
  box-shadow: 0 14px 35px rgba(25, 38, 12, .24);
}

.auth-screen {
  padding: 35px;
  background:
    radial-gradient(circle at 18% 22%, rgba(187, 224, 151, .17), transparent 25rem),
    radial-gradient(circle at 87% 82%, rgba(255, 255, 255, .08), transparent 27rem),
    linear-gradient(135deg, #1b290e 0%, #314b18 54%, #1f2f0f 100%);
}

.auth-orb {
  border-color: rgba(255, 255, 255, .08);
}

.auth-card {
  width: min(590px, 100%);
  padding: 38px 44px 42px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 30px;
  background: rgba(252, 255, 250, .97);
  box-shadow: 0 35px 100px rgba(9, 15, 3, .34);
}

.auth-brand {
  margin-bottom: 30px;
}

.brand-mark {
  width: 70px;
  height: 70px;
  flex-basis: 70px;
  border-radius: 21px;
}

.auth-brand .brand-copy strong {
  font-size: 27px;
}

.auth-brand .brand-copy span {
  color: #7d8873;
  font-size: 12px;
}

.auth-tabs {
  padding: 5px;
  border-radius: 14px;
  background: #e6eede;
}

.auth-tab {
  min-height: 42px;
  border-radius: 10px;
  font-size: 12px;
}

.auth-form h1 {
  margin-top: 18px;
  font-size: 42px;
}

.auth-form p {
  font-size: 14px;
}

.field-label {
  margin-top: 17px;
  font-size: 12px;
}

.auth-input {
  min-height: 54px;
  border-radius: 14px;
  background: #fafcf8;
  font-size: 14px;
}

.password-toggle {
  border-radius: 11px;
}

.auth-primary,
.auth-secondary {
  min-height: 54px;
  border-radius: 14px;
  font-size: 14px;
}

.auth-privacy {
  border: 1px solid #e2eed7;
  font-size: 11px !important;
}

body[data-role="user"][data-paid="false"] .main-content::before {
  margin: 20px auto 14px;
  max-width: 1460px;
  padding: 14px 17px;
  border-radius: 14px;
}

body.compact-mode .stat-card {
  height: 150px;
}

body.compact-mode .topbar {
  min-height: 64px;
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 15px;
  }

  .brand {
    padding-inline: 4px;
  }

  .brand span {
    font-size: 8px;
  }

  .main-content {
    padding-inline: 28px;
  }

  .topbar {
    margin-inline: -28px;
    padding-inline: 28px;
  }

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

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
}

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

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

  .alerts-panel {
    grid-column: 1 / -1;
  }

  .drone-status-strip,
  .land-gps-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .drone-status-strip > div:first-child,
  .land-gps-strip > div:first-child {
    grid-column: auto;
  }
}

@media (max-width: 860px) {
  body {
    background: var(--bg);
  }

  .app-shell {
    display: block;
  }

  .main-content {
    padding: 0 18px 100px;
  }

  .topbar {
    min-height: 66px;
    margin: 0 -18px 24px;
    padding: 0 18px;
    background: rgba(241, 245, 238, .92);
  }

  .search-box {
    width: min(52vw, 320px);
    height: 40px;
    padding-inline: 12px;
    background: #fff;
  }

  .top-actions {
    gap: 5px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .hero-row {
    margin-bottom: 22px;
  }

  h1 {
    margin-top: 12px;
    font-size: clamp(34px, 10vw, 44px);
  }

  .hero-row p,
  .simple-page p {
    max-width: 570px;
    font-size: 13px;
  }

  .dashboard-tools {
    margin-top: 18px;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .date-btn {
    min-width: 126px;
    height: 40px;
    margin: 0;
  }

  .history-menu {
    top: 78px;
    left: 14px;
    right: 14px;
  }

  .dashboard-sensor-state {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 16px;
  }

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

  .stat-card {
    height: 164px;
    padding: 18px;
    border-radius: 17px;
  }

  .stat-value {
    top: 55px;
    right: 18px;
    font-size: 25px;
  }

  .bars {
    left: 18px;
    right: 18px;
    bottom: 17px;
  }

  .panel {
    padding: 20px;
    border-radius: 18px;
  }

  .map-waiting-state {
    min-height: 340px;
    aspect-ratio: auto;
  }

  .right-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
  }

  .health-card {
    display: block;
    min-height: 225px;
  }

  .alerts-panel {
    grid-column: 1 / -1;
  }

  .simple-page {
    padding-top: 12px;
  }

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

  .coffee-threat-grid,
  .drone-layout,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .connection-card {
    grid-row: auto;
  }

  .mobile-nav {
    left: 10px;
    right: 10px;
    bottom: 10px;
    height: 70px;
    padding: 6px;
    border: 1px solid rgba(220, 229, 211, .9);
    border-radius: 19px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 16px 45px rgba(33, 49, 17, .18);
    backdrop-filter: blur(18px);
  }

  .mobile-nav-btn {
    gap: 5px;
    border-radius: 13px;
    font-size: 8px;
  }

  .mobile-nav-btn span {
    font-size: 18px;
  }

  .mobile-nav-btn.active {
    background: #e6f1db;
    color: #3f5d22;
  }

  .toast {
    bottom: 94px;
  }

  .auth-screen {
    padding: 18px;
  }

  .auth-card {
    margin-top: 0;
    padding: 28px 24px 30px;
    border-radius: 25px;
  }
}

@media (max-width: 580px) {
  .main-content {
    padding-inline: 14px;
  }

  .topbar {
    margin-inline: -14px;
    padding-inline: 14px;
  }

  .search-box {
    width: min(56vw, 220px);
  }

  .search-box > span {
    display: none;
  }

  .search-box input {
    font-size: 11px;
  }

  .top-actions .icon-btn:nth-child(2) {
    display: none;
  }

  .hero-row p {
    max-width: 100%;
  }

  .dashboard-tools {
    width: calc(100vw - 28px);
  }

  .stats-grid,
  .right-column,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    height: 158px;
  }

  .dashboard-side-waiting {
    min-height: 210px;
  }

  .alerts-panel {
    grid-column: auto;
  }

  .panel-head {
    align-items: flex-start;
    gap: 12px;
  }

  .legend {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .map-waiting-state {
    min-height: 300px;
    padding: 22px;
  }

  .coffee-threat-grid {
    margin-top: 24px;
  }

  .threat-panel {
    padding: 20px 16px;
  }

  .land-gps-strip,
  .drone-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .land-gps-strip > div:first-child,
  .drone-status-strip > div:first-child {
    grid-column: 1 / -1;
  }

  .land-track-card {
    display: grid;
  }

  .land-coordinate-box {
    width: 100%;
    min-width: 0;
  }

  .drone-button-row,
  .flight-actions {
    grid-template-columns: 1fr;
  }

  .direction-pad {
    width: 100%;
    grid-template-columns: repeat(3, minmax(52px, 68px));
  }

  .large-bars {
    height: 230px;
    gap: 8px;
  }

  .modal {
    align-items: end;
    padding: 10px;
  }

  .modal-card {
    padding: 26px 22px 22px;
    border-radius: 24px;
  }

  .modal-card.modal-card-map {
    width: 100%;
  }

  .archive-map-wrap {
    min-height: 230px;
    aspect-ratio: 1.15 / 1;
    border-radius: 18px;
  }

  .archive-detection-list {
    grid-template-columns: 1fr;
  }

  .auth-screen {
    place-items: start center;
    padding: 12px;
  }

  .auth-card {
    padding: 24px 19px 26px;
  }

  .brand-mark {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
  }

  .auth-brand .brand-copy strong {
    font-size: 22px;
  }

  .auth-brand .brand-copy span {
    font-size: 10px;
  }

  .auth-form h1 {
    font-size: 34px;
  }

  .auth-form p {
    font-size: 13px;
  }
}

/* Compact supported-by row in the dashboard topbar */
.topbar-support {
  min-width: 0;
  flex: 1 1 auto;
  margin-inline: auto 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: #6e7963;
  white-space: nowrap;
}

.topbar-support > span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
}

.topbar-support-logos {
  min-width: max-content;
  height: 46px;
  padding: 5px 10px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: visible;
  border: 1px solid #dee5d7;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 7px 20px rgba(39, 56, 23, .055);
}

.topbar-support-logos > img {
  width: auto;
  height: 32px;
  display: block;
  object-fit: contain;
}

.topbar-support-logos > .support-logo-emblem { width: 34px; }
.topbar-support-logos > .diktisaintek-logo { width: 96px; }
.topbar-support-logos > .belmawa-logo { width: 76px; }
.topbar-support-logos > .simbelmawa-logo { width: 78px; }
.topbar-support-logos > .pkm-logo { width: 64px; }

@media (min-width: 861px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(180px, 280px) minmax(0, 1fr) auto;
  }

  .search-box {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  .topbar-support {
    width: 100%;
    margin: 0;
    padding: 0 10px;
    justify-content: center;
  }

  .top-actions {
    justify-self: end;
  }
}

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: minmax(165px, 225px) minmax(0, 1fr) auto;
  }

  .topbar-support {
    gap: 0;
    padding-inline: 6px;
  }

  .topbar-support > span {
    display: none;
  }

  .topbar-support-logos {
    height: 43px;
    gap: 4px;
    padding-inline: 8px;
  }

  .topbar-support-logos > img { height: 29px; }
  .topbar-support-logos > .support-logo-emblem { width: 31px; }
  .topbar-support-logos > .diktisaintek-logo { width: 88px; }
  .topbar-support-logos > .belmawa-logo { width: 69px; }
  .topbar-support-logos > .simbelmawa-logo { width: 71px; }
  .topbar-support-logos > .pkm-logo { width: 58px; }
}

@media (max-width: 1020px) {
  .topbar {
    grid-template-columns: 170px minmax(0, 1fr) auto;
  }

  .topbar-support-logos {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .topbar-support-logos::-webkit-scrollbar { display: none; }
}

/* Keep the complete sponsor set readable on regular laptop widths. */
@media (min-width: 861px) and (max-width: 1450px) {
  .topbar {
    min-height: 126px;
    padding-top: 13px;
    padding-bottom: 13px;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    grid-template-rows: 44px 46px;
    grid-template-areas:
      "search actions"
      "support support";
    align-content: center;
    row-gap: 10px;
  }

  .search-box {
    grid-area: search;
    width: min(360px, 100%);
    justify-self: start;
  }

  .top-actions {
    grid-area: actions;
    justify-self: end;
  }

  .topbar-support {
    grid-area: support;
    width: 100%;
    padding: 0;
    justify-content: center;
  }

  .topbar-support > span {
    display: inline;
    flex: 0 0 auto;
  }

  .topbar-support-logos {
    width: auto;
    max-width: calc(100% - 105px);
    min-width: 0;
    height: 46px;
    padding-inline: 10px;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .topbar-support-logos::-webkit-scrollbar {
    display: none;
  }

  .topbar-support-logos > img {
    height: 32px;
    flex: 0 0 auto;
  }

  .topbar-support-logos > .support-logo-emblem { width: 34px; }
  .topbar-support-logos > .diktisaintek-logo { width: 96px; }
  .topbar-support-logos > .belmawa-logo { width: 76px; }
  .topbar-support-logos > .simbelmawa-logo { width: 78px; }
  .topbar-support-logos > .pkm-logo { width: 64px; }
}

@media (max-width: 860px) {
  .topbar-support {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Supported by */
.support-footer {
  width: min(100%, 1460px);
  margin: 54px auto 0;
  padding: 30px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(115, 158, 73, .13), transparent 23rem),
    linear-gradient(145deg, #fff 0%, #f6faf2 100%);
  box-shadow: 0 12px 38px rgba(40, 57, 23, .055);
}

.support-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 28px;
  margin-bottom: 23px;
}

.support-heading > span {
  grid-column: 1;
  color: var(--green);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .13em;
}

.support-heading h2 {
  grid-column: 1;
  margin: 6px 0 0;
  font-size: 25px;
  letter-spacing: -.035em;
}

.support-heading p {
  grid-column: 2;
  grid-row: 1 / span 2;
  max-width: 380px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: right;
}

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

.support-logo-card {
  min-width: 0;
  min-height: 92px;
  padding: 15px 17px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid #e0e9d7;
  border-radius: 16px;
  background: rgba(255, 255, 255, .86);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.support-logo-card:hover {
  border-color: #c2d5b0;
  box-shadow: 0 13px 28px rgba(41, 61, 22, .09);
  transform: translateY(-2px);
}

.support-logo-image {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  object-fit: contain;
}

.support-logo-image.support-unila {
  padding: 2px;
}

.support-logo-copy {
  min-width: 0;
}

.support-logo-copy strong {
  display: block;
  color: #29341e;
  font-size: 13px;
  line-height: 1.25;
}

.support-logo-copy span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.support-program-mark {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-content: center;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .16), transparent),
    #3a581d;
  color: #fff;
  text-align: center;
  box-shadow: 0 9px 20px rgba(45, 69, 21, .2);
}

.support-program-mark span {
  font-size: 15px;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1;
}

.support-program-mark small {
  margin-top: 4px;
  color: #c7e7a8;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
}

.support-letter-mark {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #eef5fb;
  color: #2474ac;
  font-size: 25px;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(36, 116, 172, .1);
}

.support-simbelmawa .support-letter-mark {
  background: #edf6ed;
  color: #297743;
  box-shadow: inset 0 0 0 1px rgba(41, 119, 67, .11);
}

.support-impact {
  background: linear-gradient(135deg, #fff, #f2f8fc);
}

.support-footer-bottom {
  margin-top: 22px;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--border);
  color: #838d7a;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .02em;
}

.auth-support {
  margin-top: 27px;
  padding-top: 21px;
  border-top: 1px solid #e0e9d7;
}

.auth-support > span {
  display: block;
  margin-bottom: 12px;
  color: #7f8b73;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .14em;
}

.auth-support-logos {
  display: flex;
  align-items: center;
  gap: 17px;
}

.auth-support-logos img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: saturate(.82);
}

.auth-support-logos strong {
  min-height: 32px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  border-radius: 9px;
  background: #e5f0da;
  color: #406020;
  font-size: 9px;
  letter-spacing: .05em;
}

@media (max-width: 1100px) {
  .support-logo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .support-footer {
    margin-top: 38px;
    padding: 23px 20px;
    border-radius: 20px;
  }

  .support-heading {
    display: block;
  }

  .support-heading p {
    max-width: 500px;
    margin-top: 8px;
    text-align: left;
  }

  .support-logo-card {
    min-height: 86px;
  }
}

@media (max-width: 580px) {
  .support-footer {
    padding: 21px 15px;
  }

  .support-logo-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .support-logo-card {
    min-height: 78px;
    padding: 12px 14px;
  }

  .support-logo-image,
  .support-letter-mark {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .support-program-mark {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    border-radius: 15px;
  }

  .support-footer-bottom {
    display: grid;
    line-height: 1.45;
  }

  .auth-support-logos {
    gap: 11px;
  }

  .auth-support-logos img {
    width: 29px;
    height: 29px;
  }
}

/* ============================================================
   Ledger (Blockchain QR) — panel verifikasi integritas laporan
   drone, ditambahkan saat migrasi ke backend fullstack.
   Reuse token warna & komponen drone-card yang sudah ada.
   ============================================================ */
.ledger-card { grid-column: 1 / -1; }

.drone-button-row.two-col { grid-template-columns: repeat(2, 1fr); }

.drone-field textarea {
  width: 100%;
  min-height: 74px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: 0;
  resize: vertical;
  background: #fafff6;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
}
.drone-field textarea:focus {
  border-color: #8ab95c;
  box-shadow: 0 0 0 4px rgba(73, 107, 39, .1);
}

.connection-note code,
.ledger-verify-result code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--green-pale);
  color: var(--green);
  font-size: 10px;
}

#ledgerBlockList {
  height: 92px;
  margin-top: 8px;
  padding: 10px 12px;
  overflow-y: auto;
  border-radius: 11px;
  background: #29351e;
  color: #e3f1d5;
}
#ledgerBlockList p { margin: 0 0 6px; font-size: 9px; line-height: 1.35; }
#ledgerBlockList time { color: #aed686; font-weight: 900; }
#ledgerBlockList .block-type {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(227, 241, 213, .12);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.ledger-scan-stage {
  position: relative;
  width: 100%;
  max-width: 260px;
  margin: 14px auto 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 14px;
  background: #0b0e08;
}
.ledger-scan-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ledger-reticle {
  position: absolute;
  inset: 14%;
  border: 2px solid rgba(255, 255, 255, .55);
  border-radius: 12px;
  pointer-events: none;
}

.ledger-verify-result { margin-top: 14px; display: grid; gap: 10px; }
.ledger-verify-result .verdict {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 12px;
}
.ledger-verify-result .verdict.ok { background: var(--green-pale); color: var(--green); }
.ledger-verify-result .verdict.bad { background: var(--red-pale); color: var(--red); }
.ledger-verify-result .steps { display: grid; gap: 6px; }
.ledger-verify-result .step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel-soft);
  font-size: 11px;
}
.ledger-verify-result .step .ic {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
  color: #fff;
}
.ledger-verify-result .step.ok .ic { background: #2f8f4e; }
.ledger-verify-result .step.bad .ic { background: var(--red); }
.ledger-verify-result .step small { display: block; margin-top: 2px; color: var(--muted); }
.ledger-verify-result pre.codeblock {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #19230f;
  color: #e3f1d5;
  font-size: 10px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 860px) {
  .drone-button-row.two-col { grid-template-columns: 1fr; }
}

/* ============================================================
 * Live Camera Drone (Eachine USB/UVC)
 * ============================================================ */
.camera-panel-head { align-items: flex-start; gap: 14px; }
.camera-panel-head > div:first-child { min-width: 0; }
.camera-panel-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .09em;
}
.camera-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.camera-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #f3f5f4;
  color: #748079;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}
.camera-status-badge > i,
.camera-live-chip > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #99a39e;
}
.camera-status-badge.online {
  background: #e9f6df;
  color: #46752d;
}
.camera-status-badge.online > i {
  background: #71a53f;
  box-shadow: 0 0 0 4px rgba(113,165,63,.13);
}
.camera-live-wrap { background: #0d1511; }
.camera-live-wrap img {
  background: #0d1511;
  object-fit: contain;
}
.camera-live-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(17, 25, 20, .72);
  color: #fff;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .08em;
  backdrop-filter: blur(6px);
}
.camera-live-chip > i {
  background: #f05e54;
  box-shadow: 0 0 0 4px rgba(240,94,84,.2);
}
@media (max-width: 680px) {
  .camera-panel-head { align-items: stretch; }
  .camera-panel-actions { justify-content: flex-start; }
}


/* ============================================================
 * SCARAB ResNet50 AI Console
 * ============================================================ */
.ai-console {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #dfe8d9;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdf9 0%, #f5f9f2 100%);
}
.ai-console-top,
.ai-result-main,
.ai-mode-controls,
.ai-table-head,
.ai-probability-row {
  display: flex;
  align-items: center;
}
.ai-console-top,
.ai-result-main {
  justify-content: space-between;
  gap: 14px;
}
.ai-console-title {
  display: grid;
  gap: 4px;
}
.ai-console-title strong { font-size: 13px; }
.ai-kicker {
  color: var(--green);
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .08em;
}
.ai-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef2ed;
  color: #61705f;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}
.ai-status-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ba79a;
}
.ai-status-badge.ready { background: #e6f3da; color: #40691e; }
.ai-status-badge.ready i { background: #6c9d3c; }
.ai-status-badge.error { background: #fde9eb; color: #b13444; }
.ai-status-badge.error i { background: #dd5364; }
.ai-mode-controls {
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.ai-mode-btn,
.ai-capture-btn {
  min-height: 35px;
  padding: 0 13px;
  border: 1px solid #d9e4d3;
  border-radius: 9px;
  background: white;
  color: #52624c;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .04em;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.ai-mode-btn:hover,
.ai-capture-btn:hover:not(:disabled) { transform: translateY(-1px); }
.ai-mode-btn.active {
  border-color: #527c2c;
  background: #426821;
  color: #fff;
}
.ai-capture-btn {
  margin-left: auto;
  border-color: #315416;
  background: #315416;
  color: white;
}
.ai-capture-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.ai-mode-hint {
  margin: 10px 0 0;
  color: #788474;
  font-size: 8px;
  line-height: 1.5;
}
.ai-result-empty {
  margin-top: 14px;
  padding: 18px;
  display: grid;
  gap: 4px;
  border: 1px dashed #cad9c2;
  border-radius: 11px;
  text-align: center;
  color: #7b8877;
}
.ai-result-empty strong { color: #52604e; font-size: 10px; }
.ai-result-empty span { font-size: 8px; }
.ai-result-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e3ebe0;
}
.ai-result-main > div:first-child {
  display: grid;
  gap: 4px;
}
.ai-result-main span,
.ai-confidence-box span,
.ai-meta-grid span {
  color: #889285;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .06em;
}
#aiPredictionLabel {
  font-size: 22px;
  letter-spacing: -.03em;
  color: #263321;
}
.ai-confidence-box {
  min-width: 112px;
  padding: 9px 12px;
  display: grid;
  gap: 3px;
  text-align: right;
  border-radius: 10px;
  background: #edf5e7;
}
#aiConfidenceValue {
  color: #416b20;
  font-size: 18px;
}
.ai-probability-bars {
  display: grid;
  gap: 9px;
  margin-top: 15px;
}
.ai-prob-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 54px;
  gap: 9px;
  align-items: center;
}
.ai-prob-row > span {
  overflow: hidden;
  color: #596555;
  font-size: 8px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-prob-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1eb;
}
.ai-prob-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: #6e9b43;
}
.ai-prob-row strong {
  text-align: right;
  font-size: 8px;
  color: #45523f;
}
.ai-detail-grid {
  grid-template-columns: minmax(0, .95fr) minmax(250px, 1.05fr);
  gap: 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e5ebe2;
}
.ai-detail-grid:not([hidden]) { display: grid; }
.ai-capture-preview {
  min-width: 0;
  margin: 0;
}
.ai-capture-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: #e6ebe3;
}
.ai-capture-preview figcaption {
  margin-top: 6px;
  color: #7d8878;
  font-size: 7px;
}
.ai-detail-content {
  min-width: 0;
}
.ai-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ai-meta-grid > div {
  min-width: 0;
  padding: 9px;
  display: grid;
  gap: 3px;
  border-radius: 9px;
  background: #f6f8f4;
}
.ai-meta-grid strong {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-probability-table {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid #e4eae1;
  border-radius: 9px;
}
.ai-table-head,
.ai-probability-row {
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
}
.ai-table-head {
  background: #f0f5ed;
  color: #73806e;
  font-size: 7px;
  font-weight: 950;
}
.ai-probability-row {
  border-top: 1px solid #edf0eb;
  font-size: 8px;
}
.ai-probability-row strong { color: #34432f; }

@media (max-width: 760px) {
  .ai-capture-btn { margin-left: 0; }
  .ai-prob-row { grid-template-columns: 72px minmax(0, 1fr) 48px; }
  .ai-detail-grid:not([hidden]) { grid-template-columns: 1fr; }
  #aiPredictionLabel { font-size: 18px; }
}

/* ============================================================
 * SCARAB × AgriEdge — sensor, agronomy AI, ledger, settings
 * ============================================================ */
.readonly-chip {
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid #cbd8c5;
  border-radius: 999px;
  color: #50604b;
  background: #f5f8f3;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
}
.integration-page { max-width: 1500px; }
.integration-title-row,
.integration-card-head,
.integration-actions,
.adapt-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.integration-title-row,
.integration-card-head { justify-content: space-between; }
.integration-title-row { margin-bottom: 24px; }
.integration-title-row h1 { margin-bottom: 6px; }
.integration-actions { flex-wrap: wrap; }
.link-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.integration-grid {
  display: grid;
  grid-template-columns: minmax(300px, .85fr) minmax(0, 1.35fr);
  gap: 20px;
  margin-top: 20px;
}
.integration-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid #dfe7dc;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 35px rgba(32, 51, 26, .06);
}
.integration-card-head { margin-bottom: 18px; }
.integration-card-head span:first-child {
  display: block;
  margin-bottom: 5px;
  color: #71806c;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
}
.integration-card-head h2 {
  margin: 0;
  color: #263624;
  font-size: 21px;
}
.integration-form,
.device-list,
.sample-list { display: grid; gap: 12px; }
.integration-form { margin-bottom: 18px; }
.integration-form label,
.wide-field,
.agronomy-input-grid label {
  display: grid;
  gap: 7px;
  color: #53634e;
  font-size: 14px;
  font-weight: 750;
}
.integration-form input,
.wide-field select,
.agronomy-input-grid input,
.adapt-controls select {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid #cfdacb;
  border-radius: 10px;
  color: #263624;
  background: #fbfdf9;
  font: inherit;
}
.sensor-metric-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(115px, 1fr));
  gap: 12px;
}
.sensor-metric {
  min-width: 0;
  padding: 16px;
  border: 1px solid #dfe7dc;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff, #f5f9f2);
}
.sensor-metric span,
.sensor-metric small { display: block; color: #75816f; font-size: 12px; }
.sensor-metric strong { display: block; margin: 8px 0 2px; color: #274124; font-size: 24px; }
.device-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e3e9e0;
  border-radius: 12px;
  background: #f9fbf7;
}
.device-item strong,
.device-item span { display: block; }
.device-item strong { color: #2c3e28; font-size: 15px; }
.device-item span { margin-top: 4px; color: #74806f; font-size: 12px; line-height: 1.45; }
.device-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #aeb8aa;
  box-shadow: 0 0 0 5px rgba(174, 184, 170, .16);
}
.device-dot.online {
  background: #27a35a;
  box-shadow: 0 0 0 5px rgba(39, 163, 90, .15);
}
.device-delete,
.sample-item button {
  border: 0;
  border-radius: 8px;
  color: #9c302d;
  background: #faecea;
  cursor: pointer;
  font-weight: 800;
}
.device-delete { padding: 8px 10px; }
.integration-empty,
.integration-note,
.integration-disclaimer {
  color: #70806a;
  font-size: 14px;
  line-height: 1.6;
}
.table-scroll { overflow: auto; }
.integration-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.integration-table th,
.integration-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #e5ebe2;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}
.integration-table th {
  color: #6c7a67;
  background: #f6f9f4;
  font-size: 12px;
  letter-spacing: .05em;
}
.agronomy-input-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.agronomy-verdict {
  padding: 16px;
  border-left: 4px solid #77906f;
  border-radius: 10px;
  background: #f5f8f3;
}
.agronomy-verdict.aman { border-color: #258d50; background: #eef8f1; }
.agronomy-verdict.waspada { border-color: #d99120; background: #fff8e9; }
.agronomy-verdict.kritis { border-color: #bf3f37; background: #fff0ee; }
.agronomy-verdict strong { color: #263624; font-size: 20px; }
.agronomy-verdict p { margin: 7px 0; color: #465742; font-size: 14px; line-height: 1.55; }
.agronomy-verdict span { color: #72806d; font-size: 12px; }
.recommendation-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding-left: 22px;
  color: #40503c;
  font-size: 14px;
  line-height: 1.55;
}
.adapt-controls { flex-wrap: wrap; }
.adapt-controls select { width: auto; min-width: 190px; }
.sample-list { margin-top: 16px; }
.sample-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e0e7dd;
  border-radius: 10px;
  color: #4c5d48;
  background: #fafcf9;
  font-size: 13px;
}
.sample-item button { width: 30px; min-width: 30px; font-size: 18px; }
.adapt-result {
  margin-top: 15px;
  padding: 13px;
  border-radius: 10px;
  color: #17653a;
  background: #eaf7ee;
  font-weight: 800;
}
.ledger-page-grid { margin-top: 20px; }
.ledger-page-grid .ledger-card { width: 100%; }
.system-info { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 1px; overflow: hidden; border: 1px solid #e0e7dc; border-radius: 12px; background: #e0e7dc; }
.system-info div { padding: 14px; background: #fbfdf9; }
.system-info dt { color: #72806d; font-size: 12px; }
.system-info dd { margin: 6px 0 0; color: #2d3d29; font-size: 14px; font-weight: 800; }
.codeblock {
  padding: 12px;
  overflow-wrap: anywhere;
  border-radius: 10px;
  color: #eaf5e4;
  background: #1a2a18;
  user-select: all;
}

@media (max-width: 1200px) {
  .sensor-metric-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
}
@media (max-width: 900px) {
  .integration-grid { grid-template-columns: 1fr; }
  .agronomy-input-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .system-info { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}
@media (max-width: 620px) {
  .integration-title-row,
  .integration-card-head { align-items: flex-start; flex-direction: column; }
  .sensor-metric-grid { grid-template-columns: repeat(2, minmax(115px, 1fr)); }
  .agronomy-input-grid,
  .system-info { grid-template-columns: 1fr; }
  .integration-card { padding: 16px; }
}
