/* ============================================
   COMPONENTS — Cards, Buttons, Inputs, etc.
   ============================================ */

/* ---- Glass Card ---- */
.card {
  background: var(--surface);
  background-image: var(--glass-shine);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-base);
  transition: transform var(--duration-hover) var(--ease-out),
              opacity var(--duration-hover) var(--ease-out);
  overflow: hidden;
  min-width: 0;
}

.card--elevated {
  background: var(--surface-elevated);
  box-shadow: var(--shadow-elevated);
}

.card--interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
  border-color: var(--border-hover);
}

.card--interactive:active {
  transform: translateY(0);
}

/* ---- Stat Card ---- */
.stat-card {
  background: var(--surface);
  background-image: var(--glass-shine);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-4);
  box-shadow: var(--shadow-base);
  transition: transform var(--duration-hover) var(--ease-out),
              opacity var(--duration-hover) var(--ease-out);
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}

.stat-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.stat-card__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card__value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: var(--space-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card__change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.stat-card__change--up {
  color: var(--danger);
  background: var(--danger-muted);
}

.stat-card__change--down {
  color: var(--success);
  background: var(--success-muted);
}

@media (min-width: 768px) {
  .stat-card {
    padding: var(--space-6);
  }
  .stat-card__value {
    font-size: 28px;
  }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 44px;
  transition: transform var(--duration-hover) var(--ease-out),
              opacity var(--duration-hover) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

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

/* Primary */
.btn--primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: var(--shadow-accent);
}

.btn--primary:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

.btn--secondary:focus-visible,
.btn--ghost:focus-visible,
.btn--danger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Secondary */
.btn--secondary {
  background: var(--surface-elevated);
  color: var(--text);
  border-color: var(--border);
}

.btn--secondary:hover:not(:disabled) {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn--ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface);
}

/* Danger */
.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--danger:hover:not(:disabled) {
  opacity: 0.9;
}

/* Small */
.btn--sm {
  font-size: 12px;
  padding: var(--space-2) var(--space-4);
  min-height: 36px;
  border-radius: var(--radius);
}

/* Icon Only */
.btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn--icon svg {
  width: 20px;
  height: 20px;
}

/* Loading */
.btn--loading {
  position: relative;
  color: transparent;
  pointer-events: none;
  opacity: 0.7;
}

.btn--loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn--primary.btn--loading::after {
  border-top-color: var(--bg);
}

.form-label--required::after {
  content: ' *';
  color: var(--danger);
}

/* ---- Inputs ---- */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.input {
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--text);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  min-height: 44px;
  width: 100%;
  transition: border-color var(--duration-hover) var(--ease-out),
              opacity var(--duration-hover) var(--ease-out);
}

.input::placeholder {
  color: var(--text-faint);
}

.input:hover {
  border-color: var(--border-hover);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus,
.input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-secondary) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  border-color: var(--border) !important;
  transition: background-color 5000s ease-in-out 0s;
}

.select:-webkit-autofill,
.select:-webkit-autofill:hover,
.select:-webkit-autofill:focus,
.select:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-secondary) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  border-color: var(--border) !important;
  transition: background-color 5000s ease-in-out 0s;
}

.input--error {
  border-color: var(--danger);
}

.input--error:focus {
  box-shadow: 0 0 0 3px var(--danger-muted);
}

.input-error-text {
  font-size: 12px;
  color: var(--danger);
}

.input--lg {
  font-size: 32px;
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: center;
  padding: var(--space-4);
  min-height: 64px;
  letter-spacing: -0.02em;
}

/* ---- Select ---- */
.select {
  appearance: none;
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--text);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-8) var(--space-3) var(--space-4);
  min-height: 44px;
  width: 100%;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%237A8BA0' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color var(--duration-hover) var(--ease-out),
              opacity var(--duration-hover) var(--ease-out);
}

.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

/* ---- Badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- Transaction Row ---- */
.txn-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--duration-hover) var(--ease-out),
              opacity var(--duration-hover) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.txn-row:hover {
  background: var(--surface);
  transform: translateX(4px);
}

.txn-row:active {
  transform: translateX(2px);
}

.txn-row__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.txn-row__info {
  flex: 1;
  min-width: 0;
}

.txn-row__desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.txn-row__category {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.txn-row__amount {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.txn-row__date {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
  text-align: right;
}

.txn-row__right {
  text-align: right;
  flex-shrink: 0;
}

/* ---- Transaction Row Mobile ---- */
@media (max-width: 480px) {
  .txn-row {
    gap: var(--space-3);
    padding: var(--space-3);
  }

  .txn-row__icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .txn-row__amount {
    font-size: 14px;
  }

  .txn-row__category {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .txn-edit-btn,
  .txn-delete-btn {
    display: none;
  }
}

/* Swipe Delete Background */
.txn-row__delete-bg {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  background: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity var(--duration-hover) var(--ease-out);
}

/* ---- Date Group Header ---- */
.date-group {
  margin-bottom: var(--space-6);
}

.date-group__header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-2);
}

/* ---- Modal ---- */
.modal__backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-backdrop);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--duration-modal-out) var(--ease-smooth);
}

.modal__backdrop.active {
  opacity: 1;
}

.modal__panel {
  position: fixed;
  z-index: var(--z-modal);
  background: var(--surface-floating);
  background-image: var(--glass-shine);
  backdrop-filter: blur(32px) saturate(1.3);
  -webkit-backdrop-filter: blur(32px) saturate(1.3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-floating);
  overflow-y: auto;
  opacity: 0;
  transition: opacity var(--duration-modal-out) var(--ease-out),
              transform var(--duration-modal-out) var(--ease-out);
}

.modal__panel.active {
  opacity: 1;
}

/* Mobile: bottom sheet */
.modal__panel {
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 90vh;
  max-height: 90dvh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-4);
  transform: translateY(100%);
  -webkit-overflow-scrolling: touch;
}

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

/* Desktop: centered */
@media (min-width: 768px) {
  .modal__panel {
    bottom: auto;
    left: 50%;
    top: 50%;
    right: auto;
    transform: translate(-50%, -48%) scale(0.96);
    max-height: 85vh;
    width: 90%;
    max-width: 480px;
    border-radius: var(--radius-xl);
    padding: var(--space-8);
  }

  .modal__panel.active {
    transform: translate(-50%, -50%) scale(1);
  }

  .modal__panel--widget {
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
  }
}

/* Wide modal — always centered, used for large forms like project creation */
.modal__panel--wide {
  bottom: auto !important;
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  max-width: 1200px !important;
  width: 92vw !important;
  max-height: 92vh !important;
  overflow-y: auto !important;
  transform: translate(-50%, -48%) scale(0.96) !important;
  border-radius: var(--radius-xl) !important;
  padding: var(--space-8) !important;
}

.modal__panel--wide.active {
  transform: translate(-50%, -50%) scale(1) !important;
}

/* Wide modal: mobile bottom-sheet override */
@media (max-width: 767px) {
  .modal__panel--wide {
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92dvh !important;
    padding: var(--space-4) !important;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
    transform: translateY(100%) !important;
  }

  .modal__panel--wide.active {
    transform: translateY(0) !important;
  }
}

.modal__handle {
  width: 36px;
  height: 4px;
  background: var(--text-faint);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-4);
}

@media (min-width: 768px) {
  .modal__handle {
    display: none;
  }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.modal__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.modal__close {
  min-width: 44px;
  min-height: 44px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
  transition: transform var(--duration-hover) var(--ease-out),
              opacity var(--duration-hover) var(--ease-out);
}

.modal__close:hover {
  color: var(--text);
  background: var(--surface);
}

.modal__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.modal__footer {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.modal__footer .btn {
  flex: 1;
}

/* ---- Toast ---- */
.toast-container {
  position: fixed;
  bottom: calc(64px + 56px + var(--space-4) + env(safe-area-inset-bottom, 0px));
  left: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

@media (min-width: 768px) {
  .toast-container {
    bottom: var(--space-8);
    left: auto;
    right: var(--space-8);
    width: 380px;
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4);
  background: var(--surface-floating);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-floating);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

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

.toast__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast--success .toast__icon { color: var(--success); }
.toast--error .toast__icon { color: var(--danger); }
.toast--info .toast__icon { color: var(--info); }
.toast--warning .toast__icon { color: var(--warning); }

.toast__message {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.toast__action {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: opacity var(--duration-hover) var(--ease-out);
}

.toast__action:hover {
  opacity: 0.8;
}

.toast__dismiss {
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Empty State ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-6);
  gap: var(--space-4);
}

.empty-state__icon {
  width: 64px;
  height: 64px;
  color: var(--text-faint);
  opacity: 0.5;
}

.empty-state__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted);
}

.empty-state__desc {
  font-size: 14px;
  color: var(--text-faint);
  max-width: 280px;
}

/* ---- Category Grid ---- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.category-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  background: var(--bg-secondary);
  cursor: pointer;
  min-height: 44px;
  transition: transform var(--duration-hover) var(--ease-out),
              border-color var(--duration-hover) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.category-option:hover {
  transform: scale(1.05);
  border-color: var(--border-hover);
}

.category-option.selected {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.category-option__icon {
  font-size: 22px;
  line-height: 1;
}

.category-option__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
}

.category-option.selected .category-option__label {
  color: var(--accent);
}

/* ---- Chart Card ---- */
.chart-card {
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.05);
  -webkit-backdrop-filter: blur(16px) saturate(1.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-base);
}

.chart-card__header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.chart-card__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.chart-card__canvas-wrap {
  position: relative;
  width: 100%;
  height: 220px;
}

@media (min-width: 768px) {
  .chart-card__canvas-wrap {
    height: 280px;
  }
}

/* ---- Donut Center Label ---- */
.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-center__amount {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.donut-center__label {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- Chart Legend ---- */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-4);
}

.chart-legend__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--text-muted);
}

.chart-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- Interactive Chart Legend ---- */
.chart-legend--interactive {
  flex-direction: column;
  gap: var(--space-2);
}

.chart-legend__item--toggle {
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: opacity var(--duration-hover) var(--ease-out),
              border-color var(--duration-hover) var(--ease-out),
              background var(--duration-hover) var(--ease-out);
}

.chart-legend__item--toggle:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.02);
}

.chart-legend__item--toggle input[type="checkbox"] {
  display: none;
}

.chart-legend__check {
  width: 16px;
  height: 16px;
  border-radius: 6px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  position: relative;
  transition: border-color var(--duration-hover) var(--ease-out),
              background var(--duration-hover) var(--ease-out);
}

.chart-legend__item--toggle input:checked ~ .chart-legend__check {
  border-color: var(--accent);
  background: var(--accent);
}

.chart-legend__item--toggle input:checked ~ .chart-legend__check::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4px;
  width: 4px;
  height: 8px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.chart-legend__item--toggle input:not(:checked) ~ .chart-legend__dot {
  opacity: 0.3;
}

.chart-legend__item--toggle input:not(:checked) ~ .chart-legend__text {
  opacity: 0.4;
  text-decoration: line-through;
}

