:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-soft: #050505;
  --surface-high: #111111;
  --surface-higher: #171717;
  --ink: #ffffff;
  --muted: #a3a3a3;
  --muted-strong: #d4d4d4;
  --line: #171717;
  --line-strong: #262626;
  --primary: #ffffff;
  --on-primary: #000000;
  --pastel-green: #bbf7d0;
  --pastel-red: #fecaca;
  --pastel-amber: #fef08a;
  --pastel-blue: #bfdbfe;
  --pastel-purple: #d8b4fe;
  --danger: #fecaca;
  --warning: #fef08a;
  --success: #bbf7d0;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.72);
  --radius: 0;
  --sidebar-width: 72px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 260px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

::selection {
  background: rgba(255, 255, 255, 0.18);
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: #000000;
}

::-webkit-scrollbar-thumb {
  background: #262626;
}

.material-symbols-outlined {
  direction: ltr;
  display: inline-block;
  font-family: "Material Symbols Outlined";
  font-size: 20px;
  font-style: normal;
  font-weight: normal;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
}

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  height: 100vh;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  border-right: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 18px 8px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.78rem;
  font-weight: 900;
}

.brand span:not(.brand-mark),
.nav-item span:not(.material-symbols-outlined),
.sidebar-footer {
  display: none;
}

.nav-list {
  display: grid;
  width: 100%;
  gap: 8px;
}

.nav-item {
  display: grid;
  width: 100%;
  height: 44px;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: var(--line-strong);
  background: var(--surface-higher);
  color: var(--primary);
}

.nav-item.is-active {
  box-shadow: inset 2px 0 0 var(--primary);
}

.main-content {
  width: 100%;
  min-width: 0;
  padding: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.88);
  padding: 12px 24px;
  backdrop-filter: blur(12px);
}

.topbar h1,
.section-heading h2,
.modal-header h2 {
  margin: 2px 0 0;
  color: var(--primary);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 24px 16px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 16px;
}

.section-heading h2 {
  font-size: clamp(1.35rem, 2vw, 1.95rem);
  font-style: italic;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-header h3 {
  margin: 3px 0 0;
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: uppercase;
}

.eyebrow,
.filters-bar label > span,
.expense-form label > span {
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions,
.heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-field,
.month-field,
.filters-bar label,
.expense-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

[hidden],
.expense-form label[hidden] {
  display: none !important;
}

.search-field {
  position: relative;
  width: min(420px, 36vw);
}

.search-field .material-symbols-outlined,
.search-field i {
  position: absolute;
  top: 50%;
  left: 10px;
  color: var(--muted);
  font-size: 18px;
  transform: translateY(-50%);
}

.search-field input {
  width: 100%;
  padding-left: 36px;
}

.month-field {
  min-width: 156px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #000000;
  color: var(--ink);
  outline: 0;
  padding: 10px 12px;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #525252;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: var(--surface-soft);
  box-shadow: none;
}

.button,
.icon-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 0 14px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
  white-space: nowrap;
}

.button:active,
.icon-button:active {
  transform: translateY(1px);
}

.button-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}

.button-primary:hover {
  background: #d4d4d4;
  border-color: #d4d4d4;
}

.button-secondary,
.button-ghost {
  background: #000000;
  color: var(--primary);
}

.button-secondary:hover,
.button-ghost:hover {
  border-color: var(--primary);
  background: var(--surface-high);
}

.button.is-active {
  border-color: rgba(187, 247, 208, 0.38);
  background: rgba(187, 247, 208, 0.08);
  color: var(--pastel-green);
}

.button.is-warning {
  border-color: rgba(254, 240, 138, 0.38);
  background: rgba(254, 240, 138, 0.08);
  color: var(--pastel-amber);
}

.button.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.button.compact {
  min-height: 34px;
}

.icon-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  background: #000000;
  color: var(--muted);
}

