:root {
  --bg: #08090a;
  --bg-2: #0d0f12;
  --panel: rgba(255,255,255,0.03);
  --panel-2: rgba(255,255,255,0.05);
  --panel-3: #17191d;
  --line: rgba(255,255,255,0.08);
  --line-soft: rgba(255,255,255,0.05);
  --text: #f7f8f8;
  --muted: #a0a7b4;
  --muted-2: #7d848f;
  --accent: #7170ff;
  --accent-2: #5e6ad2;
  --accent-soft: rgba(113,112,255,0.12);
  --green: #27a644;
  --green-soft: rgba(39,166,68,0.14);
  --amber: #e8a318;
  --amber-soft: rgba(232,163,24,0.14);
  --red: #ef4444;
  --red-soft: rgba(239,68,68,0.14);
  --cyan: #35c7be;
  --cyan-soft: rgba(53,199,190,0.14);
  --shadow: 0 18px 50px rgba(0,0,0,0.35);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --sidebar: 272px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at top right, rgba(113,112,255,0.12), transparent 26%), var(--bg); color: var(--text); }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: "cv01", "ss03";
  letter-spacing: -0.01em;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  margin-bottom: 22px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #8dcbff);
  box-shadow: 0 12px 24px rgba(113,112,255,0.26);
  position: relative;
}
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
}
.brand-mark::before { width: 20px; height: 4px; top: 12px; left: 10px; }
.brand-mark::after { width: 12px; height: 4px; top: 22px; left: 10px; }
.brand h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.sidebar-group {
  margin: 22px 0;
}
.sidebar-label {
  margin: 0 10px 10px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}
.nav-list {
  display: grid;
  gap: 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--muted);
  transition: 0.18s ease;
}
.nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border-color: var(--line-soft);
}
.nav-item.active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(113,112,255,0.16), rgba(255,255,255,0.04));
  border-color: rgba(113,112,255,0.35);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}