.chart-legend__item--toggle:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.chart-legend__text {
  flex: 1;
}

/* ---- Progress Ring ---- */
.progress-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-ring__svg {
  transform: rotate(-90deg);
}

.progress-ring__bg {
  fill: none;
  stroke: var(--border);
}

.progress-ring__fill {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s var(--ease-out);
}

.progress-ring__text {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

/* ---- Filter Bar ---- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

/* On mobile: limit category filter bars to ~2 rows to save vertical space */
@media (max-width: 767px) {
  .filter-bar {
    margin-bottom: var(--space-3);
  }

  #filterBar {
    max-height: 88px;
    overflow: hidden;
    position: relative;
    transition: max-height 300ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  #filterBar.expanded {
    max-height: 600px;
  }
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  min-height: 36px;
  transition: transform var(--duration-hover) var(--ease-out),
              border-color var(--duration-hover) var(--ease-out),
              opacity var(--duration-hover) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.filter-chip:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.filter-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
}

/* ---- Search Input ---- */
.search-input-wrap {
  position: relative;
  margin-bottom: var(--space-4);
}

.search-input-wrap__icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-faint);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding-left: 44px;
}

/* ---- Divider ---- */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
}

/* ---- Skeleton ---- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface-elevated) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

.skeleton--text {
  height: 16px;
  width: 60%;
}

.skeleton--heading {
  height: 32px;
  width: 40%;
}

.skeleton--card {
  height: 120px;
  border-radius: var(--radius-lg);
}

.skeleton--chart {
  height: 220px;
  border-radius: var(--radius-lg);
}

/* ---- Confirm Dialog ---- */
.confirm__message {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---- Settings Row ---- */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
  gap: var(--space-4);
}

.settings-row__info {
  flex: 1;
  min-width: 0;
}

.settings-row__label {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.settings-row__desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.settings-row__action {
  flex-shrink: 0;
}

/* ---- Toggle Switch ---- */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.toggle-switch input {
  display: none;
}

.toggle-switch__slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: var(--radius-full);
  transition: background var(--duration-hover) var(--ease-out);
}

.toggle-switch__slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--text);
  border-radius: 50%;
  transition: transform var(--duration-hover) var(--ease-out);
}

.toggle-switch input:checked + .toggle-switch__slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-switch__slider::after {
  transform: translateX(22px);
  background: var(--bg);
}

.toggle-switch:focus-within .toggle-switch__slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Category List Item ---- */
.category-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  transition: transform var(--duration-hover) var(--ease-out),
              opacity var(--duration-hover) var(--ease-out);
}

.category-item:hover {
  background: var(--surface);
}

.category-item__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.category-item__info {
  flex: 1;
  min-width: 0;
}

.category-item__name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.category-item__count {
  font-size: 12px;
  color: var(--text-muted);
}

.category-item__actions {
  display: flex;
  gap: var(--space-2);
}

/* ---- Color Picker Grid ---- */
.color-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: var(--space-2);
}

.color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 36px;
  transition: transform var(--duration-hover) var(--ease-out),
              border-color var(--duration-hover) var(--ease-out);
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.selected {
  border-color: var(--text);
  transform: scale(1.15);
}

/* ---- Pill Toggle ---- */
.pill-toggle {
  display: flex;
  gap: var(--space-1);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
}

.pill-toggle__option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--space-2) var(--space-4);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 40px;
  transition: transform var(--duration-hover) var(--ease-out),
              opacity var(--duration-hover) var(--ease-out);
}

.pill-toggle__option:hover {
  color: var(--text);
}

.pill-toggle__option.active {
  background: var(--accent);
  color: var(--bg);
  box-shadow: var(--shadow-accent);
}

.pill-toggle--small .pill-toggle__option {
  min-height: 36px;
  font-size: 12px;
  padding: var(--space-1) var(--space-3);
}

/* ---- Frequency Options ---- */
.frequency-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.frequency-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.frequency-option:hover {
  border-color: var(--accent);
}

.frequency-option input[type="radio"] {
  display: none;
}

.frequency-option__check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.18s ease;
}

.frequency-option input[type="radio"]:checked ~ .frequency-option__check {
  border-color: var(--accent);
}

.frequency-option input[type="radio"]:checked ~ .frequency-option__check::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.frequency-option input[type="radio"]:checked ~ .frequency-option__label {
  color: var(--text);
}

.frequency-option__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.18s ease;
}

.frequency-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.06);
}

.frequency-option:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Budget Row ---- */
.budget-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--duration-hover) var(--ease-out),
              opacity var(--duration-hover) var(--ease-out);
}

.budget-row:hover {
  background: var(--surface);
}

.budget-row--disabled {
  opacity: 0.4;
}

.budget-row--disabled .budget-row__label {
  text-decoration: line-through;
}

.budget-row--disabled .budget-row__amount {
  text-decoration: line-through;
}

.budget-row__info {
  flex: 1;
  min-width: 0;
}

.budget-row__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.budget-row__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: 2px;
}

.budget-row__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.budget-row__tag--income {
  background: var(--success-muted);
  color: var(--success);
}

.budget-row__type {
  font-size: 12px;
  color: var(--text-faint);
}

.budget-row__right {
  flex-shrink: 0;
  text-align: right;
}

.budget-row__amount {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
}

.budget-row__amount--income {
  color: var(--success);
}

.budget-row__amount--expense {
  color: var(--danger);
}

.budget-delete-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity var(--duration-hover) var(--ease-out),
              transform var(--duration-hover) var(--ease-out);
}

.budget-row:hover .budget-delete-btn {
  opacity: 1;
}

.budget-delete-btn:hover {
  color: var(--danger);
  background: var(--danger-muted);
}

/* ---- Budget Toggle Checkbox ---- */
.budget-toggle-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
}

.budget-toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.budget-toggle-visual {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-hover);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--duration-hover) var(--ease-out),
              border-color var(--duration-hover) var(--ease-out);
  background: transparent;
  position: relative;
}

.budget-toggle:checked + .budget-toggle-visual {
  background: var(--accent);
  border-color: var(--accent);
}

.budget-toggle:checked + .budget-toggle-visual::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  position: absolute;
  top: 1px;
}

.budget-toggle:focus-visible + .budget-toggle-visual {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Budget Subtotal ---- */
.budget-subtotal {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-2);
  border-top: 1px solid var(--border);
  margin-top: var(--space-2);
  font-size: 14px;
  color: var(--text-muted);
}

.budget-subtotal--income strong {
  color: var(--success);
}

.budget-subtotal--expense strong {
  color: var(--danger);
}

/* ---- Budget Sections ---- */
.budget-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .budget-sections {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- Onboarding ---- */
.onboarding {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 48px);
  min-height: calc(100dvh - 48px);
}

.onboarding__progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-6) 0;
}

.onboarding__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-hover);
  transition: transform var(--duration-hover) var(--ease-out),
              background var(--duration-hover) var(--ease-out);
}

.onboarding__dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.onboarding__dot.completed {
  background: var(--accent);
  opacity: 0.5;
}

.onboarding__content {
  flex: 1;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.onboarding__hero {
  text-align: center;
  margin-bottom: var(--space-8);
}

.onboarding__logo {
  width: 80px;
  height: 80px;
  background: var(--accent-muted);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
}

.onboarding__title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: var(--space-3);
}

.onboarding__subtitle {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 420px;
  margin: 0 auto;
}

.onboarding__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.onboarding__feature {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.onboarding__feature-icon {
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.onboarding__feature strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

.onboarding__feature p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.onboarding__step-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.onboarding__step-desc {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-6);
}

/* Onboarding Items List */
.onboarding__items-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.onboarding__item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: var(--space-3);
}

.onboarding__item-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.onboarding__item-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.onboarding__item-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.onboarding__item-tag--income {
  background: var(--success-muted);
  color: var(--success);
}

.onboarding__item-tag--expense {
  font-size: 12px;
}

.onboarding__item-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.onboarding__item-amount {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--success);
}

.onboarding__item-amount--expense {
  color: var(--danger);
}

.onboarding__delete-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: opacity var(--duration-hover) var(--ease-out);
}

.onboarding__delete-btn:hover {
  color: var(--danger);
  background: var(--danger-muted);
}

/* Onboarding Form */
.onboarding__add-form {
  margin-bottom: var(--space-4);
}

.onboarding__form-row {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.onboarding__form-row .input {
  flex: 1;
  min-width: 120px;
}

.onboarding__amount-wrap {
  position: relative;
  flex: 1;
  min-width: 120px;
}

.onboarding__currency-prefix {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
}

.onboarding__amount-wrap .input {
  padding-left: 28px;
}

.onboarding__total {
  padding: var(--space-3) var(--space-4);
  background: var(--success-muted);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--success);
  text-align: right;
}

.onboarding__total--expense {
  background: var(--danger-muted);
  color: var(--danger);
}

/* Onboarding Presets */
.onboarding__presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.onboarding__preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--duration-hover) var(--ease-out),
              border-color var(--duration-hover) var(--ease-out);
}

.onboarding__preset-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.03);
}

/* Onboarding Summary */
.onboarding__summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.onboarding__summary-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}

.onboarding__summary-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.onboarding__summary-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
}

.onboarding__summary-card--income .onboarding__summary-value {
  color: var(--success);
}

.onboarding__summary-card--expense .onboarding__summary-value {
  color: var(--danger);
}

.onboarding__summary-card--positive .onboarding__summary-value {
  color: var(--success);
}

.onboarding__summary-card--negative .onboarding__summary-value {
  color: var(--danger);
}

/* Onboarding Toggle Lists */
.onboarding__toggle-section {
  margin-bottom: var(--space-6);
}

.onboarding__toggle-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.onboarding__toggle-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity var(--duration-hover) var(--ease-out);
}

.onboarding__toggle-row:hover {
  background: var(--surface);
}

.onboarding__toggle-row--disabled {
  opacity: 0.35;
}

.onboarding__toggle-row--disabled .onboarding__toggle-label {
  text-decoration: line-through;
}

.onboarding__checkbox {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.onboarding__toggle-label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.onboarding__toggle-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: var(--success-muted);
  color: var(--success);
  flex-shrink: 0;
}

.onboarding__toggle-amount {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--success);
  flex-shrink: 0;
}

.onboarding__toggle-amount--expense {
  color: var(--danger);
}

/* Onboarding Actions */
.onboarding__actions {
  padding: var(--space-6) 0;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.onboarding__actions--split {
  display: flex;
  gap: var(--space-3);
}

.onboarding__actions--split .btn {
  flex: 1;
}

.onboarding__actions-right {
  display: flex;
  gap: var(--space-3);
  flex: 1;
  justify-content: flex-end;
}

.onboarding__actions-right .btn {
  flex: none;
}

.onboarding__actions-right .btn--primary {
  flex: 1;
}

.btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: var(--space-3) var(--space-5);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: color 0.18s ease, border-color 0.18s ease;
}

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

.btn--ghost:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.onboarding__skip-note {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: var(--space-3);
  padding-bottom: var(--space-4);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Account Type Cards ---- */
.onboarding__type-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.onboarding__type-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-6);
  background: var(--surface);
  background-image: var(--glass-shine);
  border: 2px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
}

