@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/Poppins-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/Poppins-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/Poppins-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/Poppins-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand: #d32f2f;
  --brand-dark: #b71c1c;
  --brand-deep: #8e1717;
  --brand-soft: #ffebee;
  --brand-soft-2: #fff5f5;
  --ink: #1f2937;
  --text: #374151;
  --muted: #6b7280;
  --muted-light: #9ca3af;
  --line: #e5e7eb;
  --line-soft: #eef0f3;
  --bg: #f3f4f6;
  --bg-soft: #f9fafb;
  --white: #ffffff;
  --success: #15803d;
  --success-soft: #dcfce7;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 14px 34px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.14);
  --shadow-brand: 0 10px 24px rgba(211, 47, 47, 0.22);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --sidebar-width: 252px;
  --topbar-height: 72px;
  --font: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

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

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(211, 47, 47, 0.04), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body:has(dialog[open]) {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4,
strong {
  color: var(--ink);
}

h1 {
  font-size: clamp(1.7rem, 2.5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

h3 {
  font-size: 0.98rem;
  font-weight: 600;
}

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

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

button {
  color: inherit;
}

img,
svg {
  display: block;
}

::selection {
  background: rgba(211, 47, 47, 0.18);
}

:focus-visible {
  outline: 3px solid rgba(211, 47, 47, 0.25);
  outline-offset: 2px;
}

.icon {
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: middle;
}

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

.muted-text {
  color: var(--muted);
  font-size: 0.88rem;
}

.text-danger {
  color: var(--danger) !important;
}

.mobile-only {
  display: none !important;
}

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

.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.64rem 1rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}

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

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--brand);
  color: var(--white);
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 14px 28px rgba(211, 47, 47, 0.27);
}

.btn-secondary {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  border-color: #d1d5db;
  background: var(--bg-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--ink);
}

.btn-light {
  background: var(--white);
  color: var(--brand);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}

.btn-light:hover {
  background: var(--brand-soft);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
  box-shadow: 0 10px 22px rgba(185, 28, 28, 0.18);
}

.btn-danger:hover {
  background: #991b1b;
}

.btn-sm {
  min-height: 34px;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  font-size: 0.78rem;
}

