/* home pages: Home and Reminders. */

/* ───────── shared pieces (also used by reports and vehicles) ───────── */
.icon-tile { display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; flex: none; background: var(--info-bg); color: var(--info); }
.icon-tile.good { background: var(--good-bg); color: var(--good); }
.icon-tile.bad { background: var(--bad-bg); color: var(--bad); }
.icon-tile.warn { background: var(--warn-bg); color: var(--warn); }
.icon-tile.accent { background: var(--accent-bg); color: var(--accent-dark); }
.icon-tile.plum { background: #F7E6F2; color: #8E2F7C; }
.icon-tile.muted { background: var(--muted-bg); color: var(--text2); }
.dash-card { display: flex; flex-direction: column; gap: 10px; }
.dash-head { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.dash-head h2 { flex: 1; color: var(--navy); }
.dash-mark { width: 3px; height: 16px; border-radius: 2px; background: var(--accent); flex: none; }
.caption-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text2); }
.action-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; color: inherit; text-decoration: none; border-radius: 8px; min-height: 56px; }
.action-row.top { align-items: flex-start; }
a.action-row:hover { background: #F7F9FD; }
.row-title { display: block; font-weight: 700; overflow-wrap: anywhere; }
.row-sub { display: block; color: var(--text2); font-size: 12.5px; }
.row-owes { display: flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; }
.row-line { display: flex; align-items: flex-start; gap: 8px; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex: none; }
.action-chip { flex: none; background: var(--info-bg); color: var(--navy); font-weight: 800; font-size: 12.5px; border-radius: 999px; padding: 5px 12px; }
.profit-eye.on-dark { color: rgba(255, 255, 255, .85); }
.profit-eye.on-dark:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ───────── Home ───────── */
.home-bell { position: relative; border: 1px solid var(--line); background: var(--surface); }
.bell-badge { position: absolute; top: -5px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }

.hero { background: linear-gradient(150deg, var(--navy) 0%, var(--navy-dark) 100%); color: #fff; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.hero .chip { background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff; font-weight: 500; }
.hero .chip:hover { background: rgba(255, 255, 255, .2); }
.hero .chip.on { background: var(--accent); color: var(--navy-dark); font-weight: 700; }
.hero-label { color: rgba(255, 255, 255, .8); font-weight: 600; }
.hero-big { font-size: 52px; font-weight: 800; line-height: 1; }
.hero-note { color: rgba(255, 255, 255, .75); font-size: 12.5px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr); gap: 10px; }
.money-side { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; min-width: 0; }
.money-side:hover { background: rgba(255, 255, 255, .15); }
.side-label { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.money-side.in .side-label { color: #8FD3A8; }
.money-side.out .side-label { color: #9DC0FF; }
.side-value { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.side-bar span { display: block; height: 100%; border-radius: 3px; }
.money-side.in .side-bar span { background: #8FD3A8; }
.money-side.out .side-bar span { background: #9DC0FF; }
.side-caption { color: #BFD0EE; font-size: 12px; }
.side-note { color: #BFD0EE; font-size: 12px; font-weight: 700; }
.side-note.alert { color: #FFB4AB; }
.hero-profit { padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .1); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hero-accent { color: var(--accent); font-weight: 700; }
.hero-dates { color: rgba(255, 255, 255, .7); font-size: 12px; }
.hero-profit-value { font-size: 36px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hero-profit-value.masked { font-size: 28px; }
.hero-hint { color: rgba(255, 255, 255, .7); font-size: 12.5px; }
.hero-change { display: flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .85); font-size: 13px; }
.change-dot { display: inline-flex; padding: 3px; border-radius: 50%; color: #fff; }
.change-dot.up { background: #0F8A4B; }
.change-dot.down { background: var(--bad); }
.home-body { display: flex; flex-direction: column; gap: 16px; }
.hero-parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.hero-part { display: flex; flex-direction: column; padding: 9px 11px; border-radius: 12px; background: rgba(255, 255, 255, .1); min-width: 0; }
.part-label { color: rgba(255, 255, 255, .75); font-size: 12px; }
.part-value { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.part-note { color: rgba(255, 255, 255, .6); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-week { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: rgba(245, 158, 11, .16); color: #FFE2B3; text-decoration: none; font-weight: 700; font-size: 13px; }
.hero-week > .icon:first-child { color: #F2B84B; }
.hero-week b { color: var(--accent); font-weight: 800; }
.hero-week .icon:last-child { color: var(--accent); }
.hero-week:hover { background: rgba(245, 158, 11, .24); }
@media (max-width: 1180px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hero-profit { grid-column: 1 / -1; }
  .hero-parts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .hero { padding: 14px; border-radius: 16px; }
  .hero-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-value { font-size: 20px; }
  .money-side { padding: 12px; }
}

.home-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.home-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* On a phone the cards follow the app's order: actions, loads, do today, profit, parties, payments. */
@media (max-width: 900px) {
  .home-cols { display: flex; flex-direction: column; }
  .home-col { display: contents; }
  .home-col > .quick-actions { order: 1; }
  .home-col > .pipeline { order: 2; }
  .home-col > .do-today { order: 3; }
  .home-col > .trend-card { order: 4; }
  .home-col > .top-parties { order: 5; }
  .home-col > .recent-payments { order: 6; }
}

.quick-actions { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); padding: 12px 6px; }
.quick { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 13px; text-align: center; }
.quick:hover { background: var(--muted-bg); }
.quick-icon { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--info-bg); color: var(--navy); }
.quick.main .quick-icon { background: var(--accent); color: var(--on-accent); }
.all-done { gap: 10px; }

.pipe-bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: var(--muted-bg); }
.pipe-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.pipe-count { display: flex; flex-direction: column; padding: 6px 4px; border-radius: 8px; color: inherit; text-decoration: none; min-width: 0; }
.pipe-count:hover { background: var(--muted-bg); }
.pipe-count b { font-size: 22px; font-weight: 700; }
.pipe-count span { display: flex; align-items: flex-start; gap: 5px; color: var(--text2); font-size: 12px; }
.pipe-count i { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex: none; }
.pipe-cancelled { display: flex; padding: 8px 4px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }

.trend { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 150px auto; column-gap: 8px; row-gap: 6px; }
.trend-axis { position: relative; font-size: 11.5px; color: var(--text2); min-width: 44px; text-align: right; }
.trend-axis span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; }
.trend-axis span:first-child { top: 0; }
.trend-plot { position: relative; display: flex; gap: 6px; border-top: 1px dashed var(--line); }
.trend-zero { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line-strong); }
.trend-col { position: relative; flex: 1; outline: none; border-radius: 4px; }
.trend-col:hover, .trend-col:focus-visible { background: var(--muted-bg); }
.trend-bar { position: absolute; left: 18%; right: 18%; background: var(--navy-light); border-radius: 4px 4px 0 0; min-height: 0; }
.trend-bar.loss { background: var(--bad); border-radius: 0 0 4px 4px; }
.trend-bar.latest { background: var(--accent); }
.trend-tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--navy-dark); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 8px; white-space: nowrap; z-index: 5; pointer-events: none; box-shadow: var(--shadow-lg); }
.trend-tip b { display: block; font-size: 13px; }
.trend-col:hover .trend-tip, .trend-col:focus-visible .trend-tip { display: block; }
.trend-col:first-child .trend-tip { left: 0; transform: none; }
.trend-col:last-child .trend-tip { left: auto; right: 0; transform: none; }
.trend-x { grid-column: 2; display: flex; gap: 6px; font-size: 11px; color: var(--text2); }
.trend-x span { flex: 1; text-align: center; white-space: nowrap; overflow: visible; }
.trend-hidden { padding: 8px 0; }

/* ───────── Reminders ───────── */
.reminder-group { display: flex; flex-direction: column; gap: 8px; }
.reminder { display: flex; align-items: center; gap: 14px; padding: 12px 16px; position: relative; }
.reminder::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line-strong); }
.reminder.urgent::before { background: var(--bad); }
.reminder.soon::before { background: var(--accent); }
.reminder-main { flex: 1; min-width: 0; }
.reminder-actions { display: flex; gap: 8px; flex: none; }
.reminder .pill { flex: none; }
.card.reminder-list { overflow: hidden; }
@media (max-width: 700px) {
  .reminder { flex-wrap: wrap; }
  .reminder-main { flex: 1 1 0%; }
  .reminder { align-items: flex-start; }
  .reminder-actions { flex: 1 1 100%; }
  .reminder-actions .btn { flex: 1; }
}