.onboarding__type-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.onboarding__type-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.onboarding__type-card--selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  background-image: var(--glass-shine);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(0,0,0,0.1);
}

.onboarding__type-card-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.onboarding__type-card--selected .onboarding__type-card-check {
  border-color: var(--accent);
  background: var(--accent);
}

.onboarding__type-card-check svg {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.onboarding__type-card--selected .onboarding__type-card-check svg {
  opacity: 1;
}

.onboarding__type-card-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
}

.onboarding__type-card-icon {
  font-size: 28px;
  line-height: 1;
}

.onboarding__type-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.onboarding__type-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  max-width: 200px;
}

.onboarding__profile-form {
  max-width: 600px;
  margin: 0 auto;
}

.onboarding__form-card {
  background: var(--surface);
  background-image: var(--glass-shine);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: var(--space-6);
  animation: onboardingFormReveal 0.35s ease-out;
}

.onboarding__form-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.onboarding__form-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onboarding__form-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.onboarding__form-card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

@keyframes onboardingFormReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.onboarding__form-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.onboarding__form-section .input-group {
  margin-bottom: 0;
}

.onboarding__field-label-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.onboarding__field-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.onboarding__currency-box {
  position: relative;
}

.onboarding__currency-box .onboarding__currency-tag {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border-right: 1px solid var(--border);
  border-radius: 6px 0 0 6px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
}

.onboarding__currency-box .input {
  padding-left: 52px;
}

/* ---- Summary: Account Badge & Empty State ---- */
.onboarding__account-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-6);
}

.onboarding__empty-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-8) 0;
}

.onboarding__empty-icon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: var(--space-4);
}

.onboarding__empty-note {
  font-size: 14px;
  color: var(--muted);
  margin-top: var(--space-4);
}

.btn--lg {
  min-height: 52px;
  font-size: 16px;
  padding: var(--space-4) var(--space-8);
}

@media (max-width: 480px) {
  .onboarding__summary-cards {
    grid-template-columns: 1fr;
  }

  .onboarding__form-row {
    flex-direction: column;
  }

  .onboarding__title {
    font-size: 24px;
  }

  .onboarding__type-cards {
    grid-template-columns: 1fr;
  }

  .onboarding__actions-right {
    flex-direction: column;
  }

  .onboarding__actions--split {
    flex-direction: column;
  }
}

/* ---- Login / Auth View ---- */
.login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 48px);
  min-height: calc(100dvh - 48px);
  padding: var(--space-6);
}

.login__content {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.login__hero {
  text-align: center;
  margin-bottom: var(--space-8);
}

.login__logo {
  width: 80px;
  height: 80px;
  background: var(--accent-muted);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
}

.login__title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.login__subtitle {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

.login__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.login__password-wrap {
  position: relative;
}

.login__password-wrap .input {
  padding-right: 48px;
}

.login__toggle-pw {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--duration-hover) var(--ease-out);
}

.login__toggle-pw:hover {
  color: var(--text-muted);
}

.login__error {
  font-size: 14px;
  color: var(--danger);
  background: var(--danger-muted);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--danger);
  border-color: rgba(244, 91, 105, 0.2);
}

.login__submit {
  margin-top: var(--space-2);
}

.login__switch {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: var(--space-6);
}

.login__switch-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  transition: opacity var(--duration-hover) var(--ease-out);
}

.login__switch-btn:hover {
  opacity: 0.8;
}

.login__switch-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.login__divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) 0;
  color: var(--text-faint);
  font-size: 12px;
}

.login__divider::before,
.login__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login__guest {
  width: 100%;
}

.login__guest-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  margin-top: var(--space-3);
  line-height: 1.5;
}

.login__forgot {
  display: inline-block;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin: 0;
  opacity: 0.8;
  transition: opacity 180ms, color 180ms;
}
.login__forgot:hover { opacity: 1; color: var(--accent); }
.login__forgot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.login__success {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
  color: #34d399;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  margin-bottom: var(--space-3);
}

/* ---- Account Card (Settings) ---- */
.account-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
}

.account-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.account-card__info {
  flex: 1;
  min-width: 0;
}

.account-card__name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.account-card__email {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Profile Menu ---- */
.profile-menu {
  position: relative;
}

.profile-menu__trigger {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  transition: transform var(--duration-hover) var(--ease-out),
              opacity var(--duration-hover) var(--ease-out);
}

.profile-menu__trigger:hover {
  color: var(--text);
  transform: scale(1.05);
  border-color: var(--border-hover);
}

.profile-menu__trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.profile-menu__trigger:active {
  transform: scale(0.95);
}

.profile-menu__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: min(220px, calc(100vw - 32px));
  background-color: var(--surface-elevated);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-floating);
  z-index: var(--z-modal);
  padding: 8px;
}

.profile-menu__dropdown.open {
  display: block;
}

.profile-menu__user {
  padding: var(--space-3) var(--space-3);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.profile-menu__user strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.profile-menu__divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-1) 0;
}

.profile-menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-3);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--duration-hover) var(--ease-out),
              opacity var(--duration-hover) var(--ease-out);
  text-align: left;
}

.profile-menu__item:hover {
  background: var(--surface);
  color: var(--text);
}

.profile-menu__item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.profile-menu__item:active {
  transform: scale(0.98);
}

.profile-menu__item--danger:hover {
  color: var(--danger);
}

/* ---- Account Selector ---- */
.account-selector {
  position: relative;
}

.account-selector__trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--duration-hover) var(--ease-out),
              background var(--duration-hover) var(--ease-out);
  min-height: 36px;
}

.account-selector__trigger:hover {
  border-color: var(--border-hover);
  background: var(--surface-elevated);
}

.account-selector__icon {
  font-size: 16px;
}

.account-selector__label {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-selector__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: var(--surface-floating);
  backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-floating);
  z-index: var(--z-modal);
  padding: var(--space-2);
  display: none;
}

.account-selector__dropdown.open {
  display: block;
}

.account-selector__option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background var(--duration-hover) var(--ease-out),
              color var(--duration-hover) var(--ease-out);
  text-align: left;
}

.account-selector__option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.account-selector__option.active {
  color: var(--accent);
  background: var(--accent-muted);
}

.account-selector__option--add {
  color: var(--accent);
}

.account-selector__badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--accent-muted);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: auto;
}

.account-selector__divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-1) var(--space-2);
}

/* ---- Account List (Manager Modal) ---- */
.account-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.account-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.account-list__icon {
  font-size: 24px;
  flex-shrink: 0;
}

.account-list__info {
  flex: 1;
  min-width: 0;
}

.account-list__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.account-list__type {
  font-size: 12px;
  color: var(--text-muted);
}

.account-list__delete {
  color: var(--text-faint);
}

.account-list__delete:hover {
  color: var(--danger);
}

/* ---- Icon Picker ---- */
.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.icon-picker__option {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  transition: border-color var(--duration-hover) var(--ease-out),
              transform var(--duration-hover) var(--ease-out);
}

.icon-picker__option:hover {
  border-color: var(--border-hover);
  transform: scale(1.1);
}

.icon-picker__option.selected {
  border-color: var(--accent);
  background: var(--accent-muted);
}

/* ---- Budget Analysis (50/30/20) ---- */
.budget-analysis-row {
  margin-bottom: var(--space-6);
}

.budget-analysis__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: var(--space-2) 0;
}

.budget-analysis__header:hover .budget-analysis__label {
  color: var(--accent);
}

.budget-analysis__label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  transition: color var(--duration-hover) var(--ease-out);
}

.budget-analysis__values {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  color: var(--text-muted);
}

.budget-analysis__amount {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.budget-analysis__bar-bg {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  position: relative;
  overflow: visible;
  margin-top: var(--space-2);
}

.budget-analysis__bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.budget-analysis__target {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 1px;
  transform: translateX(-1px);
}

.budget-analysis__detail {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

.budget-analysis__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.budget-analysis__item:last-child {
  border-bottom: none;
}

/* ---- Tip Cards ---- */
.tip-card {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: var(--space-3);
  transition: border-color var(--duration-hover) var(--ease-out);
}

.tip-card:hover {
  border-color: var(--border-hover);
}

.tip-card__icon {
  font-size: 24px;
  flex-shrink: 0;
}

.tip-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.tip-card__desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- Budget Builder ---- */
.budget-builder-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.budget-builder-row:last-child {
  border-bottom: none;
}

.budget-builder__cat {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.budget-builder__values {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.budget-builder__actual {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.budget-builder__delta {
  font-family: var(--font-mono);
}

@media (max-width: 640px) {
  .budget-builder-row {
    flex-wrap: wrap;
  }
  .budget-builder__values {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ---- Account Type Cards (Retirement) ---- */
.account-type-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  overflow: hidden;
  transition: border-color var(--duration-hover) var(--ease-out);
}

.account-type-card:hover {
  border-color: var(--border-hover);
}

.account-type-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-secondary);
}

.account-type-card__icon {
  font-size: 28px;
  flex-shrink: 0;
}

.account-type-card__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.account-type-card__subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.account-type-card__body {
  padding: var(--space-4);
}

.account-type-card__stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.account-type-card__stat:last-of-type {
  border-bottom: none;
}

.account-type-card__stat strong {
  font-family: var(--font-mono);
}

.account-type-card__desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: var(--space-3);
}

/* ---- Calculator Results ---- */
.calc-results .stat-card {
  text-align: center;
}

.calc-results .stat-card__label {
  font-size: 12px;
  margin-bottom: var(--space-2);
}

/* ── Learn / Blog ── */
.learn-page {
  max-width: 1100px;
}

.learn-controls {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  align-items: center;
}

.learn-filters {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Article Grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

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

/* Article Card */
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color var(--duration-hover) var(--ease-out),
              transform var(--duration-hover) var(--ease-out);
}

.article-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.article-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.article-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.article-card__category {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-card__bookmark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  border-radius: var(--radius);
  transition: color var(--duration-hover) var(--ease-out);
}

.article-card__bookmark:hover {
  color: var(--accent);
}

.article-card__bookmark--active {
  color: var(--accent);
}

.article-card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-2);
}

.article-card__summary {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: var(--space-3);
}

.article-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-faint);
}

.article-card__link {
  color: var(--accent);
  font-weight: 500;
}

/* Article Detail */
.article-detail {
  padding: var(--space-6);
}

.article-detail__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.article-detail__title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}

.article-detail__summary {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.article-detail__actions {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.article-detail__content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-muted);
}

.article-detail__content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: var(--space-6) 0 var(--space-3);
}

.article-detail__content h3:first-child {
  margin-top: 0;
}

.article-detail__content p {
  margin-bottom: var(--space-3);
}

.article-detail__content ul,
.article-detail__content ol {
  padding-left: var(--space-5);
  margin-bottom: var(--space-3);
}

.article-detail__content li {
  margin-bottom: var(--space-2);
}

.article-detail__content strong {
  color: var(--text);
  font-weight: 600;
}

