:root {
  color-scheme: dark;
  --brand-bg: #0b0e14;
  --brand-panel: rgba(30, 41, 59, 0.7);
  --brand-border: rgba(255, 255, 255, 0.1);
  --brand-text-p: #f8fafc;
  --brand-text-s: #94a3b8;
  --brand-sidebar: #0f172a;
  --brand-indigo: #6366f1;
  --brand-accent: #818cf8;
  --emerald: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --shadow-indigo: rgba(99, 102, 241, 0.2);
}

[data-theme='light'] {
  color-scheme: light;
  --brand-bg: #f1f5f9;
  --brand-panel: #ffffff;
  --brand-border: rgba(15, 23, 42, 0.1);
  --brand-text-p: #0f172a;
  --brand-text-s: #64748b;
  --brand-sidebar: #f8fafc;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--brand-bg);
  color: var(--brand-text-p);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  flex: 0 0 auto;
}

.icon-sm {
  width: 0.875rem;
  height: 0.875rem;
}

.selection-shell {
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0b0e14 100%);
  transition: background 300ms ease, color 300ms ease;
}

[data-theme='light'] .selection-shell {
  background: var(--brand-bg);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 16rem;
  display: flex;
  flex-direction: column;
  background: var(--brand-sidebar);
  border-right: 1px solid var(--brand-border);
  transition: background 200ms ease, border-color 200ms ease, width 200ms ease;
}

.sidebar-brand {
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  background: var(--brand-indigo);
  color: #fff;
  box-shadow: 0 10px 25px var(--shadow-indigo);
}

.brand-mark .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.sidebar-brand > span {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem;
  margin-top: 1rem;
  display: grid;
  align-content: start;
  gap: 0.5rem;
}

.nav-item {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid transparent;
  border-radius: 1rem;
  background: transparent;
  color: var(--brand-text-s);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  transition: color 200ms ease, background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--brand-indigo);
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.nav-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--brand-text-p);
}

.nav-item .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.sidebar-user {
  padding: 1rem;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--brand-panel);
  border: 1px solid var(--brand-border);
  color: var(--brand-text-s);
  display: grid;
  place-items: center;
}

.user-avatar .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.sidebar-user p {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
}

.main-shell {
  min-height: 100vh;
  padding-left: 16rem;
  transition: padding-left 200ms ease;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 14, 20, 0.6);
  border-bottom: 1px solid var(--brand-border);
  backdrop-filter: blur(12px);
  padding: 1rem 2rem;
}

[data-theme='light'] .topbar {
  background: rgba(241, 245, 249, 0.74);
}

.topbar-inner {
  max-width: 72rem;
  margin: 0 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-title h1 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  white-space: nowrap;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand-text-s);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.breadcrumb strong {
  color: var(--brand-text-p);
}

.breadcrumb .icon {
  width: 0.75rem;
  height: 0.75rem;
}

.topbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-icon-button {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--brand-text-s);
  display: grid;
  place-items: center;
  transition: color 160ms ease, background 160ms ease;
}

.header-icon-button:hover {
  color: var(--brand-text-p);
  background: rgba(255, 255, 255, 0.05);
}

.unread-dot {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 0.5rem;
  height: 0.5rem;
  background: #f43f5e;
  border: 2px solid var(--brand-bg);
  border-radius: 999px;
}