.btn-lg {
  min-height: 50px;
  padding: 0.85rem 1.25rem;
  border-radius: 14px;
  font-size: 0.94rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 42px;
  padding: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.icon-btn:hover {
  background: var(--bg);
  color: var(--ink);
}

.icon-btn-sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.icon-btn-danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.text-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.text-button:hover {
  text-decoration: underline;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.text-link:hover {
  color: var(--brand-dark);
}

/* Shared surfaces */
.card {
  background: var(--white);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: 1.45rem;
}

.view-stack {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.eyebrow {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--brand);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow-light {
  color: #fecaca;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.25rem 0 0.1rem;
}

.page-heading p {
  max-width: 620px;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.page-heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.section-header h2 {
  margin: 0;
}

.section-header p {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.section-header.compact {
  margin-bottom: 0.8rem;
}

.section-action {
  flex: 0 0 auto;
}

/* Avatars */
.avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: var(--avatar-size, 38px);
  height: var(--avatar-size, 38px);
  border-radius: 50%;
  background: var(--avatar-bg, #6b7280);
  color: var(--white);
  font-size: var(--avatar-font, 14px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.avatar-ring {
  box-shadow: 0 0 0 2px var(--white), 0 0 0 3.5px rgba(211, 47, 47, 0.28);
}

/* Brand */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  border-radius: 13px;
}

.brand-type {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  color: var(--ink);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.brand-tagline {
  margin-top: 0.14rem;
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.03em;
}

.brand-lockup-compact .brand-name {
  font-size: 1.08rem;
}

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  padding: 0.26rem 0.55rem;
  border-radius: 999px;
  background: var(--chip-bg, var(--bg));
  color: var(--chip-color, var(--muted));
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.chip .icon {
  width: 13px;
  height: 13px;
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.chip-xs {
  padding: 0.2rem 0.45rem;
  font-size: 0.62rem;
}

.category-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-color, var(--muted));
}

/* Progress */
.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--brand-soft);
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 0.4s var(--ease);
}

.progress-success {
  background: var(--success);
}

.progress-warning {
  background: var(--warning);
}

.progress-label {
  color: var(--muted);
  font-size: 0.68rem;
}

/* Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.stat-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  min-width: 0;
  padding: 1rem;
  background: var(--white);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.stat-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
}

.stat-primary .stat-icon {
  background: var(--brand-soft);
  color: var(--brand);
}

.stat-danger .stat-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.stat-warning .stat-icon {
  background: var(--warning-soft);
  color: var(--warning);
}

.stat-success .stat-icon {
  background: var(--success-soft);
  color: var(--success);
}

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

.stat-label {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-value {
  display: block;
  margin-top: 0.16rem;
  color: var(--ink);
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.stat-hint {
  display: block;
  margin-top: 0.1rem;
  overflow: hidden;
  color: var(--muted-light);
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 1.5rem 1rem;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 0.8rem;
  border-radius: 18px;
  background: var(--brand-soft);
  color: var(--brand);
}

.empty-state h3 {
  margin: 0;
  font-size: 0.96rem;
}

.empty-state p {
  max-width: 350px;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.empty-action {
  margin-top: 0.9rem;
}

/* App shell */
.app-root {
  min-height: 100dvh;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100dvh;
  padding: 1.5rem 1rem 1rem;
  background:
    radial-gradient(circle at 10% 0%, rgba(211, 47, 47, 0.28), transparent 17rem),
    linear-gradient(180deg, #1f2937 0%, #172033 100%);
  color: #d1d5db;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 0.25rem 0.5rem 1.3rem;
}

.sidebar-brand .brand-name {
  color: #fff;
}

.sidebar-brand .brand-tagline {
  color: #9ca3af;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 0.82rem;
  border-radius: 12px;
  color: #cbd5e1;
  font-size: 0.84rem;
  font-weight: 500;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  transform: translateX(2px);
}

.sidebar-link.is-active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 24px rgba(211, 47, 47, 0.26);
}

.sidebar-link.is-active::after {
  position: absolute;
  right: 0.62rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  content: '';
}

.sidebar-spacer {
  flex: 1;
  min-height: 1.5rem;
}

.sidebar-couple {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem;
  margin-bottom: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.couple-avatars {
  display: flex;
  flex: 0 0 auto;
}

.couple-avatars .avatar + .avatar {
  margin-left: -9px;
}

.couple-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.couple-copy strong {
  overflow: hidden;
  color: #f9fafb;
  font-size: 0.72rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.couple-copy span {
  color: #9ca3af;
  font-size: 0.62rem;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem;
  border-radius: 10px;
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-user-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.sidebar-user-copy strong {
  overflow: hidden;
  color: #f9fafb;
  font-size: 0.78rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy span {
  color: #9ca3af;
  font-size: 0.62rem;
}

.sidebar-logout {
  color: #9ca3af;
}

.sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fecaca;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  padding: 0 1.6rem;
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar-mobile-brand {
  display: none;
}

.topbar-context {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.topbar-date {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.topbar-caption {
  color: var(--muted);
  font-size: 0.65rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.sync-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 34px;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.sync-button:hover {
  border-color: #d1d5db;
  background: var(--bg-soft);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

.sync-online .sync-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.13);
}

.sync-connecting .sync-dot {
  background: #f59e0b;
  animation: pulse-dot 1.4s ease-in-out infinite;
}

.sync-offline .sync-dot {
  background: #94a3b8;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
}

.sync-pill.sync-online {
  background: var(--success-soft);
  color: var(--success);
}

.sync-pill.sync-connecting {
  background: var(--warning-soft);
  color: var(--warning);
}

.sync-pill.sync-offline {
  background: var(--bg);
  color: var(--muted);
}

.topbar-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.topbar-icon-btn:hover,
.topbar-icon-btn[aria-expanded='true'] {
  background: var(--brand-soft);
  color: var(--brand);
}

.notification-badge {
  position: absolute;
  top: 1px;
  right: 0;
  display: grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  border: 2px solid var(--white);
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.35rem 0.25rem 0.25rem;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  transition: background 0.18s var(--ease);
}

.topbar-user:hover {
  background: var(--bg);
}

.view-root {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.7rem clamp(1rem, 2.3vw, 2rem) 2.5rem;
}

.bottom-nav {
  display: none;
}

/* Notifications */
.notification-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(2px);
}

.notification-panel {
  position: fixed;
  top: calc(var(--topbar-height) + 8px);
  right: 1.4rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 2rem));
  max-height: min(620px, calc(100dvh - var(--topbar-height) - 26px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  animation: panel-in 0.18s var(--ease);
}

.notification-panel[hidden],
.notification-backdrop[hidden] {
  display: none;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.notification-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.8rem;
  border-bottom: 1px solid var(--line-soft);
}

.notification-panel-head div {
  display: flex;
  flex-direction: column;
}

.notification-panel-head strong {
  font-size: 0.88rem;
}

.notification-panel-head span {
  color: var(--muted);
  font-size: 0.68rem;
}

.notification-panel-list {
  overflow-y: auto;
  padding: 0.4rem;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem;
  border-radius: 11px;
  transition: background 0.16s var(--ease);
}

.notification-item:hover {
  background: var(--bg-soft);
}

.notification-icon {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--bg);
  color: var(--muted);
}

.notification-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.notification-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.notification-primary {
  background: var(--info-soft);
  color: var(--info);
}

.notification-neutral {
  background: var(--bg);
  color: var(--muted);
}

.notification-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.notification-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.77rem;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.notification-copy span {
  margin-top: 0.12rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-chevron {
  margin-top: 0.25rem;
  color: var(--muted-light);
}

.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 2.2rem 1rem;
  color: var(--muted);
  text-align: center;
}

.notification-empty .icon {
  margin-bottom: 0.35rem;
  color: var(--success);
}

.notification-empty strong {
  font-size: 0.85rem;
}

.notification-empty span {
  font-size: 0.72rem;
}

.notification-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-soft);
}

.notification-panel-foot a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 600;
}

.notification-panel-foot span {
  color: var(--muted);
  font-size: 0.64rem;
}

/* Login */
.login-root {
  background: var(--bg);
}

.login-page {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(440px, 0.92fr);
  min-height: 100dvh;
}

.login-art {
  position: relative;
  display: flex;
  min-height: 100dvh;
  padding: clamp(2rem, 4vw, 4rem);
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.12), transparent 19rem),
    linear-gradient(145deg, #8e1717 0%, #b71c1c 40%, #d32f2f 100%);
  color: #fff;
}

.login-art::after {
  position: absolute;
  right: -7rem;
  bottom: -9rem;
  width: 28rem;
  height: 28rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow:
    0 0 0 3.5rem rgba(255, 255, 255, 0.035),
    0 0 0 7rem rgba(255, 255, 255, 0.025);
  content: '';
}

.login-art-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.login-art-glow-a {
  top: -7rem;
  right: -4rem;
  width: 25rem;
  height: 25rem;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 65%);
}

.login-art-glow-b {
  bottom: 5%;
  left: -9rem;
  width: 24rem;
  height: 24rem;
  background: radial-gradient(circle, rgba(255, 177, 177, 0.15), transparent 68%);
}

.login-art-inner {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 540px);
  flex-direction: column;
  margin: auto;
}

.login-brand .brand-name {
  color: #fff;
}

.login-brand .brand-tagline {
  color: #fecaca;
}

.login-art-copy {
  margin: auto 0;
  padding: 2.5rem 0;
}

.login-art-copy h1 {
  max-width: 470px;
  color: #fff;
  font-size: clamp(2.1rem, 4.2vw, 3.45rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.07;
}

.login-art-copy p {
  max-width: 450px;
  margin-top: 1.1rem;
  color: #fee2e2;
  font-size: 0.94rem;
  line-height: 1.7;
}

.login-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.login-features li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff1f2;
  font-size: 0.72rem;
  backdrop-filter: blur(5px);
}

.login-features li > span {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.login-art-footer {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #fecaca;
  font-size: 0.72rem;
}

.login-art-footer .icon {
  color: #fff;
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: clamp(1.25rem, 4vw, 3.5rem);
  background:
    radial-gradient(circle at 100% 0%, rgba(211, 47, 47, 0.05), transparent 25rem),
    var(--white);
}

.login-card {
  width: min(100%, 410px);
}

.login-mobile-brand {
  display: none;
  margin-bottom: 2rem;
}

.login-intro h2 {
  margin-top: 0.05rem;
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.login-intro p {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.profile-picker {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1.35rem 0;
}

.profile-option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}

.profile-option:hover {
  border-color: #d1d5db;
  background: var(--bg-soft);
  transform: translateY(-1px);
}

.profile-option.is-selected {
  border-color: rgba(211, 47, 47, 0.42);
  background: var(--brand-soft-2);
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.07);
}

.profile-option-avatar {
  display: flex;
}

.profile-option-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.profile-option-copy strong {
  font-size: 0.88rem;
  font-weight: 600;
}

.profile-option-copy span {
  color: var(--muted);
  font-size: 0.68rem;
}

.profile-option-check {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: transparent;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.profile-option.is-selected .profile-option-check {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.74rem;
  cursor: pointer;
}

.checkbox-row input {
  accent-color: var(--brand);
}

.login-hint {
  margin-top: 1rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.7rem;
}

.login-hint summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.login-hint summary::-webkit-details-marker {
  display: none;
}

.login-hint p {
  padding: 0 0.75rem 0.7rem;
  line-height: 1.65;
}

.login-hint code {
  padding: 0.08rem 0.28rem;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.68rem;
}

.login-footnote {
  margin-top: 1.4rem;
  color: var(--muted-light);
  font-size: 0.63rem;
  text-align: center;
}

/* Fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-width: 0;
}

.field-full {
  grid-column: 1 / -1;
}

.field-label {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 600;
}

.required {
  color: var(--brand);
}

.input {
  width: 100%;
  min-height: 43px;
  padding: 0.62rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  color: var(--ink);
  font-size: 0.84rem;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}

.input::placeholder {
  color: var(--muted-light);
}

.input:hover {
  border-color: #d1d5db;
}

.input:focus {
  outline: none;
  border-color: rgba(211, 47, 47, 0.55);
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.09);
}

.input:disabled {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}

.textarea {
  min-height: 84px;
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' 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 0.72rem center;
  cursor: pointer;
}

.select-compact {
  width: auto;
  min-width: 190px;
  min-height: 38px;
  font-size: 0.76rem;
}

.input-affix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-affix .input {
  padding-left: 3rem;
}

.input-prefix {
  position: absolute;
  left: 0.8rem;
  z-index: 1;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  pointer-events: none;
}

.input-affix-password .input {
  padding-right: 2.7rem;
  padding-left: 0.75rem;
}

.input-suffix {
  position: absolute;
  right: 0.32rem;
}

.field-help {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.5;
}

.field-help code {
  padding: 0.05rem 0.25rem;
  border-radius: 4px;
  background: var(--bg);
  font-size: 0.62rem;
}

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

.form-error {
  padding: 0.6rem 0.7rem;
  border: 1px solid #fecaca;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.74rem;
}

.choice-field {
  padding: 0;
  border: 0;
  margin: 0;
}

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

.choice-card {
  position: relative;
  cursor: pointer;
}

.choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-inner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.choice-card:hover .choice-inner {
  background: var(--bg-soft);
}

.choice-card input:checked + .choice-inner {
  border-color: rgba(211, 47, 47, 0.45);
  background: var(--brand-soft-2);
  box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.07);
}

.choice-card input:focus-visible + .choice-inner {
  outline: 3px solid rgba(211, 47, 47, 0.25);
  outline-offset: 2px;
}

.choice-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmented {
  display: flex;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-soft);
}

.segmented-inline {
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.segmented-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 1;
  min-height: 34px;
  padding: 0.38rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.segmented-tab:hover {
  color: var(--ink);
}

.segmented-tab.is-active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.segmented-tab span {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  place-items: center;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.6rem;
}

.segmented-tab.is-active span {
  background: var(--brand-soft);
  color: var(--brand);
}

.segmented-option {
  position: relative;
  flex: 1;
  cursor: pointer;
}

.segmented-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 33px;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.segmented-option input:checked + span {
  background: var(--white);
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.segmented-option input:focus-visible + span {
  outline: 3px solid rgba(211, 47, 47, 0.25);
  outline-offset: 1px;
}

.inline-alert {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.76rem;
}

.alert-warning {
  border-color: #fde68a;
  background: var(--warning-soft);
  color: #92400e;
}

.alert-icon {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--warning);
}

.alert-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.alert-copy strong {
  color: #78350f;
  font-size: 0.77rem;
}

.alert-copy span {
  color: #92400e;
  font-size: 0.68rem;
}

.info-note {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.9rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
}

.info-note .icon {
  margin-top: 0.1rem;
  color: var(--brand);
}

.confirm-text {
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.65;
}

/* Dashboard */
.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
}

.dashboard-heading p {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.heading-heart {
  display: inline-flex;
  margin-left: 0.15rem;
  color: var(--brand);
  vertical-align: 0.05em;
}

.dashboard-heading-actions {
  display: flex;
  gap: 0.65rem;
}

.balance-hero {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 230px;
  padding: 1.65rem;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 83% 18%, rgba(211, 47, 47, 0.42), transparent 18rem),
    linear-gradient(125deg, #1b2432 0%, #1f2937 55%, #2a1b20 100%);
  color: #fff;
  box-shadow: 0 18px 45px rgba(31, 41, 55, 0.17);
}

.balance-hero-settled {
  background:
    radial-gradient(circle at 84% 18%, rgba(21, 128, 61, 0.35), transparent 18rem),
    linear-gradient(125deg, #1b2432 0%, #1f2937 55%, #172b24 100%);
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-orb-a {
  top: -8rem;
  right: -5rem;
  width: 22rem;
  height: 22rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 3rem rgba(255, 255, 255, 0.025),
    0 0 0 6rem rgba(255, 255, 255, 0.018);
}

.hero-orb-b {
  bottom: -7rem;
  left: 30%;
  width: 15rem;
  height: 15rem;
  background: radial-gradient(circle, rgba(211, 47, 47, 0.2), transparent 68%);
}

.balance-hero-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.hero-label {
  color: #fca5a5;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.balance-hero-amount {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.7rem;
  margin-top: 0.2rem;
}

.balance-hero-amount strong {
  color: #fff;
  font-size: clamp(2.1rem, 4vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.1;
}

.balance-hero-message {
  color: #fecaca;
  font-size: 0.82rem;
  font-weight: 500;
}

.balance-hero-sub {
  margin-top: 0.45rem;
  color: #9ca3af;
  font-size: 0.78rem;
}

.balance-hero-users {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.hero-user {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.36rem 0.55rem 0.36rem 0.36rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
}

.hero-user > span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.hero-user strong {
  color: #f9fafb;
  font-size: 0.67rem;
  font-weight: 600;
}

.hero-user small {
  color: #9ca3af;
  font-size: 0.58rem;
}

.balance-hero-side {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.8rem;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #e5e7eb;
  font-size: 0.7rem;
  font-weight: 500;
}

.hero-link:hover {
  color: #fff;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}

.quick-action:hover {
  border-color: rgba(211, 47, 47, 0.22);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.quick-action-icon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
}

.quick-action > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.3;
}

.quick-action strong {
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-action small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.install-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: linear-gradient(100deg, var(--brand-soft) 0%, #fff 100%);
}

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

.install-icon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
}

.install-copy > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.install-copy strong {
  font-size: 0.78rem;
}

.install-copy span {
  color: var(--muted);
  font-size: 0.68rem;
}

.install-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.3rem;
}

/* Mini rows */
.mini-list {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.mini-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.2rem;
  border-radius: 9px;
  transition: background 0.16s var(--ease);
}

a.mini-row:hover {
  background: var(--bg-soft);
}

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

.mini-row-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.mini-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.64rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.65rem;
}

.meta-item .avatar {
  margin-right: 0.05rem;
}

.mini-chevron {
  color: var(--muted-light);
}

.mini-more {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.7rem;
}

.task-mini.is-overdue .mini-title {
  color: var(--danger);
}

.date-block {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 45px;
  flex-direction: column;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  line-height: 1;
}

.date-block strong {
  color: var(--brand);
  font-size: 0.95rem;
  font-weight: 700;
}

.date-block span {
  margin-top: 0.15rem;
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
}

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

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0;
}

.activity-item + .activity-item {
  border-top: 1px solid var(--line-soft);
}

.activity-copy p {
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.45;
}

.activity-copy span {
  color: var(--muted-light);
  font-size: 0.6rem;
}

.shopping-mini-progress {
  margin-bottom: 0.55rem;
}

.shopping-mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.shopping-mini-top strong {
  color: var(--brand);
  font-size: 0.72rem;
}

/* Finance */
.finance-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.6rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.12), transparent 17rem),
    linear-gradient(135deg, #8e1717, #b71c1c 52%, #d32f2f);
  color: #fff;
  box-shadow: 0 18px 42px rgba(183, 28, 28, 0.2);
}

.finance-hero-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.finance-hero-amount {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem;
  margin-top: 0.2rem;
}

.finance-hero-amount strong {
  color: #fff;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.1;
}

.finance-hero-amount span {
  color: #fecaca;
  font-size: 0.82rem;
}

.finance-hero-main > p {
  margin-top: 0.5rem;
  color: #fee2e2;
  font-size: 0.78rem;
}

.finance-hero-main .btn {
  width: fit-content;
  margin-top: 1rem;
}

.finance-hero-side {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  gap: 0.6rem;
  align-items: stretch;
}

.finance-side-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(5px);
}

.finance-side-stat span {
  color: #fecaca;
  font-size: 0.6rem;
}

.finance-side-stat strong {
  margin-top: 0.15rem;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
}

.settled-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  margin-top: 0.9rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
}

.finance-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.8fr);
  gap: 1rem;
  align-items: start;
}

