:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.topbar-brand h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.brand-sub {
  font-size: 0.76rem;
  color: var(--muted);
  display: block;
}

.nav-desktop {
  display: flex;
  gap: 0.3rem;
  background: var(--surface-alt);
  padding: 0.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.nav-desktop .nav-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.45rem 0.9rem;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-desktop .nav-btn:hover {
  color: var(--text);
}

.nav-desktop .nav-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.38rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}

.sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
}

.sync-badge.sheets .sync-dot { background: var(--success); }
.sync-badge.syncing .sync-dot { background: var(--warning); animation: pulse 1s infinite; }
.sync-badge.error .sync-dot { background: var(--danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Main */
.main-content {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1rem 5.5rem;
  flex: 1;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.tab-panel.active {
  display: flex;
}

.grid-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.card h3 {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.95rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.card-header h2 {
  margin: 0;
}

.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 0.85rem; }
.help-text { margin: 0 0 1rem; font-size: 0.88rem; color: var(--muted); }
.hidden { display: none !important; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Segmented control */
.segmented {
  display: inline-flex;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 7px;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--primary);
  color: #ffffff;
}

/* Forms */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-row {
  display: flex;
  gap: 0.75rem;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="month"],
input[type="search"],
select {
  width: 100%;
  padding: 0.56rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}

input:focus, select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: var(--primary);
}

.select-with-dot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cat-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.58rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: var(--primary-soft); color: var(--primary); border-color: #bfdbfe; }
.btn-secondary:hover { background: #dbeafe; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-alt); }

.btn-sm { padding: 0.42rem 0.72rem; font-size: 0.82rem; }
.btn-xs { padding: 0.25rem 0.55rem; font-size: 0.76rem; }

.form-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.25rem;
}

.file-btn { cursor: pointer; }

/* Partage inégal */
.split-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.88rem;
}

.unequal-panel {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.unequal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.radio-group {
  display: flex;
  gap: 0.9rem;
  font-size: 0.84rem;
}

.unequal-row {
  display: grid;
  grid-template-columns: 88px 1fr 82px;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.unequal-row label {
  font-weight: 600;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unequal-row input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.unequal-total {
  font-size: 0.83rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: 7px;
  background: var(--success-soft);
  color: var(--success);
}

.unequal-total.invalid {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Quick Balance Card */
.quick-balance-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.balance-banner {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  border: 1px solid #bfdbfe;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.balance-banner.settled {
  background: var(--success-soft);
  border-color: #bbf7d0;
  color: #166534;
}

.carryover-note {
  font-size: 0.83rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  margin-bottom: 0.55rem;
}

.carryover-note.muted-note {
  color: var(--muted);
}

.carryover-note.highlight {
  background: var(--warning-soft);
  border-color: #fde68a;
  color: #92400e;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.mini-stat {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
}

.mini-stat small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.mini-stat strong {
  font-size: 1.05rem;
}

/* Filters & Operations List */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.filter-input { max-width: 190px; }
.filter-select { max-width: 165px; }

.operations-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.op-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.15s;
}

.op-item:hover {
  border-color: #cbd5e1;
}

.op-item.is-remb {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.op-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.op-badge {
  width: 12px;
  height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
}

.op-main {
  min-width: 0;
}

.op-title {
  font-weight: 600;
  font-size: 0.93rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.op-meta {
  font-size: 0.79rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.split-tag {
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 600;
}

.op-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.op-amount {
  font-weight: 700;
  font-size: 0.98rem;
  white-space: nowrap;
}

.op-actions {
  display: flex;
  gap: 0.3rem;
}

/* Period bar & KPIs */
.period-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.period-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.period-controls select { width: 140px; }
.period-controls input { width: 92px; text-align: center; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
  box-shadow: var(--shadow);
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  font-size: 1.4rem;
  font-weight: 800;
  margin-top: 0.25rem;
}

.kpi-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* Charts */
.donut-layout {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.donut-svg-wrap {
  width: 190px;
  height: 190px;
  flex-shrink: 0;
  margin: 0 auto;
}

.donut-svg { width: 100%; height: 100%; }
.donut-center-label { font-size: 11px; fill: var(--muted); font-weight: 600; }
.donut-center-val { font-size: 15px; fill: var(--text); font-weight: 800; }

.legend-list {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-label { flex: 1; }
.legend-val { font-weight: 600; white-space: nowrap; }
.legend-val small { color: var(--muted); font-weight: 400; }

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  height: 210px;
  padding-top: 1.25rem;
}

.bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.bar-val {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  height: 18px;
}

.bar-track {
  flex: 1;
  width: 100%;
  max-width: 44px;
  background: var(--surface-alt);
  border-radius: 8px 8px 4px 4px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  border-radius: 8px 8px 4px 4px;
  transition: height 0.25s ease;
}

.bar-label {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.35rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Member details */
.member-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}

.member-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
}

.member-card h3 {
  margin: 0 0 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.member-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.28rem 0.75rem;
  font-size: 0.85rem;
}

.member-card dt { color: var(--muted); }
.member-card dd { margin: 0; font-weight: 600; text-align: right; }

.text-pos { color: var(--success); }
.text-neg { color: var(--danger); }

/* Settings */
.tags-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.tag-row-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.color-picker {
  width: 40px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--surface);
}

.import-preview {
  margin-top: 0.9rem;
  padding: 0.9rem;
  background: var(--primary-soft);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
}

.import-preview p { margin: 0 0 0.75rem; font-size: 0.9rem; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem 0.5rem;
  font-size: 0.9rem;
  margin: 0;
}

/* Toasts */
.toast-container {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 340px;
}

.toast {
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.2);
}

.toast.success { background: #15803d; }
.toast.error { background: #b91c1c; }

/* Mobile top tab bar (libère 100 % du bas d'écran : aucun chevauchement avec le logo Netlify) */
.nav-mobile {
  display: none;
  position: sticky;
  top: 57px;
  z-index: 35;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0.35rem 0.5rem;
  gap: 0.25rem;
}

.nav-mobile .nav-btn {
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.38rem 0.2rem;
  border-radius: 10px;
  cursor: pointer;
}

.nav-mobile .nav-btn.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.nav-ico { font-size: 1.05rem; }

/* Autocomplétion intelligente & correction orthographique */
.autocomplete-wrap {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  z-index: 60;
  max-height: 240px;
  overflow-y: auto;
}

.autocomplete-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.55rem 0.75rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: inherit;
  border-bottom: 1px solid var(--surface-alt);
}

.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--primary-soft);
}

.ac-main {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
}

.ac-meta {
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
}

.typo-hint {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  padding: 0.3rem 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.typo-hint button {
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  padding: 0.18rem 0.5rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

/* Diagnostic Google Drive */
.origin-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.origin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.origin-row code {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  word-break: break-all;
}

.diagnostic-box {
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.85rem;
}

.diagnostic-box.warn {
  background: var(--warning-soft);
  border-color: #fde68a;
  color: #92400e;
}

.diagnostic-box ul {
  margin: 0.45rem 0 0;
  padding-left: 1.2rem;
}

/* Enseignes regroupées & Fusion */
.merchants-list, .merge-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.merchant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.merchant-row:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.merchant-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.merchant-name {
  font-weight: 700;
  font-size: 0.92rem;
}

.merchant-variants {
  font-size: 0.77rem;
  color: var(--muted);
}

.merchant-right {
  text-align: right;
  white-space: nowrap;
}

.merchant-right strong { display: block; font-size: 0.95rem; }
.merchant-right small { color: var(--muted); font-size: 0.76rem; }

.merge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.merge-variants {
  font-size: 0.84rem;
  color: var(--text);
}

.merge-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.merge-controls input {
  width: 170px;
  padding: 0.38rem 0.6rem;
  font-size: 0.85rem;
}

/* Écran de connexion obligatoire (Login Gate) */
.auth-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: linear-gradient(135deg, #eff6ff 0%, #f1f5f9 55%, #e0f2fe 100%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem 1.65rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.auth-logo-wrap { text-align: center; }

.auth-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin-bottom: 0.65rem;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}

.auth-logo-wrap h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
}

.auth-subtitle {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-step {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-note {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.auth-picker-title {
  margin: 0;
  font-size: 1rem;
  text-align: center;
}

.gate-status {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
}

.discovered-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.discovered-item {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-family: inherit;
  transition: all 0.15s ease;
}

.discovered-item:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.discovered-item strong {
  display: block;
  font-size: 0.92rem;
  color: var(--text);
}

.discovered-item small {
  color: var(--muted);
  font-size: 0.76rem;
}

.btn-lg { padding: 0.8rem 1.25rem; font-size: 0.98rem; }
.btn-full { width: 100%; }

/* Dépenses récurrentes */
.recurring-panel {
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.recurring-day-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.86rem;
}

.day-input {
  width: 74px !important;
  text-align: center;
  font-weight: 700;
}

.recurring-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-size: 1rem;
}

.recurring-summary::-webkit-details-marker { display: none; }

.op-item.is-paused {
  opacity: 0.6;
  background: var(--surface-alt);
}

.brand-text { min-width: 0; }
.brand-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }

/* Responsive */
@media (max-width: 820px) {
  .topbar { padding: 0.55rem 0.85rem; }
  .brand-sub { max-width: 150px; }
  .nav-desktop { display: none; }
  .nav-mobile { display: flex; }
  .main-content { padding: 0.9rem 0.75rem 6.5rem; }
  .grid-two-col { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .filter-input, .filter-select { max-width: none; flex: 1 1 45%; }
  .op-item { flex-direction: column; align-items: stretch; }
  .op-right { justify-content: space-between; border-top: 1px dashed var(--border); padding-top: 0.5rem; }
}
