:root {
  color-scheme: light;
  --accent: var(--accent-color, #868bdf);
  --accent-soft: #e0e2ff;
  --accent-soft-alt: #ebedff;
  --accent-dark: #6c71d2;
  --bg-main: #f3f4ff;
  --bg-soft: #f7f8ff;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --panel-soft: #f7f7ff;
  --text: #0f172a;
  --text-alt: #1d2233;
  --muted: #677288;
  --muted-strong: #4f5870;
  --border: rgba(134, 139, 223, 0.18);
  --border-strong: rgba(134, 139, 223, 0.28);
  --success: #1f9f77;
  --warning: #d58b1f;
  --danger: #cb5b74;
  --shadow: 0 24px 64px rgba(69, 79, 128, 0.12);
  --shadow-soft: 0 10px 28px rgba(77, 89, 148, 0.08);
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 16px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Poppins", "Segoe UI", sans-serif;
  color: var(--text-alt);
  line-height: 1.6;
  background:
    radial-gradient(circle at top left, rgba(134, 139, 223, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(184, 188, 255, 0.26), transparent 26%),
    linear-gradient(180deg, #fafbff 0%, var(--bg-main) 58%, #eef0ff 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(134, 139, 223, 0.12) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 55%);
}

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

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

button {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  padding: 14px 16px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder,
textarea::placeholder {
  color: #8c95a8;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 4px rgba(134, 139, 223, 0.12);
  background: var(--panel-strong);
}

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

input[type="color"] {
  min-height: 52px;
  padding: 4px;
}

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4,
h5,
h6,
.logo,
.btn,
.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  font-family: "SUSE", "Segoe UI", sans-serif;
  letter-spacing: -0.03em;
}

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

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

.app-layout {
  min-height: 100vh;
}

.app-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 88px;
  display: grid;
  gap: 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(243, 244, 255, 0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(134, 139, 223, 0.12);
}

.header-inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  flex: none;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
}

.logo::after {
  content: ".";
  color: var(--accent);
}

.site-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link,
.utility-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--muted-strong);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-link:hover,
.nav-link.active,
.utility-link:hover,
.utility-link.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px var(--border);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.header-secondary-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-user {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
}

.header-user strong,
.header-user small {
  display: block;
  line-height: 1.2;
}

.header-user small {
  color: var(--muted);
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.topbar,
.section-heading,
.entity-head,
.inline-actions,
.list-row,
.mini-row,
.summary-row,
.bar-label,
.split-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topbar {
  align-items: end;
  padding-top: 8px;
}

.topbar h1,
.hero h2,
.auth-copy h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.02;
  color: var(--text);
}

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

.section-kicker {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.month-chip,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  font-weight: 600;
}

.month-chip {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--border);
  color: var(--text);
}

.badge {
  background: rgba(134, 139, 223, 0.12);
  border-color: rgba(134, 139, 223, 0.16);
  color: #5c619e;
}

.badge.success {
  background: rgba(31, 159, 119, 0.12);
  border-color: rgba(31, 159, 119, 0.16);
  color: #197452;
}

.badge.warning {
  background: rgba(213, 139, 31, 0.14);
  border-color: rgba(213, 139, 31, 0.18);
  color: #9c6506;
}

.badge.danger {
  background: rgba(203, 91, 116, 0.12);
  border-color: rgba(203, 91, 116, 0.18);
  color: #a5455a;
}

.badge.neutral {
  background: rgba(134, 139, 223, 0.12);
  border-color: rgba(134, 139, 223, 0.18);
  color: #5c619e;
}

.card,
.auth-card,
.confirm-card,
.narrow-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.card::before,
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 24%);
}

.section-card,
.hero,
.auth-panel {
  display: grid;
  gap: 18px;
}

.hero {
  background:
    radial-gradient(circle at top right, rgba(134, 139, 223, 0.16), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(242, 244, 255, 0.94));
}