.finance-aside {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.data-table th {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

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

.data-table tbody tr:hover {
  background: var(--bg-soft);
}

.cell-date {
  color: var(--muted);
  font-size: 0.67rem;
  white-space: nowrap;
}

.cell-title {
  color: var(--ink);
  font-weight: 500;
}

.cell-subtitle {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.64rem;
}

.cell-amount {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

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

.user-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
  font-size: 0.7rem;
  white-space: nowrap;
}

.split-chip {
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.58rem;
  font-weight: 600;
}

.expense-card {
  padding: 0.9rem;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: var(--surface, #fff);
}

.expense-card + .expense-card {
  margin-top: 0.55rem;
}

.expense-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.expense-card-top > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.expense-card-top strong {
  font-size: 0.82rem;
}

.expense-date {
  color: var(--muted);
  font-size: 0.64rem;
}

.expense-amount {
  color: var(--brand) !important;
  white-space: nowrap;
}

.expense-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.expense-note {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.expense-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.category-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.category-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}

.category-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  font-size: 0.7rem;
}

.category-row-top strong {
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.settlement-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settlement-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: var(--bg-soft);
}

.settlement-icon {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--success-soft);
  color: var(--success);
}

.settlement-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.settlement-copy strong {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.71rem;
}

.settlement-copy span {
  color: var(--muted);
  font-size: 0.62rem;
}

.settlement-right {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.settlement-right strong {
  color: var(--success);
  font-size: 0.72rem;
  white-space: nowrap;
}

/* Shopping */
.shopping-summary {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.shopping-summary-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.3rem;
}

.shopping-summary-copy h2 {
  margin-top: 0.1rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.shopping-summary-copy p {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.shopping-progress-ring {
  display: grid;
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--progress, 0) * 1%), var(--brand-soft) 0);
  position: relative;
}

.shopping-progress-ring::before {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--white);
  content: '';
}