.notification-dropdown {
  position: absolute;
  right: 2.75rem;
  top: calc(100% + 0.5rem);
  width: 20rem;
  max-width: calc(100vw - 2rem);
  background: var(--brand-panel);
  border: 1px solid var(--brand-border);
  border-radius: 1rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.notification-head {
  padding: 1rem;
  border-bottom: 1px solid var(--brand-border);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.notification-head h4 {
  margin: 0;
  font-size: 0.875rem;
}

.notification-head div {
  display: flex;
  gap: 0.5rem;
}

.notification-head button {
  border: 0;
  background: transparent;
  color: var(--brand-indigo);
  font-size: 0.625rem;
  text-transform: uppercase;
  font-weight: 900;
}

.notification-list {
  max-height: 20rem;
  overflow-y: auto;
}

.notification-item {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 0.75rem;
}

.notification-item.unread {
  background: rgba(99, 102, 241, 0.05);
}

.notification-dot {
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.375rem;
  border-radius: 999px;
  flex: 0 0 auto;
  background: var(--brand-indigo);
}

.notification-dot.success {
  background: #10b981;
}

.notification-dot.warning {
  background: #f59e0b;
}

.notification-item p {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 800;
}

.notification-item span {
  display: block;
  color: var(--brand-text-s);
  font-size: 0.6875rem;
  line-height: 1.45;
}

.notification-item small {
  display: block;
  margin-top: 0.25rem;
  color: rgba(148, 163, 184, 0.65);
  font-size: 0.625rem;
  font-weight: 600;
}

.notification-empty {
  padding: 2rem;
  text-align: center;
  color: var(--brand-text-s);
}

.notification-empty .icon {
  margin: 0 auto 0.5rem;
  color: rgba(148, 163, 184, 0.3);
  width: 2rem;
  height: 2rem;
}

.content {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem;
  padding-bottom: 8rem;
  overflow-x: hidden;
}

.view-stack {
  display: grid;
  gap: 2rem;
  animation: viewIn 220ms ease-out both;
}

.compact-stack {
  gap: 1.5rem;
}

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

.payment-notice,
.summary-card,
.pending-panel,
.project-card,
.table-panel,
.report-pending-panel,
.metric-card,
.breakdown-panel {
  background: var(--brand-panel);
  border: 1px solid var(--brand-border);
  backdrop-filter: blur(16px);
}

.payment-notice {
  min-width: 0;
  max-width: 100%;
  border-radius: 1.5rem;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.notice-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.notice-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 1rem;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  color: var(--amber);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.notice-copy p {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  color: var(--brand-text-p);
  font-size: 0.875rem;
  font-weight: 700;
  white-space: normal;
  overflow-wrap: anywhere;
}

.manual-pay,
.manual-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.secondary-button,
.export-button,
.back-button,
.mini-indigo-button,
.pay-button,
.partial-pay-button,
.mark-paid-button,
.mark-paid-icon,
.delete-button,
.form-submit,
.confirm-yes,
.confirm-no,
.report-cta button {
  border: 1px solid transparent;
  font-weight: 800;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.secondary-button {
  min-width: 0;
  padding: 0.625rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--brand-border);
  color: var(--brand-text-p);
  font-size: 0.75rem;
  white-space: normal;
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.manual-card {
  max-width: 100%;
  width: auto;
  padding: 0.5rem 0.75rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--brand-border);
}

.manual-card span {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.875rem;
  font-weight: 800;
  white-space: nowrap;
}

.mini-indigo-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  color: var(--brand-indigo);
  font-size: 0.625rem;
}

.mini-indigo-button:hover {
  background: var(--brand-indigo);
  color: #fff;
}

.summary-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.summary-card {
  min-width: 0;
  padding: 1.5rem;
  border-radius: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  animation: cardIn 260ms ease-out both;
}

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

.summary-card:hover,
.project-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
}

.summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.summary-top span {
  color: var(--brand-text-s);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.summary-icon {
  padding: 0.5rem;
  border-radius: 0.75rem;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid var(--brand-border);
}

.summary-card.brand .summary-icon {
  color: var(--brand-indigo);
}

.summary-card.paid .summary-icon {
  color: var(--emerald);
}

.summary-card.pending .summary-icon {
  color: var(--amber);
}

.summary-card.expense .summary-icon {
  color: var(--rose);
}

.summary-value {
  margin-top: 1rem;
}

.summary-value strong {
  display: block;
  min-width: 0;
  color: var(--brand-text-p);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}

.summary-value small {
  display: flex;
  margin-top: 0.25rem;
  color: var(--emerald);
  font-size: 0.75rem;
  font-weight: 800;
}

.pending-panel {
  min-width: 0;
  padding: 1.5rem;
  border-radius: 1.5rem;
  border-style: dashed;
  background: rgba(30, 41, 59, 0.3);
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-title-row h4,
.report-pending-panel h4 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand-text-p);
  font-size: 0.875rem;
  font-weight: 800;
}

.panel-title-row h4 .icon,
.report-pending-panel h4 .icon {
  color: #f59e0b;
}

.panel-title-row span {
  color: var(--brand-text-s);
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.project-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  min-width: 0;
  min-height: 12rem;
  padding: 1rem;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 160ms ease, background 160ms ease;
}

.report-project-card {
  background: rgba(255, 255, 255, 0.05);
}

.project-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.project-meta span {
  color: var(--brand-text-s);
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-meta strong {
  color: var(--amber);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.875rem;
  font-weight: 800;
  white-space: nowrap;
}

.report-project-card .project-meta strong {
  font-size: 0.75rem;
}

.project-card h3 {
  margin: 0 0 0.25rem;
  color: var(--brand-text-p);
  font-size: 0.875rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card p,
.report-project-actions > span {
  margin: 0;
  color: var(--brand-text-s);
  font-size: 0.625rem;
}

.project-actions {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.report-project-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.report-project-actions div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pay-button,
.partial-pay-button,
.mark-paid-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.625rem;
}

.pay-button {
  background: rgba(52, 211, 153, 0.1);
  color: var(--emerald);
}

.pay-button:hover {
  background: #10b981;
  color: #fff;
}

.partial-pay-button {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.partial-pay-button:hover {
  background: #f59e0b;
  color: #fff;
}

.mark-paid-button {
  background: rgba(99, 102, 241, 0.1);
  color: var(--brand-indigo);
}

.mark-paid-button:hover {
  background: var(--brand-indigo);
  color: #fff;
}

.mark-paid-icon {
  width: 1.875rem;
  height: 1.875rem;
  padding: 0;
  border-radius: 0.5rem;
  display: grid;
  place-items: center;
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.mark-paid-icon:hover {
  background: #f59e0b;
  color: #fff;
}

.report-cta {
  position: relative;
  overflow: hidden;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem;
  background: linear-gradient(135deg, var(--brand-indigo), #312e81);
  box-shadow: 0 20px 45px var(--shadow-indigo);
  color: #fff;
}

.report-cta-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.report-cta h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 900;
}

.report-cta p {
  max-width: 24rem;
  margin: 0;
  color: rgba(248, 250, 252, 0.8);
  font-size: 0.875rem;
  line-height: 1.55;
}

.report-cta button {
  margin-top: 1rem;
  padding: 0.5rem 1.5rem;
  border-radius: 0.75rem;
  background: #fff;
  color: var(--brand-indigo);
}

.report-cta-icon .icon {
  width: 6rem;
  height: 6rem;
  color: rgba(255, 255, 255, 0.1);
  transform: rotate(12deg);
}

.report-cta-shape {
  position: absolute;
  top: -8rem;
  right: -8rem;
  width: 16rem;
  height: 16rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.transactions-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.transactions-title h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.transactions-title p {
  margin: 0;
  color: var(--brand-text-s);
  font-size: 0.875rem;
  font-weight: 600;
}

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .toolbar {
    flex-direction: row;
  }
}

.search-box {
  position: relative;
  flex: 1;
}

.search-box .icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand-text-s);
}

.search-box input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--brand-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--brand-text-p);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-box input:focus {
  border-color: var(--brand-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--brand-border);
  background: rgba(255, 255, 255, 0.05);
}

.filter-tabs button {
  border: 0;
  border-radius: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: transparent;
  color: var(--brand-text-s);
  font-size: 0.75rem;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.filter-tabs button.active {
  background: var(--brand-indigo);
  color: #fff;
  box-shadow: 0 10px 24px var(--shadow-indigo);
}

.table-panel {
  overflow: hidden;
  border-radius: 1rem;
}

.table-panel > table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  text-align: left;
}

thead tr {
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--brand-border);
}

th {
  padding: 1rem 1.5rem;
  color: var(--brand-text-s);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

th:last-child {
  text-align: right;
}

tbody tr {
  border-bottom: 1px solid var(--brand-border);
  transition: background 160ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

td {
  padding: 1rem 1.5rem;
  vertical-align: middle;
}

td strong {
  display: block;
  color: var(--brand-text-p);
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
}

td span {
  color: var(--brand-text-s);
  font-size: 0.75rem;
}

.amount {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.875rem;
  font-weight: 800;
}

.amount.income {
  color: var(--emerald);
}

.amount.expense {
  color: var(--rose);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.625rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  transition: background 160ms ease;
}

.status-pill.pending {
  color: var(--amber);
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.2);
}

.status-pill.pending:hover {
  background: rgba(251, 191, 36, 0.2);
}

.status-pill.paid {
  color: var(--emerald);
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.2);
}

.status-pill:disabled {
  opacity: 0.8;
}

.date-cell {
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 600;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.delete-button {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--brand-text-s);
}

.delete-button:hover {
  color: var(--rose);
  background: rgba(251, 113, 133, 0.1);
}

.empty-state,
.error-state {
  padding: 5rem 1rem;
  text-align: center;
  color: var(--brand-text-s);
}

.empty-state .icon {
  margin: 0 auto 0.5rem;
  width: 2rem;
  height: 2rem;
  color: rgba(255, 255, 255, 0.1);
}

.report-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .report-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.back-button {
  margin-bottom: 0.5rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--brand-text-s);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.back-button:hover {
  color: var(--brand-indigo);
}

.report-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 900;
}

