/* ==========================================================================
   Uwadiale's Financial Tracking App
   Design tokens

   The palette starts from the logo. Every visible pixel in the supplied mark
   is #E7E3DD, a warm bone tone, so that colour becomes the primary text and
   logo colour rather than pure white. It sits on true black and is paired
   with a single confident blue for actions and highlights.
   ========================================================================== */

:root {
  /* Surfaces */
  --canvas: #000000;
  --surface: #101216;
  --surface-raised: #171a20;
  --surface-hover: #1c2027;
  --line: #23272f;
  --line-strong: #2f343d;

  /* Text */
  --bone: #e7e3dd;
  --muted: #8b929c;
  --faint: #5c636d;

  /* Brand blue */
  --blue: #2f6bff;
  --blue-hover: #1f58ec;
  --blue-soft: #7ba1ff;
  --blue-wash: rgba(47, 107, 255, 0.12);
  --blue-line: rgba(47, 107, 255, 0.32);

  /* Money semantics. Never the only signal, always paired with an icon. */
  --in: #3fcf8e;
  --in-wash: rgba(63, 207, 142, 0.12);
  --out: #ff6b6b;
  --out-wash: rgba(255, 107, 107, 0.12);
  --warn: #f2a93b;
  --warn-wash: rgba(242, 169, 59, 0.12);

  /* Type */
  --display: "Sora", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Shape and depth */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.5), 0 16px 40px rgba(0, 0, 0, 0.5);

  --sidebar-w: 264px;
  --ease: cubic-bezier(0.2, 0.8, 0.3, 1);
}

/* ==========================================================================
   Reset and base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--bone);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  line-height: 1.2;
}

p {
  margin: 0;
}

a {
  color: var(--blue-soft);
  text-decoration: none;
}

a:hover {
  color: #a4c0ff;
}

img {
  max-width: 100%;
  display: block;
}

/* Numbers line up in columns only when the figures are tabular. */
.figure,
.amount,
td.num,
.stat-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Visible keyboard focus everywhere, never removed. */
:focus-visible {
  outline: 2px solid var(--blue-soft);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 999;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  transition: top 0.15s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

/* Lucide renders inline SVG. Size and alignment are set once here. */
[data-lucide],
svg.lucide {
  width: 18px;
  height: 18px;
  stroke-width: 1.75;
  flex: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 550;
  line-height: 1;
  padding: 11px 18px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: none;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease),
    color 0.15s var(--ease), transform 0.08s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.btn-primary:hover {
  background: var(--blue-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--surface-raised);
  border-color: var(--line-strong);
  color: var(--bone);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--blue-line);
  color: var(--bone);
}

.btn-ghost {
  color: var(--muted);
  padding: 9px 12px;
}

.btn-ghost:hover {
  background: var(--surface-raised);
  color: var(--bone);
}

.btn-danger {
  background: var(--out-wash);
  border-color: rgba(255, 107, 107, 0.4);
  color: #ff9c9c;
}

.btn-danger:hover {
  background: rgba(255, 107, 107, 0.2);
  color: #ffb8b8;
}

.btn-lg {
  padding: 14px 26px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--r-sm);
  color: var(--muted);
  border: 1px solid transparent;
}

.btn-icon:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  color: var(--bone);
}

.btn-icon.danger:hover {
  color: #ff9c9c;
  border-color: rgba(255, 107, 107, 0.4);
}

/* ==========================================================================
   Cards, panels and headings
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
}

.card-flush {
  padding: 0;
  overflow: hidden;
}

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

.card-head h2,
.card-head h3 {
  font-size: 16px;
  font-weight: 600;
}

.card-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.section-title {
  font-size: 20px;
  margin-bottom: 4px;
}

.section-note {
  color: var(--muted);
  font-size: 14px;
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 22px 0;
}

/* ==========================================================================
   Application shell
   ========================================================================== */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px 20px 20px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.sidebar-brand .brand-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.sidebar-brand .brand-sub {
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.2;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
  overflow-y: auto;
}

.nav-group + .nav-group {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  transition: background-color 0.14s var(--ease), color 0.14s var(--ease);
}

