:root {
  color-scheme: light;
  --ink: #16202a;
  --muted: #667085;
  --line: #d8dee8;
  --panel: #ffffff;
  --page: #eef3f7;
  --blue: #2764d8;
  --blue-dark: #174aa8;
  --green: #1d8f63;
  --amber: #b7791f;
  --red: #c2413a;
  --shadow: 0 16px 40px rgba(22, 32, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  color: #eef5ff;
  background: #172033;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #10223c;
  background: #f4c542;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.launch-card small {
  color: #b9c5d6;
}

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

.nav-item {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #dce7f7;
  background: transparent;
  text-align: left;
}

.nav-item span {
  width: 24px;
  color: #f4c542;
  text-align: center;
  font-size: 20px;
}

.nav-item.active,
.nav-item:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
}

.launch-card {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar,
.panel-heading,
.tools-row,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

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

.primary-button,
.ghost-button,
.text-button,
.danger-button,
.icon-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 800;
}

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

.primary-button:hover {
  background: var(--blue-dark);
}

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

.text-button {
  color: var(--blue);
  background: transparent;
}

.danger-button {
  color: #fff;
  background: var(--red);
}

.icon-button {
  width: 40px;
  padding: 0;
  color: var(--ink);
  background: #eef3f7;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat,
.panel,
.record-card,
.reminder-item,
.timeline-item,
.report-card,
.pipeline-column {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stat {
  padding: 18px;
}

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

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 32px;
}

.stat.urgent strong {
  color: var(--red);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

.reminder-list,
.record-list,
.timeline,
.report-grid,
.pipeline,
.finance-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.pipeline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.pipeline-column {
  padding: 12px;
  box-shadow: none;
}

.pipeline-column h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.mini-record {
  padding: 10px;
  border-radius: 8px;
  background: #f4f7fb;
  margin-bottom: 8px;
}

.mini-record strong,
.record-title strong,
.reminder-item strong,
.timeline-item strong {
  display: block;
}

.mini-record small,
.record-meta,
.reminder-item small,
.timeline-item small,
.report-card small {
  color: var(--muted);
}

.reminder-item,
.timeline-item {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.reminder-item.overdue {
  border-color: rgba(194, 65, 58, 0.4);
  background: #fff7f6;
}

.reminder-actions,
.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: #24405f;
  background: #e8eef7;
  font-size: 12px;
  font-weight: 800;
}

.chip.green {
  color: #0f6747;
  background: #daf5e9;
}

.chip.amber {
  color: #7a4b0b;
  background: #fff0cf;
}

.chip.red {
  color: #9e2f29;
  background: #ffe2df;
}

.tools-row {
  margin-bottom: 14px;
}

.search-box {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.search-box input,
.tools-row select {
  min-height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
}

.search-box input {
  width: 100%;
}

.tools-row select {
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.record-list {
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}

.record-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.record-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.record-title strong {
  font-size: 18px;
}

.record-card p {
  margin-bottom: 0;
  color: #3d4b5f;
  line-height: 1.45;
}

.report-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.report-card {
  padding: 16px;
}

.report-card strong {
  display: block;
  margin: 8px 0;
  font-size: 28px;
}

.finance-layout {
  display: grid;
  gap: 18px;
}

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

.finance-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.finance-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.finance-card strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
}

.finance-card.good strong {
  color: var(--green);
}

.finance-card.warn strong {
  color: var(--amber);
}

.finance-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 16px;
}

.finance-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.finance-table th,
.finance-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.finance-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.money-positive {
  color: var(--green);
  font-weight: 900;
}

.money-negative {
  color: var(--red);
  font-weight: 900;
}

dialog {
  width: min(940px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(22, 32, 42, 0.28);
}

dialog::backdrop {
  background: rgba(12, 20, 32, 0.55);
}

.record-form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.dialog-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.form-section-title {
  padding-top: 4px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

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

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

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

textarea {
  resize: vertical;
  line-height: 1.45;
}

.empty {
  padding: 24px;
  border: 1px dashed #b8c3d3;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.empty-table {
  color: var(--muted);
  text-align: center;
}

.table-link {
  border: 0;
  padding: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 900;
}

.extra-note {
  padding: 10px;
  border-radius: 8px;
  background: #fff8e8;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .launch-card {
    display: none;
  }

  .board-layout,
  .stats-grid,
  .pipeline,
  .form-grid,
  .finance-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .panel-heading,
  .tools-row,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .nav-item {
    justify-content: center;
  }
}
