<% content_for :page_header do %>

<%= t("pages.dashboard.welcome", name: Current.user.first_name) %>

<%= t("pages.dashboard.subtitle") %>

<%= render DS::Link.new( icon: "plus", text: t("pages.dashboard.new"), href: new_account_path, frame: :modal, class: "hidden lg:inline-flex" ) %> <%= render DS::Link.new( variant: "icon-inverse", icon: "plus", href: new_account_path, frame: :modal, class: "rounded-full lg:hidden" ) %>
<% end %> <%= turbo_frame_tag "dashboard_sections", target: "_top" do %> <% if accessible_accounts.any? %>
<%= render UI::PeriodPicker.new(selected: @period, url: root_path, frame: "dashboard_sections") %>
<% end %> <% two_column = Current.user.dashboard_two_column? %>
gap-6 pb-6 lg:pb-12" data-controller="dashboard-sortable dashboard-masonry" data-action="dragover->dashboard-sortable#dragOver drop->dashboard-sortable#drop" role="list" aria-label="<%= t("pages.dashboard.sections_aria_label") %>"> <% if accessible_accounts.any? %> <% @dashboard_sections.each do |section| %> <% next unless section[:visible] %>
" style="<%= "--dash-widget-h: #{section[:layout][:height_px]}px;" if section[:layout][:grow] %>" data-dashboard-sortable-target="section" data-section-key="<%= section[:key] %>" data-controller="dashboard-section<%= " cashflow-expand" if section[:key] == "cashflow_sankey" %>" data-dashboard-section-section-key-value="<%= section[:key] %>" data-dashboard-section-collapsed-value="<%= Current.user.dashboard_section_collapsed?(section[:key]) %>" draggable="true" tabindex="0" role="listitem" aria-grabbed="false" aria-label="<%= t(section[:title]) %> section. Press Enter or Space to grab for reordering, then use arrow keys to move." data-action=" dragstart->dashboard-sortable#dragStart dragend->dashboard-sortable#dragEnd touchstart->dashboard-sortable#touchStart touchmove->dashboard-sortable#touchMove touchend->dashboard-sortable#touchEnd touchcancel->dashboard-sortable#touchEnd keydown->dashboard-sortable#handleKeyDown">

<%= t(section[:title]) %>

<% if section[:key] == "cashflow_sankey" && section[:locals][:sankey_data][:links].present? %> <% end %> <% layout = section[:layout] %> <% show_width = layout[:width_toggle] && two_column %> <% if layout[:grow] || show_width %> <% end %> <%# A grab surface, not a button — clicking it does nothing. It keeps cursor-grab and the colour shift, and deliberately skips the hover background the other header controls use: a filled hover state reads as "clickable" and would promise a click that never lands. Still sized to the same 24px box so the icons stay aligned. %>
<%= render partial: section[:partial], locals: section[:locals] %>
<% end %> <% else %>
<%= render "pages/dashboard/no_accounts_graph_placeholder" %>
<% end %>
<% end %>