.shopping-progress-ring span {
  position: relative;
  color: var(--brand);
  font-size: 1rem;
  font-weight: 700;
}

.shopping-summary-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line-soft);
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 31px;
  padding: 0.33rem 0.58rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
}

.filter-chip:hover {
  border-color: #d1d5db;
  color: var(--ink);
}

.filter-chip.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.filter-chip.is-active .category-dot {
  background: #fff;
}

.filter-count {
  display: inline-grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 600;
}

.filter-chip.is-active .filter-count {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.shop-groups {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.shop-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line-soft);
}

.shop-group-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
}

.shop-group-count {
  display: grid;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 600;
}

.shop-group-items {
  display: flex;
  flex-direction: column;
}

.shop-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid var(--line-soft);
}

.shop-item:last-child {
  border-bottom: 0;
}

.shop-item.is-done .shop-item-title > span:first-child {
  color: var(--muted-light);
  text-decoration: line-through;
}

.shop-item-copy {
  min-width: 0;
  flex: 1;
}

.shop-item-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 500;
}

.quantity-chip {
  padding: 0.13rem 0.4rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 600;
}

.shop-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
  margin-top: 0.22rem;
}

.shop-item-note {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.shop-item-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.05rem;
}

.checkbox {
  width: 18px;
  height: 18px;
  margin: 0.18rem 0 0;
  accent-color: var(--brand);
  cursor: pointer;
}

