
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f7f7f7;
  color: #222;
}

.app-nav {
  background: #111827;
  padding: 12px 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  line-height: 1.4;
}

.app-nav > a,
.nav-dropdown summary {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  display: inline-block;
}

.app-nav > a:hover,
.nav-dropdown summary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-dropdown {
  position: relative;
}

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

.nav-dropdown summary::after {
  content: "▾";
  margin-left: 8px;
  font-size: 12px;
}

.nav-dropdown[open] summary {
  background: rgba(255, 255, 255, 0.08);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 8px;
  z-index: 100;
}

.nav-dropdown[open] .nav-dropdown-menu {
  display: grid;
  gap: 4px;
}

.nav-dropdown-menu a {
  color: #111827;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
}

.nav-dropdown-menu a:hover {
  background: #f3f4f6;
}

main {
  max-width: 1100px;
  margin: 24px auto;
  background: white;
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

h1 {
  margin-top: 0;
}

h2 {
  margin-top: 0;
  margin-bottom: 12px;
}

form {
  display: grid;
  gap: 10px;
  max-width: 420px;
}

input,
select,
button {
  padding: 10px;
  font-size: 14px;
}

button {
  cursor: pointer;
}

.summary-cards {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.summary-card {
  background: #f3f4f6;
  border-radius: 10px;
  padding: 16px 18px;
  min-width: 220px;
}

.summary-label {
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
}

.summary-value {
  font-size: 24px;
  font-weight: 700;
}

.summary-subtext {
  margin-top: 8px;
  color: #555;
  font-size: 14px;
}

.summary-window {
  margin-top: 6px;
  color: #777;
  font-size: 12px;
}

.file-name {
  font-size: 16px;
  word-break: break-word;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dashboard-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px;
}

.dashboard-panel.full-width {
  grid-column: 1 / -1;
}

.simple-list {
  margin: 0;
  padding-left: 18px;
}

.simple-list li {
  margin-bottom: 8px;
}

.muted {
  color: #666;
}

.page-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  margin-top: 12px;
}

.action-link {
  display: inline-block;
  background: #111827;
  color: white;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
}

.subs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.subs-table th,
.subs-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 10px;
  vertical-align: top;
  text-align: left;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.keep {
  background: #dcfce7;
}

.badge.cancel {
  background: #fee2e2;
}

.badge.downgrade {
  background: #fef3c7;
}

.badge.none {
  background: #e5e7eb;
}

.note {
  margin-top: 6px;
  font-size: 12px;
  color: #666;
}

.action-stack {
  display: grid;
  gap: 8px;
}

.inline-form {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  max-width: none;
}

.downgrade-form input {
  max-width: 120px;
}

.upload-result {
  margin-top: 24px;
}

.filter-form {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  max-width: none;
  margin-bottom: 20px;
}

.secondary-link {
  background: #6b7280;
}

.secondary-link:hover {
  opacity: 0.92;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.tiny-link {
  display: inline-block;
  background: #111827;
  color: white;
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.danger-button {
  background: #b91c1c;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
}

.error-box {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.edit-form {
  max-width: 520px;
}

.ignored-panel {
  margin-top: 24px;
}

.ignored-list {
  display: grid;
  gap: 10px;
}

.ignored-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
}

.trust-grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.trust-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 150px;
}

.trust-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}

.trust-value {
  font-size: 22px;
  font-weight: 700;
}

.trust-list {
  margin-top: 8px;
}

select {
  padding: 10px;
  font-size: 14px;
}

.filter-form select {
  min-width: 160px;
}

.success-box {
  background: #dcfce7;
  color: #166534;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 600;
}

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

.compact-summary-row {
  margin-top: -8px;
}

.compact-card {
  min-width: 180px;
}

.compact-value {
  font-size: 20px;
}

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


.hero-section {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
  align-items: stretch;
}

.hero-copy,
.hero-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 24px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 8px;
  font-weight: 700;
}

.hero-text {
  font-size: 18px;
  line-height: 1.5;
  color: #374151;
  max-width: 780px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hero-card-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 12px;
  font-weight: 700;
}

.hero-list {
  margin: 0;
  padding-left: 18px;
}

.hero-list li {
  margin-bottom: 10px;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.feature-card {
  border: 1px solid #e5e7eb;
  background: #fafafa;
  border-radius: 10px;
  padding: 16px;
}

.feature-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.steps-list {
  margin: 0;
  padding-left: 22px;
}

.steps-list li {
  margin-bottom: 8px;
}

.waitlist-panel {
  margin-top: 24px;
}

.alpha-section {
  margin-top: 20px;
}

.alpha-section-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 14px;
}

.alpha-progress-text {
  margin-top: 4px;
}

.alpha-progress-pill {
  background: #111827;
  color: white;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}

.alpha-items {
  display: grid;
  gap: 12px;
}

.alpha-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
  padding: 14px;
}

.alpha-item-form {
  max-width: none;
}

.alpha-item-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.alpha-checkbox-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
}

.done-label {
  text-decoration: line-through;
  color: #6b7280;
}

.alpha-updated {
  font-size: 12px;
  color: #6b7280;
}

.alpha-note {
  min-height: 90px;
}

.alpha-actions {
  margin-top: 10px;
}

.copy-box {
  white-space: pre-wrap;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  line-height: 1.55;
  font-size: 14px;
}

.doc-list {
  display: grid;
  gap: 14px;
}

.doc-card {
  border: 1px solid #e5e7eb;
  background: #fafafa;
  border-radius: 10px;
  padding: 16px;
}

.doc-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.doc-card p {
  margin-bottom: 0;
  line-height: 1.5;
}

.doc-card-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.issue-badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: lowercase;
}

.issue-low {
  background: #e5e7eb;
}

.issue-medium {
  background: #fef3c7;
}

.issue-high {
  background: #fee2e2;
}

.pricing-value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 14px;
}

nav {
  line-height: 1.8;
}

nav a {
  display: inline-block;
}

.investment-note {
  margin-top: 10px;
}

.gain-positive {
  color: #166534;
  font-weight: 700;
}

.gain-negative {
  color: #991b1b;
  font-weight: 700;
}

.gain-neutral {
  color: #374151;
  font-weight: 700;
}

.stacked-inline-form {
  display: grid;
  gap: 8px;
  max-width: none;
}

.price-update-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  max-width: none;
}

.price-update-form input {
  max-width: 120px;
}

.helper-panel {
  margin-bottom: 20px;
}

.file-name {
  word-break: break-word;
}

