/* AMOSHA UX polish v2 — finance-first density and calmer navigation */

/* Sidebar: keep the collapse affordance near the brand instead of in the footer. */
.sidebar-brand-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 4px 22px;
}
.sidebar-brand-row .brand {
  min-width: 0;
  flex: 1;
  margin: 0;
}
.sidebar-brand-row .sidebar-collapse-toggle {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.sidebar-brand-row .sidebar-collapse-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}
.app.sidebar-collapsed .sidebar-brand-row {
  justify-content: center;
  margin-inline: 0;
}
.app.sidebar-collapsed .sidebar-brand-row .brand {
  flex: 0 0 auto;
}
.app.sidebar-collapsed .sidebar-brand-row .sidebar-collapse-toggle {
  position: absolute;
  top: 58px;
  left: 21px;
  width: 30px;
  height: 30px;
}
.app.sidebar-collapsed .navigation {
  margin-top: 34px;
}

/* Logout stays reachable when the sidebar is collapsed. Expanded mode keeps the
   familiar text label; collapsed mode turns the same control into an icon button. */
#logout-button .logout-icon {
  display: none;
}
.app.sidebar-collapsed .sidebar-footer #logout-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  border-radius: 9px;
}
.app.sidebar-collapsed #logout-button .logout-label {
  display: none;
}
.app.sidebar-collapsed #logout-button .logout-icon {
  display: inline-grid;
}

/* Finance shell: fewer competing visual layers and better use of desktop width. */
.content.finance-content {
  padding-top: 20px;
}
.finance-focused-toolbar {
  gap: 16px;
  margin-bottom: 14px;
  padding-block: 8px;
}
.finance-toolbar-left {
  gap: 14px;
}
.finance-period-actions {
  gap: 7px;
}
.finance-period-actions .button.secondary {
  box-shadow: none;
  background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
}
.finance-view-switch {
  padding: 3px;
  border-radius: 10px;
}
.finance-view-switch button {
  min-width: 88px;
}

/* Bank-like operations view. */
.finance-operations-workspace {
  width: min(1180px, 100%);
  margin: 0 auto;
}
.finance-feed-toolbar {
  gap: 12px;
  margin-bottom: 12px;
  padding-block: 6px 10px;
}
.finance-feed-toolbar .search input {
  min-height: 42px;
  border-radius: 11px;
}
.finance-feed {
  gap: 18px;
}
.finance-day-header {
  align-items: center;
  padding: 0 4px 7px;
}
.finance-day-header > div strong {
  font-size: 13px;
  letter-spacing: -.01em;
}
/* The long day label already contains the date; the second date was visual duplication. */
.finance-day-header > div > span {
  display: none;
}
.finance-day-total {
  font-size: 12px;
  font-weight: 650;
}
.finance-feed-card {
  border-radius: 14px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 3%), 0 8px 26px rgb(0 0 0 / 3%);
}
.finance-feed-item {
  min-height: 68px;
  grid-template-columns: 5px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 12px 16px 12px 14px;
}
.finance-feed-marker {
  width: 4px;
  height: 38px;
}
.finance-feed-copy {
  gap: 4px;
}
.finance-feed-copy strong {
  font-size: 14px;
  font-weight: 680;
  letter-spacing: -.01em;
}
.finance-feed-copy small {
  font-size: 11px;
}
.finance-feed-meta {
  gap: 2px;
}
.finance-feed-meta strong {
  font-size: 14px;
  font-weight: 760;
}
.finance-feed-meta small.finance-currency-redundant {
  display: none;
}
.finance-feed-item:hover {
  background: color-mix(in srgb, var(--accent) 4%, var(--surface-solid));
}

/* Analytics should feel like a dashboard, not one oversized chart. */
.finance-metrics,
.finance-overview-grid {
  width: min(1380px, 100%);
  margin-inline: auto;
}
.finance-overview-grid {
  grid-template-columns: minmax(560px, 1.45fr) minmax(310px, .55fr);
  gap: 14px;
  margin-top: 14px;
}
.finance-chart-card,
.finance-side {
  height: clamp(410px, 49vh, 510px);
}
.finance-donut {
  width: min(310px, 82%);
}
.finance-donut-center strong {
  font-size: 19px;
}

/* Transaction entry: make the amount the visual anchor and batch entry less tiring. */
.modal.finance-entry-modal {
  width: min(590px, 100%);
}
.finance-entry-modal .modal-body {
  padding-top: 16px;
}
.finance-entry-form .finance-amount-field {
  grid-column: 1 / -1;
}
.finance-entry-form .finance-amount-field input {
  min-height: 54px;
  padding: 8px 14px;
  font-size: 25px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
}
.finance-entry-form .finance-amount-field > span {
  margin-bottom: 5px;
}
.finance-entry-modal .modal-footer {
  align-items: center;
}
.finance-entry-modal .modal-footer > div:last-child {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.finance-entry-modal .finance-save-next {
  order: 3;
}
.finance-entry-modal [data-modal-save] {
  order: 2;
}
.finance-entry-modal [data-modal-cancel] {
  order: 1;
}
.finance-entry-modal .button.primary.finance-save-next {
  min-width: 172px;
}
.finance-entry-modal [data-modal-save].button.secondary {
  background: var(--surface-solid);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: none;
}
.finance-entry-hint {
  grid-column: 1 / -1;
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 1050px) {
  .sidebar-brand-row .sidebar-collapse-toggle { display: none; }
  .finance-operations-workspace { width: 100%; }
  .finance-chart-card, .finance-side { height: auto; }
}

@media (max-width: 720px) {
  .finance-feed-item {
    min-height: 64px;
    padding: 10px 12px;
  }
  .finance-feed-copy strong,
  .finance-feed-meta strong {
    font-size: 13px;
  }
  .finance-entry-form .finance-amount-field {
    grid-column: auto;
  }
  .finance-entry-modal .modal-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .finance-entry-modal .modal-footer > div:last-child {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .finance-entry-modal .finance-save-next {
    grid-column: 1 / -1;
  }
  .finance-entry-modal .button.primary.finance-save-next {
    min-width: 0;
  }
}
