/* Shared mobile layout safeguards for every application screen. */
*, *::before, *::after { box-sizing: border-box; }
html, body, #root { max-width: 100%; min-width: 0; }
body { overflow-x: hidden; }
.transaction-date-sort { display:inline-flex; align-items:center; gap:6px; min-height:36px; padding:4px 2px; border:0; border-radius:4px; background:transparent; color:inherit; font:inherit; font-weight:600; cursor:pointer; }
.transaction-date-sort svg { color:#0284c7; flex-shrink:0; }
.transaction-date-sort:hover { color:#0284c7; }
.transaction-date-sort:focus-visible { outline:2px solid #0284c7; outline-offset:3px; }
.dashboard-balances { min-width:0; }
.dashboard-balances [data-balance] { overflow-wrap:anywhere; }
.csv-mapping { width:min(720px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); margin:auto; padding:24px; border:0; border-radius:12px; background:#fff; color:#0f172a; overflow:auto; }
.csv-mapping::backdrop { background:rgba(15,23,42,.55); }
.csv-mapping h2 { margin:0 0 8px; font-size:20px; font-weight:700; }
.csv-mapping h3 { margin:20px 0 8px; font-size:14px; font-weight:600; }
.csv-mapping p { margin:0 0 16px; color:#64748b; font-size:13px; line-height:1.6; }
.csv-mapping label { display:block; font-size:13px; font-weight:600; }
.csv-mapping select { display:block; width:100%; min-height:40px; margin:6px 0 0; padding:8px; border:1px solid #cbd5e1; border-radius:8px; background:white; font-size:13px; }
.csv-column-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:16px; }
.csv-preview-wrap { overflow:auto; }
.csv-preview-wrap table { width:100%; border-collapse:collapse; font-size:12px; }
.csv-preview-wrap th, .csv-preview-wrap td { padding:8px; border-bottom:1px solid #e2e8f0; text-align:left; white-space:nowrap; max-width:240px; overflow:hidden; text-overflow:ellipsis; }
.csv-mapping p.csv-map-error { color:#be123c; margin:12px 0; }
.csv-map-actions { display:flex; justify-content:flex-end; gap:8px; }
.csv-map-actions button { padding:10px 16px; border:1px solid #cbd5e1; border-radius:8px; cursor:pointer; }
.csv-map-actions .csv-map-continue { background:#0f172a; color:#fff; border-color:#0f172a; }
@media(max-width:480px) { .csv-column-fields { grid-template-columns:1fr; } .csv-mapping { padding:16px; } }
header.no-print { gap:.5rem; }
header.no-print > div:first-child { min-width:0; flex:1 1 auto; }
header.no-print > div:first-child > div:last-child { min-width:0; }
header.no-print > div:first-child p { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
header.no-print > div:last-child { flex-shrink:0; }
.recharts-tooltip-wrapper[style*="visibility: hidden"] { display:none; }
.month-picker { position:fixed; z-index:100; width:280px; padding:12px; border:1px solid #e2e8f0; border-radius:12px; background:white; color:#0f172a; box-shadow:0 8px 28px #0f172a18; }
.month-picker-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.month-picker-heading label { font-size:13px; font-weight:600; color:#475569; }
.month-picker-heading select { min-height:40px; min-width:120px; padding:8px 12px; border:1px solid #e2e8f0; border-radius:8px; background:#f8fafc; font-size:14px; color:#0f172a; }
.month-picker button { border:0; border-radius:8px; background:transparent; min-height:42px; cursor:pointer; font-size:14px; }
.month-picker-heading button { width:42px; font-size:24px; }
.month-picker-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.month-picker button:hover:not(:disabled) { background:#f1f5f9; }
.month-picker button[aria-pressed="true"] { background:#0284c7; color:white; font-weight:600; }
.month-picker button:disabled { opacity:.3; cursor:default; }
.month-picker button:focus-visible { outline:2px solid #0284c7; outline-offset:2px; }
.month-picker p { margin:12px 0 0; font-size:11px; text-align:center; color:#64748b; }
[data-slot="card"] { border: 0 !important; border-radius: 8px !important; box-shadow: none !important; }
.annual-page { color: #0f172a; }
.annual-page-header { display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; margin-bottom:1.25rem; }
.annual-eyebrow { margin:0 0 .25rem; color:#0284c7; font-size:.7rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }
.annual-page h1 { margin:0; font-size:clamp(1.5rem,3vw,2rem); font-weight:800; }
.annual-description { margin:.25rem 0 0; color:#64748b; font-size:.875rem; }
.annual-controls { display:flex; align-items:center; gap:.5rem; }
.annual-controls label { color:#64748b; font-size:.75rem; font-weight:600; }
.annual-controls select, .annual-back, .annual-print { min-height:2.25rem; border:1px solid #cbd5e1; border-radius:8px; background:#fff; padding:.4rem .65rem; color:#0f172a; font-size:.8rem; }
.annual-back, .annual-print { cursor:pointer; font-weight:600; transition:background-color 160ms ease,border-color 160ms ease; }
.annual-back:hover, .annual-print:hover { background:#f8fafc; border-color:#94a3b8; }
.annual-table-card { border-radius:12px; background:#fff; padding:1.25rem; }
.annual-table-card h2 { margin:0; font-size:1rem; }
.annual-table-card > p { margin:.35rem 0 1rem; color:#64748b; font-size:.8rem; }
.annual-table-wrap { overflow-x:auto; }
.annual-table-card table { width:100%; border-collapse:collapse; font-size:.8rem; }
.annual-table-card th, .annual-table-card td { padding:.7rem .5rem; border-bottom:1px solid #e2e8f0; text-align:right; white-space:nowrap; }
.annual-table-card th:first-child, .annual-table-card td:first-child { text-align:left; }
.annual-report-grid { display:grid; grid-template-columns:minmax(0,562px); gap:1.25rem; }
.annual-table-card { margin-top:1.25rem; }
[hidden] { display:none !important; }
.annual-profit-card { border-radius:12px; background:#fff; padding:1.25rem; }
.annual-profit-card h2 { margin:0 0 1rem; font-size:1rem; font-weight:600; }
.annual-summary-row, .annual-summary-total { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.75rem .6rem; }
.annual-summary-row { color:#475569; font-size:.875rem; }
.annual-summary-row strong { font-weight:700; }
.annual-positive { color:#047857; } .annual-negative { color:#e11d48; }
.annual-summary-total { margin-top:.4rem; border-radius:12px; background:#020617; color:#fff; font-weight:700; }
.annual-export { min-height:2.25rem; border:0; border-radius:8px; background:#0f172a; padding:.4rem .75rem; color:#fff; font-size:.8rem; font-weight:600; cursor:pointer; }
.annual-loading { padding:3rem 1rem; color:#64748b; text-align:center; }
@media (max-width: 767px) { .annual-page-header { align-items:stretch; flex-direction:column; } .annual-controls { flex-wrap:wrap; } .annual-report-grid { grid-template-columns:1fr; gap:.75rem; } }
@media print { .annual-controls, header.no-print, [data-sidebar="sidebar"] { display:none !important; } .annual-page { color:#000; } }
[data-slot="sidebar-trigger"] svg { transform: rotate(0deg); transition: transform 180ms ease, opacity 180ms ease; }
[data-state="collapsed"] [data-slot="sidebar-trigger"] svg { transform: rotate(180deg); }
[data-slot="sidebar-trigger"]:active svg { opacity: .65; transform: scale(.9); }
img, svg, video, canvas { max-width: 100%; }
button, input, select, textarea { max-width: 100%; }

@media (max-width: 767px) {
  .no-print.flex { flex-wrap:wrap; }
  main[data-slot="sidebar-inset"] { padding:0 !important; }
  .annual-host { min-width:0; width:100%; padding:8px !important; }
  .annual-profit-card, .annual-table-card { border-radius:8px; }
  [data-slot="sidebar"][data-mobile="true"] { transition: opacity 180ms ease, transform 220ms cubic-bezier(.22,1,.36,1); }
  [data-slot="sidebar"][data-mobile="true"] [data-slot="sidebar-menu-button"] { transition: background-color 160ms ease, color 160ms ease, transform 160ms ease; }
  [data-slot="sidebar"][data-mobile="true"] [data-slot="sidebar-menu-button"]:active { transform: scale(.985); }
  [data-slot="sidebar"][data-mobile="true"] ~ [data-slot="dialog-overlay"] { transition: opacity 180ms ease; }
  .mobile-sidebar-close { display:grid; place-items:center; position:absolute; top:.75rem; right:.75rem; z-index:2; width:2rem; height:2rem; border:0; border-radius:.5rem; background:rgba(255,255,255,.08); color:#e2e8f0; font-size:1.5rem; line-height:1; cursor:pointer; transition:background-color 160ms ease,transform 160ms ease; }
  .mobile-sidebar-close:hover { background:rgba(255,255,255,.16); }
  .mobile-sidebar-close:active { transform:scale(.92); }
  [data-slot="sidebar-header"] { position:relative; padding-right:3.25rem !important; }
  header.no-print { min-height: 4rem; height: auto !important; gap: .5rem !important; padding: .5rem .75rem !important; }
  header.no-print > div:first-child { min-width: 0; flex: 1 1 auto; gap: .5rem !important; }
  header.no-print > div:first-child > div:last-child { min-width: 0; }
  header.no-print > div:first-child > div:last-child p:first-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; }
  header.no-print > div:last-child { flex: 0 0 auto; min-width: 0; gap: .35rem !important; }
  header.no-print [role="combobox"], #report-month-trigger { width: clamp(7rem, 34vw, 9.25rem) !important; min-width: 0 !important; padding-left: .5rem !important; padding-right: .5rem !important; overflow: hidden; }
  header.no-print [role="combobox"] > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  header.no-print button[aria-label="Record transaction"] { flex: 0 0 2.25rem; }
  main { min-width: 0 !important; width: 100% !important; padding: 8px !important; }
  [data-sidebar="sidebar"] { max-width: 85vw; }
  [role="dialog"]:not(.month-picker) { width: calc(100vw - 1rem) !important; max-width: calc(100vw - 1rem) !important; max-height: calc(100vh - 1rem) !important; margin: .5rem !important; }
  [role="dialog"] > div { max-width: 100%; }
  table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { white-space: nowrap; }
  input, select, textarea { min-width: 0; }
  textarea { width: 100%; }
  h1 { overflow-wrap: anywhere; }
  .recharts-responsive-container { min-width: 0 !important; }
  .recharts-wrapper { overflow:hidden; }
}
@media (max-width: 359px) {
  header.no-print > div:first-child > div:last-child { display:none; }
  #csv-upload-button { padding:8px 6px !important; font-size:11px !important; }
}

@media (min-width: 768px) {
  [data-slot="card"] { border-radius: 12px !important; }
}
