/* Application mobile celduc® — ergonomie inspirée de N2F : la dépense d'abord, le scan en un geste */
.shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: calc(10px + env(safe-area-inset-top)) 12px 10px 16px; display: flex; align-items: center; gap: 8px; min-height: 58px; }
.topbar h1 { font-size: 19px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .brand { font-size: 15px; color: var(--muted); }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; font-size: 24px; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn .badge { top: 4px; left: auto; right: 4px; }
main.view { flex: 1; padding: 14px 16px calc(104px + env(safe-area-inset-bottom)); width: 100%; max-width: 640px; margin: 0 auto; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 10px; color: var(--faint); font-size: 11px; font-weight: 650; position: relative; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--accent-hover); }
[data-theme="light"] .tabbar a.on { color: var(--accent); }
.badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; }
.fab { position: fixed; right: 18px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 15; width: 62px; height: 62px; border-radius: 50%; border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; box-shadow: 0 10px 28px rgba(106, 39, 166, .55); display: grid; place-items: center; cursor: pointer; }
.fab svg { width: 30px; height: 30px; }

/* Accueil : à envoyer + liste des dépenses par mois */
.hero { padding: 16px; margin-bottom: 14px; background: linear-gradient(135deg, rgba(155, 77, 219, .22), rgba(106, 39, 166, .10)), var(--surface); border-color: rgba(155, 77, 219, .35); }
.hero .k { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.hero .v { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 2px 0 10px; }
.send-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.send-row .t { font-weight: 650; } .send-row .s { font-size: 12px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 650; color: var(--muted); }
.month-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 18px 2px 8px; }
.list { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.list > * { min-width: 0; }
.item { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 13px 14px; color: var(--ink); }
.item-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.item-title { font-weight: 650; }
.item-amount { font-weight: 750; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-sub { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.item-sub > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub > :last-child { flex: none; }
.item-top > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.item-amount { flex: none; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 18px 2px 8px; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.summary .card { padding: 12px 14px; }
.summary .k { font-size: 12px; color: var(--muted); font-weight: 650; }
.summary .v { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }

.line { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px 12px; color: var(--ink); cursor: pointer; }
.line.refused { opacity: .55; } .line.refused .item-amount { text-decoration: line-through; }
.thumb { flex: none; width: 48px; height: 48px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); object-fit: cover; display: grid; place-items: center; color: var(--accent-hover); font-size: 11px; font-weight: 800; overflow: hidden; }
.thumb svg { width: 22px; height: 22px; }
.line-main { flex: 1; min-width: 0; }
.line-main .item-title, .line-main .desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.refuse-box { margin-top: 8px; display: none; } .refuse-on .refuse-box { display: block; }

/* Feuille d'actions du bouton + */
.sheet-actions { display: grid; gap: 10px; }
.sheet-actions button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 650; font-size: 16px; cursor: pointer; text-align: left; }
.sheet-actions button:hover { border-color: var(--accent); }
.sheet-actions .ic { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-hover); }
[data-theme="light"] .sheet-actions .ic { color: var(--accent); }
.sheet-actions .ic svg { width: 24px; height: 24px; }
.sheet-actions .main { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-color: transparent; color: #fff; }
.sheet-actions .main .ic { background: rgba(255,255,255,.18); color: #fff; }
.sheet-actions small { display: block; font-weight: 500; font-size: 13px; opacity: .75; }
.reading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 0 8px; text-align: center; font-weight: 650; }

/* Saisie d'une dépense */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.cat-grid button { min-height: 46px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; padding: 6px 10px; cursor: pointer; text-align: left; }
.cat-grid button.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.photo-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 130px; border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg); background: var(--surface); color: var(--muted); cursor: pointer; text-align: center; padding: 12px; margin-bottom: 14px; font-weight: 650; }
.photo-zone img { max-height: 240px; max-width: 100%; border-radius: 8px; }
.photo-zone svg { width: 32px; height: 32px; color: var(--accent-hover); }
.amount-input { font-size: 26px !important; font-weight: 750; min-height: 56px !important; font-variant-numeric: tabular-nums; }
.sticky-actions { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); padding-top: 12px; background: linear-gradient(transparent, var(--bg) 35%); }
.offline-bar { background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 650; padding: 7px 16px; text-align: center; }
.receipt-full { width: 100%; border-radius: 10px; }
.receipt-pdf { width: 100%; height: 70vh; border: 0; border-radius: 10px; background: #fff; }