.icon-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.button .material-symbols-outlined,
.icon-button .material-symbols-outlined,
.metric-icon .material-symbols-outlined,
.empty-state .material-symbols-outlined {
  font-size: 18px;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.metrics-grid,
.dashboard-grid,
.filters-bar,
.payment-grid,
.report-grid {
  margin-right: 24px;
  margin-left: 24px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card {
  position: relative;
  display: flex;
  min-height: 126px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 16px;
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
}

.metric-card:hover {
  border-color: #404040;
  background: var(--surface-high);
}

.metric-card::after {
  position: absolute;
  right: -14px;
  bottom: -18px;
  color: rgba(255, 255, 255, 0.05);
  content: "■";
  font-size: 92px;
  line-height: 1;
}

.metric-icon {
  order: 2;
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: #000000;
  color: var(--primary);
}

.accent-mint {
  color: var(--pastel-green);
}

.accent-amber {
  color: var(--pastel-amber);
}

.accent-coral {
  color: var(--pastel-red);
}

.accent-blue {
  color: var(--pastel-blue);
}

.accent-purple {
  color: var(--pastel-purple);
}

.metric-card p,
.metric-card strong {
  display: block;
  margin: 0;
}

.metric-card p {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-card strong {
  margin-top: 14px;
  color: var(--primary);
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  font-weight: 800;
  line-height: 1;
}

.dashboard-grid,
.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 18px;
  box-shadow: none;
}

.panel-badge {
  border: 1px solid var(--line-strong);
  color: var(--muted-strong);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 6px 10px;
  text-transform: uppercase;
}

.chart-controls {
  display: flex;
  align-items: end;
  gap: 8px;
}

.chart-controls label {
  display: grid;
  gap: 5px;
}

.chart-controls label span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chart-controls select {
  min-width: 96px;
  min-height: 34px;
  padding: 7px 10px;
}

.chart-panel canvas {
  display: block;
  width: 100%;
  height: 320px;
}

.category-list,
.due-list,
.instrument-list,
.report-list,
.budget-list {
  display: grid;
  gap: 10px;
}

.category-row,
.due-item,
.instrument-row,
.report-item,
.budget-row {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  background: #000000;
  padding: 12px;
}

.category-row-top,
.budget-row-top,
.due-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-row strong,
.budget-row strong,
.due-item strong,
.instrument-row strong,
.report-item strong {
  color: var(--primary);
  font-size: 0.88rem;
}

.category-row span,
.budget-row span,
.due-item span,
.instrument-row span,
.report-item span,
.muted {
  color: var(--muted);
  font-size: 0.78rem;
}

.progress-track {
  overflow: hidden;
  height: 4px;
  background: var(--surface-higher);
}

.progress-fill {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: var(--primary);
}

.filters-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.table-panel {
  margin: 0 24px 24px;
  padding: 0;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 16px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #000000;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: var(--muted-strong);
  font-size: 0.84rem;
}

tbody tr {
  transition: background 0.18s ease;
}

tbody tr:hover {
  background: var(--surface-high);
}

.detail-cell strong,
.detail-cell span {
  display: block;
}

.detail-cell strong {
  color: var(--primary);
}

.detail-cell span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
}

.inline-link {
  display: inline-flex;
  width: fit-content;
  border-bottom: 1px solid currentColor;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  margin-top: 7px;
  text-decoration: none;
  text-transform: uppercase;
}

.inline-link:hover {
  color: var(--pastel-blue);
}

.align-right {
  text-align: right;
}

.actions-column {
  width: 112px;
  text-align: right;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.row-actions .icon-button {
  width: 32px;
  min-height: 32px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid var(--line-strong);
  padding: 3px 8px;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.chip-fixed {
  border-color: rgba(254, 240, 138, 0.38);
  background: rgba(254, 240, 138, 0.08);
  color: var(--pastel-amber);
}

.chip-variable {
  border-color: rgba(191, 219, 254, 0.36);
  background: rgba(191, 219, 254, 0.08);
  color: var(--pastel-blue);
}

.chip-subscription {
  border-color: rgba(216, 180, 254, 0.36);
  background: rgba(216, 180, 254, 0.08);
  color: var(--pastel-purple);
}

.chip-paid {
  border-color: rgba(187, 247, 208, 0.36);
  background: rgba(187, 247, 208, 0.08);
  color: var(--success);
}

.chip-pending {
  border-color: rgba(254, 240, 138, 0.36);
  background: rgba(254, 240, 138, 0.08);
  color: var(--warning);
}

.chip-overdue {
  border-color: rgba(254, 202, 202, 0.36);
  background: rgba(254, 202, 202, 0.08);
  color: var(--danger);
}

.empty-state {
  display: none;
  place-items: center;
  gap: 8px;
  min-height: 240px;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.empty-state.is-visible {
  display: grid;
}

.empty-state strong {
  color: var(--primary);
}

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

.payment-card {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 16px;
}

.payment-card span,
.payment-card strong,
.payment-card small {
  display: block;
}

.payment-card span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.payment-card strong {
  margin-top: 12px;
  color: var(--primary);
  font-size: 1.55rem;
}

.payment-card small {
  margin-top: 6px;
  color: var(--muted);
}

.instrument-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.report-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.72);
  padding: 16px;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: #000000;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line-strong);
  padding: 18px;
}

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

.expense-form .full {
  grid-column: 1 / -1;
}

.ticket-current {
  border: 1px solid var(--line);
  background: #000000;
  color: var(--muted);
  padding: 12px;
}

.ticket-current span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.checkbox-line input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 36px));
  border: 1px solid var(--line-strong);
  background: var(--primary);
  color: var(--on-primary);
  opacity: 0;
  padding: 13px 14px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  pointer-events: none;
  text-transform: uppercase;
  transform: translateY(8px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .metrics-grid,
  .payment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: 66px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
    padding: 12px;
  }

  .brand {
    flex: 0 0 auto;
  }

  .nav-list {
    display: flex;
    width: auto;
    min-width: max-content;
  }

  .nav-item {
    width: 44px;
    flex: 0 0 44px;
  }

  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    padding: 18px 14px;
  }

  .topbar-actions,
  .heading-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .search-field {
    width: 100%;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
    margin: 22px 14px 14px;
  }

  .metrics-grid,
  .dashboard-grid,
  .filters-bar,
  .payment-grid,
  .report-grid {
    grid-template-columns: 1fr;
    margin-right: 14px;
    margin-left: 14px;
  }

  .table-panel {
    margin-right: 14px;
    margin-left: 14px;
  }

  .chart-panel canvas {
    height: 260px;
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .chart-controls {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .chart-controls label,
  .chart-controls select,
  .chart-controls .panel-badge {
    width: 100%;
  }

  .expense-form {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 100vh;
    min-height: 100vh;
    border-right: 0;
    border-left: 0;
  }
}

@media (max-width: 520px) {
  .button,
  .month-field,
  .filters-bar label {
    width: 100%;
  }

  .category-row-top,
  .budget-row-top,
  .due-item,
  .instrument-row,
  .report-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .instrument-row,
  .report-item {
    display: flex;
  }
}

.sidebar-logout {
  display: grid;
  width: 44px;
  height: 44px;
  margin-top: auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  text-decoration: none;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.sidebar-logout:hover {
  border-color: var(--primary);
  background: var(--surface-higher);
  color: var(--primary);
}

.user-chip {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  background: #000000;
  padding: 0 12px;
  white-space: nowrap;
}

.user-chip small,
.user-chip strong {
  display: block;
}

.user-chip small {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-chip strong {
  color: var(--primary);
  font-size: 0.78rem;
  line-height: 1.1;
}

.metric-card::after {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.05);
  content: "";
  font-size: 0;
}

.user-cell strong,
.user-cell span {
  display: block;
}

.user-cell strong {
  color: var(--primary);
  font-size: 0.8rem;
}

.user-cell span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.68rem;
}

.loading-cell {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 32px 16px;
  text-align: center;
  text-transform: uppercase;
}

.bottom-panel {
  margin: 0 24px 24px;
}

.login-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.login-topbar {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.9);
  padding: 0 24px;
}

