:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --ink: #182125;
  --muted: #68777f;
  --line: #dce4e7;
  --accent: #287c76;
  --accent-dark: #1d5f5a;
  --warn: #a95d1f;
  --danger: #b33b3b;
  --good: #1f7a4a;
  --shadow: 0 10px 24px rgba(24, 33, 37, 0.08);
}

* {
  box-sizing: border-box;
}

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

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

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button.secondary {
  background: #e7eeee;
  color: var(--ink);
}

button.secondary:hover {
  background: #d8e3e3;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(12, 27, 28, 0.62), rgba(12, 27, 28, 0.62)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.login-panel {
  width: min(380px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: #fbfcfc;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--line);
}

.brand small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: #e7eeee;
  color: var(--ink);
}

.main {
  min-width: 0;
  padding: 24px;
}

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

.topbar h2 {
  margin: 0;
  font-size: 30px;
}

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

.session,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #e8c998;
  border-radius: 6px;
  background: #fff7e8;
  color: var(--warn);
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.metric {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

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

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

.panel-head {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel h3 {
  margin: 0;
  font-size: 16px;
}

.status-block,
.list,
.import-area,
.settings-panel {
  padding: 16px;
}

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

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.toolbar {
  display: grid;
  grid-template-columns: 180px 160px 160px minmax(120px, max-content);
  gap: 12px;
  align-items: end;
}

.search {
  max-width: 240px;
}

.chart {
  min-height: 360px;
  padding: 14px;
}

.chart svg {
  width: 100%;
  min-height: 320px;
  display: block;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e7eeee;
  color: var(--muted);
  font-size: 12px;
}

.pill.good {
  background: #e5f4ec;
  color: var(--good);
}

.pill.warn {
  background: #fff0df;
  color: var(--warn);
}

.import-area {
  display: grid;
  gap: 14px;
}

.row-actions {
  display: flex;
  gap: 10px;
}

.settings-panel {
  max-width: 420px;
  display: grid;
  gap: 14px;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .topbar,
  .grid-2 {
    grid-template-columns: 1fr;
    display: grid;
  }

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

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

@media (max-width: 560px) {
  .main {
    padding: 16px;
  }

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

  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
