:root {
  color-scheme: light;
  --bg: #f6f9fc;
  --surface: #ffffff;
  --surface-muted: #eef5f3;
  --text: #172033;
  --muted: #64748b;
  --line: #d8e2ee;
  --primary: #0f766e;
  --danger: #b91c1c;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

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

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

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

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

.brand-mark {
  display: inline-grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #0f766e, #2563eb);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

.brand-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.18;
}

.brand-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.topbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.topbar .search-input {
  width: 220px;
  max-width: min(220px, 42vw);
  min-height: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
  flex: 0 0 auto;
}

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

.unlock {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 16px;
}

.unlock-card {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 28px;
  padding: 28px;
}

.unlock-card h1 {
  margin: 18px 0 12px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.12;
}

.unlock-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.form-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 700;
}

.input,
.select {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  color: var(--text);
}

.button {
  min-height: 46px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--primary);
  padding: 0 18px;
  color: #fff;
  font-weight: 800;
}

.button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.button.compact {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.status {
  min-height: 42px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.status.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--danger);
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.kpi {
  min-height: 104px;
  padding: 16px;
}

.kpi-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kpi-value {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 900;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.content {
  padding: 18px;
}

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

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

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) 1fr 74px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.bar-meter {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  border: 0;
  background: #e2e8f0;
}

.bar-meter::-webkit-progress-bar {
  border-radius: 999px;
  background: #e2e8f0;
}

.bar-meter::-webkit-progress-value {
  border-radius: 999px;
  background: var(--primary);
}

.bar-meter::-moz-progress-bar {
  border-radius: 999px;
  background: var(--primary);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .unlock-card,
  .kpis,
  .grid-2 {
    grid-template-columns: 1fr;
  }

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

  .topbar-right,
  .top-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .topbar .search-input {
    width: 100%;
    max-width: none;
  }

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

  .top-actions {
    justify-content: flex-start;
  }
}