.hero-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
  align-items: start;
  gap: 24px;
}

.compact-hero {
  padding-top: 24px;
  padding-bottom: 24px;
}

.hero-main {
  display: grid;
  gap: 18px;
}

.hero-copy {
  max-width: 760px;
  color: var(--muted);
  font-size: 1rem;
}

.hero-aside {
  display: grid;
  gap: 16px;
  align-self: stretch;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-stat {
  min-width: 170px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.hero-stat span,
.focus-card p,
.summary-row span,
.entity-meta-grid span,
.note-meta span,
.mini-row p,
.muted-line,
.field-help,
.feed-item p,
.login-hint p {
  color: var(--muted);
}

.hero-stat span,
.focus-card p {
  display: block;
  margin-bottom: 6px;
  font-size: 0.86rem;
}

.hero-stat strong,
.focus-card strong {
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  color: var(--text);
}

.summary-banner {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(134, 139, 223, 0.14), rgba(224, 226, 255, 0.42));
  border: 1px solid rgba(134, 139, 223, 0.18);
}

.summary-banner strong {
  color: var(--text);
  font-size: 1.05rem;
}

.focus-grid,
.stats-grid,
.content-grid,
.split-overview {
  display: grid;
  gap: 16px;
}

.focus-grid,
.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.focus-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}

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

.content-grid.two-one {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
}

.aside-stack,
.summary-stack,
.quick-action-stack,
.list-stack,
.feed-list,
.bar-list,
.mini-list,
.transfer-list,
.note-list {
  display: grid;
  gap: 12px;
}

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

.split-card,
.feed-item,
.note-item,
.mini-row,
.list-row,
.transfer-card {
  padding: 16px 18px;
  border-radius: 22px;
  background: var(--panel-soft);
  border: 1px solid rgba(134, 139, 223, 0.12);
}

.transfer-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(134, 139, 223, 0.14), rgba(255, 255, 255, 0.82));
}

.split-card strong,
.mini-row strong,
.feed-item strong,
.note-item strong,
.summary-row strong {
  color: var(--text);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mini-stats div {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
}

.mini-stats span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

.mini-stats strong {
  color: var(--text);
}

.row-side {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  text-align: right;
}

.section-heading h2,
.list-section-header h2 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  color: var(--text);
}

.ghost-link {
  color: var(--accent-dark);
  font-size: 0.92rem;
  font-weight: 600;
}

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

.list-section {
  display: grid;
  gap: 16px;
}

.list-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.entity-card {
  display: grid;
  gap: 16px;
}

.compact-card {
  padding-top: 22px;
  padding-bottom: 22px;
}

.entity-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.entity-meta-grid div {
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--panel-soft);
  border: 1px solid rgba(134, 139, 223, 0.12);
}

.entity-meta-grid span {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.entity-meta-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
}

.allocation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag,
.muted-box {
  border-radius: 18px;
  border: 1px solid rgba(134, 139, 223, 0.14);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted-strong);
  font-size: 0.88rem;
}

.muted-box {
  padding: 14px 16px;
  background: var(--panel-soft);
  color: var(--muted-strong);
}

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

.slim-form {
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
}

label > span {
  color: var(--muted-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

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

.field-span-2 {
  grid-column: span 2;
}

.check-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel-soft);
  border: 1px solid rgba(134, 139, 223, 0.12);
}

.check-inline input,
.check-card input {
  width: auto;
  margin: 0;
}

.details-block {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 24px;
  background: rgba(134, 139, 223, 0.08);
  border: 1px solid rgba(134, 139, 223, 0.12);
}

.details-block summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
  list-style: none;
}

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

.details-block[open] summary {
  margin-bottom: 4px;
}

.split-panel {
  display: grid;
  gap: 14px;
}

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

.check-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(134, 139, 223, 0.12);
}

.split-extra {
  display: none;
}

.split-extra.active {
  display: block;
}