.nav-item .meta {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--muted-2);
  font-size: 11px;
}
.sidebar-footer {
  margin-top: 24px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(39,166,68,0.12), rgba(255,255,255,0.03));
  border: 1px solid rgba(39,166,68,0.22);
}
.sidebar-footer strong { display:block; font-size: 13px; margin-bottom: 4px; }
.sidebar-footer p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.main {
  min-width: 0;
  padding: 26px;
}
.topbar {
  min-width: 0;
  flex-wrap: wrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search, .context-pill, .chip, .button, .select, .input {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-radius: 12px;
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  padding: 10px 14px;
}
.search input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  outline: none;
}
.search input::placeholder, .input::placeholder, textarea::placeholder { color: var(--muted-2); }
.context-pill, .chip {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
}
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: 0.18s ease;
}
.button.primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  border-color: rgba(113,112,255,0.55);
  box-shadow: 0 12px 28px rgba(94,106,210,0.25);
}
.button:hover { transform: translateY(-1px); }
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0 24px;
}
.page-header h2 {
  margin: 0;
  font-size: 34px;
  font-weight: 510;
  line-height: 1;
  letter-spacing: -0.045em;
}
.page-header p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 800px;
  line-height: 1.6;
}
.grid {
  display: grid;
  gap: 18px;
}
.grid.metrics { grid-template-columns: repeat(4, minmax(0,1fr)); }
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.025));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.card.pad { padding: 18px; }
.metric {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 142px;
}
.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}
.metric-value {
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.05em;
}
.metric-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid transparent;
}
.badge.green { background: var(--green-soft); color: #86ec99; border-color: rgba(39,166,68,0.25); }
.badge.amber { background: var(--amber-soft); color: #f9cb60; border-color: rgba(232,163,24,0.3); }
.badge.red { background: var(--red-soft); color: #ffa9a9; border-color: rgba(239,68,68,0.28); }
.badge.cyan { background: var(--cyan-soft); color: #8ce7e1; border-color: rgba(53,199,190,0.28); }
.badge.gray { background: rgba(255,255,255,0.04); color: var(--muted); border-color: var(--line-soft); }
.dashboard-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 18px;
  margin-top: 18px;
}
.subgrid-2 { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap:18px; }
.section-title {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}
.section-title h3 { margin:0; font-size: 18px; font-weight: 590; letter-spacing: -0.025em; }
.section-title p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.mini-chart {
  height: 220px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line-soft);
}
.timeline-list, .task-list, .activity-list, .stack {
  display: grid;
  gap: 12px;
}
.stack.compact {
  gap: 10px;
}
.dashboard-data-grid {
  margin-top: 18px;
}
.dashboard-kpis-inline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 12px;
}
.subgrid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 18px;
}
.list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
}
.list-item h4, .list-item p { margin: 0; }
.list-item h4 { font-size: 14px; font-weight: 510; }
.list-item p { color: var(--muted); font-size: 12px; line-height: 1.55; margin-top: 6px; }
.kpi-ring {
  width: 132px; height: 132px; margin: 12px auto 0; position: relative;
}
.kpi-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.kpi-ring strong {
  position:absolute; inset:0; display:grid; place-items:center; font-size: 28px; letter-spacing: -0.05em;
}
.panel-grid {
  display:grid;
  grid-template-columns: 380px 1fr 360px;
  gap:18px;
}
.filter-panel, .detail-panel {
  display:grid;
  gap:12px;
  align-self:start;
}
.input, .select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-radius: 12px;
  outline: none;
}
textarea { min-height: 120px; resize: vertical; }
.field { display:grid; gap:8px; }
.field label { font-size: 12px; color: var(--muted); }
.filter-block {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.02);
}
.filter-block h4 { margin:0 0 10px; font-size:14px; }
.toggle-grid {
  display:grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap:8px;
}
.toggle {
  padding:10px 11px;
  border-radius: 12px;
  border:1px solid var(--line-soft);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  text-align:left;
  cursor:pointer;
}
.toggle.active { color: var(--text); border-color: rgba(113,112,255,0.35); background: rgba(113,112,255,0.12); }
.map-shell {
  display:grid;
  gap:16px;
}
.plant-canvas {
  position:relative;
  min-height: 720px;
  border-radius: 24px;
  border:1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02)),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    #0d1013;
  background-size: auto, 44px 44px, 44px 44px, auto;
  overflow:hidden;
}
.zone, .hotspot {
  position:absolute;
  border-radius: 18px;
}
.zone {
  border: 1px dashed rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 12px;
  padding: 10px;
}
.hotspot {
  width: 18px; height: 18px;
  border: 3px solid rgba(8,9,10,0.8);
  box-shadow: 0 0 0 10px rgba(255,255,255,0.03);
  cursor:pointer;
}
.hotspot.green { background: var(--green); }
.hotspot.amber { background: var(--amber); }
.hotspot.red { background: var(--red); }
.hotspot.cyan { background: var(--cyan); }
.legend {
  display:flex; gap:10px; flex-wrap:wrap;
}
.legend span { display:inline-flex; align-items:center; gap:8px; color: var(--muted); font-size:12px; }
.dot { width:10px; height:10px; border-radius:999px; display:inline-block; }
.table-wrap {
  overflow:auto;
  border-radius: 16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
table {
  width:100%; border-collapse: collapse; min-width: 980px;
}
th, td {
  padding: 14px 16px; text-align:left; border-bottom:1px solid var(--line-soft);
}
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
td { font-size: 14px; }
tr[data-drawer]:hover { background: rgba(255,255,255,0.03); cursor:pointer; }
.drawer {
  position: sticky;
  top: 26px;
  padding: 18px;
  border-radius: 18px;
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.025));
  align-self:start;
}
.drawer h3 { margin: 0 0 8px; }
.drawer p { color: var(--muted); line-height: 1.6; }
.info-grid { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap:10px; }
.info-box {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border:1px solid var(--line-soft);
}
.info-box small { color: var(--muted-2); display:block; margin-bottom:5px; }
.checklist-layout {
  display:grid; grid-template-columns: 320px 1fr 340px; gap:18px;
}
.step-list { display:grid; gap:10px; }
.step-item {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.02);
}
.step-item.active { border-color: rgba(113,112,255,0.35); background: rgba(113,112,255,0.10); }
.question-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.02);
  display:grid; gap:14px;
}
.question-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.question-head h4 { margin:0; font-size:15px; }
.segmented {
  display:flex; gap:8px; flex-wrap:wrap;
}
.segmented button {
  padding: 9px 12px; border-radius: 12px; border:1px solid var(--line); background: rgba(255,255,255,0.03); color: var(--muted); cursor:pointer;
}
.segmented button.active { background: var(--accent-soft); border-color: rgba(113,112,255,0.35); color: var(--text); }
.progress {
  height: 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  overflow:hidden;
}
.progress > span { display:block; height:100%; border-radius:999px; background: linear-gradient(90deg, var(--accent-2), var(--cyan)); }
.bottom-bar {
  position: sticky;
  bottom: 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border:1px solid var(--line);
  background: rgba(8,9,10,0.88);
  backdrop-filter: blur(18px);
}
.kanban {
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:18px;
}
.kanban-col {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  min-height: 600px;
}
.kanban-col h3 { margin:0 0 14px; font-size:15px; }
.kanban-card {
  padding: 14px;
  border-radius: 14px;
  border:1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.025));
  margin-bottom: 12px;
}
.kanban-card h4 { margin: 0 0 8px; font-size: 14px; }
.kanban-card p { margin:0; color: var(--muted); font-size: 12px; line-height:1.55; }
.split {
  display:grid; grid-template-columns: 1.1fr 0.9fr; gap:18px;
}
.public-lead {
  display:grid; gap:10px;
}
.public-lead .list-item { cursor: pointer; }
.footer-note {
  margin-top: 26px;
  color: var(--muted-2);
  font-size: 12px;
}
@media (max-width: 1320px) {
  .grid.metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-layout, .split, .panel-grid, .checklist-layout, .subgrid-3 { grid-template-columns: minmax(0,1fr); }
  .dashboard-kpis-inline { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kanban { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height:auto; }
}
@media (max-width: 760px) {
  .main { padding: 18px; }
  .grid.metrics, .subgrid-2, .subgrid-3, .kanban, .dashboard-kpis-inline { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .topbar { flex-direction: column; align-items: stretch; }
  .search { min-width: 100%; }
}
