:root {
  color-scheme: light;
  --bg: #f3f6f7;
  --panel: #ffffff;
  --ink: #14202b;
  --ink-soft: #344555;
  --muted: #6d7d8c;
  --line: #dfe7eb;
  --line-strong: #cbd8df;
  --brand: #0b7a66;
  --brand-dark: #075c4e;
  --brand-soft: #e4f4ef;
  --accent: #1d5f8a;
  --danger: #b93b36;
  --danger-soft: #fbeceb;
  --warning: #9a6505;
  --warning-soft: #fff5dc;
  --success: #0b7a66;
  --success-soft: #e4f4ef;
  --sidebar: #0c1c2a;
  --sidebar-soft: #142a3b;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16, 36, 50, 0.05), 0 4px 14px rgba(16, 36, 50, 0.04);
  --shadow: 0 18px 40px rgba(16, 36, 50, 0.1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-dark);
}

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

.icon {
  display: inline-block;
  vertical-align: -0.18em;
  flex: none;
}

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

.small {
  font-size: 12.5px;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

/* ---------- App shell ---------- */

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 252px;
  background:
    radial-gradient(circle at 18% 8%, rgba(29, 95, 138, 0.35), transparent 36%),
    linear-gradient(165deg, #0e2233 0%, var(--sidebar) 52%, #091722 100%);
  color: #e8f0f4;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  z-index: 50;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 22px;
  color: #fff;
}

.brand:hover {
  color: #fff;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #d8fff4;
  background: linear-gradient(145deg, #16a085, #0b6d5b);
  box-shadow: 0 8px 18px rgba(11, 122, 102, 0.28);
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
}

.brand-name {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8fa8b9;
  margin-top: 3px;
}

.nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #708b9e;
  padding: 0 12px;
  margin: 8px 0 7px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #b8cbd6;
  padding: 10px 12px;
  border-radius: 9px;
  font-weight: 550;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-link.active {
  background: rgba(22, 160, 133, 0.16);
  color: #eafff9;
  box-shadow: inset 3px 0 0 #1db394;
}

.nav-link .nav-count {
  margin-left: auto;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 7px;
  border-radius: 999px;
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-note {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
  color: #93aab9;
  font-size: 11.5px;
  line-height: 1.45;
}

.sidebar-note strong {
  color: #d8e6ed;
  display: block;
  font-size: 12px;
  margin-bottom: 3px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 6px 0;
  margin-top: 6px;
}

.user-card-text {
  min-width: 0;
  flex: 1;
}

.user-card-name {
  color: #ecf4f7;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card-role {
  color: #8199aa;
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card .icon-btn {
  color: #8fa8b9;
}

.user-card .icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.main-shell {
  margin-left: 252px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 62px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  min-width: 0;
}

.topbar-breadcrumbs strong {
  color: var(--ink-soft);
  font-weight: 650;
}

.crumb-sep {
  color: #bdcad2;
}

.topbar-spacer {
  flex: 1;
}

.env-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  background: #eef4f6;
  border-radius: 999px;
  padding: 4px 10px;
}

.env-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1aa37f;
}

.page {
  padding: 28px 32px 70px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

.menu-btn {
  display: none;
}

/* ---------- Typography ---------- */

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 750;
  margin-bottom: 8px;
}

.page-title {
  font-size: clamp(25px, 2.5vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 780;
}

.page-sub {
  color: var(--muted);
  margin-top: 8px;
  max-width: 700px;
  font-size: 13.5px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-head-main {
  flex: 1;
  min-width: 260px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.section-head .section-title {
  flex: 1;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  margin-bottom: 12px;
}

.back-link:hover {
  color: var(--brand);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 14px;
  min-height: 38px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 5px 14px rgba(11, 122, 102, 0.16);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-dark);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn-secondary:hover:not(:disabled) {
  border-color: #9eb2bd;
  background: #f9fbfc;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
  background: #eef3f5;
  color: var(--ink);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #9f2f2b;
}

.btn-danger-soft {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #f2cfcd;
}

.btn-danger-soft:hover:not(:disabled) {
  background: #f9dfdd;
}

.btn-sm {
  min-height: 31px;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 7px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: #eef3f5;
  color: var(--ink);
}

.icon-btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---------- Badges, avatars ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-neutral {
  background: #edf2f4;
  color: #526779;
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-muted {
  background: #f1f4f5;
  color: #93a1ab;
}

.badge-accent {
  background: #e8f1f8;
  color: var(--accent);
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  background: #eef4f6;
  color: #526779;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 7px;
  white-space: nowrap;
}

.avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #d9ece7, #c2e0d8);
  color: #0b6c5b;
  font-size: 11px;
  font-weight: 750;
  flex: none;
  width: 32px;
  height: 32px;
  letter-spacing: 0.01em;
}

.avatar-sm {
  width: 27px;
  height: 27px;
  font-size: 9.5px;
}

.avatar-xs {
  width: 21px;
  height: 21px;
  font-size: 8px;
}

.avatar-lg {
  width: 46px;
  height: 46px;
  font-size: 15px;
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack .avatar {
  margin-left: -6px;
  border: 2px solid #fff;
}

.avatar-stack .avatar:first-child {
  margin-left: 0;
}

/* ---------- Cards, stats ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

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

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #edf5f3;
  color: var(--brand);
  flex: none;
}

.stat-icon.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.stat-icon.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.stat-icon.neutral {
  background: #eef2f4;
  color: #64778a;
}

.stat-value {
  font-size: 22px;
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.stat-label {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 3px;
}

/* ---------- Campaign cards ---------- */

.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.campaign-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

.campaign-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), #67c7ae);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.campaign-card:hover {
  transform: translateY(-2px);
  border-color: #c8d9df;
  box-shadow: 0 16px 34px rgba(16, 36, 50, 0.09);
}

.campaign-card:hover::before {
  opacity: 1;
}

.campaign-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.campaign-card-head h3 {
  font-size: 16px;
  letter-spacing: -0.015em;
  font-weight: 730;
  line-height: 1.3;
  flex: 1;
}

.campaign-card-head h3 a {
  color: var(--ink);
}

.campaign-card-desc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  min-height: 38px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.campaign-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
}

.zone-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.zone-pill {
  font-size: 10.5px;
  font-weight: 650;
  border-radius: 5px;
  padding: 3px 6px;
  background: #f1f4f5;
  color: #5c6e7c;
}

.zone-pill.approved {
  background: var(--success-soft);
  color: var(--success);
}

.zone-pill.pending {
  background: var(--warning-soft);
  color: var(--warning);
}

.zone-pill.rejected {
  background: var(--danger-soft);
  color: var(--danger);
}

.campaign-card-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  border-top: 1px solid #edf1f3;
  padding-top: 12px;
  margin-top: auto;
}

.campaign-card-footer .link-arrow {
  margin-left: auto;
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ---------- Toolbar, tabs ---------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.search-box .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #8ba0ae;
}

.search-box input,
.search-box input[type="search"] {
  padding-left: 36px;
}

.filter-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 11.5px;
  font-weight: 600;
}

.filter-chip.active {
  background: var(--brand-soft);
  border-color: #b9ded5;
  color: var(--brand-dark);
}

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
}

.tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  color: var(--brand-dark);
  border-bottom-color: var(--brand);
}

.tab-count {
  background: #eef3f5;
  border-radius: 999px;
  font-size: 10px;
  padding: 1px 6px;
  color: #66798a;
}

/* ---------- Tables and lists ---------- */

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8797a4;
  background: #f8fafb;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 750;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f4;
  font-size: 12.5px;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: #fbfcfd;
}

.clickable-row {
  cursor: pointer;
}

.cell-title {
  font-weight: 650;
  color: var(--ink);
}

.cell-sub {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

/* ---------- Forms ---------- */

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > span,
.field-label {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--ink-soft);
}

.field small,
.field-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.field-error {
  color: var(--danger);
  font-size: 11px;
  min-height: 0;
}

.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #5eb7a1;
  box-shadow: 0 0 0 3px rgba(13, 138, 114, 0.11);
}

input::placeholder,
textarea::placeholder {
  color: #9aaab5;
}

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

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
}

.checkbox input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--brand);
}

.checkbox small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.form-error {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--danger-soft);
  border: 1px solid #f3d3d1;
  color: var(--danger);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12px;
}

.form-error.visible {
  display: flex;
}

.form-divider {
  height: 1px;
  background: var(--line);
  margin: 2px 0;
}

/* ---------- Detail layout ---------- */

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 348px;
  gap: 18px;
  align-items: start;
}

