:root {
  --navy: #10243f;
  --ink: #182132;
  --muted: #607086;
  --line: #dbe4ef;
  --sky: #e8f5fb;
  --aqua: #2da9b8;
  --green: #1b8f73;
  --gold: #c8a24a;
  --panel: #ffffff;
  --bg: #f5f8fb;
  --alert: #fff6d8;
  --danger: #b84242;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Lato, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a { color: inherit; }

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

.po-sidebar,
.sidebar {
  background: var(--navy);
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
}

.nav-list,
.nav {
  display: grid;
  gap: 8px;
}

.nav-list a,
.nav a {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #dbe7f2;
}

.nav-list a.active,
.nav a.active {
  background: #19395e;
  color: #fff;
}

.po-main,
main {
  min-width: 0;
  padding: 28px;
}

.page-header,
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

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

h1 {
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  color: var(--navy);
  font-size: 20px;
  line-height: 1.25;
}

h3 {
  color: var(--navy);
  font-size: 16px;
}

.lead,
.subtitle {
  color: var(--muted);
  line-height: 1.55;
  max-width: 760px;
}

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

.button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  padding: 9px 13px;
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.button.secondary { background: #fff; }

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

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

.metric-card span,
.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.metric-card strong,
.metric strong {
  display: block;
  margin-top: 10px;
  color: var(--navy);
  font-size: 24px;
}

.content-grid,
.modules-grid,
.grid {
  display: grid;
  gap: 14px;
}

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

.two-col {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr);
  gap: 18px;
}

.module-card {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
}

.module-card:hover {
  border-color: var(--aqua);
}

.module-kicker {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.module-card p,
.panel p {
  color: var(--muted);
  line-height: 1.45;
}

.panel-heading,
.doc-topline,
.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-chip,
.status,
.chip,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--sky);
  color: #1d6170;
  border: 1px solid #c8e9f2;
  white-space: nowrap;
}

.status.ok { background: #e5f6f1; color: #126a56; border-color: #bde2d7; }
.status.warn { background: var(--alert); color: #7c6323; border-color: #ead893; }
.status.danger { background: #fbe9e9; color: var(--danger); border-color: #edc8c8; }

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

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

.span-2 { grid-column: 1 / -1; }

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

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

.check-list,
.plain-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.table-wrap { overflow-x: auto; }

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.document-preview {
  max-width: 940px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 12px 28px rgba(16, 36, 63, .08);
}

.doc-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 24px 0 18px;
  margin-bottom: 18px;
}

.doc-meta {
  display: grid;
  gap: 10px;
  min-width: 190px;
  margin: 0;
}

.doc-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.doc-meta dt { color: var(--muted); }
.doc-meta dd { margin: 0; font-weight: 700; color: var(--navy); }

.doc-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.doc-section:last-child { border-bottom: 0; }

.total-row {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #f0f8fb;
  color: var(--navy);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

@media (max-width: 980px) {
  .po-shell,
  .shell,
  .metric-grid,
  .metrics,
  .status-row,
  .modules-grid,
  .grid,
  .two-col,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .page-header,
  .topbar,
  .doc-header {
    flex-direction: column;
  }

  .po-main,
  main { padding: 18px; }
}