.article-detail__content code {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 8px;
  background: var(--bg);
  border-radius: 6px;
  color: var(--accent);
}

.article-detail__content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-4) 0;
  font-size: 14px;
}

.article-detail__content th,
.article-detail__content td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.article-detail__content th {
  font-weight: 600;
  color: var(--text);
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--duration-hover) var(--ease-out);
}

.faq-item:hover {
  border-color: var(--border-hover);
}

.faq-item__question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: var(--space-4);
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  gap: var(--space-3);
  min-height: 44px;
}

.faq-item__question:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.faq-item__chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--duration-hover) var(--ease-out);
}

.faq-item__answer {
  padding: 0 var(--space-4) var(--space-4);
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Calendar Widget ── */
.calendar-widget {
  padding: var(--space-4);
}

.calendar-widget__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.calendar-widget__month {
  font-size: 18px;
  font-weight: 700;
}

.calendar-widget__stats {
  display: flex;
  gap: var(--space-4);
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.calendar-widget__stat {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-widget__stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Calendar Grid */
.calendar-grid__header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  margin-bottom: var(--space-1);
}

.calendar-grid__day-name {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-2) 0;
}

.calendar-grid__body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

/* Calendar Cells */
.calendar-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--space-1);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 48px;
  transition: border-color var(--duration-hover) var(--ease-out),
              background var(--duration-hover) var(--ease-out);
}

.calendar-cell:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
}

.calendar-cell:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.calendar-cell--empty {
  background: transparent;
  cursor: default;
  border: none;
}

.calendar-cell--empty:hover {
  background: transparent;
  border-color: transparent;
}

.calendar-cell--today {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.calendar-cell--due {
  border-color: var(--warning);
}

.calendar-cell--selected {
  border-color: var(--accent);
  background: var(--accent-muted);
  box-shadow: 0 0 12px rgba(15, 206, 171, 0.1);
}

.calendar-cell--has-items {
  background: rgba(255, 255, 255, 0.02);
}

.calendar-cell__number {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.calendar-cell__number--today {
  color: var(--accent);
  font-weight: 700;
}

.calendar-cell__dots {
  display: flex;
  gap: 3px;
}

.calendar-cell__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.calendar-cell__dot--income {
  background: var(--success);
}

.calendar-cell__dot--expense {
  background: var(--danger);
}

.calendar-cell__dot--due {
  background: var(--warning);
}

/* Calendar Detail Panel */
.calendar-detail {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.calendar-detail__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.calendar-detail__date {
  font-size: 16px;
  font-weight: 600;
}

.calendar-detail__summary {
  display: flex;
  gap: var(--space-3);
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  margin-top: 2px;
}

.calendar-detail__items {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.calendar-detail__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.calendar-detail__item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.calendar-detail__item-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.calendar-detail__item-label {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-detail__item-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.calendar-detail__item-amount {
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .calendar-cell {
    min-height: 40px;
    aspect-ratio: auto;
    padding: 2px;
  }

  .calendar-cell__number {
    font-size: 12px;
  }

  .calendar-cell__dot {
    width: 4px;
    height: 4px;
  }

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

/* ---- Calendar Navigation Buttons ---- */
.calendar-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: color var(--duration-hover) var(--ease-smooth),
              background var(--duration-hover) var(--ease-smooth);
}

.calendar-nav-btn:hover {
  color: var(--text);
  background: var(--surface-elevated);
}

.calendar-nav-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.calendar-nav-btn:active {
  transform: scale(0.92);
}

/* ---- Calendar Week View ---- */
.calendar-week-grid {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE/Edge */
  padding-bottom: var(--space-2);
}
.calendar-week-grid::-webkit-scrollbar {
  display: none;                /* Chrome/Safari */
}

.calendar-week-cell {
  min-width: 130px;
  flex: 0 0 auto;
  min-height: 120px;
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-hover) var(--ease-smooth),
              border-color var(--duration-hover) var(--ease-smooth);
}

.calendar-week-cell:hover {
  background: var(--surface-elevated);
  border-color: var(--border-hover);
}

.calendar-week-cell--today {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.calendar-week-cell--outside {
  opacity: 0.4;
}

.calendar-week-cell__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.calendar-week-cell__dayname {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-week-cell__number {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.calendar-week-cell__items {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.calendar-week-item {
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--bg-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-1);
}

.calendar-week-item__label {
  font-size: 10px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.calendar-week-item__amount {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.calendar-week-item__overflow {
  font-size: 10px;
  color: var(--text-faint);
  text-align: center;
  padding: 2px;
}

/* ---- Calendar Day View ---- */
.calendar-day-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.calendar-day-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background var(--duration-hover) var(--ease-smooth);
}

.calendar-day-item:hover {
  background: var(--surface-elevated);
}

.calendar-day-item__indicator {
  width: 3px;
  border-radius: 2px;
  flex-shrink: 0;
  align-self: stretch;
}

.calendar-day-item__content {
  flex: 1;
  min-width: 0;
}

/* Week view responsive */
@media (max-width: 767px) {
  .calendar-week-cell {
    min-width: 110px;
    min-height: 80px;
  }

  .calendar-week-cell__number {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .calendar-week-cell {
    min-width: 100px;
    min-height: auto;
  }
}

/* ---- Ticker Allocation Table ---- */
.ticker-allocation-table {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ticker-allocation-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

@media (max-width: 600px) {
  .ticker-allocation-row {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
}

/* ---- Ticker Projection List ---- */
.ticker-projection-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ticker-projection-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

@media (max-width: 600px) {
  .ticker-projection-row {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
}

/* ---- Portfolio Comparison ---- */
.portfolio-comparison {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.portfolio-comparison__row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--duration-hover) var(--ease-out);
}

.portfolio-comparison__row:hover {
  border-color: var(--accent);
}

.portfolio-comparison__name {
  font-size: 14px;
  font-weight: 600;
}

.portfolio-comparison__rate {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 50px;
  text-align: center;
}

.portfolio-comparison__value {
  font-size: 16px;
  font-weight: 700;
  min-width: 100px;
  text-align: right;
}

@media (max-width: 600px) {
  .portfolio-comparison__row {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  .portfolio-comparison__value {
    min-width: auto;
  }
}

/* ---- Upload Zone (Statement Import) ---- */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--duration-hover) var(--ease-out),
              background var(--duration-hover) var(--ease-out);
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.upload-zone--active {
  border-color: var(--accent);
  background: var(--accent-muted);
  border-style: solid;
}

.upload-zone__icon {
  margin-bottom: var(--space-4);
}

.upload-zone__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: 14px;
  color: var(--text-muted);
}

.upload-zone__text strong {
  color: var(--text);
  font-size: 16px;
}

/* ---- Import Transaction List ---- */
.import-txn-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.import-txn-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: opacity var(--duration-hover) var(--ease-out);
}

.import-txn-row--deselected {
  opacity: 0.4;
}

.import-txn__check {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.import-txn__info {
  flex: 1;
  min-width: 0;
}

.import-txn__desc {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-txn__date {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}

.import-txn__amount {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.import-txn__amount--income {
  color: var(--success);
}

.import-txn__amount--expense {
  color: var(--danger);
}

.import-txn__cat {
  flex-shrink: 0;
}

/* Responsive: stack on mobile */
@media (max-width: 480px) {
  .import-txn-row {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .import-txn__info {
    flex: 1 1 calc(100% - 80px);
  }

  .import-txn__amount {
    order: 3;
    flex-basis: auto;
  }

  .import-txn__cat {
    order: 4;
    width: 100%;
    min-width: 100%;
  }
}

/* ---- Investment Grid (Retirement Calculator) ---- */
.investment-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.investment-category__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.investment-category__items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
}

.investment-card {
  display: block;
  cursor: pointer;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--duration-hover) var(--ease-out),
              transform var(--duration-hover) var(--ease-out);
}

.investment-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.investment-card--selected {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.investment-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.investment-card__name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.investment-card__ticker {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  margin-bottom: var(--space-1);
}

.investment-card__return {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--success);
  margin-bottom: 2px;
}

.investment-card__range {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: var(--space-2);
}

.investment-card__desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Risk Badge */
.risk-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--risk-color, var(--text-muted));
  background: color-mix(in srgb, var(--risk-color, var(--text-muted)) 12%, transparent);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Weight Allocation Sliders */
.weight-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.weight-row__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  min-width: 100px;
}

.weight-row__value {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent);
  min-width: 36px;
  text-align: right;
}

.weight-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 6px;
  background: var(--border);
  outline: none;
}

.weight-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 0 4px rgba(15, 206, 171, 0.4);
}

.weight-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
}

/* Blended Return Display */
.blended-return-bar__track {
  height: 8px;
  background: var(--border);
  border-radius: 6px;
  position: relative;
  margin-bottom: var(--space-3);
}

.blended-return-bar__fill {
  position: absolute;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--warning), var(--success), var(--accent));
  border-radius: 6px;
}

.blended-return-values {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 14px;
  margin-bottom: 2px;
}

.blended-return-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Responsive: investment grid */
@media (max-width: 480px) {
  .investment-category__items {
    grid-template-columns: 1fr;
  }

  .weight-row__label {
    min-width: 70px;
    font-size: 12px;
  }
}

/* ── Planning Tabs ── */
.planning-tabs {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  overflow-x: auto;
}

.planning-tab {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--duration-hover) var(--ease-out),
              background var(--duration-hover) var(--ease-out);
  min-height: 44px;
}

.planning-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.planning-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.planning-tab--active {
  color: var(--accent);
  background: var(--accent-muted);
  font-weight: 600;
}

/* ── Portfolio Grid ── */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4);
}

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

/* ── Portfolio Card ── */
.portfolio-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  transition: border-color var(--duration-hover) var(--ease-out),
              transform var(--duration-hover) var(--ease-out);
}

.portfolio-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.portfolio-card--selected {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(15, 206, 171, 0.12);
}

.portfolio-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.portfolio-card__name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.portfolio-card__subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.portfolio-card__select-btn {
  margin-top: auto;
}

.portfolio-ticker-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* ── Ticker Row (Explorer) ── */
.ticker-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ticker-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--duration-hover) var(--ease-out);
}

.ticker-row:hover {
  border-color: var(--border-hover);
}

.ticker-row__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  gap: var(--space-3);
}

.ticker-row__left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.ticker-row__symbol {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  min-width: 48px;
}

.ticker-row__name {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker-row__right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.ticker-row__returns {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.ticker-row__return {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
}

.ticker-row__expand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: transform var(--duration-hover) var(--ease-out),
              background var(--duration-hover) var(--ease-out);
}

.ticker-row__expand:hover {
  background: var(--surface);
}

.ticker-row__expand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.ticker-row__details {
  padding: 0 var(--space-4) var(--space-4);
  border-top: 1px solid var(--border);
}

/* ── Ticker Category Filter ── */
.ticker-category-filter {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

/* ── Risk Quiz ── */
.risk-quiz {
  text-align: left;
}

.risk-quiz__header {
  margin-bottom: var(--space-4);
}

.risk-quiz__title {
  font-size: 18px;
  font-weight: 700;
}

.risk-quiz__progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: var(--space-6);
  overflow: hidden;
}

.risk-quiz__progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 300ms var(--ease-out);
}