.report-header p {
  margin: 0.25rem 0 0;
  color: var(--brand-text-s);
}

.report-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  appearance: none;
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--brand-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--brand-text-p);
  outline: none;
  font-size: 0.875rem;
  font-weight: 800;
}

.select-wrap .icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  color: var(--brand-text-s);
  pointer-events: none;
}

.export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  border-color: var(--brand-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--brand-text-p);
  font-size: 0.875rem;
}

.export-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.report-pending-panel {
  padding: 1.5rem;
  border-radius: 1.5rem;
  background: rgba(30, 41, 59, 0.5);
}

.report-pending-panel h4 {
  margin-bottom: 1rem;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

@media (min-width: 768px) {
  .report-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
}

.metrics-column {
  display: grid;
  gap: 1.5rem;
  align-content: start;
}

.metric-card,
.breakdown-panel {
  border-radius: 1.5rem;
  padding: 1.5rem;
}

.metric-card p {
  margin: 0 0 1rem;
  color: var(--brand-text-s);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card strong {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 900;
}

.metric-card div {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 800;
}

.metric-card span,
.metric-card small {
  color: var(--brand-text-s);
}

.metric-card b {
  color: var(--emerald);
}

.breakdown-panel {
  display: grid;
  gap: 2rem;
}

.breakdown-panel h4 {
  margin: 0;
  font-size: 1.125rem;
}

.breakdown-list {
  display: grid;
  gap: 1.5rem;
}

.breakdown-row {
  display: grid;
  gap: 0.5rem;
}

.breakdown-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.breakdown-row span {
  font-size: 0.875rem;
  font-weight: 800;
}

.breakdown-row b {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.875rem;
}

.bar-track {
  height: 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  transition: width 300ms ease;
}

.bar-fill.emerald {
  background: var(--emerald);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.3);
}

.bar-fill.amber {
  background: var(--amber);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.3);
}

