:root {
  --bg: #f6f9f8;
  --surface: #ffffff;
  --surface-soft: #f4faf8;
  --surface-tint: #eef8f5;
  --text: #111827;
  --muted: #667085;
  --line: #d9e3e1;
  --primary: #007f73;
  --primary-dark: #00665d;
  --primary-soft: #e7f8f4;
  --accent: #2563eb;
  --danger: #d92d20;
  --warning: #f79009;
  --success: #12805c;
  --shadow: 0 24px 70px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 14px 36px rgba(16, 24, 40, 0.06);
  --radius: 8px;
  --sidebar: 280px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(0, 127, 115, 0.12), transparent 34%),
    linear-gradient(180deg, #fbfdfd 0%, var(--bg) 52%, #f2f6f5 100%);
  color: var(--text);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

h1 {
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
}

.muted,
.topbar p {
  color: var(--muted);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 24px 20px;
  color: #f8fffd;
  background:
    radial-gradient(circle at 20% 0%, rgba(38, 216, 184, 0.22), transparent 34%),
    linear-gradient(180deg, #062722 0%, #0a211d 48%, #071a17 100%);
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 8px 28px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, #c5fff0 0%, #91e7da 100%);
  color: #06332d;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.brand small {
  display: block;
  color: rgba(218, 255, 247, 0.72);
  margin-top: 4px;
}

.sidebar nav {
  display: grid;
  gap: 5px;
}

.nav-section-title {
  margin: 18px 10px 8px;
  color: rgba(219, 245, 239, 0.54);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 13px;
  border-radius: var(--radius);
  color: rgba(243, 255, 252, 0.82);
  text-decoration: none;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.sidebar a::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(197, 255, 240, 0.38);
}

.sidebar a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(1px);
}

.sidebar a.active {
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.09));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.sidebar a.active::before {
  background: #8bf5de;
}

.shell,
.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar);
  padding: 30px 34px 38px;
}

.topbar,
.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 28px;
}

.topbar > div:first-child {
  display: grid;
  gap: 8px;
}

.eyebrow {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(0, 127, 115, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--success);
}

.topbar-actions,
.actions,
.panel-heading,
.panel-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-actions,
.actions,
.panel-heading {
  justify-content: space-between;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(18, 128, 92, 0.16);
  border-radius: 999px;
  background: #f0faf5;
  color: var(--success);
  font-size: 12px;
  font-weight: 900;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 16px;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 10px 24px rgba(0, 127, 115, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 127, 115, 0.22);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  box-shadow: none;
}

.button.secondary {
  color: #263240;
  background: var(--surface-soft);
  border-color: rgba(217, 227, 225, 0.95);
  box-shadow: none;
}

.button.secondary:hover:not(:disabled) {
  color: var(--primary-dark);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
}

.button.danger {
  background: var(--danger);
  box-shadow: 0 10px 24px rgba(217, 45, 32, 0.16);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics,
.grid,
.locations-layout,
.plans {
  display: grid;
  gap: 18px;
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.grid.two,
.locations-layout {
  grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
  margin-bottom: 18px;
}

.locations-overview {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.locations-overview .metrics {
  margin-bottom: 0;
}

.overview-panels {
  display: grid;
  grid-template-columns: minmax(420px, 0.82fr) minmax(520px, 1.18fr);
  gap: 18px;
}

.panel,
.metric,
.plan {
  border: 1px solid rgba(217, 227, 225, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px 26px;
}

.panel-body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 253, 252, 0.92));
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-heading h2::before {
  content: "";
  width: 9px;
  height: 22px;
  border-radius: 999px;
  background: var(--primary);
  opacity: 0.22;
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 20px;
  min-height: 118px;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), rgba(37, 99, 235, 0.5));
}

.metric span {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 10px;
}

.metric strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.alert {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #fedf89;
  border-radius: var(--radius);
  background: #fffbeb;
  color: #7a4b00;
  font-weight: 700;
}

.panel-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(244, 250, 248, 0.95), rgba(255, 255, 255, 0.96));
}

.table-title {
  display: grid;
  gap: 2px;
}

