:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d8dee8;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b91c1c;
  --shadow: 0 10px 24px rgba(20, 31, 44, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

header {
  background: #17313b;
  color: white;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

h1 { font-size: 21px; margin: 0; }
h2 { font-size: 18px; margin: 0 0 12px; }

main {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.account, .actions, .tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.tabs {
  overflow-x: auto;
  padding: 10px 0 14px;
}

.tab, button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 9px 12px;
  font: inherit;
  cursor: pointer;
  min-height: 38px;
}

.tab.active, button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

button.ghost {
  background: transparent;
  color: white;
  border-color: rgba(255,255,255,.35);
}

.auth-card, .panel, .metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.auth-card {
  width: min(520px, 100%);
  margin: 40px auto;
}

.notice {
  background: #fff7ed;
  border-left: 4px solid #b45309;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 14px;
}

.view { display: none; }
.view.active { display: block; }

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

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

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

.field { margin-bottom: 10px; }
.field.full { grid-column: 1 / -1; }

label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 9px 10px;
  font: inherit;
  min-height: 38px;
}

textarea {
  min-height: 74px;
  resize: vertical;
}

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

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.metric strong {
  font-size: 23px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

th {
  background: #f8fafc;
  color: var(--muted);
  position: sticky;
  top: 0;
}

#status {
  color: var(--muted);
  min-height: 24px;
}

.danger { color: var(--danger); }
.help { color: var(--muted); font-size: 13px; }

@media (max-width: 980px) {
  .layout, .cards, .grid, .grid.compact { grid-template-columns: 1fr; }
}