.map-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.map-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}

.map-card-head h3 {
  font-size: 13px;
  font-weight: 700;
  flex: 1;
}

.map-shell {
  height: 360px;
  position: relative;
  background: #e8eef1;
}

.map-shell-large {
  height: 600px;
}

.map-shell-editor {
  height: 580px;
}

.map-shell-new {
  height: 500px;
}

.map-card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 13px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.map-card-foot .status-line {
  flex: 1;
  min-width: 160px;
}

.map-card-foot .action-row {
  margin: 0;
}

.mode-cards.two {
  grid-template-columns: 1fr 1fr;
}

.map-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 700;
  background: rgba(12, 28, 42, 0.9);
  color: #eaf2f6;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 11px;
  pointer-events: none;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.map-legend {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10.5px;
  color: #4e6170;
  box-shadow: var(--shadow-sm);
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.map-tooltip-status {
  color: #6d7d8c;
  font-size: 11px;
}

.leaflet-container {
  font-family: var(--font);
  font-size: 12px;
  background: #e4eaed;
}

.leaflet-control-attribution {
  font-size: 9px !important;
}

.leaflet-pm-toolbar .button-container a.leaflet-buttons-control-button {
  border-radius: 0;
}

.leaflet-pm-toolbar .leaflet-buttons-control-button {
  background-color: #fff;
}

/* ---------- Panels ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel + .panel {
  margin-top: 14px;
}

.panel-head {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-head h3 {
  font-size: 13px;
  font-weight: 720;
  flex: 1;
}

.panel-body {
  padding: 15px;
}

.panel-body.tight {
  padding: 0;
}

.status-hero {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.status-hero-main {
  padding: 17px;
  position: relative;
  z-index: 1;
}

.status-hero::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -48px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 138, 114, 0.12), transparent 68%);
}

.status-hero.pending::after {
  background: radial-gradient(circle, rgba(192, 124, 10, 0.16), transparent 68%);
}

.status-hero.rejected::after {
  background: radial-gradient(circle, rgba(194, 65, 58, 0.14), transparent 68%);
}

.status-hero h2 {
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 8px 0 7px;
}

.status-hero p {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.status-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid #edf1f3;
}

.status-fact span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.status-fact strong {
  font-size: 12.5px;
  font-weight: 650;
}

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.action-row {
  display: flex;
  gap: 8px;
}

.action-row .btn {
  flex: 1;
}

#audit-filter .action-row {
  justify-content: flex-start;
}

#audit-filter .action-row .btn {
  flex: 0 0 auto;
  min-width: 190px;
}

.callout {
  display: flex;
  gap: 10px;
  border-radius: 9px;
  padding: 10px 11px;
  font-size: 11.5px;
  line-height: 1.5;
  background: #f4f8f9;
  color: #526779;
}

.callout.warning {
  background: var(--warning-soft);
  color: #6f4a04;
}

.callout.danger {
  background: var(--danger-soft);
  color: #8e2f2b;
}

.callout.success {
  background: var(--success-soft);
  color: #075c4e;
}

.callout .icon {
  margin-top: 1px;
  flex: none;
}

.meta-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  align-items: baseline;
}

.meta-row > span {
  color: var(--muted);
  flex: none;
}

.meta-row > strong,
.meta-row > a {
  text-align: right;
  font-weight: 600;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.coordinator-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid #eef2f4;
}

.coordinator-row:last-child {
  border-bottom: 0;
}

.coordinator-text {
  flex: 1;
  min-width: 0;
}

.coordinator-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coordinator-email {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Status, source, history ---------- */

.source-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  padding: 11px;
}