.nav-link:hover {
  background: var(--surface-raised);
  color: var(--bone);
}

.nav-link.active {
  background: var(--blue-wash);
  color: var(--bone);
}

/* A blue rail marks the current page, so position is not signalled by colour alone. */
.nav-link.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--blue);
  border-radius: 0 3px 3px 0;
}

.nav-link.active [data-lucide],
.nav-link.active svg {
  color: var(--blue-soft);
}

.sidebar-foot {
  padding: 14px 12px;
  border-top: 1px solid var(--line);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
}

.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--blue-wash);
  border: 1px solid var(--blue-line);
  color: var(--blue-soft);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
}

.user-chip .who {
  min-width: 0;
}

.user-chip .who strong {
  display: block;
  font-size: 13.5px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip .who span {
  display: block;
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  font-size: 18px;
  flex: 1;
  min-width: 0;
}

.topbar .page-sub {
  color: var(--muted);
  font-size: 13px;
  font-family: var(--body);
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 1px;
}

.page {
  padding: 26px 28px 96px;
  max-width: 1240px;
  width: 100%;
}

/* ==========================================================================
   Notification bell
   ========================================================================== */

.bell {
  position: relative;
}

.bell-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warn);
  border: 2px solid var(--canvas);
}

.bell-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 330px;
  max-width: calc(100vw - 32px);
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lift);
  padding: 8px;
  z-index: 60;
}

.bell-panel[hidden] {
  display: none;
}

.bell-panel h3 {
  font-size: 13px;
  padding: 8px 10px 10px;
  color: var(--muted);
  font-weight: 500;
  font-family: var(--body);
}

.alert-row {
  display: flex;
  gap: 11px;
  padding: 11px;
  border-radius: var(--r-sm);
  align-items: flex-start;
}

.alert-row + .alert-row {
  border-top: 1px solid var(--line);
}

.alert-row strong {
  display: block;
  font-size: 13.5px;
  font-weight: 550;
}

.alert-row p {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}

.alert-row.danger [data-lucide],
.alert-row.danger svg {
  color: var(--out);
}

.alert-row.warning [data-lucide],
.alert-row.warning svg {
  color: var(--warn);
}

/* ==========================================================================
   Dashboard statistics
   The balance panel is deliberately larger than the other three. Equal cards
   would flatten the hierarchy and hide the number that matters most.
   ========================================================================== */

.stat-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  color: var(--muted);
  margin-bottom: 14px;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.stat-value {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 4px;
  word-break: break-word;
}

.stat-meta {
  color: var(--faint);
  font-size: 12.5px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-meta [data-lucide],
.stat-meta svg {
  width: 14px;
  height: 14px;
}

/* The signature panel: bigger type, a blue rail, and a live balance line. */
.stat-balance {
  position: relative;
  background: linear-gradient(180deg, #0e131f 0%, var(--surface) 62%);
  border-color: var(--blue-line);
  overflow: hidden;
}

.stat-balance::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--blue);
}

.stat-balance .stat-icon {
  background: var(--blue-wash);
  border-color: var(--blue-line);
  color: var(--blue-soft);
}

.stat-balance .stat-value {
  font-size: 38px;
}

.spark {
  margin-top: auto;
  padding-top: 14px;
  height: 62px;
}

.stat-income .stat-icon {
  background: var(--in-wash);
  border-color: rgba(63, 207, 142, 0.28);
  color: var(--in);
}

.stat-expense .stat-icon {
  background: var(--out-wash);
  border-color: rgba(255, 107, 107, 0.28);
  color: var(--out);
}

.stat-savings .stat-icon {
  background: var(--blue-wash);
  border-color: var(--blue-line);
  color: var(--blue-soft);
}

/* ==========================================================================
   Warning banner
   ========================================================================== */

.banner {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px 18px;
  border-radius: var(--r-md);
  border: 1px solid;
  margin-bottom: 20px;
}

.banner strong {
  font-size: 14.5px;
  font-weight: 600;
  display: block;
}

.banner p {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 2px;
}