/* Agenda */
.agenda-tabs {
  align-self: flex-start;
}

.agenda-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 1rem;
  align-items: start;
}

.calendar-card {
  padding: 1.2rem;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.calendar-head h2 {
  margin-top: 0.1rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: capitalize;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.calendar-grid {
  display: grid;
  overflow: hidden;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.calendar-weekday {
  padding: 0.45rem 0.3rem;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 96px;
  padding: 0.3rem;
  background: var(--white);
  cursor: pointer;
  transition: background 0.16s var(--ease);
}

.calendar-day:hover {
  background: var(--brand-soft-2);
}

.calendar-day.is-other-month {
  background: #fcfcfd;
}

.calendar-day.is-other-month .calendar-day-number {
  color: var(--muted-light);
}

.calendar-day-number {
  display: grid;
  width: 25px;
  height: 25px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
}

.calendar-day.is-today .calendar-day-number {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(211, 47, 47, 0.24);
}

.calendar-day-items {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  margin-top: 0.18rem;
}

.calendar-chip {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  width: 100%;
  min-width: 0;
  padding: 0.16rem 0.3rem;
  border: 0;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.56rem;
  text-align: left;
  cursor: pointer;
}

.calendar-chip:hover {
  background: #ffd7dc;
}

.calendar-chip-time {
  flex: 0 0 auto;
  font-weight: 600;
}

.calendar-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-more {
  padding-left: 0.3rem;
  color: var(--muted);
  font-size: 0.55rem;
}

.task-filters {
  margin-bottom: 1rem;
}

.task-groups {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.task-group-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line-soft);
}

.task-group-title {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.task-group-danger {
  color: var(--danger);
}

.task-group-warning {
  color: var(--warning);
}

.task-group-success {
  color: var(--success);
}

.task-group-count {
  display: grid;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 600;
}

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

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.2rem;
  border-bottom: 1px solid var(--line-soft);
}

.task-item:last-child {
  border-bottom: 0;
}

.task-item.is-overdue {
  position: relative;
}

.task-item.is-overdue::before {
  position: absolute;
  top: 0.85rem;
  bottom: 0.85rem;
  left: -0.05rem;
  width: 3px;
  border-radius: 999px;
  background: var(--brand);
  content: '';
}

.task-item.is-done .task-title-row strong {
  color: var(--muted-light);
  text-decoration: line-through;
}

.task-copy {
  min-width: 0;
  flex: 1;
}

.task-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.task-title-row strong {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
}

.assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.14rem 0.35rem 0.14rem 0.15rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 500;
}

.assignee-chip:not(:has(.avatar)) {
  padding-left: 0.4rem;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.7rem;
  margin-top: 0.25rem;
}

.task-note {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.5;
}

.task-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.05rem;
}

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