.bar-fill.rose {
  background: var(--rose);
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.3);
}

.advice {
  padding-top: 1.5rem;
  border-top: 1px solid var(--brand-border);
}

.advice h5 {
  margin: 0 0 1rem;
  color: var(--brand-text-s);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.advice p {
  margin: 0;
  padding: 1.25rem;
  border-radius: 1rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--brand-text-p);
  font-size: 0.875rem;
  line-height: 1.65;
  font-style: italic;
}

.fab {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  z-index: 40;
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--brand-indigo);
  color: #fff;
  box-shadow: 0 18px 38px rgba(99, 102, 241, 0.4);
  transition: background 160ms ease, transform 160ms ease;
}

.fab:hover {
  background: var(--brand-accent);
  transform: scale(1.1);
}

.fab:active {
  transform: scale(0.95);
}

.fab .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.mobile-nav {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 14, 20, 0.8);
  backdrop-filter: blur(12px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  background: var(--brand-panel);
  border: 1px solid var(--brand-border);
  border-radius: 1.5rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  animation: modalIn 180ms ease-out both;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.transaction-modal {
  max-width: 32rem;
  overflow: hidden;
}

.partial-payment-modal {
  max-width: 28rem;
  overflow: hidden;
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--brand-border);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  margin: 0;
  color: var(--brand-text-p);
  font-size: 1.25rem;
  font-weight: 800;
}

.modal-close {
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--brand-text-s);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--brand-text-p);
}

.transaction-modal .segmented,
.transaction-modal label,
.transaction-modal .form-grid,
.transaction-modal .form-submit,
.partial-payment-body,
.partial-payment-modal .form-submit {
  margin-left: 2rem;
  margin-right: 2rem;
}

.transaction-modal .segmented {
  margin-top: 2rem;
}

.segmented {
  display: flex;
  padding: 0.25rem;
  border-radius: 1rem;
  border: 1px solid var(--brand-border);
  background: rgba(255, 255, 255, 0.05);
}

