/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #e8e0d4;   /* beige-grigio caldo, meno bianco */
  --surface:    #fffcf8;
  --surface-2:  #f1e9dc;   /* pannelli secondari, leggero contrasto sul bianco puro */
  --header-bg:  #2b1c12;   /* espresso scuro, caldo e professionale */
  --header-text:#faf3ea;
  --primary:    #c1440e;   /* terracotta / arancio bruciato */
  --primary-dk: #9c3708;
  --amber:      #b8860b;   /* accento caldo per "da scalare" */
  --amber-lt:   #fdf0d5;
  --green:      #3f7d3a;
  --green-lt:   #e2efd8;
  --red:        #b3261e;
  --red-lt:     #f7e0dd;
  --text:       #241a12;
  --muted:      #6e5e4d;   /* bruno caldo, più scuro per contrasto */
  --border:     #cdbda6;
  --radius:     16px;
  --header-h:   76px;      /* altezza barra senza safe area */
  --safe-top:   env(safe-area-inset-top, 0px);
  --safe-bot:   env(safe-area-inset-bottom, 0px);
}

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, 'SF Pro Text', BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* zoom gestito via JS su html.style.zoom — nessuna classe CSS necessaria */

/* ===== LOGIN ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px 20px;
  background: var(--bg);
}

.login-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 44px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,.10);
  text-align: center;
}

.login-logo { font-size: 56px; margin-bottom: 10px; }
.login-title { font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.login-sub { color: var(--muted); margin-bottom: 36px; font-size: 15px; }

/* ===== FORMS ===== */
.field { text-align: left; margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.field input, .field input[type=file] {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 17px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  background: var(--bg);
  color: var(--text);
}
.field input:focus { border-color: var(--primary); background: #fff; }
.field input[type=file] { font-size: 15px; padding: 12px 14px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 15px 22px;
  min-height: 52px;
  border-radius: 13px;
  border: none;
  cursor: pointer;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  transition: opacity .12s, transform .1s;
  -webkit-user-select: none;
  user-select: none;
}
.btn:active { transform: scale(.97); opacity: .82; }
.btn:disabled { opacity: .45; pointer-events: none; }

.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-secondary { background: #ece2d2; color: var(--text); }
.btn-full { width: 100%; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 28px;
  padding: 0;
  min-width: 58px;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  border-radius: 14px;
  line-height: 1;
  font-family: inherit;
  font-weight: 600;
  -webkit-user-select: none;
  user-select: none;
}
.btn-icon:active { background: rgba(0,0,0,.08); }

/* icone dentro l'header: colore chiaro sullo sfondo scuro */
.app-header .btn-icon { color: var(--header-text); }
.app-header .btn-icon:active { background: rgba(255,255,255,.14); }

/* back: molto visibile */
#backBtn {
  color: var(--header-text);
  font-size: 26px;
  min-width: 52px;
  font-weight: 700;
}
/* logout: leggermente attenuato */
#logoutBtn { color: #c3cad6; font-size: 25px; }

/* ===== HEADER ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255,255,255,.08);
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  padding-left: 6px;
  padding-right: 6px;
  gap: 2px;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}

.header-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
}

.header-title-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  -webkit-user-select: none;
  user-select: none;
}
.header-title-btn:active { background: rgba(255,255,255,.12); }

.app-header h1 {
  font-size: 24px;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: -.4px;
  color: var(--header-text);
}

/* pulsante zoom testo */
#zoomBtn {
  font-size: 15px;
  font-weight: 700;
  min-width: 48px;
  letter-spacing: -.5px;
  color: var(--header-text);
}

/* swipe hint (freccia) */
.swipe-hint {
  position: fixed;
  bottom: calc(20px + var(--safe-bot));
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.swipe-hint.show { opacity: .7; }

/* indicatore pull-to-refresh */
.ptr-indicator {
  text-align: center;
  font-size: 22px;
  overflow: hidden;
  height: 0;
  transition: height .2s;
  color: var(--muted);
}
.ptr-indicator.active { height: 40px; line-height: 40px; }

/* ===== MAIN / VIEWS ===== */
#app { padding: 14px 14px 32px; max-width: 640px; margin: 0 auto; }

.view.hidden { display: none; }
.view-actions { margin-bottom: 16px; }

/* ===== VIEW ACTIONS ROW ===== */
.view-actions-row { display: flex; gap: 10px; }
.view-actions-row .btn { flex: 1; }

/* ===== DASHBOARD ===== */
.dashboard { margin-bottom: 16px; }

.birthday-banner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  margin-bottom: 12px;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.dash-tile {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 10px 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 2px 8px rgba(0,0,0,.04);
}
.dash-tile-btn { cursor: pointer; }
.dash-tile-btn:active { opacity: .75; transform: scale(.97); }

.dash-ico { font-size: 28px; line-height: 1; }
.dash-num { font-size: 30px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.dash-lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; font-weight: 500; }
.dash-tile.warn .dash-num { color: var(--red); }
.dash-tile.amber .dash-num { color: var(--amber); }

/* widget unico "da saldare / da scalare" */
.dash-merged {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 2px 8px rgba(0,0,0,.04);
  margin-bottom: 12px;
  overflow: hidden;
}
.dash-merged-half {
  flex: 1;
  text-align: center;
  padding: 16px 10px;
}
.dash-merged-half.dash-tile-btn { cursor: pointer; }
.dash-merged-half.dash-tile-btn:active { background: var(--surface-2); }
.dash-merged-half.warn .dash-num { color: var(--red); }
.dash-merged-half.green .dash-num { color: var(--green); }
.dash-merged-half.amber .dash-num { color: var(--amber); }
.dash-merged-sep { width: 1px; background: var(--border); margin: 10px 0; }

.dash-list {
  background: var(--surface);
  border-radius: 14px;
  padding: 0 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  margin-bottom: 12px;
  overflow: hidden;
}
.dash-list-h {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  padding: 12px 0 6px;
}
.dash-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
  padding: 13px 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  border-bottom: .5px solid var(--border);
  color: var(--text);
  text-align: left;
  min-height: 52px;
}
.dash-row:last-child { border-bottom: none; }
.dash-row.static { cursor: default; }
.dash-mini { font-size: 14px; color: var(--muted); }
.muted-red { color: var(--red); }

/* note recenti */
.dash-notes-list { margin-bottom: 12px; }
.dash-note-entry { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; }
.dash-note-date { font-size: 13px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.dash-note-who { font-weight: 700; font-size: 15px; white-space: nowrap; flex-shrink: 0; }
.dash-note-text { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }

/* ===== CLIENT GRID ===== */
.client-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.client-tile {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 2px 8px rgba(0,0,0,.04);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 108px;
  position: relative;
  transition: transform .1s;
}
.client-tile:active { transform: scale(.97); box-shadow: 0 0 0 2px var(--primary); }
.client-tile-name { font-weight: 700; font-size: 17px; line-height: 1.3; }
.client-tile-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.client-tile-last { font-size: 12px; color: var(--muted); }
.client-tile-30d { font-size: 12px; color: var(--muted); }

/* ===== CLIENTI ARCHIVIATI ===== */
.archived-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 2px 8px rgba(0,0,0,.04);
}
.archived-banner:active { background: var(--surface-2); }
.archived-banner-ico { font-size: 30px; flex-shrink: 0; }
.archived-banner-body { flex: 1; min-width: 0; line-height: 1.4; }
.archived-banner-body b { font-size: 17px; display: block; color: var(--text); }
.archived-banner-body small { font-size: 13px; color: var(--muted); display: block; margin-top: 2px; }
.archived-banner-arr { color: var(--muted); font-size: 22px; flex-shrink: 0; }
.archived-rows { display: flex; flex-direction: column; gap: 10px; }
.archived-row {
  background: var(--surface);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.archived-name { flex: 1; font-weight: 700; font-size: 16px; }
.btn.sm { padding: 9px 14px; min-height: 40px; font-size: 14px; }

/* ===== BADGES ===== */
.badge {
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge.green { background: var(--green-lt); color: #15803d; }
.badge.red   { background: var(--red-lt);   color: #dc2626; }
.badge.grey  { background: #ece2d2;          color: var(--muted); }
.badge.amber { background: var(--amber-lt);  color: #8a6508; }

/* ===== SECTION LABEL ===== */
.section-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin: 22px 4px 12px;
}

/* ===== CLIENT DETAILS ===== */
.client-details {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  margin-bottom: 14px;
}
.cd-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cd-title { flex: 1; font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cd-head-btn {
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 40px;
  padding: 8px 12px;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border-radius: 12px;
}
.cd-head-btn span { font-size: 17px; }
.cd-head-btn:active { background: var(--border); }
.cd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cd-fact {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 10px 12px;
}
.cd-fact-ico { font-size: 20px; flex-shrink: 0; }
.cd-fact-body { display: flex; flex-direction: column; min-width: 0; }
.cd-fact-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cd-fact-val { font-size: 15px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-empty { font-size: 14px; color: var(--muted); }
.cd-note { font-size: 14px; color: var(--text); margin-top: 10px; background: var(--surface-2); padding: 10px 12px; border-radius: 10px; line-height: 1.5; }
.cd-upd { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ===== STATS WRAP ===== */
.stats-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 18px;
}
.stat-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.stat-box .stat-num { font-size: 30px; font-weight: 700; letter-spacing: -.5px; }
.stat-box .stat-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; font-weight: 500; }
.stat-box .s-med { font-size: 22px; font-weight: 700; }
.stat-box.s-wide { grid-column: 1 / -1; }
.stat-box.amber .stat-num, .stat-box.amber .s-med { color: var(--amber); }
.stat-box.green .stat-num, .stat-box.green .s-med { color: var(--green); }
.stat-box.red .stat-num { color: var(--red); }

/* dettaglio cliente: 6 widget fissi, 2 colonne x 3 righe, tutti uguali */
.stats-fixed6 {
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
}
.stats-fixed6 .stat-box { display: flex; flex-direction: column; justify-content: center; }
.stat-box-btn {
  border: none;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  position: relative;
}
.stat-box-btn::after {
  content: '›';
  position: absolute;
  top: 8px; right: 10px;
  color: var(--muted);
  font-size: 16px;
}
.stat-box-btn:active { background: var(--surface-2); }

/* ===== LEZIONI PRECEDENTI PER ANNO (compatte, espandibili) ===== */
.older-years { display: flex; flex-direction: column; gap: 10px; }
.older-year-group {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  overflow: hidden;
}
.older-year-h {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}
.older-year-count { color: var(--muted); font-size: 13px; font-weight: 500; margin-left: auto; }
.older-year-arrow { color: var(--muted); font-size: 14px; transition: transform .15s; }
.older-year-h.open .older-year-arrow { transform: rotate(180deg); }
.older-year-group .compact-grid { padding: 0 12px 14px; }

/* ===== ANNO PER ANNO ===== */
.year-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  margin-bottom: 18px;
}
.year-h { font-size: 12px; color: var(--muted); margin-bottom: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.year-h b { color: var(--primary); }
.yr-row { display: flex; align-items: center; gap: 7px; padding: 6px 0; border-bottom: .5px solid var(--bg); font-size: 14px; }
.yr-row:last-child { border-bottom: none; }
.yr-lbl { width: 36px; font-weight: 700; flex-shrink: 0; }
.yr-bar { flex: 1; height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.yr-fill { display: block; height: 100%; background: #e2c290; border-radius: 5px; }
.yr-fill.top { background: var(--primary); }
.yr-val { width: 28px; text-align: right; font-weight: 700; flex-shrink: 0; }
.yr-rate { width: 44px; text-align: right; color: var(--muted); font-size: 12px; flex-shrink: 0; }
.yr-gap { width: 40px; text-align: right; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.yr-gap.top { color: var(--red); font-weight: 700; }

/* ===== CREDIT BANNER ===== */
.credit-banner {
  background: var(--green-lt);
  border: 1px solid #b9dba8;
  color: #285e24;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  margin-bottom: 16px;
}
.credit-banner .credit-head { font-weight: 700; margin-bottom: 12px; font-size: 16px; }
.credit-chips { display: flex; flex-direction: column; gap: 8px; }
.credit-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid #b9dba8;
  border-radius: 12px;
  padding: 10px 10px 10px 14px;
  min-height: 52px;
}
.credit-chip .cc-lbl { flex: 1; font-weight: 600; color: var(--text); font-size: 15px; }
.cc-btn {
  border: none;
  border-radius: 10px;
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  min-height: 44px;
}
.cc-btn:active { transform: scale(.96); }
.cc-done { background: var(--green-lt); color: #15803d; }
.cc-del  { background: var(--red-lt);  color: #dc2626; }

/* ===== SESSION CARDS ===== */
.card-list { display: flex; flex-direction: column; gap: 10px; }

.session-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  min-height: 60px;
}
.session-card:active { box-shadow: 0 0 0 2px var(--primary); }
.session-card.selectable { cursor: pointer; }
.sc-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.session-date { display: flex; align-items: center; font-weight: 600; font-size: 17px; }
.session-note { font-size: 13px; color: var(--text); background: var(--bg); padding: 4px 10px; border-radius: 8px; }

.paid-pill {
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  border: 2px solid var(--border);
  color: var(--muted);
  background: var(--bg);
  white-space: nowrap;
}
.paid-pill.on {
  background: var(--green-lt);
  border-color: var(--green);
  color: #15803d;
}

/* ===== COMPACT GRID (sessioni > 30gg) ===== */
.compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}
.compact-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  min-height: 44px;
}
.compact-item:active { transform: scale(.96); }
.compact-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.compact-item.paid   { background: var(--green-lt); border-color: #bbf7d0; }
.compact-item.paid   .dot { background: var(--green); }
.compact-item.unpaid .dot { background: var(--red); }

/* ===== SELECTION ===== */
.sel-cb { width: 22px; height: 22px; flex-shrink: 0; }
.session-card.selected, .compact-item.selected { box-shadow: 0 0 0 2.5px var(--primary); }
.compact-item.selectable { cursor: pointer; }

.selection-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(20px + var(--safe-bot));
  z-index: 250;
  background: var(--text);
  color: #fff;
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.selection-bar.hidden { display: none; }
.selection-bar #selCount { font-size: 14px; padding: 0 6px; font-weight: 600; }
.selection-bar .btn { padding: 9px 14px; font-size: 14px; min-height: 40px; }
.selection-bar .btn-icon { color: #fff; min-width: 40px; min-height: 40px; }

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: flex-end;
  padding-bottom: var(--safe-bot);
}
.modal.hidden { display: none; }

.modal-card {
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 32px 24px calc(24px + var(--safe-bot));
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  max-height: 92dvh;
  overflow-y: auto;
}
.modal-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 22px; letter-spacing: -.3px; }

.modal-actions { display: flex; gap: 12px; margin-top: 28px; }
.modal-actions .btn { flex: 1; }

/* ===== UTILS ===== */
.hidden { display: none !important; }
.error-msg { color: var(--red); font-size: 15px; margin-bottom: 14px; padding: 10px 14px; background: var(--red-lt); border-radius: 10px; }
.modal-hint { font-size: 13px; color: var(--muted); margin-top: -4px; margin-bottom: 6px; line-height: 1.5; }
.loading { color: var(--muted); padding: 20px 0; font-size: 16px; }
.badge-row { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.chevron { color: var(--muted); font-size: 20px; }
.clients-only.hidden { display: none !important; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 52px 16px;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 54px; margin-bottom: 14px; }
.empty-state p { font-size: 17px; }

/* ===== FORMS EXTRAS ===== */
.check-row { display: flex; align-items: center; gap: 10px; font-size: 17px; padding: 12px 0; cursor: pointer; min-height: 52px; }
.check-row input { width: 24px; height: 24px; flex-shrink: 0; }
.inline-row { display: flex; gap: 10px; }
.inline-row input { flex: 1; }
.inline-row .btn { flex: 0 0 auto; }
.modal-card textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 17px;
  font-family: inherit;
  background: var(--bg);
  resize: vertical;
  color: var(--text);
  line-height: 1.5;
}
.modal-card textarea:focus { border-color: var(--primary); background: #fff; outline: none; }

/* ===== BACKUP MODAL ===== */
.bk-section { margin-bottom: 22px; }
.bk-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }
.bk-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.bk-row { display: flex; align-items: center; gap: 10px; background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.bk-info { flex: 1; display: flex; flex-direction: column; }
.bk-name { font-size: 14px; font-weight: 600; }
.bk-size { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bk-row .cc-btn { text-decoration: none; display: inline-flex; align-items: center; }

/* backup entry list */
.bk-entry-list {
  display: flex;
  flex-direction: column;
  border: .5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
}
.bk-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  background: var(--surface);
  border: none;
  border-bottom: .5px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  text-align: left;
  min-height: 68px;
  transition: background .12s;
}
.bk-entry:last-child { border-bottom: none; }
.bk-entry:active { background: var(--bg); }
.bk-entry-ico { font-size: 26px; flex-shrink: 0; width: 38px; text-align: center; }
.bk-entry-body { flex: 1; min-width: 0; line-height: 1.4; }
.bk-entry-body b { font-size: 17px; display: block; }
.bk-entry-body small { font-size: 13px; color: var(--muted); display: block; margin-top: 2px; }
.bk-entry-arr { color: var(--muted); font-size: 20px; flex-shrink: 0; }

/* ===== FOOTER ===== */
.app-footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 20px 16px calc(24px + var(--safe-bot));
}

/* ===== PAYMENT BOOKMARK ===== */
.pay-bk { font-size: 13px; margin-left: 5px; cursor: default; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.delete-btn { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 20px; padding: 6px; border-radius: 8px; line-height: 1; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.delete-btn:active { color: var(--red); background: var(--red-lt); }