.source-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.source-card-head strong {
  font-size: 11.5px;
  flex: 1;
}

.source-query {
  font-size: 11px;
  color: #4e6170;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 120px;
  overflow: auto;
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.match-item {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  font-size: 10.5px;
  color: #526779;
  line-height: 1.4;
}

.match-item .icon {
  color: var(--brand);
  margin-top: 1px;
}

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

.timeline {
  display: flex;
  flex-direction: column;
}

.version-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid #eef2f4;
  position: relative;
}

.version-item:last-child {
  border-bottom: 0;
}

.version-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef4f6;
  color: #526779;
  font-size: 11.5px;
  font-weight: 750;
  border: 1px solid #dfe8ec;
}

.version-item.approved .version-number {
  background: var(--success-soft);
  color: var(--success);
  border-color: #bce2d8;
}

.version-item.pending .version-number {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: #f0ddb0;
}

.version-item.rejected .version-number {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #f0cecc;
}

.version-body {
  min-width: 0;
}

.version-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.version-title strong {
  font-size: 12.5px;
}

.version-sub {
  color: var(--muted);
  font-size: 10.5px;
  margin-top: 2px;
}

.version-note {
  margin-top: 5px;
  color: #4e6170;
  font-size: 11.5px;
  line-height: 1.45;
}

.version-review {
  margin-top: 6px;
  font-size: 11px;
  color: #6f4a04;
  background: var(--warning-soft);
  border-radius: 6px;
  padding: 6px 8px;
  line-height: 1.45;
}

.version-actions {
  display: flex;
  align-items: flex-start;
  gap: 3px;
}

.audit-list {
  display: flex;
  flex-direction: column;
}

.audit-entry {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #eef2f4;
  align-items: flex-start;
}

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

.audit-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 6px;
  background: #9aaab5;
}

.audit-dot-success {
  background: #0d8a72;
}

.audit-dot-warning {
  background: #c07c0a;
}

.audit-dot-danger {
  background: #c2413a;
}

.audit-dot-accent {
  background: #1d5f8a;
}

.audit-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  justify-content: space-between;
}

.audit-head strong {
  font-size: 11.5px;
  font-weight: 650;
}

.audit-head time {
  color: #9aaab5;
  font-size: 10px;
  white-space: nowrap;
}

.audit-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 10.5px;
  margin-top: 4px;
}

.audit-sep {
  color: #c2ced6;
}

.audit-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 650;
  margin-top: 4px;
}

.audit-ip {
  color: #a4b2bc;
  font-size: 9.5px;
  font-family: "SFMono-Regular", Consolas, monospace;
  padding-top: 2px;
}

/* ---------- New zone / editor ---------- */

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

.editor-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mode-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.mode-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 10px 8px;
  text-align: left;
  color: var(--muted);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.mode-card:hover {
  border-color: #b5cbd3;
}

.mode-card.active {
  border-color: #6dc1ad;
  background: var(--brand-soft);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px #6dc1ad;
}

.mode-card .icon {
  display: block;
  margin-bottom: 5px;
}

.mode-card strong {
  display: block;
  font-size: 10.5px;
  line-height: 1.3;
}

.mode-card small {
  display: block;
  font-size: 9.5px;
  color: inherit;
  opacity: 0.75;
  margin-top: 2px;
}

.geo-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.geo-result {
  background: #f4f8f9;
  border: 1px solid #e2ebee;
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 11px;
  line-height: 1.5;
  color: #4e6170;
}

.geo-result.warning {
  background: var(--warning-soft);
  border-color: #f1dfb8;
  color: #6f4a04;
}