.banner.warning {
  background: var(--warn-wash);
  border-color: rgba(242, 169, 59, 0.34);
}

.banner.warning > [data-lucide],
.banner.warning > svg {
  color: var(--warn);
}

.banner.danger {
  background: var(--out-wash);
  border-color: rgba(255, 107, 107, 0.34);
}

.banner.danger > [data-lucide],
.banner.danger > svg {
  color: var(--out);
}

.banner.info {
  background: var(--blue-wash);
  border-color: var(--blue-line);
}

.banner.info > [data-lucide],
.banner.info > svg {
  color: var(--blue-soft);
}

/* ==========================================================================
   Layout grids
   ========================================================================== */

.grid-2 {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  align-items: start;
}

.grid-2-even {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 16px;
}

/* ==========================================================================
   Transaction rows
   ========================================================================== */

.tx-list {
  display: flex;
  flex-direction: column;
}

.tx-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 13px;
  align-items: center;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
}

.tx-row:last-child {
  border-bottom: 0;
}

.tx-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface-raised);
  color: var(--muted);
}

.tx-row.income .tx-mark {
  background: var(--in-wash);
  border-color: rgba(63, 207, 142, 0.28);
  color: var(--in);
}

.tx-row.expense .tx-mark {
  background: var(--out-wash);
  border-color: rgba(255, 107, 107, 0.28);
  color: var(--out);
}

.tx-body {
  min-width: 0;
}

.tx-title {
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta {
  color: var(--faint);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 1px;
}

.tx-meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
  flex: none;
}

.tx-amount {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tx-row.income .tx-amount {
  color: var(--in);
}

.tx-row.expense .tx-amount {
  color: var(--out);
}

/* ==========================================================================
   Tables
   ========================================================================== */

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

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

table.data th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

table.data tbody tr {
  transition: background-color 0.12s var(--ease);
}

table.data tbody tr:hover {
  background: var(--surface-raised);
}

td.num,
th.num {
  text-align: right;
}

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

/* ==========================================================================
   Pills and badges
   ========================================================================== */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 550;
  border: 1px solid var(--line-strong);
  background: var(--surface-raised);
  color: var(--muted);
  white-space: nowrap;
}

.pill [data-lucide],
.pill svg {
  width: 13px;
  height: 13px;
}

.pill.income {
  background: var(--in-wash);
  border-color: rgba(63, 207, 142, 0.3);
  color: var(--in);
}

.pill.expense {
  background: var(--out-wash);
  border-color: rgba(255, 107, 107, 0.3);
  color: var(--out);
}

.pill.warn {
  background: var(--warn-wash);
  border-color: rgba(242, 169, 59, 0.3);
  color: var(--warn);
}

.pill.blue {
  background: var(--blue-wash);
  border-color: var(--blue-line);
  color: var(--blue-soft);
}

/* ==========================================================================
   Progress bars
   ========================================================================== */

.progress {
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--surface-hover);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--blue);
  width: 0;
  transition: width 0.55s var(--ease);
}

.progress-fill.safe {
  background: var(--blue);
}

.progress-fill.close {
  background: var(--warn);
}

.progress-fill.over {
  background: var(--out);
}

.progress-fill.done {
  background: var(--in);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  margin-bottom: 7px;
}

.progress-label .value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.field {
  margin-bottom: 17px;
}

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 550;
  margin-bottom: 7px;
}

.field .hint {
  color: var(--faint);
  font-size: 12.5px;
  margin-top: 6px;
}

.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 14.5px;
  color: var(--bone);
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  transition: border-color 0.14s var(--ease), background-color 0.14s var(--ease);
}

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

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b929c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px var(--blue-wash);
}

/* Dates and numbers need help to look right on a dark background. */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.62);
  cursor: pointer;
}

input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-error,
.input-error:focus {
  border-color: var(--out);
  box-shadow: 0 0 0 3px var(--out-wash);
}

.error-text {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ff9c9c;
  font-size: 12.5px;
  margin-top: 7px;
}

.error-text [data-lucide],
.error-text svg {
  width: 14px;
  height: 14px;
}