.appointment-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.1rem;
  border-bottom: 1px solid var(--line-soft);
}

.appointment-item:last-child {
  border-bottom: 0;
}

.appointment-copy {
  min-width: 0;
  flex: 1;
}

.appointment-copy > strong {
  display: block;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 500;
}

.appointment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.65rem;
  margin-top: 0.22rem;
}

.appointment-note {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.66rem;
}

.past-appointments {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
}

.past-appointments summary {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.past-appointments[open] summary {
  margin-bottom: 0.3rem;
}

/* Settings */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.settings-profile-card {
  grid-row: span 2;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.profile-summary-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.profile-summary-copy > strong {
  font-size: 1.05rem;
  font-weight: 700;
}

.profile-summary-copy > span {
  color: var(--muted);
  font-size: 0.72rem;
}

.profile-status {
  margin-top: 0.4rem;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1rem;
}

.settings-actions.wrap {
  margin-top: 0.9rem;
}

.profile-other {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

.profile-other-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-other-inner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.profile-other-inner > div {
  display: flex;
  flex-direction: column;
}

.profile-other-inner strong {
  font-size: 0.76rem;
}

.profile-other-inner span {
  color: var(--muted);
  font-size: 0.64rem;
}

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

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
}

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

.settings-row-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.settings-row-copy strong {
  font-size: 0.76rem;
  font-weight: 600;
}

.settings-row-copy span {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.5;
}

.settings-static {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.danger-row .settings-row-copy strong {
  color: var(--danger);
}

.settings-note {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.6;
}

.settings-note .icon {
  margin-top: 0.15rem;
  flex: 0 0 auto;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
}

.sync-status-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--bg-soft);
}

.sync-status-card > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.sync-status-card strong {
  font-size: 0.74rem;
}

.sync-status-card span {
  color: var(--muted);
  font-size: 0.62rem;
}

.sync-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

.sync-status-online .sync-status-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.sync-status-connecting .sync-status-dot {
  background: #f59e0b;
  animation: pulse-dot 1.4s ease-in-out infinite;
}

.sync-status-offline .sync-status-dot {
  background: #94a3b8;
}

.install-settings {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.install-settings-icon {
  display: grid;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
}

.install-settings-copy {
  display: flex;
  flex-direction: column;
}

.install-settings-copy strong {
  font-size: 0.78rem;
}

.install-settings-copy span {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.5;
}

.about-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.about-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.about-brand img {
  border-radius: 14px;
}

.about-brand > div {
  display: flex;
  flex-direction: column;
}

.about-brand strong {
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.about-brand span {
  color: var(--muted);
  font-size: 0.66rem;
}

.about-card p {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.65;
}

.about-privacy {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  background: var(--bg-soft);
}

.about-privacy .icon {
  margin-top: 0.1rem;
  flex: 0 0 auto;
  color: var(--brand);
}

.about-heart {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--brand);
  font-size: 0.66rem;
  font-weight: 600;
}

/* Modal */
.modal {
  width: min(560px, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--text);
  overflow: visible;
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
}

.modal[open] {
  animation: modal-in 0.2s var(--ease);
}

.modal-shell {
  display: flex;
  max-height: calc(100dvh - 2rem);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

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

.modal-sm {
  width: min(420px, calc(100vw - 2rem));
}

.modal-lg {
  width: min(720px, calc(100vw - 2rem));
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem 0.8rem;
  border-bottom: 1px solid var(--line-soft);
}

.modal-heading h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.modal-heading p {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
}

#modal-form {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.modal-body {
  padding: 1rem 1.2rem;
  overflow-y: auto;
}

.modal-error {
  margin: 0 1.2rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #fecaca;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.72rem;
}

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

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.85rem 1.2rem;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-soft);
}

