:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --panel-2: #f0f4f8;
  --ink: #17202a;
  --muted: #697586;
  --line: #d9e2ec;
  --brand: #146c94;
  --brand-2: #19a7ce;
  --good: #148f63;
  --warn: #b7791f;
  --bad: #c2410c;
  --info: #3b5bdb;
  --shadow: 0 18px 45px rgba(30, 41, 59, 0.10);
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(20,108,148,.08), transparent 320px),
    var(--bg);
  color: var(--ink);
}

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

button {
  border: 0;
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 420px;
  background: linear-gradient(135deg, #093545 0%, #15616d 43%, #f3f7fb 43%);
}

.login-copy {
  color: white;
  padding: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-copy h1 {
  font-size: 54px;
  line-height: 1.02;
  margin: 0 0 24px;
  letter-spacing: 0;
}
.login-copy p {
  max-width: 620px;
  font-size: 18px;
  line-height: 1.7;
  color: rgba(255,255,255,.82);
}
.login-panel {
  margin: auto 48px auto 0;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 28px;
}

.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #0f2730;
  color: #dbeafe;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  padding: 8px 10px 24px;
}
.brand strong {
  display: block;
  font-size: 22px;
  color: #fff;
}
.brand span {
  color: #96bbc8;
  font-size: 13px;
}
.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 12px;
  color: #b7d3dc;
  background: transparent;
  border-radius: 6px;
  margin-bottom: 4px;
  text-align: left;
}
.nav button.active,
.nav button:hover {
  background: rgba(255,255,255,.09);
  color: #fff;
}
.main {
  min-width: 0;
}
.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(247,248,251,.82);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 {
  font-size: 22px;
  margin: 0;
}
.content {
  padding: 28px;
}
.grid {
  display: grid;
  gap: 16px;
}
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}
.panel.pad { padding: 18px; }
.panel h2 {
  margin: 0 0 14px;
  font-size: 16px;
}
.metric {
  min-height: 110px;
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.metric strong {
  display: block;
  font-size: 30px;
  margin-top: 8px;
}
.metric small {
  color: var(--muted);
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  color: #fff;
  background: var(--brand);
}
.btn.secondary {
  color: var(--ink);
  background: #e9eef5;
}
.btn.ghost {
  color: var(--brand);
  background: transparent;
}
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.field label {
  color: var(--muted);
  font-size: 13px;
}
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 10px 11px;
  min-height: 38px;
}
.field textarea {
  min-height: 88px;
  resize: vertical;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.table th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  background: #f7fafc;
}
.pill {
  display: inline-flex;
  height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #e8f4f8;
  color: #126076;
}
.pill.good { background: #e7f8f0; color: var(--good); }
.pill.warn { background: #fff5db; color: var(--warn); }
.pill.bad { background: #fff0e8; color: var(--bad); }
.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.lane {
  background: #edf3f7;
  border: 1px solid #d8e5ed;
  border-radius: 8px;
  min-height: 420px;
  padding: 12px;
}
.lane h3 {
  margin: 2px 2px 12px;
  font-size: 14px;
  color: #365563;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  margin-bottom: 10px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
}
.card h4 {
  margin: 0 0 8px;
  font-size: 15px;
}
.card p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.theme-card {
  border-top: 4px solid var(--brand-2);
}
.split {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
}
.doc-list button {
  width: 100%;
  text-align: left;
  background: transparent;
  border-radius: 6px;
  padding: 10px;
  color: var(--ink);
}
.doc-list button.active,
.doc-list button:hover {
  background: #e8f4f8;
}
.markdown {
  line-height: 1.7;
  max-width: 980px;
}
.markdown h1 { font-size: 26px; }
.markdown h2 { font-size: 20px; margin-top: 28px; }
.markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}
.markdown th, .markdown td {
  border: 1px solid var(--line);
  padding: 8px 10px;
}
.markdown code {
  background: #eef4f8;
  border-radius: 4px;
  padding: 2px 5px;
}
.notice {
  padding: 12px 14px;
  background: #fff7e6;
  color: #79520d;
  border: 1px solid #f5d99a;
  border-radius: 8px;
  margin-bottom: 16px;
}

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-copy { padding: 36px; }
  .login-copy h1 { font-size: 38px; }
  .login-panel { margin: 0 24px 40px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2, .split { grid-template-columns: 1fr; }
  .topbar { position: relative; }
}