/* Amount inputs carry the currency symbol inside the field. */
.input-affix {
  position: relative;
}

.input-affix .affix {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14.5px;
  pointer-events: none;
}

.input-affix input {
  padding-left: 32px;
}

.input-affix .toggle-visibility {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 7px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
}

.input-affix .toggle-visibility:hover {
  color: var(--bone);
  background: var(--surface-hover);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
}

.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ==========================================================================
   Filter bar
   ========================================================================== */

.filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) repeat(4, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
}

.filters .field {
  margin: 0;
}

.filters label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 5px;
}

.search-field {
  position: relative;
}

.search-field [data-lucide],
.search-field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.search-field input {
  padding-left: 38px;
}

/* ==========================================================================
   Empty states
   ========================================================================== */

.empty {
  text-align: center;
  padding: 52px 24px;
}

.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  color: var(--faint);
}

.empty-icon [data-lucide],
.empty-icon svg {
  width: 24px;
  height: 24px;
}

.empty h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.empty p {
  color: var(--muted);
  font-size: 14px;
  max-width: 380px;
  margin: 0 auto 20px;
}

/* ==========================================================================
   Toasts
   ========================================================================== */

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 340px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 15px;
  border-radius: var(--r-md);
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lift);
  pointer-events: auto;
  animation: toast-in 0.28s var(--ease);
}

.toast.leaving {
  animation: toast-out 0.22s var(--ease) forwards;
}

.toast p {
  font-size: 13.5px;
  flex: 1;
}

.toast .close {
  background: none;
  border: 0;
  color: var(--faint);
  cursor: pointer;
  padding: 2px;
  display: grid;
  place-items: center;
}

.toast .close:hover {
  color: var(--bone);
}

.toast.success > [data-lucide],
.toast.success > svg {
  color: var(--in);
}

.toast.error > [data-lucide],
.toast.error > svg {
  color: var(--out);
}

.toast.info > [data-lucide],
.toast.info > svg {
  color: var(--blue-soft);
}

.toast.warning > [data-lucide],
.toast.warning > svg {
  color: var(--warn);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(24px);
  }
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade-in 0.16s var(--ease);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lift);
  padding: 24px;
  width: 100%;
  max-width: 420px;
  animation: modal-in 0.22s var(--ease);
}

.modal h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.modal p {
  color: var(--muted);
  font-size: 14px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}

/* ==========================================================================
   Charts
   ========================================================================== */

.chart-box {
  position: relative;
  height: 280px;
}

.chart-box.tall {
  height: 320px;
}

.chart-box canvas {
  animation: fade-in 0.4s var(--ease);
}

/* ==========================================================================
   Category and goal lists
   ========================================================================== */

.cat-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cat-row:last-child {
  border-bottom: 0;
}

.cat-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  color: var(--muted);
}

.cat-name {
  font-size: 14px;
  font-weight: 500;
}

.cat-bar {
  margin-top: 6px;
}

.goal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.goal-card.complete {
  border-color: rgba(63, 207, 142, 0.34);
}

.goal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.goal-name {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
}

.goal-figures {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.goal-figures .saved {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
}

.goal-figures .target {
  color: var(--muted);
  font-size: 14px;
}

.goal-add {
  display: flex;
  gap: 8px;
}

.goal-add .input-affix {
  flex: 1;
}

/* ==========================================================================
   Mobile navigation
   ========================================================================== */

.mobile-bar,
.mobile-top {
  display: none;
}

/* ==========================================================================
   Landing page
   ========================================================================== */

.landing {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  gap: 20px;
}

.landing-nav .brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.landing-nav .brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.landing-nav .brand span {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
}

.landing-nav .links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 68px 0 84px;
}

.hero-logo {
  width: 132px;
  margin-bottom: 30px;
}

