:root {
  color-scheme: light;
  --color-bg: #ebf1f5;
  --color-surface: #ffffff;
  --color-surface-secondary: #f5f9fc;
  --color-sidebar: #f7f9fa;
  --color-primary: #1d9bf0;
  --color-primary-hover: #1787d1;
  --color-primary-muted: #e8f5fe;
  --color-text: #0f1419;
  --color-text-secondary: #536471;
  --color-text-muted: #7a8b98;
  --color-border: #d7e1e8;
  --color-border-subtle: #e6edf2;
  --color-positive: #1f9d72;
  --color-neutral: #dbe5ec;
  --color-warning: #ffb000;
  --color-chart-primary: #1e9df1;
  --color-chart-secondary: #17bf63;
  --color-chart-grid: #dfe8ee;
  --chart-fill-top: rgba(29, 155, 240, 0.24);
  --chart-fill-bottom: rgba(29, 155, 240, 0.06);
  --radius-card: 20px;
  --radius-input: 16px;
  --shadow-card: 0 10px 30px rgba(15, 20, 25, 0.05);
  --shadow-hover: 0 16px 34px rgba(15, 20, 25, 0.1);
  --shadow-soft: 0 8px 18px rgba(29, 155, 240, 0.12);
  --focus-ring: 0 0 0 3px rgba(29, 155, 240, 0.18);
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --sidebar-width: 240px;
  --container-max: 1440px;
  --font-numeric: "Oxanium", "Inter", system-ui, sans-serif;
  --dashboard-page-bg: linear-gradient(180deg, #f4f8fb 0%, #eef4f7 100%);
  --dashboard-section-bg: #dfe9ef;
  --dashboard-section-border: rgba(15, 20, 25, 0.08);
  --dashboard-section-shadow: 0 18px 42px rgba(15, 20, 25, 0.08);
  --dashboard-card-bg: #fdfefe;
  --dashboard-card-border: rgba(29, 55, 78, 0.12);
  --dashboard-card-shadow: 0 10px 22px rgba(15, 20, 25, 0.06);
  --dashboard-card-shadow-hover: 0 14px 28px rgba(15, 20, 25, 0.1);
  --dashboard-alert-bg: #fff4dd;
  --dashboard-alert-border: rgba(255, 176, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
canvas {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.page {
  min-height: 100vh;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--color-sidebar);
  border-right: 1px solid var(--color-border);
  padding: var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.sidebar-header {
  display: grid;
  gap: var(--space-xs);
}

.sidebar-title {
  font-size: 18px;
  font-weight: 600;
}

.sidebar-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  display: grid;
  gap: var(--space-sm);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--color-text-secondary);
  transition: all 150ms ease;
  position: relative;
}

.sidebar-link:hover {
  background: var(--color-surface-secondary);
  border-color: var(--color-border);
  color: var(--color-text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.sidebar-link.is-active {
  background: var(--color-primary-muted);
  border-color: var(--color-primary);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
  font-weight: 600;
}

.nav-icon {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--color-text-muted);
  background: transparent;
}

.sidebar-link.is-active .nav-icon {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.page-content {
  flex: 1;
  padding: var(--space-xl) 0 var(--space-xl);
}

.container {
  width: min(var(--container-max), 100% - (var(--space-lg) * 2));
  margin: 0 auto;
}

.section {
  margin-top: var(--space-xl);
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.section-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

.section-subtitle {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.section-body {
  margin-top: var(--space-md);
}

.section--dashboard {
  margin-top: 0;
}

.divider {
  height: 1px;
  background: var(--color-border-subtle);
  margin: var(--space-md) 0 0;
}

.stack {
  display: grid;
  gap: var(--space-md);
}

.stack-sm {
  gap: var(--space-sm);
}

.stack-lg {
  gap: var(--space-lg);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.grid--2 > * {
  grid-column: span 6;
}

.grid--3 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.grid--3 > * {
  grid-column: span 4;
}

.grid--compact {
  gap: var(--space-sm);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.card--muted {
  background: var(--color-surface-secondary);
}

.card--alert {
  background: #fff2e4;
  border-color: #f1cfad;
}

.card--wide {
  grid-column: span 12;
}

.card-title {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 var(--space-sm);
}

.card-title--strong {
  font-weight: 600;
}

.card--stat {
  display: flex;
  flex-direction: column;
}

.card--stat .card-title {
  margin-bottom: var(--space-md);
}

.stat-list {
  --stat-text-size: clamp(30px, 3.2vw, 34px);
  display: flex;
  flex-direction: column;
  gap: calc(var(--space-lg) * 1.5);
  flex: 1;
  justify-content: center;
  align-items: center;
}

.stat-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

.stat-text,
.stat-label {
  font-size: var(--stat-text-size);
  font-weight: 500;
  color: var(--color-text-secondary);
}

.stat-value {
  font-size: calc(var(--stat-text-size) + 4px);
  font-weight: 700;
  font-family: var(--font-numeric);
}

.stat-value--main {
  font-size: calc(var(--stat-text-size) + 6px);
  color: inherit;
}

.chart-box {
  margin-top: var(--space-sm);
}

.dashboard-page {
  display: grid;
  gap: var(--space-xl);
  padding: 4px 0 24px;
}

.dashboard-strip {
  padding: 20px;
  border-radius: 28px;
  background: var(--dashboard-page-bg);
  border: 1px solid rgba(15, 20, 25, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.dashboard-note-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(29, 55, 78, 0.08);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 8px 18px rgba(15, 20, 25, 0.05);
}

.section--dashboard .section-header {
  margin-bottom: var(--space-md);
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
}

.section--dashboard .section-title {
  font-size: 28px;
  line-height: 1.1;
}

.section--dashboard .section-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-lg);
  align-items: start;
}

.dashboard-panel {
  grid-column: span 6;
  display: grid;
  gap: 20px;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid var(--dashboard-section-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0))
      top / 100% 72px no-repeat,
    var(--dashboard-section-bg);
  box-shadow: var(--dashboard-section-shadow);
}

.dashboard-panel--fit {
  align-self: start;
}

.dashboard-panel--alert {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0))
      top / 100% 72px no-repeat,
    #f3e6c2;
}

.dashboard-panel--span-4 {
  grid-column: span 4;
}

.dashboard-panel--span-5 {
  grid-column: span 5;
}

.dashboard-panel--span-7 {
  grid-column: span 7;
}

.dashboard-panel--span-8 {
  grid-column: span 8;
}

.dashboard-panel--span-12 {
  grid-column: span 12;
}

.dashboard-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.dashboard-panel__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
}

.dashboard-panel__subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.dashboard-mini-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.dashboard-mini-grid--stack {
  grid-template-columns: 1fr;
}

.dashboard-mini-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-mini-grid--assets {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.dashboard-mini-grid--loan-cards {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.dashboard-mini-grid--personal {
  grid-template-columns: 1fr;
}

.dashboard-metric-card,
.dashboard-entity-card,
.dashboard-empty-card,
.dashboard-chart-card {
  background: var(--dashboard-card-bg);
  border: 1px solid var(--dashboard-card-border);
  border-radius: 16px;
  box-shadow: var(--dashboard-card-shadow);
}

.dashboard-metric-card,
.dashboard-entity-card,
.dashboard-empty-card {
  padding: 14px 16px;
  min-width: 0;
}

.dashboard-metric-card {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 0;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.dashboard-metric-card:hover,
.dashboard-entity-card:hover,
.dashboard-chart-card:hover,
.dashboard-empty-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--dashboard-card-shadow-hover);
}

.dashboard-metric-card--hero {
  min-height: 0;
}

.dashboard-metric-card--wide {
  grid-column: 1 / -1;
}

.dashboard-metric-card--alert {
  background: var(--dashboard-alert-bg);
  border-color: var(--dashboard-alert-border);
}

.dashboard-kpi-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}

.dashboard-kpi-value,
.dashboard-entity-card__value,
.dashboard-inline-value {
  font-family: var(--font-numeric);
  letter-spacing: 0;
}

.dashboard-kpi-value {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1;
  font-weight: 700;
  color: var(--color-text);
}

.dashboard-panel--span-4 .dashboard-kpi-value {
  font-size: 30px;
}

.dashboard-kpi-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
}

.dashboard-kpi-value--nowrap {
  white-space: nowrap;
}

.dashboard-kpi-unit {
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

.dashboard-kpi-meta {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.45;
}

.dashboard-inline-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.dashboard-entity-card {
  display: grid;
  gap: 14px;
  min-height: 178px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.dashboard-entity-card--loan {
  gap: 10px;
  min-height: 0;
  padding: 14px 16px;
}

.dashboard-entity-card--loan .dashboard-entity-card__top {
  gap: 10px;
}

.dashboard-entity-card--loan .dashboard-entity-card__value {
  font-size: 24px;
}

.dashboard-entity-card--loan .dashboard-detail-list {
  gap: 6px;
}

.dashboard-entity-card--loan .dashboard-detail-row {
  padding-top: 6px;
}

.dashboard-entity-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-entity-card__title,
.dashboard-empty-card__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.dashboard-entity-card__value {
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.05;
  font-weight: 700;
  color: var(--color-text);
}

/* Asset cards can be as narrow as 180px. Keep a six-digit amount and currency readable on one line. */
.dashboard-entity-card--asset .dashboard-entity-card__value {
  font-size: clamp(18px, 1.6vw, 20px);
  line-height: 1.15;
  white-space: nowrap;
}

.dashboard-entity-card__meta,
.dashboard-empty-card__text {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.45;
}

.dashboard-detail-list {
  display: grid;
  gap: 10px;
}

.dashboard-detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 20, 25, 0.06);
}

.dashboard-detail-label {
  font-size: 12px;
  color: var(--color-text-muted);
}

.dashboard-detail-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
}

.dashboard-empty-card {
  display: grid;
  gap: 10px;
  min-height: 168px;
  align-content: center;
}

.dashboard-empty-card--loan {
  padding: 14px 16px;
  min-height: 0;
}

.dashboard-chart-card {
  padding: 18px;
  position: relative;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 188px;
  max-width: 260px;
  padding: 12px 14px;
  border: 1px solid rgba(215, 225, 232, 0.72);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(15, 20, 25, 0.12);
  color: var(--color-text);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 120ms ease;
  backdrop-filter: blur(12px);
}

.chart-tooltip__title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
}