.inline-filter {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-filter label {
  min-width: 180px;
}

.btn,
.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.btn:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.btn-primary,
.primary-button {
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 78%, #ffffff);
  color: #ffffff;
  box-shadow: 0 16px 32px rgba(108, 113, 210, 0.22);
}

.btn-outline,
.ghost-button {
  background: rgba(255, 255, 255, 0.76);
  border-color: var(--border);
  color: var(--text);
}

.secondary-button {
  background: rgba(134, 139, 223, 0.1);
  border-color: rgba(134, 139, 223, 0.18);
  color: var(--accent-dark);
}

.danger-button {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(203, 91, 116, 0.18);
  color: #ab4058;
}

.full-width {
  width: 100%;
}

.empty-state {
  padding: 22px;
  border-radius: 24px;
  border: 1px dashed rgba(134, 139, 223, 0.24);
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  text-align: center;
}

.small-empty {
  padding: 16px;
  border-radius: 18px;
}

.bar-row {
  display: grid;
  gap: 10px;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(134, 139, 223, 0.12);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #b4b8ff);
}

.note-item p,
.feed-item p,
.mini-row p,
.muted-line,
.login-hint p {
  font-size: 0.92rem;
}

.note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.note-meta strong {
  color: var(--text);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
}

.divider {
  width: 100%;
  height: 1px;
  margin: 8px 0;
  border: none;
  background: rgba(134, 139, 223, 0.16);
}

.toast {
  position: fixed;
  top: 96px;
  right: 24px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100% - 32px));
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(134, 139, 223, 0.14);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.toast-success {
  color: #1a7c58;
}

.toast-error {
  color: #ab4058;
}

.auth-shell,
.centered-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-card-wide {
  width: min(1080px, 100%);
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
}

.auth-copy {
  display: grid;
  gap: 18px;
  padding: 44px;
  background:
    radial-gradient(circle at top right, rgba(134, 139, 223, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 241, 255, 0.96));
  border-right: 1px solid rgba(134, 139, 223, 0.12);
}

.auth-panel {
  padding: 44px;
}

.login-hint {
  padding: 18px;
  border-radius: 22px;
  background: rgba(134, 139, 223, 0.08);
  border: 1px solid rgba(134, 139, 223, 0.12);
}

.narrow-card {
  width: min(560px, 100%);
}

.confirm-dialog {
  border: none;
  padding: 0;
  background: transparent;
}

.confirm-dialog::backdrop {
  background: rgba(13, 18, 37, 0.28);
  backdrop-filter: blur(6px);
}

.confirm-card {
  width: min(460px, calc(100vw - 32px));
}

canvas {
  width: 100% !important;
}

@media (max-width: 1120px) {
  .focus-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid.two-one,
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .split-overview {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 12px);
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-list,
  .header-actions,
  .header-secondary-links {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .header-user,
  .header-actions form,
  .header-cta,
  .header-logout,
  .topbar-link {
    width: 100%;
  }

  .content-grid,
  .focus-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

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

  .auth-copy {
    border-right: none;
    border-bottom: 1px solid rgba(134, 139, 223, 0.12);
  }
}

@media (max-width: 720px) {
  .app-main {
    width: min(100%, calc(100% - 20px));
    padding-top: 24px;
    gap: 18px;
  }

  .card,
  .auth-copy,
  .auth-panel,
  .confirm-card {
    padding: 22px;
  }

  .topbar,
  .section-heading,
  .entity-head,
  .inline-actions,
  .list-row,
  .mini-row,
  .summary-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .row-side {
    width: 100%;
    justify-content: space-between;
    text-align: left;
  }

  .form-grid,
  .compact-grid,
  .checkbox-grid,
  .entity-meta-grid,
  .mini-stats {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: span 1;
  }

  .inline-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-filter label {
    min-width: 0;
  }

  .toast {
    right: 10px;
    left: 10px;
    top: 88px;
    max-width: none;
  }
}