.modal-footer .btn-danger {
  margin-left: auto;
}

/* Toasts */
.toast-root {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 100;
  display: flex;
  width: min(360px, calc(100vw - 2rem));
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  color: var(--text);
  font-size: 0.74rem;
  opacity: 0;
  pointer-events: auto;
  transform: translateY(8px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  cursor: pointer;
}

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

.toast-icon {
  display: grid;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 8px;
  background: var(--success-soft);
  color: var(--success);
}

.toast-error .toast-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.toast-warning .toast-icon {
  background: var(--warning-soft);
  color: var(--warning);
}

.toast-info .toast-icon {
  background: var(--info-soft);
  color: var(--info);
}

.toast-message {
  padding-top: 0.16rem;
  line-height: 1.45;
}

/* Boot / offline / noscript */
.boot-screen {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  background:
    radial-gradient(circle at 50% 42%, rgba(211, 47, 47, 0.08), transparent 20rem),
    var(--bg);
}

.boot-logo {
  margin-bottom: 0.6rem;
  border-radius: 24px;
  box-shadow: var(--shadow-brand);
  animation: boot-float 2.4s ease-in-out infinite;
}

@keyframes boot-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.boot-name {
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.boot-tagline {
  color: var(--muted);
  font-size: 0.7rem;
}

.boot-loader {
  width: 26px;
  height: 3px;
  margin-top: 1.1rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--brand-soft);
  position: relative;
}

.boot-loader::after {
  position: absolute;
  inset: 0;
  width: 45%;
  border-radius: inherit;
  background: var(--brand);
  content: '';
  animation: boot-load 1.1s ease-in-out infinite;
}

@keyframes boot-load {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(240%);
  }
}

.boot-error,
.noscript-message {
  max-width: 520px;
  margin: 20vh auto;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  text-align: center;
}

.boot-error h1 {
  font-size: 1.3rem;
}