.segment {
  flex: 1;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: transparent;
  color: var(--brand-text-s);
  font-size: 0.875rem;
  font-weight: 800;
}

.segment.active[data-type='income'] {
  color: var(--emerald);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(52, 211, 153, 0.2);
}

.segment.active[data-type='expense'] {
  color: var(--rose);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(251, 113, 133, 0.2);
}

.form-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

label {
  display: grid;
  gap: 0.5rem;
  color: var(--brand-text-s);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

label > span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

label .icon {
  width: 0.75rem;
  height: 0.75rem;
}

.transaction-modal > label {
  margin-top: 1.5rem;
}

.partial-payment-body {
  margin-top: 2rem;
  display: grid;
  gap: 1.5rem;
}

.partial-payment-project {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--brand-border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 0.375rem;
}

.partial-payment-project span {
  color: var(--brand-text-s);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.partial-payment-project strong {
  color: var(--amber);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--brand-border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--brand-text-p);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

input[type='number'] {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 800;
}

textarea {
  resize: none;
}

.form-submit {
  margin-top: 2rem;
  margin-bottom: 2rem;
  width: calc(100% - 4rem);
  padding: 1rem;
  border: 0;
  border-radius: 1rem;
  background: #059669;
  color: #fff;
  box-shadow: 0 16px 30px rgba(16, 185, 129, 0.2);
}

.form-submit.expense {
  background: #e11d48;
  box-shadow: 0 16px 30px rgba(225, 29, 72, 0.22);
}

.confirm-modal {
  max-width: 24rem;
  padding: 1.5rem;
}

.confirm-modal h2 {
  margin: 0;
  color: var(--brand-text-p);
  font-size: 1.125rem;
  font-weight: 900;
}

.confirm-actions {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.confirm-yes,
.confirm-no {
  padding: 0.75rem 1rem;
  border-radius: 1rem;
}

.confirm-yes {
  background: var(--brand-indigo);
  color: #fff;
}

.confirm-yes:hover {
  background: var(--brand-accent);
}

.confirm-no {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--brand-border);
  color: var(--brand-text-p);
}

@media (max-width: 1023px) and (min-width: 768px) {
  .sidebar {
    width: 5rem;
  }

  .sidebar-brand {
    padding: 1.5rem 1.25rem;
    justify-content: center;
  }

  .sidebar-brand > span,
  .nav-item > span:last-child,
  .sidebar-user p {
    display: none;
  }

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

  .main-shell {
    padding-left: 5rem;
  }
}

@media (max-width: 1023px) {
  .summary-grid,
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .sidebar {
    display: none;
  }

  .main-shell {
    padding-left: 0;
  }

  .topbar {
    padding: 1rem;
  }

  .breadcrumb {
    display: none;
  }

  .content {
    padding: 1rem;
    padding-bottom: 6rem;
  }

  .summary-grid,
  .project-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .payment-notice,
  .manual-pay,
  .manual-card,
  .transactions-title,
  .report-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .notice-copy {
    align-items: flex-start;
  }

  .manual-card span {
    text-align: center;
  }

  .report-cta-content {
    align-items: flex-start;
  }

  .report-cta-icon {
    display: none;
  }

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

  .fab {
    right: 1.25rem;
    bottom: 5rem;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 0.75rem;
    background: rgba(11, 14, 20, 0.8);
    border-top: 1px solid var(--brand-border);
    backdrop-filter: blur(16px);
  }

  [data-theme='light'] .mobile-nav {
    background: rgba(241, 245, 249, 0.86);
  }

  .mobile-nav-item {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--brand-text-s);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.625rem;
    font-weight: 800;
  }

  .mobile-nav-item span:last-child {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-nav-item.active {
    color: var(--brand-indigo);
  }

  .mobile-nav-item .icon {
    width: 1.5rem;
    height: 1.5rem;
  }
}

@media (max-width: 520px) {
  .topbar-title h1 {
    font-size: 1rem;
  }

  .notification-dropdown {
    right: -0.25rem;
    width: calc(100vw - 2rem);
  }

  .transaction-modal .segmented,
  .transaction-modal label,
  .transaction-modal .form-grid,
  .transaction-modal .form-submit {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .modal-header {
    padding: 1rem;
  }

  .form-submit {
    width: calc(100% - 2rem);
    margin-bottom: 1rem;
  }
}