.hero h1 {
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.hero p.lede {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  margin-top: 20px;
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.hero-trust {
  display: flex;
  gap: 22px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.hero-trust div strong {
  display: block;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
}

.hero-trust div span {
  color: var(--faint);
  font-size: 12.5px;
}

/* The hero visual is a real interface built from the same components as the
   product, not a stock photograph of a bank. */
.hero-preview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-lift);
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.preview-head span {
  color: var(--faint);
  font-size: 12px;
}

.preview-balance {
  background: linear-gradient(180deg, #0e131f, var(--surface-raised));
  border: 1px solid var(--blue-line);
  border-radius: var(--r-md);
  padding: 18px;
  margin-bottom: 12px;
}

.preview-balance .label {
  color: var(--muted);
  font-size: 12.5px;
}

.preview-balance .value {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.preview-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.preview-mini {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
}

.preview-mini .label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.preview-mini .value {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.preview-mini.up .label [data-lucide],
.preview-mini.up .label svg {
  color: var(--in);
  width: 14px;
  height: 14px;
}

.preview-mini.down .label [data-lucide],
.preview-mini.down .label svg {
  color: var(--out);
  width: 14px;
  height: 14px;
}

.preview-chart {
  height: 96px;
}

.feature-band {
  padding: 76px 0;
  border-top: 1px solid var(--line);
}

.band-intro {
  max-width: 52ch;
  margin-bottom: 42px;
}

.band-intro h2 {
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.025em;
}

.band-intro p {
  color: var(--muted);
  font-size: 16px;
  margin-top: 14px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
}

.feature .icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  background: var(--blue-wash);
  border: 1px solid var(--blue-line);
  color: var(--blue-soft);
  margin-bottom: 16px;
}

.feature h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.feature p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.cta-band {
  border-top: 1px solid var(--line);
  padding: 76px 0;
  text-align: center;
}

.cta-band h2 {
  font-size: clamp(26px, 3.2vw, 38px);
  letter-spacing: -0.025em;
}

.cta-band p {
  color: var(--muted);
  font-size: 16px;
  margin: 14px auto 28px;
  max-width: 48ch;
}

.landing-foot {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 13px;
}

/* ==========================================================================
   Auth pages
   ========================================================================== */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-card .logo {
  width: 60px;
  margin-bottom: 26px;
}

.auth-card h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.auth-card .sub {
  color: var(--muted);
  font-size: 14.5px;
  margin-top: 8px;
  margin-bottom: 28px;
}

.auth-foot {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.auth-aside {
  background:
    radial-gradient(900px 600px at 30% 20%, rgba(47, 107, 255, 0.16), transparent 62%),
    var(--surface);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
}

.auth-aside h2 {
  font-size: 28px;
  letter-spacing: -0.025em;
  max-width: 20ch;
}

.auth-aside p {
  color: var(--muted);
  font-size: 15px;
  margin-top: 14px;
  max-width: 40ch;
}

.aside-points {
  list-style: none;
  padding: 0;
  margin: 34px 0 0;
  display: grid;
  gap: 16px;
}

.aside-points li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14.5px;
}

.aside-points li [data-lucide],
.aside-points li svg {
  color: var(--blue-soft);
  margin-top: 2px;
}

.aside-points li span {
  color: var(--muted);
  display: block;
  font-size: 13.5px;
  margin-top: 2px;
}

/* Password strength readout */
.strength {
  margin-top: 10px;
}

.strength-track {
  display: flex;
  gap: 4px;
}

.strength-track i {
  flex: 1;
  height: 3px;
  border-radius: var(--r-pill);
  background: var(--surface-hover);
  transition: background-color 0.2s var(--ease);
}

.strength-track i.on-weak {
  background: var(--out);
}

.strength-track i.on-fair {
  background: var(--warn);
}

.strength-track i.on-strong {
  background: var(--in);
}

.strength-text {
  color: var(--faint);
  font-size: 12.5px;
  margin-top: 6px;
}

/* ==========================================================================
   Error pages
   ========================================================================== */

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

.error-page .code {
  font-family: var(--display);
  font-size: 15px;
  color: var(--blue-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.error-page h1 {
  font-size: 30px;
  margin: 10px 0 12px;
  letter-spacing: -0.025em;
}

.error-page p {
  color: var(--muted);
  max-width: 44ch;
  margin: 0 auto 26px;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.pager .count {
  color: var(--faint);
  font-size: 13px;
}

.pager .pages {
  display: flex;
  gap: 6px;
}

.pager .pages a,
.pager .pages span {
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pager .pages a:hover {
  border-color: var(--blue-line);
  color: var(--bone);
  background: var(--surface-raised);
}

.pager .pages .current {
  background: var(--blue-wash);
  border-color: var(--blue-line);
  color: var(--bone);
}

.pager .pages .gap {
  border-color: transparent;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.small {
  font-size: 13px;
}

.right {
  text-align: right;
}

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

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.wrap {
  flex-wrap: wrap;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.grow { flex: 1; min-width: 0; }

/* A single page-load reveal, used once per page rather than on every card. */
.reveal {
  animation: reveal 0.42s var(--ease) both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ==========================================================================
   Responsive
   The mobile layout is rebuilt rather than shrunk: the sidebar becomes a
   bottom bar, tables become stacked rows, and multi-column grids collapse.
   ========================================================================== */

@media (max-width: 1100px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-balance {
    grid-column: 1 / -1;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 48px 0 60px;
  }

  .feature-grid,
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .grid-2,
  .grid-2-even {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .filters .search-field {
    grid-column: 1 / -1;
  }

  .auth-aside {
    display: none;
  }

  .auth-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 14.5px;
  }

  .sidebar {
    display: none;
  }

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

  .topbar {
    display: none;
  }

  /* Compact top bar with page title and the notification bell. */
  .mobile-top {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 13px 16px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }

  .mobile-top img {
    width: 26px;
    height: 26px;
    object-fit: contain;
  }

  .mobile-top h1 {
    font-size: 16px;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Five destinations, thumb reachable, with the add action in the middle. */
  .mobile-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    inset: auto 0 0 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
  }

  .mobile-bar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 2px;
    border-radius: var(--r-sm);
    color: var(--faint);
    font-size: 10.5px;
    font-weight: 500;
  }

  .mobile-bar a.active {
    color: var(--blue-soft);
  }

  .mobile-bar a.add [data-lucide],
  .mobile-bar a.add svg {
    background: var(--blue);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    padding: 8px;
    stroke-width: 2.25;
  }

  .mobile-bar a.add {
    color: var(--muted);
  }

  .page {
    padding: 18px 16px 40px;
  }

  .card {
    padding: 17px;
    border-radius: var(--r-md);
  }

  .stat-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-balance .stat-value {
    font-size: 31px;
  }

  .stat {
    padding: 17px;
  }

  /* Income, expense and savings sit in one compact row on a phone. */
  .stat-income,
  .stat-expense {
    flex-direction: row;
    align-items: center;
    gap: 13px;
  }

  .stat-income .stat-icon,
  .stat-expense .stat-icon {
    margin-bottom: 0;
  }

  .stat-income .stat-value,
  .stat-expense .stat-value {
    font-size: 20px;
  }

  .feature-grid,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
  }

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

  .hero-logo {
    width: 104px;
  }

  .landing {
    padding: 0 16px;
  }

  .feature-band,
  .cta-band {
    padding: 52px 0;
  }

  .toast-stack {
    right: 12px;
    left: 12px;
    bottom: 84px;
    width: auto;
  }

  .chart-box {
    height: 240px;
  }

  /* Tables become stacked cards, each cell labelled by its column header. */
  table.data.stack-mobile thead {
    display: none;
  }

  table.data.stack-mobile,
  table.data.stack-mobile tbody,
  table.data.stack-mobile tr,
  table.data.stack-mobile td {
    display: block;
    width: 100%;
  }

  table.data.stack-mobile tr {
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 6px 12px;
    margin-bottom: 10px;
    background: var(--surface-raised);
  }

  table.data.stack-mobile td {
    border: 0;
    padding: 7px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    text-align: right;
  }

  table.data.stack-mobile td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
    text-align: left;
    flex: none;
  }

  table.data.stack-mobile td.actions {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    margin-top: 4px;
    padding-top: 10px;
  }

  .landing-nav .links .hide-sm {
    display: none;
  }
}

/* Anyone who has asked for less motion gets none of it. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