.boot-error p,
.noscript-message {
  color: var(--muted);
  font-size: 0.85rem;
}

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

  .stat-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .finance-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.8fr);
  }

  .agenda-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(290px, 0.85fr);
  }

  .finance-hero {
    flex-direction: column;
  }

  .finance-hero-side {
    width: 100%;
  }

  .finance-side-stat {
    text-align: center;
  }
}

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

  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .settings-profile-card {
    grid-row: auto;
  }

  .agenda-layout {
    grid-template-columns: 1fr;
  }

  .calendar-day {
    min-height: 90px;
  }

  .finance-layout {
    grid-template-columns: 1fr;
  }

  .finance-aside {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sidebar {
    display: none;
  }

  .app-main {
    margin-left: 0;
  }

  .topbar {
    height: 64px;
    padding: 0 1rem;
  }

  .topbar-context {
    display: none;
  }

  .topbar-mobile-brand {
    display: block;
  }

  .topbar-user span {
    display: none;
  }

  .topbar-user {
    padding: 0;
  }

  .sync-button-label {
    display: none;
  }

  .sync-button {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .view-root {
    padding: 1.1rem 1rem calc(86px + env(safe-area-inset-bottom));
  }

  .bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 0.4rem 0.45rem calc(0.4rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(229, 231, 235, 0.9);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .bottom-link {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.16rem;
    padding: 0.32rem 0.1rem;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.57rem;
    font-weight: 500;
    transition: background 0.18s var(--ease), color 0.18s var(--ease);
  }

  .bottom-link.is-active {
    background: var(--brand-soft);
    color: var(--brand);
  }

  .bottom-link .icon {
    stroke-width: 2;
  }

  .notification-panel {
    top: 68px;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }

  .toast-root {
    right: 0.75rem;
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: 0.75rem;
    width: auto;
  }

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-art {
    display: none;
  }

  .login-main {
    min-height: 100dvh;
    background:
      radial-gradient(circle at 100% 0%, rgba(211, 47, 47, 0.07), transparent 25rem),
      linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  }

  .login-mobile-brand {
    display: block;
  }

  .login-card {
    padding: 1.3rem;
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-md);
  }
}

@media (max-width: 720px) {
  body {
    font-size: 14px;
  }

  .page-heading,
  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.85rem;
  }

  .page-heading-actions,
  .dashboard-heading-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .page-heading-actions .btn,
  .dashboard-heading-actions .btn {
    flex: 1;
  }

  .stat-grid,
  .stat-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .balance-hero {
    min-height: 0;
    flex-direction: column;
    padding: 1.35rem;
  }

  .balance-hero-side {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .balance-hero-amount strong {
    font-size: 2.2rem;
  }

  .quick-actions {
    gap: 0.55rem;
  }

  .quick-action {
    padding: 0.65rem;
  }

  .quick-action-icon {
    width: 33px;
    height: 33px;
  }

  .quick-action small {
    display: none;
  }

  .finance-hero {
    padding: 1.35rem;
  }

  .finance-hero-side {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .finance-aside {
    grid-template-columns: 1fr;
  }

  .card-pad {
    padding: 1.1rem;
  }

  .install-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .install-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  .settings-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }

  .settings-row .select-compact {
    width: 100%;
  }

  .settings-row > .btn,
  .settings-row > .sync-pill {
    align-self: flex-start;
  }

  .sync-status-card {
    flex-wrap: wrap;
  }

  .sync-status-card .btn {
    width: 100%;
  }

  .calendar-card {
    padding: 0.8rem;
  }

  .calendar-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-nav {
    align-self: flex-end;
    margin-top: -2.7rem;
  }

  .calendar-day {
    min-height: 78px;
    padding: 0.22rem;
  }

  .calendar-chip {
    padding: 0.12rem 0.22rem;
    font-size: 0.52rem;
  }

  .calendar-chip-time {
    display: none;
  }

  .calendar-day-number {
    width: 22px;
    height: 22px;
    font-size: 0.63rem;
  }

  .calendar-weekday {
    font-size: 0.53rem;
  }

  .shopping-summary-main {
    align-items: flex-start;
  }

  .shopping-progress-ring {
    width: 72px;
    height: 72px;
  }

  .shopping-progress-ring span {
    font-size: 0.85rem;
  }

  .shopping-summary-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-tabs {
    flex-wrap: nowrap;
    padding-bottom: 0.2rem;
    overflow-x: auto;
  }

  .filter-chip {
    flex: 0 0 auto;
  }

  .task-item,
  .shop-item {
    padding-right: 0;
  }

  .task-actions,
  .shop-item-actions {
    flex-direction: column;
  }

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

  .modal {
    width: calc(100vw - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
  }

  .modal-shell {
    max-height: calc(100dvh - 1.5rem);
  }

  .modal-header {
    padding: 0.95rem 1rem 0.75rem;
  }

  .modal-body {
    padding: 0.9rem 1rem;
  }

  .modal-error {
    margin: 0 1rem;
  }

  .modal-footer {
    padding: 0.75rem 1rem;
  }

  .toast-root {
    right: 0.6rem;
    left: 0.6rem;
  }

  .login-main {
    padding: 1rem;
  }

  .login-card {
    padding: 1.1rem;
  }
}

@media (max-width: 520px) {
  .view-root {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

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

  .stat-card {
    padding: 0.85rem;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .quick-action small {
    display: block;
  }

  .balance-hero-users {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-user {
    width: 100%;
  }

  .finance-hero-side {
    grid-template-columns: 1fr;
  }

  .finance-side-stat {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .finance-side-stat strong {
    margin: 0;
  }

  .shopping-summary-main {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .shopping-progress-ring {
    align-self: flex-end;
    margin-top: -3.2rem;
  }

  .settings-actions .btn {
    flex: 1 1 auto;
  }

  .calendar-day {
    min-height: 60px;
  }

  .calendar-day-items {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.12rem;
  }

  .calendar-chip {
    width: 6px;
    height: 6px;
    padding: 0;
    overflow: hidden;
    border-radius: 50%;
    background: var(--brand);
  }

  .calendar-chip-time,
  .calendar-chip-title {
    display: none;
  }

  .calendar-more {
    display: none;
  }

  .notification-panel {
    top: 64px;
    right: 0.5rem;
    left: 0.5rem;
    max-height: calc(100dvh - 76px - env(safe-area-inset-bottom));
  }

  .toast-root {
    right: 0.5rem;
    left: 0.5rem;
  }

  .modal-footer {
    flex-direction: column-reverse;
  }

  .modal-footer .btn {
    width: 100%;
  }
}

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