/* Eterano v1.6.3 — mobile layout and navigation polish */

/* Accounting reports must be allowed to shrink inside the mobile viewport. */
#view-accounting,
#view-accounting .accounting-tab-pane,
#accountingReportsPane,
.reports-root,
.reports-root > *,
#reportContent,
.reports-two-grid,
.reports-head-card,
.reports-head-copy,
.reports-controls,
.reports-trend-card,
.reports-export-card{
  min-width:0;
  max-width:100%;
}
#view-accounting{overflow-x:clip}
.reports-root .panel{min-width:0}
.reports-head-copy p,
.reports-warning,
.reports-export-card p{overflow-wrap:anywhere}
.reports-controls label,
.reports-controls select{max-width:100%}
.report-monthly-chart{
  width:100%;
  max-width:100%;
  min-width:0;
  overscroll-behavior-inline:contain;
}

@media(max-width:760px){
  /* The full month remains useful on phones, but it must follow dark mode. */
  #view-calendar .calendar-toolbar{min-width:0}
  #view-calendar .calendar-toolbar h2{
    min-width:0;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  html[data-theme="dark"] #view-calendar{
    color:#eef5ff;
    background:linear-gradient(180deg,#071126 0%,#08162a 52%,#061123 100%);
  }
  html[data-theme="dark"] #view-calendar .calendar-toolbar{
    color:#eef5ff;
    background:rgba(7,17,38,.96);
    border-bottom-color:#263a57;
    box-shadow:0 8px 24px rgba(0,0,0,.24);
  }
  html[data-theme="dark"] #view-calendar .calendar-toolbar h2{color:#eef5ff}
  html[data-theme="dark"] #view-calendar .calendar-weekdays span{color:#95a8c4}
  html[data-theme="dark"] #view-calendar .calendar-grid{
    background:#09162a;
    border-color:#263a57;
    box-shadow:0 14px 36px rgba(0,0,0,.24);
  }
  html[data-theme="dark"] #view-calendar .calendar-day{
    color:#dce8fa;
    background:#0f2039;
  }
  html[data-theme="dark"] #view-calendar .calendar-day.outside{
    color:#7286a4;
    background:#0a172b;
    opacity:.7;
  }
  html[data-theme="dark"] #view-calendar .calendar-day.today{
    color:#fff;
    background:linear-gradient(145deg,#0d62e8,#17bdf0);
    box-shadow:0 7px 18px rgba(20,121,248,.28);
  }
  html[data-theme="dark"] #view-calendar .calendar-event{background:#2b91ff}
  html[data-theme="dark"] #view-calendar .calendar-event.requested{background:#f2a441}
  html[data-theme="dark"] #view-calendar .calendar-event.ready{background:#2bc38c}
  html[data-theme="dark"] #view-calendar .calendar-event.completed{background:#91a0b7}
  html[data-theme="dark"] #view-calendar .calendar-day.today .calendar-event{background:#fff}
  html[data-theme="dark"] #view-calendar .mobile-agenda-item{
    color:#eaf1ff;
    background:#0d1c33;
    border-color:#293e5b;
    box-shadow:0 12px 30px rgba(0,0,0,.2);
  }
  html[data-theme="dark"] #view-calendar .mobile-agenda-main > span{color:#9eb0ca}
  html[data-theme="dark"] #view-calendar .mobile-agenda-main > small{color:#70b8ff}
  html[data-theme="dark"] #view-calendar .mobile-agenda-amount{color:#eef5ff}

  /* Reports become a true single-column phone layout with contained chart scroll. */
  #accountingReportsPane{overflow-x:clip}
  .reports-root{width:100%;gap:14px}
  .reports-root .panel{width:100%;padding:18px}
  .reports-head-card{gap:18px}
  .reports-controls{
    display:grid;
    grid-template-columns:1fr;
    width:100%;
  }
  .reports-controls label,
  .reports-controls select,
  .reports-controls button{width:100%;min-width:0;grid-column:auto}
  .reports-stat-grid{grid-template-columns:1fr!important}
  .reports-two-grid{grid-template-columns:minmax(0,1fr)}
  .report-financial-row,
  .report-outstanding-total{min-width:0;flex-wrap:wrap}
  .report-financial-row span,
  .report-outstanding-total span{min-width:0;overflow-wrap:anywhere}
  .report-category-row,
  .report-outstanding-row{min-width:0}
  .reports-export-actions{grid-template-columns:1fr}
  .report-monthly-chart{
    grid-template-columns:repeat(12,50px);
    overflow-x:auto;
    padding-bottom:8px;
  }
}