.risk-quiz__question {
  margin-bottom: var(--space-6);
}

.risk-quiz__options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.risk-quiz__option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  min-height: 44px;
  transition: border-color var(--duration-hover) var(--ease-out),
              background var(--duration-hover) var(--ease-out);
}

.risk-quiz__option:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.02);
}

.risk-quiz__option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.risk-quiz__option--selected {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.risk-quiz__option-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: border-color var(--duration-hover) var(--ease-out),
              background var(--duration-hover) var(--ease-out);
}

.risk-quiz__option--selected .risk-quiz__option-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--bg);
}

.risk-quiz__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

/* ── Risk Result ── */
.risk-result {
  text-align: left;
}

.risk-result__header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.risk-result__badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-3);
}

.risk-result__title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.risk-result__description {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.risk-result__allocation {
  margin-bottom: var(--space-6);
}

.risk-result__bar {
  display: flex;
  height: 36px;
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
}

.risk-result__bar-stocks {
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.risk-result__bar-bonds {
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.risk-result__portfolio {
  margin-bottom: var(--space-6);
}

.risk-result__portfolio-card {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.risk-result__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ── Tax Strategy Cards ── */
.tax-strategy-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.tax-strategy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--duration-hover) var(--ease-out);
}

.tax-strategy-card:hover {
  border-color: var(--border-hover);
}

.tax-strategy-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  gap: var(--space-3);
}

.tax-strategy-card__body {
  padding: 0 var(--space-4) var(--space-4);
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

.tax-strategy-card__body h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: var(--space-4) 0 var(--space-2);
}

.tax-strategy-card__body ul,
.tax-strategy-card__body ol {
  padding-left: var(--space-5);
  margin: var(--space-2) 0;
}

.tax-strategy-card__body li {
  margin-bottom: var(--space-1);
}

.tax-strategy-card__body code {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 6px;
  background: var(--bg);
  border-radius: 6px;
  color: var(--accent);
}

/* ── Contribution Order ── */
.contribution-order {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.contribution-order__step {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.contribution-order__number {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

/* ---- Project Cards ---- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

.project-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  cursor: pointer;
  transition: transform var(--duration-hover) var(--ease-out),
              border-color var(--duration-hover) var(--ease-out);
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.project-card__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.project-card__icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.project-card__info {
  flex: 1;
  min-width: 0;
}

.project-card__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card__desc {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  min-width: 0;
}

.project-card__stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
}

.project-card__stat span {
  color: var(--text-muted);
}

.project-card__stat strong {
  font-family: var(--font-mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Payment Badge ---- */
.payment-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

.payment-badge--paid {
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success);
}

.payment-badge--pending {
  background: color-mix(in srgb, var(--warning) 15%, transparent);
  color: var(--warning);
}

.payment-badge--overdue {
  background: color-mix(in srgb, var(--danger) 15%, transparent);
  color: var(--danger);
}

/* ---- Customer Row (Revenue) ---- */
.customer-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.customer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--duration-hover) var(--ease-out);
}

.customer-row:hover {
  border-color: var(--accent);
}

.customer-row__info {
  flex: 1;
  min-width: 0;
}

.customer-row__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.customer-row__meta {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}

.customer-row__total {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

/* ---- Icon Picker ---- */
.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.icon-picker__item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: border-color var(--duration-hover) var(--ease-out),
              transform var(--duration-hover) var(--ease-out);
}

.icon-picker__item:hover {
  border-color: var(--text-muted);
  transform: scale(1.05);
}

.icon-picker__item--active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

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

/* ============================================
   CRM — Contacts, Pipeline, Deals
   ============================================ */

.crm-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-4);
}

.crm-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
}

/* CRM Tabs */
.crm-tabs {
  display: flex;
  gap: var(--space-1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: var(--space-6);
}

.crm-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: background 180ms, color 180ms;
  flex: 1;
  justify-content: center;
}

.crm-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.crm-tab.active {
  background: var(--accent);
  color: var(--bg);
}

/* CRM Controls (Search + Filters) */
.crm-controls {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.crm-filters {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* CRM Stats Row */
.crm-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.crm-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.crm-stat-card__value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.crm-stat-card__label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Contact Cards */
.crm-contact-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.crm-contact-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: border-color 180ms, transform 180ms;
}

.crm-contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.crm-contact-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.crm-contact-card__info {
  flex: 1;
  min-width: 0;
}

.crm-contact-card__name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-contact-card__meta {
  display: flex;
  gap: var(--space-3);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.crm-contact-card__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.crm-contact-card__actions {
  display: flex;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity 180ms;
}

.crm-contact-card:hover .crm-contact-card__actions {
  opacity: 1;
}

.crm-contact-card__edit,
.crm-contact-card__delete {
  padding: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: color 180ms, background 180ms;
}

.crm-contact-card__edit:hover { color: var(--accent); background: rgba(255,255,255,0.06); }
.crm-contact-card__delete:hover { color: var(--danger); background: rgba(255,255,255,0.06); }

/* Stage Badge */
.crm-stage-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* Type Badge */
.crm-contact-card__type-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.crm-contact-card__type-badge--customer {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.crm-contact-card__type-badge--lead {
  background: rgba(99, 102, 241, 0.15);
  color: #6366F1;
}

/* Empty State */
.crm-empty {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.crm-empty p {
  margin-top: var(--space-2);
  font-size: 16px;
}

/* ---- Contact Detail ---- */
.crm-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.crm-detail__header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-4) var(--space-5);
}

.crm-detail__header-info {
  flex: 1;
}

.crm-detail__name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-1);
}

.crm-detail__meta {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

.crm-detail__header-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.crm-stage-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
}

.crm-detail__info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-4);
}

.crm-detail__info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.crm-detail__info-label {
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.crm-detail__info-item > span:last-child {
  font-size: 14px;
  color: var(--text);
}

.crm-detail__notes {
  padding: var(--space-4);
}

.crm-detail__section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-4);
}

.crm-detail__section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.crm-detail__section-header h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* Deal Rows */
.crm-deal-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.crm-deal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.crm-deal-row__info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.crm-deal-row__title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.crm-deal-row__amount {
  font-size: 12px;
}

/* Activity Timeline */
.crm-activity-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.crm-activity-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  align-items: flex-start;
}

.crm-activity-item--done {
  opacity: 0.6;
}

.crm-activity-item__icon {
  font-size: 18px;
  flex-shrink: 0;
  padding-top: 2px;
}

.crm-activity-item__content {
  flex: 1;
  min-width: 0;
}

.crm-activity-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.crm-activity-item__type {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.crm-activity-item__date {
  font-size: 12px;
  color: var(--text-faint);
}

.crm-activity-item__desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.crm-activity-item__due {
  font-size: 12px;
  color: var(--warning);
  margin-top: 4px;
  display: inline-block;
}

.crm-activity-item__toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

/* ---- Pipeline Kanban ---- */
.crm-pipeline {
  overflow-x: auto;
  padding-bottom: var(--space-4);
}

.crm-pipeline__board {
  display: grid;
  grid-template-columns: repeat(6, minmax(200px, 1fr));
  gap: var(--space-3);
  min-width: 900px;
}

.crm-pipeline__column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

.crm-pipeline__column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border);
}

.crm-pipeline__column-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.crm-pipeline__column-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.crm-pipeline__column-count {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.crm-pipeline__column-body {
  flex: 1;
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: background 180ms;
}

.crm-pipeline__column-body--dragover {
  background: rgba(15, 206, 171, 0.06);
}

.crm-pipeline__card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-3);
  cursor: grab;
  transition: border-color 180ms, transform 180ms, opacity 180ms;
}

.crm-pipeline__card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.crm-pipeline__card--dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.crm-pipeline__card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.crm-pipeline__card-company {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.crm-pipeline__card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.crm-pipeline__card-days {
  font-size: 12px;
  color: var(--text-faint);
}

.crm-pipeline__empty {
  text-align: center;
  padding: var(--space-4);
  color: var(--text-faint);
  font-size: 12px;
}

/* ---- Deals Table ---- */
.crm-deal-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.crm-deal-table__header {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 1fr 0.8fr 80px;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.crm-deal-table__row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 1fr 0.8fr 80px;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 12px;
  color: var(--text);
  transition: background 180ms;
}

.crm-deal-table__row:last-child {
  border-bottom: none;
}

.crm-deal-table__row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.crm-deal-table__title {
  font-weight: 500;
}

.crm-deal-table__contact {
  color: var(--text-muted);
}

.crm-deal-table__actions {
  display: flex;
  gap: var(--space-1);
  justify-content: flex-end;
}

.crm-deal-edit,
.crm-deal-delete {
  padding: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: color 180ms, background 180ms;
}

.crm-deal-edit:hover { color: var(--accent); background: rgba(255,255,255,0.06); }
.crm-deal-delete:hover { color: var(--danger); background: rgba(255,255,255,0.06); }

/* Modal overlay — full-screen backdrop + centered content */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-backdrop, 40);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--duration-modal-out, 200ms) var(--ease-smooth, ease);
}

.modal-overlay.open {
  opacity: 1;
}

.modal-overlay > .modal,
.modal-overlay > .crm-modal {
  position: relative;
  z-index: var(--z-modal, 50);
  background: var(--surface-floating, var(--surface));
  background-image: var(--glass-shine);
  backdrop-filter: blur(32px) saturate(1.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl, 16px);
  box-shadow: var(--shadow-floating);
  padding: var(--space-6);
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.96) translateY(8px);
  transition: transform var(--duration-modal-out, 200ms) var(--ease-out, ease-out),
              opacity var(--duration-modal-out, 200ms) var(--ease-out, ease-out);
}

.modal-overlay.open > .modal,
.modal-overlay.open > .crm-modal {
  transform: scale(1) translateY(0);
}

/* CRM Modal */
.crm-modal {
  max-width: 560px;
}

.crm-modal .form-row {
  display: flex;
  gap: var(--space-3);
}

.crm-modal .form-group {
  margin-bottom: var(--space-3);
}

.crm-modal .form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Responsive */
@media (max-width: 768px) {
  .crm-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .crm-pipeline__board {
    grid-template-columns: repeat(6, 180px);
  }

  .crm-deal-table__header,
  .crm-deal-table__row {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .crm-deal-table__header > span:nth-child(n+4),
  .crm-deal-table__row > span:nth-child(n+4) {
    display: none;
  }

  .crm-detail__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .crm-detail__header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .crm-contact-card {
    flex-wrap: wrap;
  }

  .crm-contact-card__right {
    order: 3;
    width: 100%;
    margin-top: var(--space-1);
  }

  .crm-modal .form-row {
    flex-direction: column;
    gap: 0;
  }
}

@media (max-width: 480px) {
  .crm-stats {
    grid-template-columns: 1fr 1fr;
  }

  .crm-stat-card__value {
    font-size: 18px;
  }

  .crm-contact-card__actions {
    opacity: 1;
  }
}

/* CRM Pipeline: stack columns vertically on mobile */
@media (max-width: 767px) {
  .crm-pipeline__board {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
  }

  .crm-pipeline__column {
    min-height: auto;
  }
}

/* ============================================
   PROJECTS — Folder/File Explorer
   ============================================ */

.projects-page {
  max-width: 960px;
  margin: 0 auto;
}

.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
}