.login-topbar strong {
  color: var(--primary);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.login-topbar span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-main {
  display: grid;
  flex: 1;
  place-items: center;
  padding: 28px 16px;
}

.login-card {
  position: relative;
  width: min(430px, 100%);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 32px;
  animation: fadeUp 0.5s ease both;
}

.login-card::after {
  position: absolute;
  inset: -50%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  content: "";
  transform: translateX(-100%) rotate(18deg);
  animation: scanLine 6s linear infinite;
  pointer-events: none;
}

.brand-lock {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.login-card h1 {
  position: relative;
  z-index: 1;
  margin: 4px 0 0;
  color: var(--primary);
  font-size: 1.7rem;
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
}

.login-copy,
.login-users {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.login-error {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(254, 202, 202, 0.35);
  background: rgba(254, 202, 202, 0.08);
  color: var(--pastel-red);
  font-size: 0.78rem;
  font-weight: 800;
  margin: 18px 0 0;
  padding: 11px 12px;
}

.login-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.login-form label {
  display: grid;
  gap: 7px;
}

.login-form label span,
.login-users span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-form .button {
  margin-top: 6px;
  width: 100%;
}

.login-users {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 18px;
}

.login-users strong {
  color: var(--primary);
  font-size: 0.8rem;
}

.diagnostic-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(254, 240, 138, 0.35);
  background: rgba(254, 240, 138, 0.08);
  color: var(--pastel-amber);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  margin-top: 14px;
  padding: 10px 12px;
  text-decoration: none;
  text-transform: uppercase;
}

.diagnostic-card {
  width: min(680px, 100%);
}

.diagnostic-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.diagnostic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  background: #000000;
  padding: 12px;
}

.diagnostic-row strong,
.diagnostic-row span {
  display: block;
}

.diagnostic-row strong {
  color: var(--primary);
  font-size: 0.84rem;
}

.diagnostic-row span {
  color: var(--muted);
  font-size: 0.74rem;
  margin-top: 4px;
}

.diagnostic-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.metric-card,
.panel,
.payment-card,
.category-row,
.due-item,
.instrument-row,
.report-item,
.budget-row,
tbody tr {
  animation: fadeUp 0.42s ease both;
}

.metrics-grid .metric-card:nth-child(2),
.payment-grid .payment-card:nth-child(2) {
  animation-delay: 0.04s;
}

.metrics-grid .metric-card:nth-child(3),
.payment-grid .payment-card:nth-child(3) {
  animation-delay: 0.08s;
}

.metrics-grid .metric-card:nth-child(4),
.payment-grid .payment-card:nth-child(4) {
  animation-delay: 0.12s;
}

.metrics-grid .metric-card:nth-child(5) {
  animation-delay: 0.16s;
}

.metrics-grid .metric-card:nth-child(6) {
  animation-delay: 0.2s;
}

.modal-backdrop.is-open .modal {
  animation: panelSlide 0.22s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panelSlide {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scanLine {
  from {
    transform: translateX(-100%) rotate(18deg);
  }
  to {
    transform: translateX(100%) rotate(18deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 820px) {
  .sidebar-logout {
    width: 44px;
    flex: 0 0 44px;
    margin-top: 0;
    margin-left: auto;
  }

  .user-chip {
    width: 100%;
  }

  .bottom-panel {
    margin-right: 14px;
    margin-left: 14px;
  }

  .login-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
  }

  .login-card {
    padding: 24px;
  }
}
