:root {
  --bg: #f4f6f7;
  --panel: #ffffff;
  --line: #d8e0e4;
  --ink: #172023;
  --muted: #647278;
  --green: #1f6f57;
  --blue: #2d5f86;
  --gold: #a86f16;
  --red: #a33a31;
  --soft-green: #e7f2ee;
  --soft-blue: #e8f0f6;
  --soft-gold: #f5eddf;
  --soft-red: #f6e7e5;
  --shadow: 0 10px 24px rgba(23, 32, 35, 0.08);
}

* { box-sizing: border-box; }

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

a { color: inherit; text-decoration: none; }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fbfcfc;
  border-right: 1px solid var(--line);
  padding: 24px 18px;
}

.brand {
  margin-bottom: 24px;
}

.brand strong {
  display: block;
  font-size: 15px;
}

.brand span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 12px;
}

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

.nav a {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: #314044;
}

.nav a.active,
.nav a:hover {
  background: var(--soft-green);
  color: var(--green);
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(244, 246, 247, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.title h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button,
button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  min-height: 36px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
}

.button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.content {
  padding: 28px;
}

.section {
  margin-bottom: 22px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 820px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

.card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.metric {
  margin-top: 12px;
  font-size: 28px;
  font-weight: 760;
  line-height: 1;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f3;
  color: #405054;
  font-size: 12px;
  font-weight: 620;
  white-space: nowrap;
}

.tag.green { background: var(--soft-green); color: var(--green); }
.tag.blue { background: var(--soft-blue); color: var(--blue); }
.tag.gold { background: var(--soft-gold); color: var(--gold); }
.tag.red { background: var(--soft-red); color: var(--red); }

.list {
  display: grid;
  gap: 0;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.row:first-child {
  border-top: 0;
  padding-top: 0;
}

.row strong {
  display: block;
  font-size: 14px;
}

.row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.screen-note {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 13px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(230px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

.column {
  min-height: 320px;
  padding: 10px;
  background: #eef2f3;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.column h3 {
  margin: 0 0 10px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.mini-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 5px 14px rgba(23, 32, 35, 0.06);
}

.mini-card strong {
  display: block;
  font-size: 14px;
}

.mini-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.day {
  min-height: 118px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.day:nth-child(7n) { border-right: 0; }

.num {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.pill {
  display: block;
  padding: 6px;
  border-radius: 6px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.25;
  background: var(--soft-blue);
  color: var(--blue);
}

.pill.green { background: var(--soft-green); color: var(--green); }
.pill.gold { background: var(--soft-gold); color: var(--gold); }
.pill.red { background: var(--soft-red); color: var(--red); }

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

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

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

.input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
  font-size: 13px;
  color: #314044;
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .cols-2, .cols-3, .cols-4, .split { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .kanban { grid-template-columns: repeat(5, 260px); }
  .calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