.projects-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

/* ---- Folder List ---- */
.folder-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.folder-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--duration-hover) var(--ease-out);
}

.folder-row:hover {
  border-color: var(--border-hover);
}

.folder-row--expanded {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(15, 206, 171, 0.08);
}

.folder-row__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  cursor: pointer;
  transition: background var(--duration-hover) var(--ease-out);
}

.folder-row__header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.folder-row__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.folder-row__chevron {
  transition: transform var(--duration-hover) var(--ease-out);
  color: var(--text-muted);
}

.folder-row--expanded .folder-row__chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.folder-row__icon {
  font-size: 24px;
  flex-shrink: 0;
}

.folder-row__info {
  flex: 1;
  min-width: 0;
}

.folder-row__name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-row__desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-row__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.folder-row__type-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius);
  background: rgba(139, 92, 246, 0.12);
  color: #8B5CF6;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.folder-row__summary {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
  font-size: 12px;
}

.folder-row__count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: var(--radius);
}

.folder-row__actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--duration-hover) var(--ease-out);
}

.folder-row:hover .folder-row__actions {
  opacity: 1;
}

.folder-row__action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
  transition: background var(--duration-hover) var(--ease-out),
              color var(--duration-hover) var(--ease-out);
}

.folder-row__action:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.folder-row__action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.folder-row__body {
  padding: 0 var(--space-4) var(--space-4);
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}

/* ---- Sub-items inside folder body ---- */
.sub-items-section {
  padding-top: var(--space-4);
}

.sub-items-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.sub-items-stat {
  text-align: center;
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sub-items-stat__value {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

.sub-items-stat__label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.sub-items-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.sub-items-table__header {
  display: grid;
  grid-template-columns: 40px 1fr 100px 100px 120px 100px 70px;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.sub-items-table__row {
  display: grid;
  grid-template-columns: 40px 1fr 100px 100px 120px 100px 70px;
  gap: var(--space-2);
  padding: var(--space-3);
  align-items: center;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background var(--duration-hover) var(--ease-out);
}

.sub-items-table__row:last-child {
  border-bottom: none;
}

.sub-items-table__row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.sub-items-table__icon {
  font-size: 20px;
  text-align: center;
}

.sub-items-table__name {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-item-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius);
  text-transform: capitalize;
}

.sub-items-table__buyer {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-items-table__actions {
  display: flex;
  gap: var(--space-1);
  justify-content: flex-end;
}

.sub-item-edit,
.sub-item-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
  transition: background var(--duration-hover) var(--ease-out),
              color var(--duration-hover) var(--ease-out);
}

.sub-item-edit:hover,
.sub-item-delete:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.sub-item-edit:focus-visible,
.sub-item-delete:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.sub-item-delete:hover {
  color: var(--danger);
}

.sub-items-empty {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  color: var(--text-muted);
  font-size: 12px;
}

/* ---- Projects page responsive ---- */
@media (max-width: 768px) {
  .projects-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .folder-row__header {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .folder-row__summary {
    width: 100%;
    justify-content: space-between;
    padding-top: var(--space-2);
    font-size: 12px;
  }

  .folder-row__meta {
    order: 5;
  }

  .folder-row__actions {
    opacity: 1;
  }

  .sub-items-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .sub-items-table__header,
  .sub-items-table__row {
    grid-template-columns: 32px 1fr 80px 80px 60px;
  }

  .sub-items-table__header > :nth-child(5),
  .sub-items-table__header > :nth-child(6),
  .sub-items-table__row > :nth-child(5),
  .sub-items-table__row > :nth-child(6) {
    display: none;
  }
}

@media (max-width: 480px) {
  .projects-header {
    flex-direction: column;
  }

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

  .folder-row__summary {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .folder-row__meta {
    width: 100%;
  }

  .sub-items-table__header,
  .sub-items-table__row {
    grid-template-columns: 28px 1fr 70px 50px;
  }

  .sub-items-table__header > :nth-child(4),
  .sub-items-table__row > :nth-child(4) {
    display: none;
  }
}

/* ============================================
   HEALTH ENGINE — Score, Projections, Intel
   ============================================ */

/* ---- Hero Section ---- */
.health-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-8) var(--space-4);
  gap: var(--space-4);
}

.health-score-ring {
  position: relative;
  width: 140px;
  height: 140px;
}

.health-score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.health-score-ring__track {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.health-score-ring__fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s var(--ease-out), stroke 0.3s var(--ease-smooth);
}

.health-score-ring__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.health-score-ring__label small {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: var(--font-ui);
}

/* ---- Grade Badge ---- */
.health-grade {
  font-size: 14px;
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  display: inline-block;
}

.health-grade--excellent { color: var(--success); background: var(--success-muted); }
.health-grade--good { color: var(--accent); background: var(--accent-muted); }
.health-grade--fair { color: var(--warning); background: var(--warning-muted); }
.health-grade--poor { color: var(--danger); background: var(--danger-muted); }

/* ---- Filter Bar (Checkbox Row) ---- */
.health-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.health-filter::-webkit-scrollbar { display: none; }

.health-filter__item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration-hover) var(--ease-smooth),
              color var(--duration-hover) var(--ease-smooth),
              border-color var(--duration-hover) var(--ease-smooth);
  user-select: none;
}

.health-filter__item:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.health-filter__item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.health-filter__item.active {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
}

.health-filter__check {
  width: 14px;
  height: 14px;
  border-radius: 6px;
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.health-filter__item.active .health-filter__check {
  background: var(--accent);
  border-color: var(--accent);
}

.health-filter__item.active .health-filter__check svg {
  display: block;
}

.health-filter__check svg {
  display: none;
  width: 10px;
  height: 10px;
  stroke: var(--bg);
  stroke-width: 3;
}

/* ---- Breakdown Grid ---- */
.health-breakdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

@media (max-width: 1024px) {
  .health-breakdown { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .health-breakdown { grid-template-columns: repeat(2, 1fr); }
}

.health-dimension {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  transition: transform var(--duration-hover) var(--ease-out),
              opacity var(--duration-normal) var(--ease-smooth),
              max-height var(--duration-normal) var(--ease-smooth);
  overflow: hidden;
}

.health-dimension:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
  border-color: var(--border-hover);
}

.health-dimension--hidden {
  opacity: 0;
  max-height: 0;
  padding: 0;
  margin: 0;
  border: none;
  overflow: hidden;
  pointer-events: none;
}

.health-dimension__name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.health-dimension__score {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.health-dimension__detail {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.4;
}

/* ---- Projection Grid ---- */
.health-projection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

@media (max-width: 768px) {
  .health-projection-grid { grid-template-columns: 1fr; }
}

.health-projection-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.health-projection-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.health-projection-card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
}

.health-projection-card__label {
  color: var(--text-muted);
}

.health-projection-card__surplus { color: var(--success); font-weight: 600; }
.health-projection-card__deficit { color: var(--danger); font-weight: 600; }

.health-projection-card__position {
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

/* ---- Revenue Horizontal Bars ---- */
.health-revenue-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.health-revenue-bar__name {
  width: 100px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.health-revenue-bar__track {
  flex: 1;
  height: 8px;
  background: var(--surface);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.health-revenue-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--duration-normal) var(--ease-out);
  min-width: 2px;
}

.health-revenue-bar__value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}

/* ---- Insight Severity Cards ---- */
.health-insight {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  border-left: 4px solid var(--border);
  transition: transform var(--duration-hover) var(--ease-out),
              opacity var(--duration-normal) var(--ease-smooth);
}

.health-insight:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-elevated);
}

.health-insight--critical { border-left-color: var(--danger); }
.health-insight--warning { border-left-color: var(--warning); }
.health-insight--positive { border-left-color: var(--success); }
.health-insight--info { border-left-color: var(--info); }
.health-insight--hidden { display: none; }

.health-insight__severity {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-1);
}

.health-insight--critical .health-insight__severity { color: var(--danger); }
.health-insight--warning .health-insight__severity { color: var(--warning); }
.health-insight--positive .health-insight__severity { color: var(--success); }
.health-insight--info .health-insight__severity { color: var(--info); }

.health-insight__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-1);
}

.health-insight__body {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---- Sort Controls ---- */
.health-sort {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.health-sort__btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--duration-hover) var(--ease-smooth),
              border-color var(--duration-hover) var(--ease-smooth);
}

.health-sort__btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.health-sort__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.health-sort__btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-muted);
}

/* ---- Section Toggle ---- */
.health-section--hidden { display: none; }

/* ---- Expandable 50/30/20 Rows ---- */
.health-budget-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  overflow: hidden;
  background: var(--surface);
}

.health-budget-row__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  cursor: pointer;
  transition: background var(--duration-hover) var(--ease-smooth);
}

.health-budget-row__header:hover {
  background: var(--surface-elevated);
}

.health-budget-row__header:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.health-budget-row__icon {
  font-size: 18px;
  flex-shrink: 0;
}

.health-budget-row__info {
  flex: 1;
  min-width: 0;
}

.health-budget-row__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.health-budget-row__bar {
  height: 6px;
  background: var(--surface-elevated);
  border-radius: var(--radius-full);
  margin-top: 6px;
  overflow: hidden;
}

.health-budget-row__bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--duration-normal) var(--ease-out);
}

.health-budget-row__pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  margin-left: var(--space-2);
}

.health-budget-row__amount {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: var(--space-3);
}

.health-budget-row__chevron {
  color: var(--text-faint);
  transition: transform var(--duration-hover) var(--ease-out);
  flex-shrink: 0;
}

.health-budget-row.open .health-budget-row__chevron {
  transform: rotate(180deg);
}

.health-budget-row__details {
  display: none;
  padding: 0 var(--space-4) var(--space-4);
  border-top: 1px solid var(--border);
}

.health-budget-row.open .health-budget-row__details {
  display: block;
}

.health-budget-row__cat {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.health-budget-row__cat-amount {
  margin-left: auto;
  font-weight: 500;
  color: var(--text);
}

/* ---- Chart/Table View Toggle (small pill) ---- */
.health-view-toggle {
  display: inline-flex;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.health-view-toggle__btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: background var(--duration-hover) var(--ease-smooth),
              color var(--duration-hover) var(--ease-smooth);
}

.health-view-toggle__btn:hover {
  color: var(--text);
}

.health-view-toggle__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.health-view-toggle__btn.active {
  background: var(--accent-muted);
  color: var(--accent);
}

/* ---- Profit Cards ---- */
.health-profit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

@media (max-width: 768px) {
  .health-profit-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .health-profit-grid { grid-template-columns: 1fr; }
}

.health-profit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.health-profit-card__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-3);
}

.health-profit-card__row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
  color: var(--text-muted);
}