.geo-result strong {
  font-weight: 650;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
}

.status-line .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9aaab5;
}

.status-line.unsaved .dot {
  background: #c07c0a;
}

.status-line.saved .dot {
  background: #0d8a72;
}

/* ---------- Empty, loading, skeleton ---------- */

.empty-state {
  border: 1px dashed #cbd8df;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  padding: 44px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #e8f2f4;
  color: #5d7d8a;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.empty-state p {
  color: var(--muted);
  font-size: 12px;
  max-width: 430px;
  margin-bottom: 16px;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 50px 20px;
  color: var(--muted);
  font-size: 12px;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid #c9d6dc;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: none;
}

.spinner-light {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.skeleton-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton {
  background: linear-gradient(90deg, #eef3f5, #f8fafb, #eef3f5);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 5px;
}

.skeleton-line {
  height: 10px;
}

.skeleton-block {
  height: 58px;
  margin-top: 8px;
}

.w30 {
  width: 30%;
}

.w40 {
  width: 40%;
}

.w60 {
  width: 60%;
}

.w80 {
  width: 80%;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- Modal, toast ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 20, 30, 0.48);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.modal-overlay.open {
  opacity: 1;
}

.modal {
  width: min(100%, 500px);
  max-height: calc(100vh - 36px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 30px 70px rgba(7, 20, 30, 0.28);
  display: flex;
  flex-direction: column;
  transform: translateY(8px) scale(0.99);
  transition: transform 0.16s ease;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-md {
  max-width: 560px;
}

.modal-lg {
  max-width: 720px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.modal-header p {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 4px;
  max-width: 470px;
}

.modal-header .icon-btn {
  margin: -3px -5px 0 auto;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
  border-radius: 0 0 16px 16px;
}

.modal-text {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

#toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

#toast-root.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #102433;
  color: #edf5f8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 12px;
  box-shadow: var(--shadow);
  max-width: 420px;
}

.toast-icon {
  color: #6ed5bd;
  display: flex;
}

.toast-error {
  background: #42201e;
  border-color: #64302c;
}

.toast-error .toast-icon {
  color: #f3a6a1;
}

.toast-success {
  background: #0b342c;
  border-color: #165b4d;
}

/* ---------- Login ---------- */

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(430px, 0.9fr);
  background: #f4f7f8;
}

.login-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 15%, rgba(35, 156, 135, 0.25), transparent 34%),
    radial-gradient(circle at 15% 85%, rgba(34, 93, 135, 0.3), transparent 38%),
    linear-gradient(155deg, #0e2638 0%, #0b1a27 64%, #07131c 100%);
  color: #eaf4f7;
  padding: clamp(38px, 6vw, 76px);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.login-hero .brand {
  padding: 0;
  margin-bottom: auto;
}

.login-copy {
  max-width: 560px;
  margin: 70px 0 50px;
  position: relative;
  z-index: 2;
}

.login-copy h1 {
  font-size: clamp(34px, 4.5vw, 55px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 780;
  margin-bottom: 18px;
}

.login-copy h1 em {
  font-style: normal;
  color: #6ed5bd;
}

.login-copy p {
  color: #a3b8c5;
  font-size: 14.5px;
  line-height: 1.65;
  max-width: 470px;
}

.login-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 530px;
  position: relative;
  z-index: 2;
}

.login-feature {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 10px;
  padding: 11px;
  font-size: 11.5px;
  line-height: 1.45;
  color: #b9ccd6;
}

.login-feature .icon {
  color: #6ed5bd;
  margin-top: 1px;
}

.login-hero-foot {
  margin-top: auto;
  padding-top: 40px;
  color: #6f8b9c;
  font-size: 10.5px;
  position: relative;
  z-index: 2;
}

.map-art {
  position: absolute;
  right: -80px;
  top: 18%;
  width: 520px;
  height: 520px;
  opacity: 0.26;
  z-index: 1;
}

.map-art svg {
  width: 100%;
  height: 100%;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background:
    radial-gradient(circle at 70% 20%, rgba(13, 138, 114, 0.05), transparent 34%),
    #f4f7f8;
}

.login-card {
  width: 100%;
  max-width: 390px;
}

.login-card h2 {
  font-size: 26px;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.login-card > p {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 24px;
}

.login-card .form {
  gap: 13px;
}

.login-card .btn-primary {
  min-height: 43px;
  margin-top: 4px;
}

.login-help {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: #8a9ba7;
  font-size: 10.5px;
  line-height: 1.55;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 40px;
}

.password-wrap .icon-btn {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
}

/* ---------- Misc ---------- */

.divider {
  height: 1px;
  background: var(--line);
  margin: 14px 0;
}

.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.right {
  text-align: right;
}

.nowrap {
  white-space: nowrap;
}

.status-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(13, 138, 114, 0.12), transparent 34%),
    #0c1c2a;
  color: #eaf4f7;
}

.boot-mark {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #16a085, #0b6d5b);
  color: #eafff9;
  box-shadow: 0 14px 36px rgba(11, 122, 102, 0.3);
  margin-bottom: 16px;
}

.boot-title {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.boot-sub {
  color: #8fa8b9;
  font-size: 11.5px;
  margin-top: 5px;
}

.code {
  background: #f1f5f6;
  border: 1px solid #e1e9ec;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10.5px;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
}

.pagination-actions {
  display: flex;
  gap: 6px;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-cell-text {
  min-width: 0;
}

.status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--muted);
}

.status-toggle i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a6b4bd;
}

.status-toggle.active i {
  background: #0d8a72;
}

.mobile-overlay {
  display: none;
}

@media (max-width: 1180px) {
  .detail-grid,
  .editor-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .map-shell-editor {
    height: 540px;
  }
}

@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 18px 0 40px rgba(0, 0, 0, 0.2);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-shell {
    margin-left: 0;
  }

  .menu-btn {
    display: inline-grid;
  }

  .topbar {
    padding: 0 18px;
  }

  .page {
    padding: 22px 18px 60px;
  }

  .mobile-overlay.visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(7, 20, 30, 0.4);
    z-index: 45;
  }

  .detail-grid,
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .map-shell-large {
    height: 430px;
  }

  .map-shell-editor {
    height: 470px;
  }

  .editor-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .editor-side > .status-hero {
    grid-column: span 2;
  }

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

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: 390px;
    padding: 34px;
  }

  .login-copy {
    margin: 45px 0 25px;
  }

  .login-features {
    display: none;
  }

  .login-panel {
    padding: 30px 20px 50px;
  }
}