.chart-tooltip__list {
  display: grid;
  gap: 7px;
}

.chart-tooltip__row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.chart-tooltip__marker {
  width: 12px;
  height: 12px;
  display: inline-block;
}

.chart-tooltip__marker--circle {
  border-radius: 999px;
}

.chart-tooltip__marker--square {
  border-radius: 3px;
}

.chart-tooltip__label {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-tooltip__value {
  color: var(--color-text);
  font-family: var(--font-numeric);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(29, 155, 240, 0.18);
  background: rgba(29, 155, 240, 0.08);
  color: #156ea6;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.dashboard-chip--accent {
  background: rgba(31, 157, 114, 0.1);
  border-color: rgba(31, 157, 114, 0.18);
  color: #1a7756;
}

.panel {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  padding: 12px;
}

.list {
  display: grid;
  gap: var(--space-sm);
}

.list-item {
  display: grid;
  gap: var(--space-xs);
}

.asset-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  column-gap: var(--space-md);
  width: 100%;
}

.asset-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.asset-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-surface-secondary);
  border: 1px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.asset-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.asset-logo--sm {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.asset-logo--lg {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.list--divided .list-item {
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: var(--space-sm);
}

.list--divided .list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.item-title {
  font-weight: 600;
}

.text-muted {
  color: var(--color-text-secondary);
}

.text-small {
  font-size: 12px;
}

.text-body-lg {
  font-size: 16px;
}

.personal-metrics {
  font-size: 16px;
  line-height: 1.6;
}

.personal-metrics .metric-value {
  font-weight: 700;
}

.personal-metrics .text-small {
  font-size: 12px;
}

.reminder-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: baseline;
}

.reminder-label {
  font-weight: 600;
}

.reminder-value {
  font-size: 16px;
  font-weight: 700;
  color: #9f0712;
}

.kpi-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.kpi-card {
  grid-column: span 3;
  display: grid;
  gap: var(--space-sm);
}

.kpi-label {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kpi-value {
  font-size: 24px;
  font-weight: 600;
  font-family: var(--font-numeric);
}

.kpi-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-secondary);
  font-size: 12px;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-strong {
  font-weight: 600;
}

.form {
  display: grid;
  gap: var(--space-sm);
  font-size: 14px;
}

.form-field {
  display: grid;
  gap: var(--space-xs);
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  padding: 0 12px;
  font-size: 14px;
  background: #ffffff;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.form-textarea {
  min-height: 90px;
  padding: 10px 12px;
  height: auto;
  resize: vertical;
}

.form-input[type="file"] {
  min-height: 44px;
  height: auto;
  padding: 8px 12px;
  line-height: 26px;
}

.form-input[type="file"]::file-selector-button,
.form-input[type="file"]::-webkit-file-upload-button {
  height: 26px;
  margin: 0 12px 0 0;
  padding: 0 10px;
  font: inherit;
  line-height: 24px;
  vertical-align: middle;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
}

.btn:focus-visible,
.sidebar-link:focus-visible,
.link:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.form-note {
  font-size: 12px;
  color: var(--color-text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-input);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.btn--primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

.btn--primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn--outline {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn--outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn--ghost:hover {
  background: var(--color-surface-secondary);
}

.btn--block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.chart-filters {
  display: inline-flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.chart-filter {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 999px;
  border-color: rgba(29, 55, 78, 0.1);
  background: rgba(255, 255, 255, 0.55);
}

.chart-filter.is-active {
  background: rgba(29, 155, 240, 0.12);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: var(--shadow-soft);
}

.link {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link--danger {
  color: #b45309;
}

button.link {
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.table-wrap {
  margin-top: var(--space-sm);
  overflow-x: auto;
}

.table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  padding: 0 12px;
  height: 44px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.table th {
  text-align: left;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-surface-secondary);
}

.table tbody tr:hover {
  background: rgba(197, 122, 58, 0.06);
}

.table-empty {
  padding: 18px 8px;
  text-align: center;
  color: var(--color-text-muted);
}

.alert {
  border-radius: var(--radius-input);
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid #f1cfad;
  background: #fff2e4;
  color: #8a4b1f;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--color-neutral);
  color: var(--color-text-secondary);
}

.badge--positive {
  background: rgba(155, 179, 168, 0.35);
  color: #4b665a;
}

.badge--warning {
  background: rgba(225, 179, 130, 0.4);
  color: #8a4b1f;
}

.auth {
  width: 100%;
  min-height: calc(100vh - (var(--space-xl) * 2));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.auth--kinetic {
  position: relative;
  isolation: isolate;
}

.auth-kinetic-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #ffffff;
}

.auth-kinetic-grid canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.auth--kinetic .auth-heading,
.auth--kinetic .auth-card {
  position: relative;
  z-index: 1;
}

.auth--kinetic .auth-title {
  color: var(--color-text);
  text-shadow: none;
}

.auth--kinetic .auth-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 20, 25, 0.12);
  box-shadow: 0 18px 50px rgba(15, 20, 25, 0.12);
  backdrop-filter: blur(10px);
}

.auth--kinetic .auth-card:hover {
  transform: none;
  box-shadow: 0 20px 56px rgba(15, 20, 25, 0.14);
}

.auth-heading {
  width: min(420px, 100%);
  text-align: center;
}

.auth-title {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 64px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text);
}

.auth-card {
  width: min(420px, 100%);
}

.auth-card-title {
  text-align: center;
}

.auth-helper {
  text-align: center;
}

.form-label--spacer {
  visibility: hidden;
}

@media (max-width: 1024px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-md);
  }

  .sidebar-nav {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    overflow: visible;
  }

  .sidebar-link {
    justify-content: center;
    min-height: 42px;
    text-align: center;
    white-space: normal;
  }

  .grid--2,
  .grid--3,
  .dashboard-grid,
  .dashboard-mini-grid--three,
  .dashboard-mini-grid--personal {
    grid-template-columns: 1fr;
  }

  .grid--2 > *,
  .grid--3 > *,
  .card--wide,
  .dashboard-panel,
  .dashboard-panel--span-4,
  .dashboard-panel--span-5,
  .dashboard-panel--span-7,
  .dashboard-panel--span-8,
  .dashboard-panel--span-12 {
    grid-column: span 1;
  }

  .kpi-card {
    grid-column: span 6;
  }

  .section--dashboard .section-title {
    font-size: 24px;
  }
}

@media (max-width: 640px) {
  .sidebar {
    padding: var(--space-md);
  }

  .sidebar-header {
    width: 100%;
  }

  .sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-link {
    padding: 9px 10px;
  }

  .container {
    width: calc(100% - (var(--space-md) * 2));
  }

  .page-content {
    padding-top: var(--space-lg);
  }

  .dashboard-page {
    gap: var(--space-lg);
  }

  .dashboard-strip,
  .dashboard-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .dashboard-panel__title {
    font-size: 18px;
  }

  .dashboard-kpi-value,
  .dashboard-entity-card__value {
    font-size: 26px;
  }

  .dashboard-detail-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-detail-value {
    text-align: left;
  }

  .kpi-card {
    grid-column: span 12;
  }

  .auth-title {
    font-size: 48px;
  }
}