.health-profit-card__margin-bar {
  height: 4px;
  background: var(--surface-elevated);
  border-radius: var(--radius-full);
  margin-top: var(--space-2);
  overflow: hidden;
}

.health-profit-card__margin-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--duration-normal) var(--ease-out);
}

/* ---- Tax Quarterly Schedule ---- */
.health-tax-quarters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

@media (max-width: 640px) {
  .health-tax-quarters { grid-template-columns: repeat(2, 1fr); }
}

.health-tax-quarter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  text-align: center;
  font-size: 12px;
}

.health-tax-quarter__label {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.health-tax-quarter__amount {
  color: var(--text-muted);
  margin-bottom: 6px;
}

.health-tax-quarter__status {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.health-tax-quarter__status--paid {
  color: var(--success);
  background: var(--success-muted);
}

.health-tax-quarter__status--due {
  color: var(--warning);
  background: var(--warning-muted);
}

.health-tax-quarter__status--upcoming {
  color: var(--text-faint);
  background: var(--surface-elevated);
}

/* ---- Revenue Table (alt to chart) ---- */
.health-revenue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.health-revenue-table th {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.health-revenue-table td {
  padding: var(--space-2) var(--space-3);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.health-revenue-table tr:last-child td {
  border-bottom: none;
}

.health-revenue-table tr:hover td {
  background: var(--surface-elevated);
}

/* ---- Learn Slideout Panel ---- */
.learn-slideout {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-modal);
  pointer-events: none;
  visibility: hidden;
}

.learn-slideout.open {
  pointer-events: auto;
  visibility: visible;
}

.learn-slideout__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity var(--duration-modal-in) var(--ease-smooth);
}

.learn-slideout.open .learn-slideout__backdrop {
  opacity: 1;
}

.learn-slideout__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 90vw;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-floating);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--duration-modal-in) var(--ease-out);
}

.learn-slideout.open .learn-slideout__panel {
  transform: translateX(0);
}

.learn-slideout__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.learn-slideout__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.learn-slideout__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), opacity 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.learn-slideout__close:hover {
  color: var(--text);
  transform: scale(1.05);
}

.learn-slideout__close:active {
  transform: scale(0.95);
}

.learn-slideout__close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.learn-slideout__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  -webkit-overflow-scrolling: touch;
}

/* ---- Desktop Nav Help Button ---- */
.desktop-nav__help-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), opacity 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.desktop-nav__help-btn:hover {
  color: var(--accent);
  border-color: var(--border-hover);
  transform: scale(1.05);
}

.desktop-nav__help-btn:active {
  transform: scale(0.95);
}

.desktop-nav__help-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (min-width: 768px) {
  .desktop-nav__help-btn {
    display: flex;
  }
}

/* ---- Theme Toggle ---- */
.theme-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-hover) var(--ease-smooth),
              background var(--duration-hover) var(--ease-smooth);
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--surface-elevated);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle:active {
  transform: scale(0.92);
}

/* Show correct icon based on theme — default is dark */
.theme-toggle__icon--dark { display: none; }
.theme-toggle__icon--light { display: block; }

[data-theme="light"] .theme-toggle__icon--light { display: none; }
[data-theme="light"] .theme-toggle__icon--dark { display: block; }

/* ---- Light Theme Component Overrides ---- */
[data-theme="light"] .modal__backdrop {
  background: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .learn-slideout__backdrop {
  background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .card {
  box-shadow: var(--shadow-base);
}

/* ============================================
   WIDGET SYSTEM — Wrappers, Drag, Expand
   ============================================ */

/* ---- Widget Row Wrapper ---- */
.widget-wrapper {
  position: relative;
  min-width: 0;
}

/* ---- Row Toolbar — centered grip strip ---- */
.widget-wrapper__toolbar {
  position: absolute;
  top: -14px;
  right: var(--space-2);
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 3;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--duration-hover) var(--ease-smooth),
              transform var(--duration-hover) var(--ease-smooth);
  background: rgba(22, 27, 38, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius);
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.widget-wrapper:hover .widget-wrapper__toolbar {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Shared Widget Button Base (ghost style) ---- */
.drag-handle,
.expand-toggle,
.widget-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  cursor: pointer;
  padding: 0;
  transition: color var(--duration-hover) var(--ease-smooth),
              background var(--duration-hover) var(--ease-smooth);
}

.drag-handle:hover,
.expand-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.drag-handle {
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle:focus-visible,
.expand-toggle:focus-visible,
.widget-remove-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.drag-handle--card {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
}

.drag-handle--row {
  width: 26px;
  height: 26px;
}

/* ---- Widget Remove Button ---- */
.widget-remove-btn {
  color: var(--text-faint);
}

.widget-remove-btn:hover {
  color: var(--danger, #ef4444);
  background: rgba(232, 93, 106, 0.12);
}

.widget-remove-btn:active {
  transform: scale(0.92);
}

/* ---- Dashboard Customize Bar ---- */
.dashboard-customize-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-2);
}

.dashboard-customize-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--duration-hover) var(--ease-smooth),
              background var(--duration-hover) var(--ease-smooth),
              border-color var(--duration-hover) var(--ease-smooth);
}

.dashboard-customize-btn:hover {
  color: var(--text);
  background: var(--surface-elevated);
  border-color: var(--border-hover);
}

.dashboard-customize-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dashboard-customize-btn:active {
  transform: scale(0.97);
}

.dashboard-customize-btn svg {
  flex-shrink: 0;
}

/* ---- Customize Modal Widget List ---- */
.customize-widget-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.customize-widget-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--duration-hover) var(--ease-smooth);
}

.customize-widget-row:hover {
  background: var(--surface-elevated);
}

.customize-widget-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* Toggle switch */
.customize-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.customize-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.customize-toggle__track {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 12px;
  transition: background var(--duration-hover) var(--ease-smooth);
}

.customize-toggle input:checked + .customize-toggle__track {
  background: var(--accent);
}

.customize-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform var(--duration-hover) var(--ease-smooth);
}

.customize-toggle input:checked + .customize-toggle__track .customize-toggle__thumb {
  transform: translateX(18px);
}

.customize-toggle input:focus-visible + .customize-toggle__track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Drag States ---- */
.widget-wrapper--dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.widget-wrapper--drag-above {
  border-top: 2px solid var(--accent);
  padding-top: var(--space-2);
}

.widget-wrapper--drag-below {
  border-bottom: 2px solid var(--accent);
  padding-bottom: var(--space-2);
}

/* Card drag states */
.widget-card--dragging {
  opacity: 0.5;
  transform: scale(0.97);
}

.widget-card--drag-left {
  border-left: 2px solid var(--accent);
  padding-left: var(--space-1);
}

.widget-card--drag-right {
  border-right: 2px solid var(--accent);
  padding-right: var(--space-1);
}

/* Touch drag ghost */
.widget-drag-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.8;
  transform: scale(0.95);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-floating);
  overflow: hidden;
}

/* ---- Widget Card Wrapper ---- */
.widget-card-wrap {
  position: relative;
}

.widget-card__toolbar {
  position: absolute;
  top: -14px;
  right: var(--space-2);
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 2;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--duration-hover) var(--ease-smooth),
              transform var(--duration-hover) var(--ease-smooth);
  background: rgba(22, 27, 38, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius);
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.widget-card-wrap:hover .widget-card__toolbar,
.widget-card-wrap:focus-within .widget-card__toolbar {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Expand Toggle ---- */
/* Base styles inherited from shared widget button rule above */

.expand-toggle svg {
  transition: transform var(--duration-normal) var(--ease-out);
}

.expand-toggle.active svg {
  transform: rotate(180deg);
}

/* ---- Expanded Content ---- */
.widget-wrapper__expanded {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-normal) var(--ease-out);
}

.widget-wrapper__expanded.active {
  overflow: visible;
}

/* ---- Segmented Control ---- */
.segmented-control {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0;
  gap: 1px;
}

.segmented-control__btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 22px;
  white-space: nowrap;
  transition: color var(--duration-hover) var(--ease-smooth),
              background var(--duration-hover) var(--ease-smooth);
}

.segmented-control__btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.segmented-control__btn.active {
  background: rgba(20, 212, 184, 0.18);
  color: var(--accent);
  font-weight: 600;
}

.segmented-control__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ---- Expanded Content Shared Styles ---- */
.expanded-content {
  padding-top: var(--space-4);
  margin-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.expanded-content__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.expanded-content__row:last-child {
  border-bottom: none;
}

/* ---- Responsive Widget Overrides ---- */
@media (max-width: 767px) {
  .widget-wrapper__toolbar {
    opacity: 1;
    transform: translateY(0);
  }

  .drag-handle,
  .expand-toggle,
  .widget-remove-btn {
    min-width: 36px;
    min-height: 36px;
    width: 36px;
    height: 36px;
  }

  .drag-handle--card {
    min-width: 32px;
    min-height: 32px;
    width: 32px;
    height: 32px;
  }

  .segmented-control__btn {
    min-height: 32px;
    padding: 6px 12px;
    font-size: 12px;
  }

  .widget-card__toolbar {
    position: relative;
    top: 0;
    right: 0;
    margin-bottom: var(--space-3);
    justify-content: flex-end;
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   NOTIFICATION BELL
   ============================================ */
.notification-bell {
  position: relative;
}

.notification-bell__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 180ms var(--ease-out), opacity 180ms var(--ease-out);
}

.notification-bell__trigger:hover {
  color: var(--text);
  background: var(--surface);
}

.notification-bell__trigger:active {
  transform: scale(0.95);
}

.notification-bell__trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.notification-bell__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  animation: pulseGlow 2s ease-in-out infinite;
}

.notification-bell__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  max-height: 460px;
  background: var(--surface-floating);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-floating);
  z-index: var(--z-modal);
  overflow: hidden;
  animation: scaleIn 200ms var(--ease-out);
}

.notification-bell__dropdown.open {
  display: block;
}

.notif-dropdown__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border);
}

.notif-dropdown__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.notif-dropdown__mark-all {
  border: none;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: opacity 180ms var(--ease-out);
}

.notif-dropdown__mark-all:hover {
  opacity: 0.8;
}

.notif-dropdown__mark-all:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.notif-dropdown__list {
  overflow-y: auto;
  max-height: 400px;
}

.notif-dropdown__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-8);
  color: var(--text-muted);
  font-size: 12px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 180ms var(--ease-out);
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: var(--surface-elevated);
}

.notif-item:focus-visible {
  outline: 2px solid var(--accent) inset;
}

.notif-item--unread {
  background: rgba(20, 212, 184, 0.04);
}

.notif-item__icon {
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
  margin-top: 2px;
}

.notif-item__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.notif-item__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.notif-item__message {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-item__time {
  font-size: 12px;
  color: var(--text-faint);
}

.notif-item__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent);
  margin-top: 4px;
}

/* ---- Notification Item Wrapper (for dismiss X) ---- */
.notif-item-wrap {
  position: relative;
}

.notif-item-wrap .notif-item {
  width: 100%;
}

.notif-item__dismiss {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-hover) var(--ease-smooth),
              color var(--duration-hover) var(--ease-smooth),
              background var(--duration-hover) var(--ease-smooth);
}