@media (max-width: 680px) {
  .page-head {
    align-items: flex-start;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .stat-value {
    font-size: 19px;
  }

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

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

  .mode-cards {
    grid-template-columns: 1fr;
  }

  .mode-card {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mode-card .icon {
    margin: 0;
  }

  .mode-card small {
    margin-left: auto;
  }

  .editor-side {
    display: flex;
  }

  .map-shell-editor,
  .map-shell-new {
    height: 400px;
  }

  .map-shell-large {
    height: 350px;
  }

  .topbar-breadcrumbs {
    display: none;
  }

  .login-hero {
    min-height: 330px;
    padding: 26px;
  }

  .login-copy {
    margin: 32px 0 0;
  }

  .login-copy h1 {
    font-size: 33px;
  }

  .login-copy p {
    font-size: 13px;
  }

  .login-hero-foot {
    display: none;
  }

  .modal-footer {
    flex-wrap: wrap;
  }

  .modal-footer .btn {
    flex: 1;
  }

  .audit-ip {
    display: none;
  }

  .version-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .version-actions {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- RBAC ---------- */
.select-compact {
  height: 38px;
  min-width: 160px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

.selected-row,
.clickable-row.selected-row {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.role-chip-row .role-chip {
  font-size: 11px;
  padding: 3px 7px;
}