code {
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.app-nav {
  position: relative;
}

.edit-form input[type="password"] {
  max-width: 360px;
}

@media (max-width: 900px) {
  .app-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .app-nav > a,
  .nav-dropdown summary {
    width: 100%;
    box-sizing: border-box;
  }

  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown-menu {
    position: static;
    min-width: unset;
    margin-top: 8px;
  }
}

@media (max-width: 900px) {
  .hero-section {
    grid-template-columns: 1fr;
  }

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

  .subs-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  main {
    margin: 12px;
    padding: 16px;
  }
}

.active-link {
  background: #374151;
}

.success-text {
  color: #166534;
  font-weight: 600;
  margin-top: 12px;
}

.small-card {
  font-size: 18px;
  line-height: 1.35;
}

.watch-priority,
.watch-status {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.watch-priority-low {
  background: #e5e7eb;
}

.watch-priority-normal {
  background: #dbeafe;
}

.watch-priority-high {
  background: #fee2e2;
}

.watch-status-active {
  background: #dcfce7;
}

.watch-status-paused {
  background: #fef3c7;
}

.watch-status-closed {
  background: #e5e7eb;
}

.error-box {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 600;
}

.reconcile-status {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.reconcile-status-matched {
  background: #dcfce7;
}

.reconcile-status-different {
  background: #fee2e2;
}

.reconcile-status-manual_only {
  background: #dbeafe;
}

.reconcile-status-imported_only {
  background: #fef3c7;
}

.success-box {
  background: #dcfce7;
  color: #166534;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 600;
}

.support-status,
.support-priority {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.support-status-open {
  background: #fee2e2;
}

.support-status-reviewing {
  background: #fef3c7;
}

.support-status-resolved {
  background: #dcfce7;
}

.support-priority-low {
  background: #e5e7eb;
}

.support-priority-normal {
  background: #dbeafe;
}

.support-priority-high {
  background: #fee2e2;
}

.app-intro {
  font-size: 18px;
  margin-bottom: 20px;
}

.goal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.goal-card {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 14px;
  background: #ffffff;
}

.goal-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.goal-line {
  margin-top: 6px;
  color: #374151;
}

.goal-progress {
  width: 100%;
  height: 12px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.goal-progress-fill {
  height: 100%;
  background: #0f172a;
}

.goal-progress-text {
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
}

.mini-goal-progress {
  min-width: 120px;
}

.action-link.active-link {
  font-weight: 700;
}

.error-box {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 600;
}

.highlight-card {
  border: 1px solid #dbeafe;
  background: #f8fbff;
}

.next-action-text {
  font-size: 18px;
  margin-bottom: 14px;
}

.calendar-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e5e7eb;
  font-size: 12px;
  margin-right: 6px;
}

.decision-positive {
  font-weight: 700;
  color: #166534;
}

.decision-neutral {
  font-weight: 700;
  color: #374151;
}

.update-callout {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  margin-bottom: 18px;
}

.suggestion-stack {
  display: grid;
  gap: 12px;
}

.suggestion-card {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.suggestion-high {
  border-color: #fecaca;
  background: #fff7f7;
}

.suggestion-medium {
  border-color: #fde68a;
  background: #fffdf5;
}

.suggestion-low {
  border-color: #d1d5db;
}

.suggestion-positive {
  border-color: #bbf7d0;
  background: #f7fff9;
}

.empty-state-box {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 16px;
  background: #fafafa;
}

.checklist-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.checklist-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
}

.checklist-item.done {
  background: #f7fff9;
}

.checklist-item.pending {
  background: #fff;
}

.large-progress {
  margin-bottom: 12px;
}

.bar-stack {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 90px;
  gap: 10px;
  align-items: center;
}

.bar-label {
  font-size: 14px;
  color: #374151;
}

.bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: #0f172a;
}

.bar-value {
  font-size: 13px;
  color: #374151;
}

.nav-command-button {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

.command-bar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  z-index: 9999;
}

.command-bar-overlay.hidden {
  display: none;
}

.command-bar-dialog {
  width: min(720px, 92vw);
  background: #fff;
  border-radius: 14px;
  border: 1px solid #d1d5db;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.command-bar-header {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.command-bar-header input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

.command-bar-results {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.command-bar-result {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #111827;
  background: #f9fafb;
}

.command-bar-result:hover {
  background: #eef2ff;
}

.command-bar-empty {
  padding: 10px 12px;
  color: #6b7280;
}

.notes-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.admin-note {
  border: 1px solid #e5e7eb;
  background: #fafafa;
  border-radius: 8px;
  padding: 8px;
}

.small-textarea {
  min-height: 70px;
}

.note-form {
  display: grid;
  gap: 8px;
}

.update-callout {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  margin-bottom: 18px;
}

.suggestion-stack {
  display: grid;
  gap: 12px;
}

.suggestion-card {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.suggestion-high {
  border-color: #fecaca;
  background: #fff7f7;
}

.suggestion-medium {
  border-color: #fde68a;
  background: #fffdf5;
}

.suggestion-low {
  border-color: #d1d5db;
}

.suggestion-positive {
  border-color: #bbf7d0;
  background: #f7fff9;
}

.empty-state-box {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 16px;
  background: #fafafa;
}

.checklist-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.checklist-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
}

.checklist-item.done {
  background: #f7fff9;
}

.checklist-item.pending {
  background: #fff;
}

.large-progress {
  margin-bottom: 12px;
}

.bar-stack {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 90px;
  gap: 10px;
  align-items: center;
}

.bar-label {
  font-size: 14px;
  color: #374151;
}

.bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: #0f172a;
}

.bar-value {
  font-size: 13px;
  color: #374151;
}

.pricing-card {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
}

.pricing-current {
  border-color: #93c5fd;
  background: #f8fbff;
}

.account-summary-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  font-size: 12px;
}

.notification-stack {
  display: grid;
  gap: 12px;
}

.notification-card {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.notification-read {
  opacity: 0.78;
}

.notification-info {
  border-color: #dbeafe;
}

.notification-warning {
  border-color: #fde68a;
  background: #fffdf5;
}

.notification-urgent {
  border-color: #fecaca;
  background: #fff7f7;
}

.notification-positive {
  border-color: #bbf7d0;
  background: #f7fff9;
}

.notification-header,
.notification-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.source-badge,
.freshness-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.source-manual {
  background: #eef2ff;
}

.source-linked_placeholder {
  background: #ede9fe;
}

.freshness-manual,
.freshness-current,
.freshness-synced {
  background: #dcfce7;
}

.freshness-requested,
.freshness-pending {
  background: #fef3c7;
}

.freshness-error,
.freshness-failed,
.freshness-attention {
  background: #fee2e2;
}

.dashboard-top-actions {
  margin-bottom: 12px;
}

.modular-dashboard {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.widget-card {
  grid-column: span 6;
}

.widget-size-small {
  grid-column: span 4;
}

.widget-size-medium {
  grid-column: span 6;
}

.widget-size-large {
  grid-column: span 12;
}

.widget-kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 6px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.preset-card {
  display: grid;
  gap: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.preset-card-active {
  border-color: #93c5fd;
  background: #f8fbff;
}

.density-grid {
  display: grid;
  gap: 12px;
}

.density-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.density-card-active {
  border-color: #93c5fd;
  background: #f8fbff;
}

.dashboard-density-simple .widget-size-small {
  grid-column: span 6;
}

.dashboard-density-simple .widget-size-medium {
  grid-column: span 12;
}

.dashboard-density-simple .widget-size-large {
  grid-column: span 12;
}

.dashboard-density-balanced .widget-size-small {
  grid-column: span 4;
}

.dashboard-density-balanced .widget-size-medium {
  grid-column: span 6;
}

.dashboard-density-balanced .widget-size-large {
  grid-column: span 12;
}

.dashboard-density-detailed .widget-size-small {
  grid-column: span 3;
}

.dashboard-density-detailed .widget-size-medium {
  grid-column: span 4;
}

.dashboard-density-detailed .widget-size-large {
  grid-column: span 8;
}

@media (max-width: 900px) {
  .widget-size-small,
  .widget-size-medium,
  .widget-size-large,
  .widget-card {
    grid-column: span 12;
  }
}

.widget-group-section {
  margin-top: 18px;
}

.widget-group-header {
  margin-bottom: 10px;
}

.widget-group-kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.widget-subtitle {
  color: #6b7280;
  margin-top: -4px;
  margin-bottom: 12px;
}

.widget-stat-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.widget-hero-number {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 10px;
}

.widget-card .page-actions {
  margin-top: 14px;
}

.widget-card .empty-state-box {
  margin-top: 12px;
}

.widget-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.widget-card h2 {
  margin-bottom: 8px;
}

.widget-card ul.simple-list {
  margin-top: 0;
}

.summary-cards {
  margin-bottom: 18px;
}

.hero-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.hero-summary-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  background: #ffffff;
}

.hero-summary-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 8px;
}

.hero-summary-number {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 8px;
}

.widget-primary-action {
  font-weight: 600;
}

.widget-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.widget-editor-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.widget-editor-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.control-strip {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.widget-control {
  display: grid;
  gap: 6px;
}

.top-gap {
  margin-top: 14px;
}

.small-top-gap {
  margin-top: 8px;
}

.urgency-panel {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid #fde68a;
  background: #fffdf5;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.urgency-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fef3c7;
  font-size: 12px;
  font-weight: 600;
}

.urgency-main {
  display: grid;
  gap: 2px;
}

.goal-hero-card {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.goal-mini-bar,
.goal-progress {
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.goal-mini-fill,
.goal-progress-fill {
  height: 100%;
  background: #93c5fd;
  border-radius: 999px;
}

.large-progress {
  margin-bottom: 12px;
}

.stat-pill {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
}

.stat-pill-label {
  font-size: 12px;
  color: #6b7280;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.info-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  font-size: 12px;
}

@media (max-width: 1000px) {
  .hero-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .hero-summary-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}



/* ---------- UI Surface Alignment: app shell + dashboard polish ---------- */

.app-body {
  margin: 0;
  background: #f4f7fb;
  color: #111827;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Keep beta access and sign-in forms reachable before an account is open. */
.guest-shell .app-shell { display: block; }
.guest-shell .app-sidebar { position: static; height: auto; overflow: visible; }
.guest-shell .brand-block { margin-bottom: 0; }
.guest-shell .app-main { max-width: 1100px; margin: 0 auto; }
.guest-shell .workspace-header { position: static; }

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  background: #0f172a;
  color: #e5e7eb;
  padding: 22px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #60a5fa, #818cf8);
  color: #ffffff;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.brand-title {
  font-weight: 700;
  font-size: 16px;
}

.brand-subtitle {
  font-size: 12px;
  color: #94a3b8;
}

.sidebar-nav {
  display: grid;
  gap: 18px;
}

.nav-section {
  display: grid;
  gap: 6px;
}

.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 4px;
}

.nav-link {
  color: #cbd5e1;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
  font-size: 14px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-link.active {
  background: rgba(96, 165, 250, 0.20);
  color: #ffffff;
  font-weight: 600;
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 28px 28px 18px;
  background: #f4f7fb;
  position: sticky;
  top: 0;
  z-index: 10;
}

.workspace-kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 8px;
}

.workspace-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.workspace-subtitle {
  color: #6b7280;
  margin-top: 8px;
  max-width: 760px;
}

.workspace-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: #111827;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  font-size: 14px;
}

.workspace-content {
  padding: 0 28px 28px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.dashboard-hero-copy,
.dashboard-hero-panel {
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #ffffff;
  padding: 22px;
}

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

.hero-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 10px;
}

.dashboard-hero-title {
  margin: 0 0 10px 0;
  font-size: 30px;
  line-height: 1.15;
}

.dashboard-hero-text {
  color: #6b7280;
  margin-bottom: 18px;
  max-width: 720px;
}

.hero-side-card {
  border: 1px solid #eef2f7;
  border-radius: 16px;
  background: #f8fbff;
  padding: 16px;
}

.hero-side-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 8px;
}

.hero-side-value {
  font-weight: 600;
  line-height: 1.4;
}

.dashboard-page-header-card {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 18px;
  display: grid;
  gap: 18px;
}

.header-card-title {
  margin: 0 0 8px 0;
}

.header-card-text {
  margin: 0;
  color: #6b7280;
}

.panel-topline {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 8px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.compact-summary-cards {
  margin-top: 8px;
}

.summary-card {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 14px;
  padding: 14px;
  min-width: 0;
}

.summary-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 8px;
}

.summary-value {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

.summary-subtext {
  margin-top: 8px;
  color: #6b7280;
  font-size: 14px;
}

.hero-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.hero-summary-card {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.hero-summary-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 8px;
}

.hero-summary-number {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 8px;
}

.dashboard-grid {
  display: grid;
  gap: 16px;
}

.dashboard-panel {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.dashboard-panel.full-width {
  grid-column: 1 / -1;
}

.modular-dashboard {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.widget-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  grid-column: span 6;
}

.widget-card h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

.widget-card .page-actions {
  margin-top: 14px;
}

.widget-card .empty-state-box {
  margin-top: 12px;
}

.widget-size-small {
  grid-column: span 4;
}

.widget-size-medium {
  grid-column: span 6;
}

.widget-size-large {
  grid-column: span 12;
}

.dashboard-density-simple .widget-size-small {
  grid-column: span 6;
}

.dashboard-density-simple .widget-size-medium {
  grid-column: span 12;
}

.dashboard-density-simple .widget-size-large {
  grid-column: span 12;
}

.dashboard-density-balanced .widget-size-small {
  grid-column: span 4;
}

.dashboard-density-balanced .widget-size-medium {
  grid-column: span 6;
}

.dashboard-density-balanced .widget-size-large {
  grid-column: span 12;
}

.dashboard-density-detailed .widget-size-small {
  grid-column: span 3;
}

.dashboard-density-detailed .widget-size-medium {
  grid-column: span 4;
}

.dashboard-density-detailed .widget-size-large {
  grid-column: span 8;
}

.widget-group-section {
  margin-top: 20px;
}

.widget-group-header {
  margin-bottom: 10px;
}

.widget-group-kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.widget-kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 6px;
}

.widget-subtitle {
  color: #6b7280;
  margin-top: -4px;
  margin-bottom: 12px;
}

.widget-stat-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.widget-hero-number {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 10px;
}

.widget-primary-action {
  font-weight: 600;
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  margin-bottom: 0;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: #ffffff;
  background: #2563eb;
  border: 1px solid #2563eb;
  font-size: 14px;
}

.action-link:hover {
  opacity: 0.95;
}

.secondary-link {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
}

.danger-button {
  background: #b91c1c;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 8px 10px;
}

.header-link,
.nav-command-button,
.action-link,
.secondary-link,
.tiny-link {
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.success-box {
  margin: 0 0 16px 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
  font-weight: 600;
}

.error-box {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-weight: 600;
}

.empty-state-box {
  border: 1px dashed #d1d5db;
  border-radius: 14px;
  padding: 16px;
  background: #fafafa;
}

.urgency-panel {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid #fde68a;
  background: #fffdf5;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.urgency-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fef3c7;
  font-size: 12px;
  font-weight: 600;
}

.urgency-main {
  display: grid;
  gap: 2px;
}

.goal-hero-card {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.goal-mini-bar,
.goal-progress {
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.goal-mini-fill,
.goal-progress-fill {
  height: 100%;
  background: #93c5fd;
  border-radius: 999px;
}

.large-progress {
  margin-bottom: 12px;
}

.stat-pill {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
}

.stat-pill-label {
  font-size: 12px;
  color: #6b7280;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.info-chip,
.calendar-badge,
.account-summary-chip,
.source-badge,
.freshness-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.info-chip,
.account-summary-chip {
  background: #eef2ff;
}

.notification-stack {
  display: grid;
  gap: 12px;
}

.notification-card {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.notification-read {
  opacity: 0.78;
}

.notification-info {
  border-color: #dbeafe;
}

.notification-warning {
  border-color: #fde68a;
  background: #fffdf5;
}

.notification-urgent {
  border-color: #fecaca;
  background: #fff7f7;
}

.notification-positive {
  border-color: #bbf7d0;
  background: #f7fff9;
}

.notification-header,
.notification-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.source-manual {
  background: #eef2ff;
}

.source-linked_placeholder {
  background: #ede9fe;
}

.freshness-manual,
.freshness-current,
.freshness-synced {
  background: #dcfce7;
}

.freshness-requested,
.freshness-pending {
  background: #fef3c7;
}

.freshness-error,
.freshness-failed,
.freshness-attention {
  background: #fee2e2;
}

.suggestion-stack {
  display: grid;
  gap: 12px;
}

.suggestion-card {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.suggestion-high {
  border-color: #fecaca;
  background: #fff7f7;
}

.suggestion-medium {
  border-color: #fde68a;
  background: #fffdf5;
}

.suggestion-low {
  border-color: #d1d5db;
}

.suggestion-positive {
  border-color: #bbf7d0;
  background: #f7fff9;
}

.checklist-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.checklist-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}

.checklist-item.done {
  background: #f7fff9;
}

.checklist-item.pending {
  background: #ffffff;
}

.bar-stack {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 90px;
  gap: 10px;
  align-items: center;
}

.bar-label {
  font-size: 14px;
  color: #374151;
}

.bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: #0f172a;
}

.bar-value {
  font-size: 13px;
  color: #374151;
}

.dashboard-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.dashboard-toolbar-left {
  max-width: 760px;
}

.dashboard-toolbar-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.dashboard-toolbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar-dropdown {
  position: relative;
}

.toolbar-dropdown summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  font-size: 14px;
}

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

.toolbar-dropdown summary::after {
  content: "▾";
  margin-left: 8px;
  font-size: 12px;
}

.toolbar-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  display: grid;
  gap: 6px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  z-index: 30;
}

.toolbar-dropdown-menu form {
  max-width: none;
}

.toolbar-dropdown-menu button {
  width: 100%;
  text-align: left;
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
}

.toolbar-dropdown-menu button:hover {
  background: #f8fafc;
}

.dashboard-edit-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 16px;
  margin-bottom: 18px;
}

.dashboard-edit-bar.hidden {
  display: none;
}

.widget-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.widget-editor-card,
.preset-card,
.density-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  padding: 14px;
}

.secondary-button {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
}

.widget-editor-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.control-strip {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.widget-control {
  display: grid;
  gap: 6px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.density-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  align-items: end;
}

.preset-card-active,
.density-card-active {
  border-color: #93c5fd;
  background: #f8fbff;
}

.top-gap {
  margin-top: 14px;
}

.small-top-gap {
  margin-top: 8px;
}

.widget-edit-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #fafcff;
}

.widget-edit-controls.hidden {
  display: none;
}

.widget-inline-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.decision-positive,
.decision-neutral {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.decision-positive {
  background: #dcfce7;
  color: #166534;
}

.decision-neutral {
  background: #f3f4f6;
  color: #374151;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: relative;
    height: auto;
  }

  .workspace-header {
    position: relative;
    padding: 20px 18px 12px;
  }

  .workspace-content {
    padding: 0 18px 18px;
  }

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

  .widget-size-small,
  .widget-size-medium,
  .widget-size-large,
  .widget-card {
    grid-column: span 1;
  }
}

@media (max-width: 900px) {
  .dashboard-toolbar,
  .dashboard-edit-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-dropdown-menu {
    right: auto;
    left: 0;
  }

  .widget-edit-controls {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 700px) {
  .hero-summary-grid,
  .summary-cards {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Dashboard top-right controls fix ---------- */

.dashboard-top-right-bar {
  width: 100%;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center;
  margin: 0 0 16px 0;
}

.dashboard-top-right-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ---------- Stronger details/summary styling for View ---------- */

details.toolbar-dropdown {
  position: relative;
}

details.toolbar-dropdown > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  font-size: 14px;
  color: #111827;
  min-width: 92px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

details.toolbar-dropdown > summary::-webkit-details-marker {
  display: none;
}

details.toolbar-dropdown > summary::marker {
  content: "";
}

details.toolbar-dropdown > summary::after {
  content: "▾";
  margin-left: 8px;
  font-size: 12px;
  color: #475569;
}

details.toolbar-dropdown > .toolbar-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  gap: 6px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  z-index: 40;
}

details.toolbar-dropdown[open] > .toolbar-dropdown-menu {
  display: grid;
}

details.toolbar-dropdown > .toolbar-dropdown-menu form {
  margin: 0;
}

details.toolbar-dropdown > .toolbar-dropdown-menu button {
  width: 100%;
  text-align: left;
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
}

details.toolbar-dropdown > .toolbar-dropdown-menu button:hover {
  background: #f8fafc;
}

/* ---------- Widget 3-dot menu fix ---------- */

.widget-top-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.widget-top-controls.hidden {
  display: none;
}

details.widget-settings-menu {
  position: relative;
}

details.widget-settings-menu > summary.widget-settings-trigger {
  list-style: none;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  color: #334155;
}

details.widget-settings-menu > summary.widget-settings-trigger::-webkit-details-marker {
  display: none;
}

details.widget-settings-menu > summary.widget-settings-trigger::marker {
  content: "";
}

details.widget-settings-menu > .widget-settings-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 190px;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  z-index: 35;
}

details.widget-settings-menu[open] > .widget-settings-panel {
  display: grid;
}

.widget-settings-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #475569;
}

.widget-settings-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.widget-settings-check input {
  width: auto;
}

.widget-drag-handle {
  cursor: grab;
  user-select: none;
  font-size: 18px;
  color: #64748b;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
}

.widget-drag-handle:active {
  cursor: grabbing;
}

/* ---------- Small polish so the dashboard feels less clunky ---------- */

.dashboard-hero-compact {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 0.9fr);
  gap: 16px;
  margin-bottom: 18px;
}

.dashboard-hero-compact-copy,
.dashboard-hero-compact-side {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  padding: 20px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.dashboard-hero-compact-title {
  margin: 0 0 10px 0;
  font-size: 30px;
  line-height: 1.15;
}

.dashboard-hero-compact-text {
  margin: 0;
  color: #6b7280;
  max-width: 720px;
}

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

@media (max-width: 900px) {
  .dashboard-top-right-bar {
    justify-content: stretch !important;
  }

  .dashboard-top-right-actions {
    width: 100%;
  }

  .dashboard-top-right-actions > * {
    flex: 1 1 auto;
  }

  details.toolbar-dropdown > .toolbar-dropdown-menu {
    right: auto;
    left: 0;
  }
}

.dashboard-top-right-bar {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0 0 16px 0;
}

.dashboard-top-right-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

details.toolbar-dropdown {
  position: relative;
}

details.toolbar-dropdown > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  font-size: 14px;
  color: #111827;
  min-width: 92px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

details.toolbar-dropdown > summary::-webkit-details-marker {
  display: none;
}

details.toolbar-dropdown > summary::marker {
  content: "";
}

details.toolbar-dropdown > summary::after {
  content: "▾";
  margin-left: 8px;
  font-size: 12px;
  color: #475569;
}

details.toolbar-dropdown > .toolbar-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  gap: 6px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  z-index: 40;
}

details.toolbar-dropdown[open] > .toolbar-dropdown-menu {
  display: grid;
}

details.toolbar-dropdown > .toolbar-dropdown-menu form {
  margin: 0;
}

details.toolbar-dropdown > .toolbar-dropdown-menu button {
  width: 100%;
  text-align: left;
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
}

details.toolbar-dropdown > .toolbar-dropdown-menu button:hover {
  background: #f8fafc;
}


/* ---------- Final dashboard right-corner toolbar override ---------- */
.workspace-content > .dashboard-top-right-bar {
  width: 100%;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center;
  margin: 0 0 16px 0;
}

.workspace-content > .dashboard-top-right-bar > .dashboard-top-right-actions {
  margin-left: auto;
  display: flex !important;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  max-width: 100%;
}

.workspace-content > .dashboard-top-right-bar details.toolbar-dropdown > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
}

.workspace-content > .dashboard-top-right-bar details.toolbar-dropdown > summary::-webkit-details-marker {
  display: none;
}

.workspace-content > .dashboard-top-right-bar details.toolbar-dropdown > summary::marker {
  content: "";
}

.workspace-content > .dashboard-top-right-bar details.toolbar-dropdown > .toolbar-dropdown-menu {
  right: 0;
  left: auto;
}

.widget-top-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.widget-top-controls.hidden {
  display: none;
}

details.widget-settings-menu {
  position: relative;
}

details.widget-settings-menu > summary.widget-settings-trigger {
  list-style: none;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  color: #334155;
}

details.widget-settings-menu > summary.widget-settings-trigger::-webkit-details-marker {
  display: none;
}

details.widget-settings-menu > summary.widget-settings-trigger::marker {
  content: "";
}

details.widget-settings-menu > .widget-settings-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 190px;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  z-index: 35;
}

details.widget-settings-menu[open] > .widget-settings-panel {
  display: grid;
}

/* ---------- UI Surface Alignment: pages ---------- */

.page-section-hero {
  border: 1px solid #e5e7eb;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border-radius: 22px;
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.page-section-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6366f1;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-section-title {
  margin: 0 0 8px 0;
  font-size: 24px;
  line-height: 1.1;
}

.page-section-subtitle {
  margin: 0;
  color: #667085;
  max-width: 820px;
  line-height: 1.5;
}

.page-stack {
  display: grid;
  gap: 18px;
}

.page-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.surface-card {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.surface-card-tight {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.surface-card h3,
.surface-card h4,
.surface-card-tight h3,
.surface-card-tight h4 {
  margin-top: 0;
  margin-bottom: 8px;
}

.surface-card p,
.surface-card-tight p {
  margin-top: 0;
}

.section-kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  font-weight: 700;
  margin-bottom: 8px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.summary-card {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.stat-tile {
  position: relative;
  overflow: hidden;
}

.stat-tile::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 14px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #eef2ff;
}

.stat-tile-success::after { background: #e8f7ea; }
.stat-tile-danger::after { background: #fdecec; }
.stat-tile-info::after { background: #eef2ff; }
.stat-tile-warning::after { background: #fff6de; }

.summary-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin-bottom: 8px;
}

.summary-value {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
}

.surface-form {
  display: grid;
  gap: 14px;
  max-width: none;
}

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

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

.field-stack {
  display: grid;
  gap: 6px;
}

.field-stack label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.inline-helper-text {
  font-size: 13px;
  color: #667085;
  line-height: 1.45;
}

.textarea-input {
  min-height: 132px;
}

.table-shell {
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.table-shell-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border-bottom: 1px solid #edf2f7;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.table-shell-title {
  margin: 0;
  font-size: 20px;
}

.table-shell-subtitle {
  margin: 4px 0 0 0;
  color: #667085;
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
}

.surface-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.surface-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #fcfdff;
}

.surface-table th,
.surface-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: top;
}

.surface-table tbody tr:hover td {
  background: #fafcff;
}

.list-stack {
  display: grid;
  gap: 12px;
}

.ui-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.ui-pill-neutral { background: #f3f4f6; color: #374151; }
.ui-pill-info { background: #eef2ff; color: #4f46e5; }
.ui-pill-success { background: #e8f7ea; color: #1f7a34; }
.ui-pill-warning { background: #fff5db; color: #a16207; }
.ui-pill-danger { background: #fde8e8; color: #b42318; }

.source-badge,
.freshness-badge,
.account-summary-chip,
.calendar-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.source-manual { background: #eef2ff; color: #4f46e5; }
.source-linked_placeholder { background: #f3e8ff; color: #7e22ce; }
.source-plaid, .source-link { background: #e0f2fe; color: #0369a1; }

.freshness-manual,
.freshness-current,
.freshness-synced,
.freshness-active,
.freshness-updated,
.freshness-resolved { background: #e8f7ea; color: #1f7a34; }

.freshness-requested,
.freshness-pending,
.freshness-reviewing,
.freshness-warning,
.freshness-open,
.freshness-medium { background: #fff5db; color: #a16207; }

.freshness-error,
.freshness-failed,
.freshness-attention,
.freshness-urgent,
.freshness-high { background: #fde8e8; color: #b42318; }

.empty-state-panel {
  border: 1px dashed #d0d5dd;
  border-radius: 18px;
  padding: 18px;
  background: #fbfcfd;
  display: grid;
  gap: 8px;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-form {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  max-width: none;
}

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

.link-tile {
  border: 1px solid #dbe3f0;
  background: #ffffff;
  border-radius: 14px;
  min-height: 48px;
}

.link-tile a,
.link-tile button {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.notification-feed {
  display: grid;
  gap: 12px;
}

.notification-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  border: 1px solid #eaecf0;
  border-radius: 18px;
  padding: 16px;
  background: #ffffff;
}

.notification-row-left {
  display: grid;
  gap: 4px;
}

.notification-row-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.notification-row.notification-info { border-color: #dbeafe; }
.notification-row.notification-warning { border-color: #fde68a; background: #fffdf7; }
.notification-row.notification-urgent { border-color: #fecaca; background: #fff8f8; }
.notification-row.notification-positive { border-color: #bbf7d0; background: #f8fffa; }

.input-like-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-like-inline input { max-width: 140px; }

.panel-note {
  border: 1px solid #e0e7ff;
  background: #f8faff;
  color: #4f46e5;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
}

@media (max-width: 1100px) {
  .summary-cards,
  .link-grid,
  .field-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 800px) {
  .summary-cards,
  .link-grid,
  .field-grid-2,
  .field-grid-3 {
    grid-template-columns: 1fr;
  }

  .notification-row {
    grid-template-columns: 1fr;
  }

  .table-shell-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---------- Controls + Table Polish Bundle ---------- */
/* Paste this block at the very bottom of app/static/styles.css */

.page-section-hero {
  border: 1px solid #e5e7eb;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border-radius: 22px;
  padding: 24px 26px;
  margin-bottom: 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.page-section-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6366f1;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-section-title {
  margin: 0 0 8px 0;
  font-size: 24px;
  line-height: 1.1;
}

.page-section-subtitle {
  margin: 0;
  max-width: 820px;
  line-height: 1.5;
  color: #667085;
}

.page-stack {
  display: grid;
  gap: 18px;
}

.page-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.surface-card,
.table-shell {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.surface-card {
  padding: 20px;
}

.table-shell {
  overflow: hidden;
}

.section-kicker,
.table-shell-kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  font-weight: 700;
  margin-bottom: 8px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.stat-tile {
  position: relative;
  overflow: hidden;
}

.stat-tile::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 14px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #eef2ff;
}

.stat-tile-success::after { background: #e8f7ea; }
.stat-tile-danger::after { background: #fdecec; }
.stat-tile-info::after { background: #eef2ff; }
.stat-tile-warning::after { background: #fff6de; }

.summary-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin-bottom: 8px;
}

.summary-value {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
}

.surface-form {
  display: grid;
  gap: 14px;
  max-width: none;
}

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

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

.field-stack {
  display: grid;
  gap: 6px;
}

.field-stack label,
.field-label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.inline-helper-text {
  font-size: 13px;
  color: #667085;
  line-height: 1.45;
}

.textarea-input {
  min-height: 132px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dbe3f0;
  border-radius: 14px;
  background: #ffffff;
  padding: 12px 14px;
  font: inherit;
  color: #111827;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #7c8cff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
  background: #ffffff;
}

textarea {
  resize: vertical;
}

button,
.action-link {
  border-radius: 14px;
  min-height: 42px;
}

button {
  border: 1px solid #6366f1;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  padding: 10px 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.18);
}

button:hover {
  opacity: 0.98;
}

.secondary-button,
.secondary-link,
.inline-form .secondary-button {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d6dbe6;
  box-shadow: none;
}

.page-actions,
.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-form {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  max-width: none;
}

.table-shell-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid #edf0f5;
  background: linear-gradient(180deg, #fcfdff 0%, #fafcff 100%);
}

.table-shell-title {
  margin: 0;
  font-size: 18px;
}

.table-shell-subtitle {
  margin: 6px 0 0 0;
  color: #667085;
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
}

.surface-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.surface-table th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  color: #64748b;
  background: #fcfcfd;
  font-weight: 800;
}

.surface-table th,
.surface-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
  vertical-align: middle;
}

.surface-table tbody tr:hover td {
  background: #fafcff;
}

.money-value {
  font-weight: 800;
  color: #111827;
  white-space: nowrap;
}

.table-muted {
  color: #667085;
  font-size: 13px;
}

.source-badge,
.freshness-badge,
.calendar-badge,
.ui-pill,
.severity-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.source-manual,
.source-manual_account { background: #eef2ff; color: #4f46e5; }
.source-linked_placeholder { background: #f3e8ff; color: #7e22ce; }
.source-plaid,
.source-link,
.source-import { background: #e0f2fe; color: #0369a1; }

.freshness-manual,
.freshness-current,
.freshness-synced,
.freshness-active,
.freshness-updated,
.freshness-resolved { background: #e8f7ea; color: #1f7a34; }

.freshness-requested,
.freshness-pending,
.freshness-reviewing,
.freshness-warning,
.freshness-open,
.freshness-medium,
.severity-warning { background: #fff5db; color: #a16207; }

.freshness-error,
.freshness-failed,
.freshness-attention,
.freshness-urgent,
.freshness-high,
.severity-urgent,
.severity-danger { background: #fde8e8; color: #b42318; }

.severity-info { background: #eef2ff; color: #4f46e5; }
.severity-positive,
.severity-success { background: #e8f7ea; color: #1f7a34; }

.compact-tools-form {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.compact-tools-form input {
  min-width: 0;
  padding: 10px 12px;
}

.compact-tools-form button {
  padding: 10px 14px;
  white-space: nowrap;
}

.empty-state-panel {
  border: 1px dashed #d0d5dd;
  border-radius: 18px;
  padding: 18px;
  background: #fbfcfd;
  display: grid;
  gap: 8px;
}

.helper-stack {
  display: grid;
  gap: 12px;
}

.helper-card {
  border: 1px solid #e9edf5;
  border-radius: 16px;
  padding: 14px 14px 14px 16px;
  background: #fcfdff;
}

.helper-card strong {
  display: block;
  margin-bottom: 4px;
}

.panel-note {
  border: 1px solid #e0e7ff;
  background: #f8faff;
  color: #4f46e5;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
}

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

.link-tile {
  border: 1px solid #dbe3f0;
  background: #ffffff;
  border-radius: 16px;
  min-height: 52px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.03);
}

.link-tile a,
.link-tile button {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
}

.feedback-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 18px;
}

.recent-list {
  display: grid;
  gap: 10px;
}

.recent-item {
  border: 1px solid #edf0f5;
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
}

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

.rating-stars {
  color: #4f46e5;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.notification-feed {
  display: grid;
  gap: 12px;
}

.notification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  border: 1px solid #eaecf0;
  border-radius: 18px;
  padding: 16px;
  background: #ffffff;
}

.notification-row-left {
  display: grid;
  gap: 4px;
}

.notification-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.notification-row-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.notification-row.notification-info { border-color: #dbeafe; }
.notification-row.notification-warning { border-color: #fde68a; background: #fffdf7; }
.notification-row.notification-urgent { border-color: #fecaca; background: #fff8f8; }
.notification-row.notification-positive { border-color: #bbf7d0; background: #f8fffa; }

.unread-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #4f46e5;
  display: inline-block;
}

.note-card {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 16px;
  background: #ffffff;
}

@media (max-width: 1200px) {
  .summary-cards,
  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feedback-layout,
  .page-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .field-grid-2,
  .field-grid-3,
  .summary-cards,
  .link-grid,
  .compact-tools-form {
    grid-template-columns: 1fr;
  }

  .notification-row {
    grid-template-columns: 1fr;
  }

  .table-shell-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---------- Micro-Interaction + Density Polish Bundle ---------- */
/* Paste this entire block at the very bottom of app/static/styles.css */

:root {
  --ui-border: #e7ebf3;
  --ui-border-strong: #d8e0ec;
  --ui-text-soft: #667085;
  --ui-bg-soft: #f8fbff;
  --ui-shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.045);
  --ui-shadow-card: 0 10px 26px rgba(15, 23, 42, 0.05);
  --ui-primary: #4f46e5;
  --ui-primary-dark: #4338ca;
}

.page-section-hero {
  padding: 20px 22px;
  border-radius: 20px;
  box-shadow: var(--ui-shadow-card);
}

.page-section-title {
  font-size: 22px;
}

.page-section-subtitle {
  max-width: 760px;
}

.surface-card,
.table-shell,
.summary-card {
  border-color: var(--ui-border);
}

.surface-card,
.table-shell {
  border-radius: 20px;
  box-shadow: var(--ui-shadow-card);
}

.surface-card {
  padding: 18px;
}

.summary-cards {
  gap: 12px;
}

.summary-card {
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--ui-shadow-soft);
}

.summary-value {
  font-size: 16px;
}

.surface-form {
  gap: 12px;
}

.field-grid-2,
.field-grid-3 {
  gap: 12px;
}

.field-stack {
  gap: 5px;
}

.field-stack label,
.field-label {
  font-size: 12px;
  letter-spacing: 0.01em;
}

.inline-helper-text {
  font-size: 12px;
  line-height: 1.45;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 13px;
  background: #ffffff;
}

textarea {
  min-height: 116px;
}

textarea.short-textarea {
  min-height: 92px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #98a2ff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.10);
}

button,
.action-link {
  min-height: 40px;
  border-radius: 13px;
  font-weight: 700;
}

button {
  padding: 10px 14px;
  background: linear-gradient(180deg, #5b54f2 0%, #4f46e5 100%);
  border: 1px solid #5850ec;
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.14);
}

button:hover {
  background: linear-gradient(180deg, #554df0 0%, #4338ca 100%);
}

.secondary-button,
.secondary-link,
.inline-form .secondary-button {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid var(--ui-border-strong);
  box-shadow: none;
}

button:focus-visible,
.action-link:focus-visible,
.secondary-button:focus-visible,
.secondary-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.10);
}

.table-shell-header {
  padding: 16px 18px;
}

.table-shell-title {
  font-size: 17px;
}

.table-shell-subtitle {
  font-size: 13px;
}

.surface-table th,
.surface-table td {
  padding: 12px 10px;
}

.surface-table th {
  font-size: 11px;
}

.money-value {
  font-size: 15px;
}

.table-compact-meta {
  display: grid;
  gap: 2px;
}

.table-compact-note {
  font-size: 12px;
  color: var(--ui-text-soft);
}

.source-badge,
.freshness-badge,
.severity-pill,
.calendar-badge,
.ui-pill {
  padding: 4px 9px;
  font-size: 11px;
}

/* Accounts */
.account-form-dense .field-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-panel-note {
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px dashed var(--ui-border-strong);
  border-radius: 14px;
  background: var(--ui-bg-soft);
  color: #5b6475;
  font-size: 12px;
}

.accounts-tools-cell {
  min-width: 230px;
}

.compact-tools-form {
  display: grid;
  grid-template-columns: 88px 88px auto;
  gap: 8px;
  align-items: center;
  max-width: none;
}

.compact-tools-form input {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 11px;
}

.compact-tools-form button {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 12px;
  box-shadow: none;
}

.mini-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.mini-actions .action-link,
.mini-actions button,
.mini-actions .secondary-button {
  min-height: 34px;
  border-radius: 12px;
  padding: 7px 12px;
  font-size: 12px;
  box-shadow: none;
}

/* Balances */
.balance-shell-accent {
  position: relative;
}

.balance-shell-accent::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 20px 0 0 20px;
  background: #c7d2fe;
}

.balance-shell-accent.balance-shell-success::before {
  background: #86efac;
}

.balance-shell-accent.balance-shell-danger::before {
  background: #fca5a5;
}

.balance-name {
  font-weight: 700;
}

.balance-subtext {
  font-size: 12px;
  color: var(--ui-text-soft);
  margin-top: 2px;
}

/* Feedback + Support */
.feedback-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 16px;
}

.helper-stack,
.recent-list {
  display: grid;
  gap: 10px;
}

.helper-card,
.recent-item {
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  background: #fbfcff;
  padding: 12px 13px;
}

.helper-card strong,
.recent-item strong {
  font-size: 14px;
}

.panel-note {
  padding: 12px 13px;
  border: 1px dashed #d9def8;
  border-radius: 14px;
  background: #f8f9ff;
  color: #667085;
  font-size: 12px;
}

.rating-stars {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #f59e0b;
}

.history-empty-wrap {
  padding: 14px 16px 16px;
}

/* Notifications */
.notification-feed {
  display: grid;
  gap: 10px;
}

.notification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  padding: 14px 14px;
  background: #ffffff;
}

.notification-row-left {
  min-width: 0;
}

.notification-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.notification-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.notification-row-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.notification-row .action-link,
.notification-row button {
  min-height: 34px;
  border-radius: 12px;
  padding: 7px 12px;
  font-size: 12px;
  box-shadow: none;
}

.notification-row .action-link {
  background: #ffffff;
  color: var(--ui-primary);
  border: 1px solid #c7cffd;
}

.notification-row .action-link:hover {
  background: #f8f9ff;
}

.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}

.notification-read {
  opacity: 0.92;
}

.notification-urgent { border-color: #f7c8cd; background: #fffdfd; }
.notification-warning { border-color: #f5e7ad; background: #fffef9; }
.notification-info { border-color: #dbe6fb; background: #fcfdff; }
.notification-success { border-color: #cdeed6; background: #fbfffc; }

.severity-urgent { background: #fee2e2; color: #b42318; }
.severity-warning { background: #fef3c7; color: #b54708; }
.severity-info { background: #e0e7ff; color: #4338ca; }
.severity-success { background: #dcfce7; color: #166534; }

/* Utility */
.soft-divider {
  border-top: 1px solid #edf0f5;
  margin: 4px 0 0 0;
}

@media (max-width: 1120px) {
  .page-grid-2,
  .feedback-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .compact-tools-form button {
    grid-column: span 2;
  }

  .notification-row {
    grid-template-columns: 1fr;
  }

  .notification-row-actions {
    justify-items: start;
    grid-auto-flow: column;
    justify-content: start;
  }
}

@media (max-width: 700px) {
  .summary-cards,
  .field-grid-2,
  .field-grid-3,
  .account-form-dense .field-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Overhaul Bundle: Account + Notifications + Page Smoothness ---------- */
/* Paste this entire block at the very bottom of app/static/styles.css */

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

.toolbar-pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.outline-chip-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #dbe3f0;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.outline-chip-link:hover {
  background: #f8fbff;
}

.section-card-title {
  margin: 0 0 4px 0;
  font-size: 18px;
}

.section-card-note {
  margin: 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.5;
}

.product-form-card {
  display: grid;
  gap: 14px;
}

.form-header-block {
  display: grid;
  gap: 6px;
}

.form-field-panel {
  border: 1px solid #e8edf6;
  border-radius: 16px;
  background: #fbfdff;
  padding: 14px;
}

.form-field-panel + .form-field-panel {
  margin-top: 12px;
}

.form-field-panel .field-grid-2,
.form-field-panel .field-grid-3 {
  margin-top: 10px;
}

.helper-inline-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.helper-inline-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #42526b;
  font-size: 11px;
  font-weight: 700;
}

.account-editor-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

.account-record-list,
.placeholder-record-list,
.recent-feedback-list,
.support-history-list,
.notification-feed-stack {
  display: grid;
  gap: 12px;
}

.account-record-card,
.placeholder-card,
.recent-feedback-row,
.support-history-row,
.notification-card {
  border: 1px solid #e8edf6;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.account-record-card,
.placeholder-card {
  padding: 14px 16px;
}

.account-record-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto auto;
  gap: 14px;
  align-items: center;
}

.account-record-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.account-record-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.account-record-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.account-record-sub {
  color: #667085;
  font-size: 13px;
}

.account-record-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.account-record-metrics {
  display: grid;
  gap: 8px;
  min-width: 170px;
}

.metric-chip {
  border: 1px solid #e6ebf5;
  border-radius: 14px;
  background: #fbfcfe;
  padding: 9px 12px;
}

.metric-chip-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7a8699;
  margin-bottom: 4px;
}

.metric-chip-value {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.account-record-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
  min-width: 220px;
}

.account-inline-update {
  width: 100%;
  max-width: 220px;
}

.account-inline-update summary {
  list-style: none;
  cursor: pointer;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #dbe3f0;
  border-radius: 12px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.account-inline-update summary::-webkit-details-marker { display: none; }
.account-inline-update summary::marker { content: ""; }

.account-inline-update-panel {
  margin-top: 10px;
  border: 1px solid #e8edf6;
  border-radius: 14px;
  background: #fbfdff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.account-inline-update-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.account-inline-update-grid input {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 12px;
}

.account-inline-update-panel button,
.mini-action-row button,
.mini-action-row .action-link,
.account-inline-update summary {
  box-shadow: none;
}

.mini-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.mini-action-row button,
.mini-action-row .action-link {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 12px;
}

.placeholder-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.placeholder-card-main {
  display: grid;
  gap: 8px;
}

.placeholder-card-title {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.panel-note {
  border: 1px dashed #d8e0ec;
  border-radius: 14px;
  background: #fbfdff;
  padding: 12px 13px;
  color: #5d6678;
  font-size: 12px;
  line-height: 1.45;
}

.history-empty-wrap {
  padding: 14px;
}

.history-empty-wrap .empty-state-panel {
  padding: 16px;
}

.feedback-layout-refined {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

.feedback-side-stack,
.support-side-stack {
  display: grid;
  gap: 14px;
}

.guide-note-card,
.helper-card {
  border: 1px solid #e8edf6;
  border-radius: 16px;
  background: #fbfdff;
  padding: 12px 13px;
}

.guide-note-card strong,
.helper-card strong {
  display: block;
  margin-bottom: 4px;
}

.feedback-rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff8e8;
  color: #8a5a00;
  font-size: 11px;
  font-weight: 800;
}

.recent-feedback-row,
.support-history-row {
  padding: 13px 14px;
}

.recent-feedback-head,
.support-history-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.support-shell-refined {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

.support-guides {
  display: grid;
  gap: 10px;
}

.support-guide-card {
  border: 1px solid #e8edf6;
  border-radius: 16px;
  background: #fbfdff;
  padding: 12px 13px;
}

.support-guide-card strong {
  display: block;
  margin-bottom: 4px;
}

.notification-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.notification-toolbar .button-row {
  margin: 0;
}

.notification-feed-card {
  padding: 14px;
}

.notification-feed-stack {
  gap: 10px;
}

.notification-card {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  overflow: hidden;
}

.notification-severity-accent {
  background: #dbeafe;
}

.notification-card.urgent .notification-severity-accent { background: #fecaca; }
.notification-card.warning .notification-severity-accent { background: #fde68a; }
.notification-card.info .notification-severity-accent { background: #dbeafe; }
.notification-card.success .notification-severity-accent { background: #bbf7d0; }

.notification-card-body {
  padding: 14px 0 14px 2px;
  display: grid;
  gap: 8px;
}

.notification-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.notification-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.notification-card-message {
  color: #667085;
  line-height: 1.45;
  font-size: 13px;
}

.notification-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.notification-card-actions {
  padding: 12px 12px 12px 0;
  display: grid;
  gap: 8px;
  align-content: center;
  justify-items: end;
  min-width: 96px;
}

.notification-card-actions .action-link,
.notification-card-actions button {
  min-height: 34px;
  min-width: 78px;
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 12px;
  box-shadow: none;
}

.notification-card-read {
  opacity: 0.88;
}

.unread-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.10);
  flex: 0 0 auto;
}

.severity-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: lowercase;
}

.severity-urgent { background: #fee2e2; color: #991b1b; }
.severity-warning { background: #fef3c7; color: #92400e; }
.severity-info { background: #dbeafe; color: #1d4ed8; }
.severity-success { background: #dcfce7; color: #166534; }

.balance-hero-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: stretch;
}

.balance-hero-panel {
  flex: 1 1 220px;
  border: 1px solid #e7ebf3;
  border-radius: 16px;
  background: #fbfdff;
  padding: 12px 14px;
}

.balance-hero-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7a8699;
  margin-bottom: 6px;
}

.balance-hero-value {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.balance-shell-accent::before {
  width: 5px;
}

.balance-row-name {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.balance-row-sub {
  font-size: 12px;
  color: #667085;
}

.balance-money-strong {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}

@media (max-width: 1150px) {
  .account-editor-layout,
  .feedback-layout-refined,
  .support-shell-refined {
    grid-template-columns: 1fr;
  }

  .account-record-card,
  .placeholder-card,
  .notification-card {
    grid-template-columns: 1fr;
  }

  .account-record-metrics,
  .account-record-actions,
  .notification-card-actions {
    min-width: 0;
    justify-items: stretch;
  }

  .mini-action-row {
    justify-content: flex-start;
  }
}

@media (max-width: 800px) {
  .account-inline-update-grid,
  .account-form-dense .field-grid-2,
  .feedback-layout-refined .field-grid-2,
  .support-shell-refined .field-grid-2 {
    grid-template-columns: 1fr;
  }

  .notification-toolbar {
    align-items: stretch;
  }

  .notification-card-head,
  .recent-feedback-head,
  .support-history-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Final polish pass: density + product smoothness ---------- */
/* Paste this entire block at the very bottom of app/static/styles.css */

.page-tight-stack {
  display: grid;
  gap: 14px;
}

.section-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #667085;
  font-weight: 800;
}

.page-subactions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: -4px 0 6px 0;
}

.subaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #dbe3f0;
  background: #fff;
  text-decoration: none;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.subaction-chip:hover {
  background: #f8fbff;
}

.summary-cards.summary-cards-tight {
  gap: 10px;
}

.stat-tile {
  position: relative;
  overflow: hidden;
}

.stat-tile::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: #e5e7eb;
}

.stat-tile-info::after { background: #93c5fd; }
.stat-tile-success::after { background: #86efac; }
.stat-tile-warning::after { background: #fcd34d; }
.stat-tile-danger::after { background: #fca5a5; }

.product-panel {
  border: 1px solid #e8edf6;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15,23,42,.04);
}

.product-panel-body {
  padding: 16px;
}

.panel-note {
  border: 1px solid #e8edf6;
  border-radius: 14px;
  background: #fbfdff;
  padding: 12px 14px;
  color: #667085;
  font-size: 12px;
  line-height: 1.5;
}

.form-shell-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 16px;
}

.form-shell-grid-tight {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
}

.field-stack {
  display: grid;
  gap: 6px;
}

.field-stack label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.field-grid-2.tight-grid,
.field-grid-3.tight-grid {
  gap: 10px;
}

.dense-panel {
  border: 1px solid #e8edf6;
  border-radius: 16px;
  background: #fbfdff;
  padding: 12px;
}

.short-textarea {
  min-height: 96px;
}

.tiny-textarea {
  min-height: 78px;
}

.button-row.tight-row {
  gap: 8px;
}

button.compact-primary,
a.compact-primary {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

button.compact-secondary,
a.compact-secondary {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #dbe3f0;
  background: #fff;
  color: #334155;
  text-decoration: none;
}

button.compact-secondary:hover,
a.compact-secondary:hover {
  background: #f8fbff;
}

.account-record-stack,
.placeholder-record-stack,
.notification-feed-clean,
.history-card-stack,
.help-card-stack {
  display: grid;
  gap: 12px;
}

.account-row-card,
.placeholder-row-card,
.notification-card-clean,
.history-row-card {
  border: 1px solid #e8edf6;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15,23,42,.04);
}

.account-row-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.account-row-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.account-row-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.account-row-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.account-row-sub {
  font-size: 13px;
  color: #667085;
}

.account-badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.account-metric-grid {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.account-metric-chip {
  border: 1px solid #e6ebf5;
  border-radius: 14px;
  background: #fbfcfe;
  padding: 8px 12px;
}

.account-metric-label {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #7a8699;
}

.account-metric-value {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.account-actions-col {
  display: grid;
  gap: 8px;
  justify-items: end;
  min-width: 210px;
}

.account-inline-editor {
  width: 100%;
}

.account-inline-editor summary {
  list-style: none;
  cursor: pointer;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #dbe3f0;
  border-radius: 12px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.account-inline-editor summary::-webkit-details-marker { display: none; }
.account-inline-editor summary::marker { content: ""; }

.account-inline-editor[open] summary {
  background: #f8fbff;
}

.account-inline-editor-panel {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #e8edf6;
  border-radius: 14px;
  background: #fbfdff;
}

.account-inline-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.account-inline-grid input {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.placeholder-row-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.placeholder-row-main {
  display: grid;
  gap: 8px;
}

.placeholder-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.table-shell-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #667085;
  font-weight: 800;
  margin-bottom: 4px;
}

.history-empty-wrap {
  padding: 14px;
}

.help-card-stack {
  display: grid;
  gap: 10px;
}

.help-card {
  border: 1px solid #e8edf6;
  border-radius: 16px;
  background: #fff;
  padding: 12px 14px;
}

.help-card strong {
  display: block;
  margin-bottom: 3px;
}

.table-muted {
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}

.notification-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 14px 16px 0 16px;
}

.notification-feed-clean {
  padding: 12px 16px 16px 16px;
}

.notification-card-clean {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: stretch;
  padding: 14px 14px 14px 0;
  overflow: hidden;
}

.notification-rail {
  border-radius: 999px;
  margin: 12px 0 12px 12px;
  background: #e5e7eb;
}

.notification-card-clean.notification-urgent .notification-rail { background: #fca5a5; }
.notification-card-clean.notification-warning .notification-rail { background: #fcd34d; }
.notification-card-clean.notification-info .notification-rail { background: #93c5fd; }
.notification-card-clean.notification-success .notification-rail { background: #86efac; }

.notification-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.notification-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.notification-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.notification-message {
  color: #475467;
  font-size: 14px;
  line-height: 1.5;
}

.notification-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.notification-actions {
  display: grid;
  gap: 8px;
  align-content: center;
  justify-items: end;
  min-width: 92px;
  padding-right: 4px;
}

.notification-actions .action-link,
.notification-actions button {
  min-width: 70px;
}

.notification-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #e0e7ff;
  display: inline-block;
}

.notification-read .notification-dot {
  opacity: 0;
}

.recent-side-stack {
  display: grid;
  gap: 12px;
}

.side-note-card {
  border: 1px solid #e8edf6;
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.feedback-shell-refined,
.support-shell-refined {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 16px;
}

.support-history-row,
.recent-feedback-row {
  padding: 14px 16px;
}

.support-history-head,
.recent-feedback-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.table-compact-meta {
  display: grid;
  gap: 6px;
}

.table-compact-note {
  color: #667085;
  font-size: 12px;
}

.mini-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.balance-emphasis {
  font-weight: 800;
  color: #0f172a;
}

.balance-subnote {
  color: #667085;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .form-shell-grid,
  .form-shell-grid-tight,
  .feedback-shell-refined,
  .support-shell-refined,
  .account-editor-layout {
    grid-template-columns: 1fr;
  }

  .account-row-card,
  .placeholder-row-card,
  .notification-card-clean {
    grid-template-columns: 1fr;
  }

  .account-metric-grid,
  .account-actions-col,
  .notification-actions {
    min-width: 0;
    justify-items: stretch;
  }
}

@media (max-width: 820px) {
  .account-inline-grid,
  .field-grid-2.tight-grid,
  .field-grid-3.tight-grid {
    grid-template-columns: 1fr;
  }

  .notification-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---------- Targeted Account Hub debug + Notifications finish ---------- */
/* Paste this entire block at the very bottom of app/static/styles.css */

/* Explicit v2 classes so this pass is visually obvious if accounts.html is the live template */

.account-hub-v2-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 16px;
  margin-bottom: 18px;
}

.account-form-shell-v2 {
  padding: 0;
  overflow: hidden;
}

.account-form-shell-head {
  padding: 16px 16px 0 16px;
}

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

.account-form-grid-v2 .field-stack:nth-child(3),
.account-form-grid-v2 .field-stack:nth-child(4),
.account-form-grid-v2 .field-stack:nth-child(5),
.account-form-grid-v2 .field-stack:nth-child(6) {
  grid-column: span 1;
}

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

.account-form-notes-v2 {
  grid-column: 1 / -1;
}

.account-hub-note-v2 {
  margin: 0 16px;
  border: 1px solid #e8edf6;
  background: #fbfdff;
  border-radius: 14px;
  padding: 12px 14px;
  color: #667085;
  font-size: 12px;
  line-height: 1.5;
}

.compact-textarea-v2 {
  min-height: 84px;
}

.section-card-header-v2 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.account-record-list-v2,
.placeholder-card-list-v2 {
  display: grid;
  gap: 12px;
}

.account-record-v2,
.placeholder-card-v2 {
  border: 1px solid #e8edf6;
  border-radius: 16px;
  background: #fbfdff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.account-record-v2 {
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.9fr) auto;
  align-items: center;
}

.account-record-v2-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.account-record-v2-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.account-record-v2-sub {
  color: #667085;
  font-size: 13px;
}

.account-record-v2-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 10px;
}

.account-metric-tile-v2 {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.account-metric-tile-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  font-weight: 700;
}

.account-metric-tile-value {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.account-record-v2-actions {
  justify-self: end;
}

details.account-quick-edit-v2 {
  position: relative;
}

details.account-quick-edit-v2 > summary {
  list-style: none;
  cursor: pointer;
}

details.account-quick-edit-v2 > summary::-webkit-details-marker {
  display: none;
}

.account-quick-edit-panel-v2 {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 280px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  padding: 12px;
  z-index: 20;
}

.account-quick-edit-grid-v2 {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.placeholder-card-v2 {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.placeholder-card-v2-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.notification-shell-v2 {
  padding-top: 14px;
}

.notification-header-v2 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.notification-list-v2 {
  display: grid;
  gap: 12px;
}

.notification-item-v2 {
  border: 1px solid #e8edf6;
  border-radius: 18px;
  background: #ffffff;
  padding: 14px 14px 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.notification-item-v2.notification-unread-v2 {
  border-color: #dbeafe;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.notification-item-v2-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.notification-item-v2-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.notification-unread-pill-v2 {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.notification-item-v2-message {
  color: #475467;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.notification-item-v2-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.notification-item-v2-actions {
  display: grid;
  gap: 8px;
  align-content: center;
  justify-items: end;
}

.compact-pill-action {
  border-radius: 999px;
}

.compact-action-slim {
  min-width: 70px;
  min-height: 32px;
  padding: 6px 10px;
  justify-content: center;
}

.support-history-compact .history-empty-wrap,
.feedback-history-compact .history-empty-wrap {
  padding-top: 6px;
}

@media (max-width: 1150px) {
  .account-hub-v2-grid,
  .account-record-v2,
  .placeholder-card-v2,
  .notification-item-v2,
  .notification-header-v2 {
    grid-template-columns: 1fr;
  }

  .account-record-v2-actions,
  .placeholder-card-v2-actions,
  .notification-item-v2-actions {
    justify-self: start;
  }

  .account-quick-edit-panel-v2 {
    position: static;
    width: 100%;
    margin-top: 8px;
  }
}

@media (max-width: 780px) {
  .account-form-grid-v2,
  .account-record-v2-metrics {
    grid-template-columns: 1fr;
  }
}

/* ---------- Account Hub final mini polish ---------- */
/* Paste this entire block at the very bottom of app/static/styles.css */

.account-summary-strip-v3 .stat-tile {
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  border-color: #e6ecf5;
}

.account-form-shell-v3 {
  border-color: #e6ecf5;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.account-form-v3 {
  padding: 0 16px 16px 16px;
}

.account-form-grid-v3-single {
  gap: 8px;
}

.account-hub-note-v3 {
  margin-bottom: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f8fbff 100%);
}

.compact-textarea-v3 {
  min-height: 68px;
}

.account-placeholder-notes-v3 {
  min-height: 62px;
}

.account-cta-row-v3 {
  margin-top: 2px;
}

.account-cta-v3 {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid #2563eb;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18);
}

.account-cta-v3:hover {
  filter: brightness(0.98);
}

.account-results-shell-v3 {
  border-color: #e6ecf5;
}

.account-empty-state-v3 {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid #e6ecf5;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 18px;
}

.account-empty-state-soft-v3 {
  background: #fbfdff;
}

.account-empty-state-copy-v3 {
  display: grid;
  gap: 6px;
  max-width: 640px;
}

.account-empty-state-title-v3 {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.account-empty-state-text-v3 {
  color: #667085;
  line-height: 1.55;
}

.account-ghost-cta-v3 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 14px;
  border: 1px solid #dbe3f0;
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.account-ghost-cta-v3:hover {
  background: #f8fbff;
}

@media (max-width: 900px) {
  .account-empty-state-v3 {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Layout fix bundle for Account Hub ---------- */
/* Paste this at the very bottom of app/static/styles.css */

.account-page-flow-v3 {
  display: grid;
  gap: 16px;
  align-content: start;
}

.account-page-flow-v3 > .page-section-hero {
  order: 1;
  margin-top: 0;
}

.account-page-flow-v3 > .page-subactions {
  order: 2;
}

.account-page-flow-v3 > .summary-cards {
  order: 3;
}

.account-page-flow-v3 > .account-hub-v2-grid {
  order: 4;
}

.account-page-flow-v3 > .surface-card {
  order: 5;
}

.account-cta-strong-v3 {
  min-width: 170px;
  min-height: 40px;
  border-radius: 14px;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.14);
}

.account-form-shell-v2-tight .account-hub-note-v2 {
  margin-bottom: 2px;
}

.compact-textarea-v2-tight {
  min-height: 68px;
}

.account-empty-emphasis-v3 {
  border-color: #e3eaf7;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.account-history-empty-v3 .empty-state-panel {
  background: #fbfdff;
  border-style: solid;
  border-color: #eef2f7;
  padding: 22px;
}

.account-history-empty-v3 .action-link,
.account-history-empty-v3 .secondary-link {
  min-height: 38px;
  padding: 8px 14px;
  font-weight: 700;
}

.account-page-flow-v3 .summary-cards-tight .stat-tile {
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

@media print {
  .workspace-header {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    box-shadow: none !important;
    background: transparent !important;
    padding-bottom: 8px !important;
  }

  .workspace-content {
    padding-top: 0 !important;
  }
}

/* ---------- Beta readiness + first-run flow slice 1 ---------- */

.progress-shell {
  display: grid;
  gap: 8px;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.checklist-stack {
  display: grid;
  gap: 10px;
}

.checklist-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
}

.checklist-row-done {
  background: #fbfffc;
  border-color: #dcfce7;
}

.checklist-copy {
  display: grid;
  gap: 4px;
}

.checklist-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.section-card-note {
  color: #667085;
  line-height: 1.55;
}

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

.nav-section-label {
  margin: 14px 0 8px 0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

@media (max-width: 900px) {
  .checklist-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Beta readiness + first-run flow slice 2 ---------- */

.beta-help-strip {
  display: grid;
  gap: 14px;
}

.readiness-card {
  display: grid;
  gap: 12px;
}

.readiness-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.readiness-expected {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fbfdff;
  color: #475467;
}

.qa-row {
  align-items: flex-start;
}

@media (max-width: 900px) {
  .readiness-card-top {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Small cleanup pass ---------- */

.beta-help-strip {
  display: grid;
  gap: 14px;
}

.readiness-card {
  display: grid;
  gap: 12px;
}

.readiness-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.readiness-expected {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fbfdff;
  color: #475467;
}

.qa-row {
  align-items: flex-start;
}

@media (max-width: 900px) {
  .readiness-card-top {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Investments: holdings layout polish ---------- */

.investment-page-intro {
  margin-top: -4px;
  margin-bottom: 18px;
  max-width: 760px;
}

.investments-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #667085;
  margin-bottom: 8px;
}

.investments-holdings-top {
  grid-template-columns: minmax(280px, 0.8fr) minmax(340px, 1.2fr);
  align-items: start;
}

.investments-compact-card,
.investments-helper-card,
.investments-main-form-card {
  display: grid;
  gap: 12px;
}

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

.investments-form-grid {
  display: grid;
  gap: 14px;
}

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

.investments-field {
  display: grid;
  gap: 8px;
}

.investments-field textarea {
  min-height: 108px;
}

.investments-data-grid {
  margin-top: 2px;
}

.investments-empty-panel {
  margin: 0;
}

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

@media (max-width: 980px) {
  .investments-holdings-top,
  .investments-form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Investments: watchlist layout polish ---------- */

.investments-watchlist-top {
  grid-template-columns: minmax(420px, 1.15fr) minmax(280px, 0.85fr);
  align-items: start;
}

.watchlist-actions {
  display: grid;
  gap: 8px;
  min-width: 110px;
}

.watch-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #344054;
}

.watch-priority-high {
  background: #fff1f3;
  border-color: #fecdd3;
  color: #b42318;
}

.watch-priority-normal {
  background: #f5f8ff;
  border-color: #dbeafe;
  color: #1d4ed8;
}

.watch-priority-low {
  background: #f8fafc;
  border-color: #e5e7eb;
  color: #475467;
}

.watch-status-active {
  background: #ecfdf3;
  border-color: #b7ebc6;
  color: #067647;
}

.watch-status-paused {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #b54708;
}

.watch-status-closed {
  background: #f2f4f7;
  border-color: #d0d5dd;
  color: #475467;
}

@media (max-width: 980px) {
  .investments-watchlist-top {
    grid-template-columns: 1fr;
  }
}

/* ---------- Investments: overview / hub polish ---------- */

.investments-hero-callout {
  display: grid;
  gap: 14px;
}

.investments-overview-top {
  grid-template-columns: minmax(360px, 1.15fr) minmax(320px, 0.85fr);
  align-items: start;
}

.investments-step-list {
  display: grid;
  gap: 10px;
}

.investments-step-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fbfdff;
}

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

.investment-shortcut-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  text-decoration: none;
  color: inherit;
}

.investment-shortcut-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.investments-about-card {
  display: grid;
  gap: 8px;
}

@media (max-width: 980px) {
  .investments-overview-top,
  .investments-shortcut-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Investments: table-density polish ---------- */

.subs-table-compact th,
.subs-table-compact td {
  padding: 10px 12px;
  vertical-align: top;
}

.investments-table-compact {
  font-size: 14px;
}

.table-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #667085;
  line-height: 1.35;
}

.compact-button {
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.action-stack-compact {
  display: grid;
  gap: 8px;
  min-width: 170px;
}

.inline-price-editor {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-price-editor input {
  width: 84px;
  min-width: 84px;
}

.action-chip-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.action-chip-row-wrap {
  max-width: 180px;
}

.reconcile-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  border: 1px solid #e5e7eb;
}

.reconcile-badge-matched {
  background: #ecfdf3;
  border-color: #b7ebc6;
  color: #067647;
}

.reconcile-badge-different {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #b54708;
}

.reconcile-badge-manual_only,
.reconcile-badge-imported_only {
  background: #f5f8ff;
  border-color: #dbeafe;
  color: #1d4ed8;
}

@media (max-width: 980px) {
  .inline-price-editor {
    align-items: stretch;
  }

  .inline-price-editor input {
    width: 100%;
  }
}

/* ---------- Investments: watchlist final cleanup ---------- */

.watchlist-table-tight th,
.watchlist-table-tight td {
  padding-top: 10px;
  padding-bottom: 10px;
  vertical-align: top;
}

.watch-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 170px;
}

.watch-action-button {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d0d5dd;
  background: #ffffff;
  color: #344054;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.watch-action-button:hover {
  background: #f8fafc;
  border-color: #98a2b3;
}

.watch-action-danger {
  color: #b42318;
  border-color: #fecdca;
  background: #fff5f3;
}

.watch-action-danger:hover {
  background: #fef3f2;
  border-color: #fda29b;
}

/* ---------- Investments: watchlist final cleanup ---------- */

.watchlist-table-tight th,
.watchlist-table-tight td {
  padding-top: 10px;
  padding-bottom: 10px;
  vertical-align: top;
}

.watch-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 170px;
}

.watch-action-button {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d0d5dd;
  background: #ffffff;
  color: #344054;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.watch-action-button:hover {
  background: #f8fafc;
  border-color: #98a2b3;
}

.watch-action-danger {
  color: #b42318;
  border-color: #fecdca;
  background: #fff5f3;
}

.watch-action-danger:hover {
  background: #fef3f2;
  border-color: #fda29b;
}
