:root {
  --ink: #18243a;
  --muted: #7c8799;
  --line: #e8edf3;
  --bg: #f5f7fb;
  --navy: #101d35;
  --blue: #3169d5;
  --green: #13875d;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
.app-shell {
  min-height: 100vh;
}
.sidebar {
  width: 248px;
  background: var(--navy);
  color: #fff;
  position: fixed;
  inset: 0 auto 0 0;
  padding: 27px 19px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 43px;
}
.brand-logo {
  width: 43px;
  height: 43px;
  border-radius: 13px;
  object-fit: cover;
}
.brand b {
  display: block;
  font: 800 16px Manrope;
}
.brand span {
  display: block;
  color: #91a1ba;
  font-size: 10px;
  letter-spacing: 2px;
  margin-top: 2px;
}
.brand-mark {
  width: 43px;
  height: 43px;
  border-radius: 13px;
  background: linear-gradient(140deg, #5e94f3, #2860c9);
  display: grid;
  place-items: center;
  color: #fff;
  font: 800 22px Manrope;
  box-shadow: 0 8px 20px #2e69d955;
}
.brand-mark.small {
  width: 37px;
  height: 37px;
  border-radius: 11px;
  font-size: 19px;
}
.side-caption,
.eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #8b98aa;
}
.side-caption {
  padding: 0 10px 12px;
}
.nav-item {
  padding: 12px 13px;
  border-radius: 9px;
  color: #dce6f5;
  font-weight: 600;
  background: #ffffff12;
}
.nav-icon {
  margin-right: 10px;
}
.side-bottom {
  margin-top: auto;
  border-top: 1px solid #ffffff18;
  padding: 17px 7px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a9b6c9;
  font-size: 11px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38c58c;
}
.logout {
  margin-left: auto;
  background: none;
  border: 0;
  color: #cbd5e1;
  font-size: 11px;
}
.main {
  margin-left: 248px;
  padding: 34px 42px 20px;
  max-width: 1800px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 27px;
}
.topbar h1 {
  font: 800 27px Manrope;
  margin: 7px 0 5px;
  letter-spacing: -0.7px;
}
.muted {
  color: var(--muted);
  margin: 0;
}
.top-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.year-label {
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--muted);
  font-weight: 800;
}
.year-label select {
  display: block;
  margin-top: 6px;
  min-width: 118px;
}
.btn,
select,
input {
  border: 1px solid #e0e6ef;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}
.btn {
  font-weight: 700;
  font-size: 12px;
}
.btn-primary {
  background: #2864d3;
  border-color: #2864d3;
  color: #fff;
  box-shadow: 0 5px 12px #2864d326;
}
.btn-outline {
  background: #fff;
}
.full {
  width: 100%;
  padding: 12px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card,
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 3px 12px #172b4605;
}
.stat-card {
  padding: 18px 19px;
}
.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #66748a;
  font-size: 12px;
  font-weight: 600;
}
.stat-card strong {
  display: block;
  font: 800 23px Manrope;
  letter-spacing: -0.7px;
  margin: 13px 0 5px;
  overflow-wrap: anywhere;
}
.stat-card small {
  color: #98a2b1;
  font-size: 10px;
}
.stat-icon {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 15px;
}
.stat-icon.blue {
  background: #edf3ff;
  color: #3973df;
}
.stat-icon.purple {
  background: #f2efff;
  color: #8067d8;
}
.stat-icon.orange {
  background: #fff3e8;
  color: #e18b42;
}
.stat-icon.green {
  background: #e8f7f0;
  color: #149363;
}
.highlight {
  border-color: #d5eee2;
  background: linear-gradient(145deg, #fff, #f7fffb);
}
.highlight strong {
  color: #13875d;
}
.panel {
  padding: 22px;
  margin-bottom: 18px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 18px;
}
.section-heading h2 {
  font: 800 17px Manrope;
  margin: 6px 0;
}
.section-heading .muted {
  font-size: 11px;
}
.legend {
  display: flex;
  gap: 15px;
  color: #8a95a5;
  font-size: 10px;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.blue-dot {
  background: #5283e5;
}
.green-dot {
  background: #20a779;
}
.table-scroll {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 970px;
}
th {
  text-align: right;
  color: #8a95a5;
  font-size: 9px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: #f8fafc;
  padding: 12px 10px;
  white-space: nowrap;
}
td {
  text-align: right;
  padding: 12px 10px;
  border-bottom: 1px solid #eff2f6;
  font-size: 11px;
  white-space: nowrap;
  color: #5b687a;
}
th:first-child,
td:first-child {
  text-align: left;
}
td:first-child {
  font-weight: 700;
  color: #273750;
}
td.net {
  color: #13875d;
  font-weight: 800;
}
td.negative {
  color: #c34e4e !important;
}
.month-link {
  border: 0;
  background: none;
  color: #3169d5;
  font-weight: 700;
  padding: 0;
}
.month-link:hover {
  text-decoration: underline;
}
.edit-icon {
  border: 1px solid #e7ecf2;
  background: #fff;
  border-radius: 6px;
  padding: 5px 8px;
  color: #62718a;
}
.total-row td {
  background: #f8fafc;
  color: #273750;
  font-weight: 800;
  border: 0;
}
.table-note {
  font-size: 10px;
  color: #929dad;
  padding-top: 13px;
}
.editor-panel {
  padding: 22px;
}
.save-indicator {
  font-size: 10px;
  color: #8c98a8;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}
.form-grid label,
.login-card label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #66748a;
  font-size: 10px;
  font-weight: 700;
}
.form-grid input,
.form-grid select {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  font-size: 12px;
}
.form-grid input:focus,
.form-grid select:focus,
.login-card input:focus {
  outline: 2px solid #d6e5ff;
  border-color: #79a2ec;
}
.notes-field {
  grid-column: span 2;
}
.calc-preview {
  margin-top: 17px;
  background: #f7f9fc;
  border: 1px solid #edf1f6;
  border-radius: 9px;
  padding: 13px 15px;
  display: flex;
  gap: 35px;
  flex-wrap: wrap;
}
.calc-preview div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.calc-preview span {
  color: #8a95a5;
  font-size: 10px;
}
.calc-preview b {
  font-size: 12px;
}
.calc-preview .preview-net b {
  color: #13875d;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 16px;
}
.print-year {
  display: none;
}
@media print {
  @page {
    size: landscape;
    margin: 8mm;
  }
  html,
  body {
    width: 100%;
  }
  body {
    background: #fff;
    font-size: 7pt;
  }
  .no-print,
  .sidebar,
  footer {
    display: none !important;
  }
  .main {
    margin-left: 0;
    padding: 0;
    max-width: none;
    width: 100%;
  }
  .topbar {
    align-items: flex-start;
    margin: 0 0 3mm;
  }
  .topbar h1 {
    font-size: 18pt;
    margin: 1.5mm 0;
  }
  .topbar .muted {
    display: none;
  }
  .print-year {
    display: block;
    margin-top: 1.5mm;
    font-size: 8pt;
    font-weight: 800;
  }
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2mm;
    margin-bottom: 3mm;
  }
  .stat-card,
  .panel {
    border: 1px solid #dfe5ec;
    box-shadow: none;
  }
  .stat-card {
    break-inside: avoid;
    padding: 2.5mm 3mm;
  }
  .stat-card strong {
    font-size: 11pt;
    margin: 1mm 0;
  }
  .stat-card small {
    display: none;
  }
  .stat-icon {
    display: none;
  }
  .panel {
    break-inside: auto;
    margin: 0;
    padding: 3mm;
  }
  .section-heading {
    margin-bottom: 2mm;
  }
  .section-heading h2 {
    font-size: 11pt;
    margin: 1.5mm 0;
  }
  .legend {
    display: none;
  }
  .table-scroll {
    overflow: visible;
  }
  table {
    min-width: 0;
    table-layout: fixed;
  }
  thead {
    display: table-header-group;
  }
  tr {
    break-inside: avoid;
  }
  th,
  td {
    font-size: 8pt;
    padding: 1.5mm 1mm;
    line-height: 1.05;
  }
  th:nth-child(n + 2),
  td:nth-child(n + 2) {
    text-align: right;
  }
  th:last-child,
  td:last-child,
  .month-link,
  .edit-icon {
    display: none;
  }
  .table-note {
    display: none;
  }
}
footer {
  text-align: center;
  color: #a0a9b7;
  font-size: 10px;
  padding: 12px;
}
footer span {
  padding: 0 5px;
}
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at 50% 0, #e8efff, transparent 55%), #f5f7fb;
}
.login-card {
  width: min(100%, 390px);
  background: #fff;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 70px #182c4a12;
}
.login-card .brand-mark {
  margin-bottom: 22px;
}
.login-card h1 {
  font: 800 22px Manrope;
  margin: 8px 0;
}
.login-card .muted {
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 22px;
}
.login-card label {
  margin: 13px 0;
}
.login-card input {
  width: 100%;
  padding: 12px;
}
.error {
  color: #c34e4e;
  font-size: 11px;
  margin-top: 12px;
  min-height: 14px;
}
@media (max-width: 1100px) {
  .main {
    padding: 28px 24px;
    margin-left: 215px;
  }
  .sidebar {
    width: 215px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 14px 17px;
    flex-direction: row;
    align-items: center;
  }
  .brand {
    padding: 0;
  }
  .side-caption,
  .nav-item {
    display: none;
  }
  .side-bottom {
    margin: 0 0 0 auto;
    border: 0;
    padding: 0;
  }
  .main {
    margin: 0;
    padding: 22px 14px;
  }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .topbar h1 {
    font-size: 23px;
  }
  .top-actions {
    width: 100%;
    justify-content: space-between;
  }
  .stats-grid {
    gap: 9px;
  }
  .stat-card {
    padding: 14px;
  }
  .stat-card strong {
    font-size: 18px;
  }
  .stat-card small {
    font-size: 9px;
  }
  .panel {
    padding: 15px;
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .legend {
    display: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .notes-field {
    grid-column: auto;
  }
  .calc-preview {
    gap: 17px;
  }
  .calc-preview div {
    min-width: calc(50% - 10px);
  }
  .form-actions .btn {
    flex: 1;
  }
  .logout {
    font-size: 10px;
  }
}
[hidden] {
  display: none !important;
}