.table-title strong {
  font-size: 18px;
  line-height: 1.2;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-actions .search {
  max-width: 420px;
}

.panel-subsection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--surface-soft), #ffffff);
}

.panel-subsection h3 {
  margin-bottom: 5px;
}

label {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin-bottom: 14px;
  color: #263240;
  font-size: 14px;
  font-weight: 800;
}

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

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  padding: 10px 13px;
  outline: none;
  font-weight: 500;
}

input::placeholder,
textarea::placeholder {
  color: #98a2b3;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(0, 127, 115, 0.72);
  box-shadow: 0 0 0 3px rgba(0, 127, 115, 0.12);
}

input[type="color"] {
  height: 48px;
  padding: 5px;
}

textarea {
  resize: vertical;
  min-height: 190px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.search {
  min-width: min(420px, 100%);
}

.upload-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 92px;
  padding: 18px;
  border: 1px dashed rgba(0, 127, 115, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(231, 248, 244, 0.82), rgba(255, 255, 255, 0.9));
}

.upload-panel .muted {
  font-weight: 700;
}

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

.file-left {
  display: grid;
  gap: 4px;
}

.file-left strong {
  font-size: 15px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.checkbox input {
  width: 18px;
  min-height: 18px;
}

.table-wrap {
  overflow: auto;
  margin: 0;
  border-radius: var(--radius);
}

.table-panel > [data-geocode-status] {
  padding: 12px 20px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #475467;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #fbfdfc;
}

td {
  color: #344054;
  font-size: 14px;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: #f8fbfb;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  margin: 0 5px 5px 0;
  border-radius: 6px;
  background: #eef4ff;
  color: #3538cd;
  font-size: 12px;
  font-weight: 800;
}

.checklist {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  counter-reset: checklist;
}

.checklist li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #263240;
  font-weight: 700;
}

.checklist li::before {
  counter-increment: checklist;
  content: counter(checklist);
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef4f2;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}

.checklist.compact {
  margin-top: 18px;
  line-height: 1.65;
}

.checklist .done {
  color: var(--primary-dark);
}

.checklist .done::before {
  content: "OK";
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.preflight {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.preflight li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  align-items: start;
  padding: 13px 14px;
  border: 1px solid rgba(18, 128, 92, 0.14);
  border-radius: var(--radius);
  background: #f0faf5;
}

.preflight strong {
  color: var(--success);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.preflight .missing {
  border-color: rgba(217, 45, 32, 0.16);
  background: #fff5f5;
}

.preflight .missing strong {
  color: var(--danger);
}

.plans {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.plan {
  position: relative;
  overflow: hidden;
  padding: 22px;
  display: grid;
  gap: 14px;
}

.plan::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.plan h2 {
  font-size: 18px;
}

.plan strong {
  font-size: 30px;
  line-height: 1;
}

.plan p {
  color: #344054;
  font-weight: 700;
}

.plan ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 7px;
}

.narrow {
  max-width: 760px;
}

.narrow + .narrow {
  margin-top: 18px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #111827;
  color: #ffffff;
  box-shadow: 0 20px 50px rgba(16, 24, 40, 0.22);
  z-index: 20;
}

@media (max-width: 1120px) {
  :root {
    --sidebar: 248px;
  }

  .grid.two,
  .locations-layout,
  .overview-panels {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {
  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
  }

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

  .nav-section-title {
    grid-column: 1 / -1;
  }

  .shell {
    margin-left: 0;
    padding: 22px 18px 28px;
  }

  .topbar,
  .admin-header {
    display: grid;
  }

  .topbar-actions,
  .actions {
    justify-content: start;
    flex-wrap: wrap;
  }
}

@media (max-width: 620px) {
  .metrics,
  .form-row,
  .sidebar nav {
    grid-template-columns: 1fr;
  }

  .panel,
  .metric,
  .plan {
    padding: 18px;
  }

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

  .panel-actions,
  .toolbar-controls,
  .button-row {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .topbar-actions .button,
  .toolbar-controls .button,
  .panel-actions .search {
    width: 100%;
  }

  .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