.notif-item-wrap:hover .notif-item__dismiss {
  opacity: 1;
}

.notif-item__dismiss:hover {
  color: var(--danger);
  background: rgba(255, 90, 90, 0.1);
}

.notif-item__dismiss:focus-visible {
  opacity: 1;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Clear All Button ---- */
.notif-dropdown__clear-all {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--duration-hover) var(--ease-smooth);
}

.notif-dropdown__clear-all:hover {
  background: rgba(255, 90, 90, 0.1);
}

.notif-dropdown__clear-all:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .notification-bell__dropdown {
    width: calc(100vw - 32px);
    right: -60px;
  }
}

/* ============================================
   GLASS UTILITY CLASSES
   ============================================ */
.glass-card {
  background: var(--surface-elevated);
  background-image: var(--glass-shine);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
  min-width: 0;
}

.glass-panel {
  background: var(--surface-floating);
  background-image: var(--glass-shine);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-floating);
}

/* ============================================
   SMART PROJECT FORM
   ============================================ */
.smart-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-height: 70vh;
  overflow-y: auto;
  padding: var(--space-2) var(--space-1);
}

.smart-form__progress {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) 0;
}

.smart-form__step {
  flex: 1;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--border);
  transition: background 180ms var(--ease-out);
}

.smart-form__step--active {
  background: var(--accent);
}

.smart-form__step--completed {
  background: var(--success);
}

.smart-form__section {
  background: var(--surface-elevated);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  transition: border-color 180ms var(--ease-out);
}

.smart-form__section:hover {
  border-color: var(--border-strong);
}

.smart-form__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  gap: var(--space-3);
}

.smart-form__section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.smart-form__section-toggle {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform 180ms var(--ease-out);
}

.smart-form__section--collapsed .smart-form__section-toggle {
  transform: rotate(-90deg);
}

.smart-form__section--collapsed .smart-form__section-body {
  display: none;
}

.smart-form__section-body {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.smart-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 600px) {
  .smart-form__row {
    grid-template-columns: 1fr;
  }
}

.smart-form__autocomplete {
  position: relative;
}

.smart-form__autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--surface-floating);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-floating);
  max-height: 200px;
  overflow-y: auto;
  margin-top: 4px;
}

.smart-form__autocomplete-item {
  padding: var(--space-3) var(--space-4);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: background 120ms var(--ease-out);
}

.smart-form__autocomplete-item:hover,
.smart-form__autocomplete-item:focus-visible {
  background: var(--surface-elevated);
}

.smart-form__tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 44px;
  align-items: center;
  cursor: text;
  transition: border-color 180ms var(--ease-out);
}

.smart-form__tag-input:focus-within {
  border-color: var(--accent);
}

.smart-form__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--accent-muted);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}

.smart-form__tag-remove {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 120ms var(--ease-out);
}

.smart-form__tag-remove:hover {
  opacity: 1;
}

.smart-form__tag-input input {
  border: none;
  background: none;
  outline: none;
  color: var(--text);
  font-size: 12px;
  flex: 1;
  min-width: 80px;
}

.smart-form__dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms var(--ease-out), background 180ms var(--ease-out);
}

.smart-form__dropzone:hover,
.smart-form__dropzone--dragover {
  border-color: var(--accent);
  background: rgba(20, 212, 184, 0.04);
}

.smart-form__dropzone-icon {
  font-size: 32px;
  margin-bottom: var(--space-2);
}

.smart-form__dropzone-text {
  font-size: 12px;
  color: var(--text-muted);
}

.smart-form__dropzone-text strong {
  color: var(--accent);
}

.smart-form__file-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.smart-form__file-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
}

.smart-form__file-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.smart-form__file-item-size {
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

.smart-form__file-item-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius);
  transition: background 120ms var(--ease-out);
  flex-shrink: 0;
}

.smart-form__file-item-remove:hover {
  background: var(--danger-muted);
}

/* Business type selector */
.smart-form__type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
}

.smart-form__type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-3);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 180ms var(--ease-out), transform 180ms var(--ease-out);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.smart-form__type-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.smart-form__type-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.smart-form__type-card--active {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.smart-form__type-card-icon {
  font-size: 28px;
}

/* ============================================
   DOCUMENT STORAGE
   ============================================ */
.doc-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.doc-panel__upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms var(--ease-out), background 180ms var(--ease-out);
}

.doc-panel__upload:hover,
.doc-panel__upload--dragover {
  border-color: var(--accent);
  background: rgba(20, 212, 184, 0.04);
}

.doc-panel__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.doc-panel__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 180ms var(--ease-out);
}

.doc-panel__item:hover {
  border-color: var(--border-strong);
}

.doc-panel__item-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.doc-panel__item-info {
  flex: 1;
  min-width: 0;
}

.doc-panel__item-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-panel__item-meta {
  font-size: 12px;
  color: var(--text-faint);
}

.doc-panel__item-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.doc-panel__storage-bar {
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-2);
}

.doc-panel__storage-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: width 300ms var(--ease-out);
}

.doc-panel__storage-fill--warning {
  background: var(--warning);
}

.doc-panel__storage-fill--danger {
  background: var(--danger);
}

/* ============================================
   COMMAND CENTER
   ============================================ */
.command-center__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.command-center__stat {
  background: var(--surface-elevated);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  transition: border-color 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.command-center__stat:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.command-center__stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.command-center__stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}

.command-center__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .command-center__grid {
    grid-template-columns: 1fr;
  }
}

.command-center__panel {
  background: var(--surface-elevated);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.command-center__panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.command-center__action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.command-center__action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 180ms var(--ease-out), transform 180ms var(--ease-out);
  min-height: 44px;
}

.command-center__action-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.command-center__action-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.command-center__action-btn:active {
  transform: scale(0.98);
}

.command-center__activity-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 320px;
  overflow-y: auto;
}

.command-center__activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius);
  transition: background 120ms var(--ease-out);
}

.command-center__activity-item:hover {
  background: var(--surface);
}

.command-center__activity-icon {
  flex-shrink: 0;
  font-size: 16px;
  margin-top: 1px;
}

.command-center__activity-text {
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
}

.command-center__activity-time {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}

.command-center__action-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 320px;
  overflow-y: auto;
}

.command-center__action-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 180ms var(--ease-out);
  font-size: 12px;
  color: var(--text);
}

.command-center__action-item:hover {
  border-color: var(--accent);
}

.command-center__action-item--urgent {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.04);
}

/* ---- Load More Button ---- */
.load-more-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) 0 var(--space-2);
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 180ms var(--ease-out),
              color 180ms var(--ease-out),
              background 180ms var(--ease-out);
  min-height: 44px;
}

.load-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(15, 206, 171, 0.06);
}

.load-more-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.load-more-btn:active {
  transform: scale(0.98);
}

.load-more-count {
  font-size: 12px;
  color: var(--text-faint);
}

.load-more-showing {
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--font-ui);
}

/* ---- Schedule ---- */
.schedule-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-6); }
.schedule-header__title { font-size: 24px; font-weight: 700; color: var(--text); }

.schedule-section { margin-bottom: var(--space-6); }
.schedule-section__title { font-size: 14px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-3); }

.schedule-overdue { background: rgba(232, 93, 106, 0.08); border: 1px solid rgba(232, 93, 106, 0.2); border-radius: var(--radius); padding: var(--space-4); margin-bottom: var(--space-6); }
.schedule-overdue__title { font-size: 14px; font-weight: 600; color: var(--danger); margin-bottom: var(--space-3); display: flex; align-items: center; gap: var(--space-2); }

.schedule-timeline { display: flex; flex-direction: column; gap: var(--space-3); }

.schedule-card { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out); }
.schedule-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-elevated); }
.schedule-card--overdue { border-left: 3px solid var(--danger); }
.schedule-card--completed { opacity: 0.6; }
.schedule-card--completed .schedule-card__title { text-decoration: line-through; }

.schedule-card__time { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--accent); min-width: 64px; white-space: nowrap; }
.schedule-card__body { flex: 1; min-width: 0; }
.schedule-card__title { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-card__meta { display: flex; align-items: center; gap: var(--space-2); margin-top: 4px; flex-wrap: wrap; }

.schedule-card__type { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; background: var(--surface-elevated); color: var(--text-muted); }
.schedule-card__entity { font-size: 12px; color: var(--text-muted); }
.schedule-card__priority { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.schedule-card__actions { display: flex; align-items: center; gap: var(--space-1); margin-left: var(--space-2); }
.schedule-card__action { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: none; background: none; color: var(--text-muted); border-radius: var(--radius-sm); cursor: pointer; transition: background 180ms var(--ease-out), color 180ms var(--ease-out); }
.schedule-card__action:hover { background: var(--surface-elevated); color: var(--text); }
.schedule-card__action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.schedule-card__check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); background: none; cursor: pointer; transition: background 180ms var(--ease-out), border-color 180ms var(--ease-out); flex-shrink: 0; }
.schedule-card__check:hover { border-color: var(--accent); }
.schedule-card__check--done { background: var(--success); border-color: var(--success); }

/* Schedule cards: allow title wrapping on mobile */
@media (max-width: 767px) {
  .schedule-card__title {
    white-space: normal;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .schedule-card__time {
    min-width: 56px;
    font-size: 11px;
  }

  .schedule-card__actions {
    margin-left: 0;
  }
}

.schedule-day-group { margin-bottom: var(--space-4); }
.schedule-day-group__label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-2); padding-left: var(--space-1); }

.schedule-filters { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); flex-wrap: wrap; }

/* Schedule Form */
.schedule-form__datetime { display: flex; gap: var(--space-3); }
.schedule-form__datetime > * { flex: 1; }

/* Post-action modal */
.post-action-modal { text-align: center; padding: var(--space-4) 0; }
.post-action-modal__icon { font-size: 48px; margin-bottom: var(--space-4); }
.post-action-modal__title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: var(--space-2); }
.post-action-modal__subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: var(--space-6); }
.post-action-modal__form { text-align: left; }

/* ---- Status Utilities ---- */
.status-paid { color: var(--success); background: rgba(46, 196, 140, 0.12); padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.status-pending { color: var(--warning); background: rgba(232, 168, 48, 0.12); padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.status-overdue { color: var(--danger); background: rgba(232, 93, 106, 0.12); padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.status-draft { color: var(--text-muted); background: var(--surface-elevated); padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; }

@media (max-width: 768px) {
  .schedule-form__datetime { flex-direction: column; }
  .schedule-card__actions { gap: 0; }
  .schedule-card { padding: var(--space-3); }
}

.calendar-cell__dot--task {
  background: var(--accent);
}

/* ---- Mobile Touch Targets (44px minimum) ---- */
@media (max-width: 768px) {
  /* Fix undersized touch targets on mobile */
  .filter-chip,
  [data-route] {
    min-height: 44px;
    min-width: 44px;
  }

  .notification-bell__trigger,
  .topbar-icon-btn,
  .theme-toggle,
  .profile-menu__trigger {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
