
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --page-gradient-start: #eef3fb;
  --page-gradient-end: #f6f8fd;
  --surface: #ffffff;
  --surface-alt: #f8faff;
  --border-soft: rgba(209, 217, 234, 0.9);
  --border-strong: #cad5ea;
  --text-strong: #0f172a;
  --text-muted: #64748b;
  --brand-900: #184d78;
  --brand-800: #1c5e90;
  --brand-600: #1f6df2;
  --brand-500: #2a7bff;
  --brand-soft: #e5eeff;
  --shadow-soft: 0 18px 48px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 20px 40px rgba(15, 23, 42, 0.08);
  --success: #22c55e;
  --success-soft: #dcfce7;
  --error: #ef4444;
  --error-soft: #fee2e2;
  --warning: #f59e0b;
  --warning-soft: #fef3c7;
  --info-soft: #e0f2fe;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, var(--page-gradient-start) 0%, var(--page-gradient-end) 100%);
  color: var(--text-strong);
  min-height: 100%;
}

a { color: inherit; text-decoration: none; }

.site-topbar {
  background: linear-gradient(90deg, var(--brand-900) 0%, #194d7a 40%, #0f3f63 100%);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.25);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.4px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(255, 255, 255, 0.28));
}

.brand-name { color: #fff; }

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

.top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.96rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  transition: background .2s ease, color .2s ease, border .2s ease;
}

.top-link--ghost:hover { background: rgba(255, 255, 255, 0.18); }

.top-link--primary {
  background: #fff;
  color: var(--brand-900);
  border-color: #fff;
  box-shadow: 0 8px 16px rgba(255, 255, 255, 0.18);
}

.top-link--primary:hover { filter: brightness(0.98); }

.user-chip {
  background: rgba(255, 255, 255, 0.18);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
}

.page-wrapper {
  max-width: 1120px;
  margin: 0 auto;
  padding: 52px 28px 72px;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  align-items: start;
}

.dashboard-sidebar { position: relative; }

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 26px;
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.sidebar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--brand-600) 0%, #1c5de0 100%);
  color: #fff;
  font-weight: 600;
  transition: transform .2s ease, filter .2s ease;
}

.sidebar-action:hover {
  transform: translateY(-1px);
  filter: brightness(.96);
}

.sidebar-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-link {
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--surface-alt);
  border: 1px solid transparent;
  font-weight: 600;
  color: var(--text-strong);
  transition: all .2s ease;
}

.sidebar-link:hover {
  border-color: var(--border-soft);
  background: #eef3ff;
}

.sidebar-link.is-active {
  background: var(--brand-soft);
  border-color: #a7c4ff;
  color: var(--brand-800);
}

.sidebar-empty {
  padding: 18px;
  border-radius: 16px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  background: #f0f3ff;
  border: 1px dashed var(--border-soft);
}

.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 28px;
  padding: 30px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-header--between {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.panel-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.panel-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.panel-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.panel-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease;
}

.btn-primary {
  background: linear-gradient(90deg, var(--brand-600) 0%, #1b63e6 100%);
  color: #fff;
  box-shadow: 0 14px 26px rgba(30, 99, 230, 0.25);
}

.btn-primary:hover { transform: translateY(-1px); filter: brightness(.97); }

.btn-secondary {
  background: #f3f6ff;
  color: var(--brand-800);
  border-color: #c8d8ff;
}

.btn-secondary:hover { background: #e3ecff; }

.flash-stack { display: flex; flex-direction: column; gap: 14px; }

.flash {
  border-radius: 18px;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.95rem;
}

.flash-success { background: var(--success-soft); color: var(--success); }
.flash-error { background: var(--error-soft); color: var(--error); }
.flash-warning { background: var(--warning-soft); color: var(--warning); }
.flash-info { background: var(--info-soft); color: var(--brand-800); }

.inline-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-input {
  flex: 1 1 220px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: #f9fbff;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.inline-input:focus { border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(31, 109, 242, 0.18); }

.pill-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }

.pill { padding: 8px 16px; border-radius: 999px; background: #eef2ff; color: var(--brand-800); font-weight: 600; }

.expense-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }

.expense-item {
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 18px 20px;
  background: #f9fbff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.expense-name { font-weight: 700; font-size: 1.05rem; }

.expense-meta { color: var(--text-muted); font-size: 0.95rem; }

.expense-amount { font-weight: 700; font-size: 1.12rem; color: var(--brand-800); }

.expense-split { font-size: 0.92rem; color: var(--text-muted); }

.expense-split strong { color: var(--text-strong); }

.expense-total {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: baseline;
  font-size: 0.98rem;
  color: var(--text-muted);
}

.expense-total strong { font-size: 1.2rem; color: var(--text-strong); }

.form-stack { display: flex; flex-direction: column; gap: 18px; }

.form-label { font-weight: 600; color: var(--text-strong); }

.form-input {
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: #f9fbff;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.form-input:focus { border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(31, 109, 242, 0.18); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

select.form-input {
  appearance: none;
  background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="12" height="8" fill="none" viewBox="0 0 12 8"%3E%3Cpath fill="%23184d78" d="M6 8 0 0h12L6 8Z"/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: calc(100% - 16px) 50%;
  background-size: 12px 8px;
  padding-right: 42px;
}

.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;
}

@media (max-width: 1024px) {
  .dashboard-shell { grid-template-columns: 1fr; }
  .dashboard-sidebar { order: -1; }
}

@media (max-width: 640px) {
  .page-wrapper { padding: 36px 18px 48px; }
  .panel { padding: 24px; border-radius: 22px; }
  .sidebar-card { border-radius: 22px; }
}
