:root {
  --brand: #8f1d2c;
  --brand-dark: #61131e;
  --ink: #1d2433;
  --muted: #6d7686;
  --line: #e7e9ef;
  --paper: #ffffff;
  --bg: #f5f6f8;
  --success: #147a4d;
  --warning: #ad6b00;
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 280px;
  padding: 24px;
  background: #151922;
  color: #fff;
}

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

.brand .mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  font-weight: 900;
}

.brand span {
  display: block;
  margin-top: 3px;
  color: #b8bfca;
  font-size: 13px;
}

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

nav a {
  padding: 12px 14px;
  border-radius: 8px;
  color: #edf0f5;
  background: rgba(255, 255, 255, 0.06);
}

.main {
  margin-left: 280px;
  padding: 28px;
}

.hero,
.page-head {
  display: flex;
  gap: 24px;
  align-items: stretch;
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
}

.hero h1,
.page-head h1 {
  max-width: 760px;
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: 0;
}

.hero p,
.page-head p {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.82);
}

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

.hero .eyebrow,
.page-head .eyebrow {
  color: #ffdce2;
}

.scan-card {
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.scan-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 8px;
}

.scan-result {
  min-height: 58px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.scan-result span,
.scan-result b {
  display: block;
  margin-top: 4px;
}

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

.stats-grid article,
.panel,
.invoice-paper {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 12px 30px rgba(21, 25, 34, 0.06);
}

.stats-grid article {
  padding: 20px;
}

.stats-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stats-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.panel {
  margin-bottom: 22px;
  padding: 22px;
}

.panel-head,
.invoice-top {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel h2,
.invoice-paper h1 {
  margin: 0;
  font-size: 22px;
}

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

label {
  display: grid;
  gap: 7px;
  color: #3d4654;
  font-size: 13px;
  font-weight: 800;
}

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

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

button,
.primary,
.ghost {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 10px 15px;
}

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

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand);
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 18px;
}

table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

th {
  background: #f2f3f6;
  color: #465062;
  font-size: 12px;
  text-align: left;
  text-transform: uppercase;
}

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

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.entry-table input,
.entry-table select {
  min-width: 110px;
}

.entry-table .wide {
  display: grid;
  min-width: 260px;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.entry-table .wide input {
  grid-column: 1 / -1;
}

.split {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 22px;
}

.list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 10px;
  background: #edf0f5;
  color: #485264;
  font-size: 12px;
  font-weight: 800;
}

.badge.approved {
  background: #e3f5eb;
  color: var(--success);
}

.badge.pending_supervisor {
  background: #fff0d7;
  color: var(--warning);
}

.badge.planned {
  background: #edf0f5;
  color: #485264;
}

.badge.in_progress {
  background: #fff0d7;
  color: var(--warning);
}

.badge.released {
  background: #e3f5eb;
  color: var(--success);
}

.badge.priority {
  background: #f4e9ec;
  color: var(--brand);
}

.single-action {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 14px;
}

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

.update-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.update-card h3 {
  margin: 0;
  font-size: 18px;
}

.update-card p {
  margin: 0;
  color: #4c5666;
  line-height: 1.5;
}

.update-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.update-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.update-card dd {
  margin: 4px 0 0;
  font-size: 13px;
}

.invoice-paper {
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px;
}

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

.meta-grid span,
.approval-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
}

.approval-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: end;
  margin-top: 20px;
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .main {
    margin-left: 0;
    padding: 18px;
  }

  .hero,
  .page-head,
  .split,
  .approval-box,
  .updates-list {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .stats-grid,
  .form-grid,
  .meta-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .stats-grid,
  .form-grid,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .hero h1,
  .page-head h1 {
    font-size: 26px;
  }
}

@media print {
  .sidebar,
  .page-head button,
  .invoice-top button,
  .approval-box {
    display: none;
  }

  .main {
    margin: 0;
    padding: 0;
  }

  body {
    background: #fff;
  }

  .invoice-paper,
  .panel {
    border: 0;
    box-shadow: none;
  }
}
