/* Rubik מתארח בפורטל עצמו: בלי טעינה מ-Google Fonts. משקל 600 ו-800 נופלים אוטומטית ל-700 */
@font-face { font-family: "Rubik"; font-weight: 400; font-display: swap; src: url("assets/fonts/rubik-400.ttf") format("truetype"); }
@font-face { font-family: "Rubik"; font-weight: 500; font-display: swap; src: url("assets/fonts/rubik-500.ttf") format("truetype"); }
@font-face { font-family: "Rubik"; font-weight: 700; font-display: swap; src: url("assets/fonts/rubik-700.ttf") format("truetype"); }

/* מערכת העיצוב של CourierFinance, מתורגמת לוובּ.
   הערכים כאן נלקחו ישירות מ-Color.kt, Dimens.kt ו-Type.kt באפליקציה. */

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-container: #DBEAFE;
  --on-primary-container: #1D4ED8;

  --income: #16A34A;
  --income-soft: rgba(22, 163, 74, 0.12);
  --expense: #DC2626;
  --expense-soft: rgba(220, 38, 38, 0.12);
  --warning: #F59E0B;
  --warning-soft: rgba(245, 158, 11, 0.12);
  --primary-soft: rgba(37, 99, 235, 0.12);

  --ci-purple: #5B3FE4;
  --chart-1: #2563EB; --chart-2: #DC2626; --chart-3: #F59E0B; --chart-4: #16A34A;
  --chart-5: #9333EA; --chart-6: #0EA5E9; --chart-7: #DB2777; --chart-8: #64748B;

  --bg: #F0F4FC;
  --surface: #FFFFFF;
  --surface-variant: #F1F5F9;
  --text: #111827;
  --text-muted: #6B7280;
  --outline: #E2E8F0;

  /* Dimens.kt */
  --xs: 4px;
  --sm: 8px;
  --md: 12px;
  --df: 16px;
  --lg: 20px;
  --xl: 24px;
  --card-radius: 20px;
  --pill-radius: 100px;

  --shadow-card: 0 1px 2px rgba(17, 24, 39, 0.06), 0 1px 3px rgba(17, 24, 39, 0.04);
  --shadow-raised: 0 4px 16px rgba(17, 24, 39, 0.10);
}

html[data-theme="dark"] {
  --primary-container: #1D4ED8;
  --on-primary-container: #DBEAFE;
  --bg: #030712;
  --surface: #111827;
  --surface-variant: #1F2937;
  --text: #F9FAFB;
  --text-muted: #9CA3AF;
  --outline: #374151;
  --shadow-card: none;
  --shadow-raised: 0 6px 24px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Rubik', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

button { font-family: inherit; }

.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sm);
  padding: 13px 24px;
  border-radius: var(--pill-radius);
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

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

.btn-ghost {
  background: transparent;
  border: 1px solid var(--outline);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--text-muted); }

.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13.5px; }

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

.error { color: var(--expense); font-size: 13.5px; }

/* ---------------- Entry screens ---------------- */

.center-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--df);
  padding: var(--xl);
  text-align: center;
}

.entry-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  padding: 36px 28px;
}

.entry-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  margin-bottom: var(--df);
}

.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--outline);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Shell ---------------- */

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  padding-bottom: 88px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--md);
  height: 64px;
  padding: 0 var(--df);
  background: var(--surface);
  border-bottom: 1px solid var(--outline);
}

.topbar h1 { font-size: 20px; flex: 1; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--surface-variant); color: var(--text); }

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-container);
}

.content {
  padding: var(--df);
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

/* ---------------- Bottom nav (mirrors CFBottomBar) ---------------- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 30;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--outline);
  padding: var(--sm) 0 calc(var(--sm) + env(safe-area-inset-bottom));
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.nav-item svg { width: 22px; height: 22px; }

.nav-item .nav-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 30px;
  border-radius: var(--pill-radius);
  transition: background-color 0.18s ease;
}

.nav-item-active { color: var(--primary); font-weight: 500; }
.nav-item-active .nav-pill { background: var(--primary-container); color: var(--on-primary-container); }

@media (min-width: 900px) {
  .shell { grid-template-columns: 232px 1fr; padding-bottom: 0; }
  .topbar { grid-column: 1 / -1; }
  .bottom-nav {
    position: sticky;
    top: 64px;
    align-self: start;
    height: calc(100vh - 64px);
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--xs);
    border-top: none;
    border-inline-end: 1px solid var(--outline);
    padding: var(--df) var(--md);
  }
  .nav-item {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--md);
    padding: 10px 14px;
    border-radius: var(--pill-radius);
    font-size: 14px;
  }
  .nav-item .nav-pill { width: auto; height: auto; background: none !important; }
  .nav-item-active { background: var(--primary-container); color: var(--on-primary-container); }
  .content { padding: var(--xl); }
}

/* ---------------- Cards (mirrors CFCard) ---------------- */

.card {
  background: var(--surface);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  padding: var(--df);
  margin-bottom: var(--md);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sm);
  margin-bottom: var(--md);
}

.section-title { font-size: 16px; font-weight: 600; }

/* Stat cards (mirrors CompactStatCard) */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sm);
  margin-bottom: var(--md);
}

.stat-card {
  background: var(--surface);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  padding: var(--md);
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  margin-bottom: var(--xs);
}
.stat-badge svg { width: 16px; height: 16px; }

.stat-label { font-size: 12px; color: var(--text-muted); }

.stat-value {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

@media (max-width: 400px) {
  .stat-value { font-size: 16px; }
  .stat-grid { gap: var(--xs); }
  .stat-card { padding: var(--sm); }
}

/* ---------------- Filter chips (mirrors PackedFilterChipRow) ---------------- */

.chip-row {
  display: flex;
  gap: var(--sm);
  overflow-x: auto;
  padding-bottom: var(--sm);
  margin-bottom: var(--md);
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 7px 16px;
  border-radius: var(--pill-radius);
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--primary); }

.chip-active {
  background: var(--primary-container);
  border-color: transparent;
  color: var(--on-primary-container);
  font-weight: 500;
}

/* ---------------- List rows ---------------- */

.row {
  display: flex;
  align-items: center;
  gap: var(--md);
  width: 100%;
  padding: var(--md) var(--df);
  background: var(--surface);
  border: none;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--sm);
  text-align: start;
  cursor: pointer;
  color: inherit;
  font-size: 15px;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.row:hover { box-shadow: var(--shadow-raised); }
.row:active { transform: scale(0.995); }

.row-badge {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
}
.row-badge svg { width: 18px; height: 18px; }

.row-main { flex: 1; min-width: 0; }

.row-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-sub { font-size: 12.5px; color: var(--text-muted); }

.row-amount { font-weight: 600; white-space: nowrap; }

.row-chevron { color: var(--text-muted); flex: 0 0 auto; }
.row-chevron svg { width: 18px; height: 18px; display: block; }

.date-heading {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin: var(--df) 0 var(--sm);
}
.date-heading:first-child { margin-top: 0; }

.empty {
  text-align: center;
  padding: 48px var(--df);
  color: var(--text-muted);
}
.empty-title { font-weight: 500; color: var(--text); margin-bottom: var(--xs); }

/* ---------------- Reports bars ---------------- */

.bar-row { margin-bottom: var(--md); }

.bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  margin-bottom: 5px;
}

.bar-track {
  height: 8px;
  border-radius: var(--pill-radius);
  background: var(--surface-variant);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: var(--pill-radius);
  transition: width 0.4s cubic-bezier(0.2, 0, 0, 1);
}

/* ---------------- Sheet / modal ---------------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(3, 7, 18, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 720px) {
  .sheet-backdrop { align-items: center; padding: var(--xl); }
}

.sheet {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  padding: var(--lg) var(--lg) var(--xl);
  animation: sheet-in 0.22s cubic-bezier(0.2, 0, 0, 1);
}

@media (min-width: 720px) {
  .sheet { border-radius: 28px; }
}

@keyframes sheet-in {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-grip {
  width: 36px;
  height: 4px;
  border-radius: var(--pill-radius);
  background: var(--outline);
  margin: 0 auto var(--df);
}

.sheet-title { margin-bottom: var(--lg); }

.form-row { margin-bottom: var(--df); }

.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.text-input {
  width: 100%;
  padding: 14px var(--df);
  border-radius: var(--df);
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.15s ease;
}

.text-input:focus {
  outline: none;
  border-color: var(--primary);
}

select.text-input { appearance: none; }

.switch-row {
  display: flex;
  align-items: center;
  gap: var(--md);
  padding: 12px var(--df);
  border-radius: var(--df);
  background: var(--surface-variant);
  cursor: pointer;
}
.switch-row input { width: 18px; height: 18px; accent-color: var(--primary); }

.sheet-actions {
  display: flex;
  gap: var(--md);
  margin-top: var(--lg);
}
.sheet-actions .btn { flex: 1; }

.delete-link {
  display: block;
  width: 100%;
  margin-top: var(--md);
  padding: 10px;
  background: none;
  border: none;
  color: var(--expense);
  font-size: 14px;
  cursor: pointer;
  border-radius: var(--md);
}
.delete-link:hover { background: var(--expense-soft); }

/* ---------------- Settings ---------------- */

.settings-row {
  display: flex;
  align-items: center;
  gap: var(--md);
  width: 100%;
  padding: var(--md) 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--outline);
  color: inherit;
  font-size: 15px;
  text-align: start;
  cursor: pointer;
}
.settings-row:last-child { border-bottom: none; }
.settings-row:hover .row-title { color: var(--primary); }

.count-pill {
  padding: 2px 10px;
  border-radius: var(--pill-radius);
  background: var(--surface-variant);
  color: var(--text-muted);
  font-size: 12px;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: var(--df);
  padding: 10px 0;
  border-bottom: 1px solid var(--outline);
  font-size: 14px;
}
.kv:last-child { border-bottom: none; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; text-align: start; word-break: break-word; }

.badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: var(--pill-radius);
  font-size: 13.5px;
  font-weight: 500;
  background: var(--surface-variant);
  color: var(--text);
}
.badge-active { background: var(--income-soft); color: var(--income); }
.badge-trial { background: var(--primary-soft); color: var(--primary); }
.badge-expired { background: var(--expense-soft); color: var(--expense); }

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  bottom: calc(96px + env(safe-area-inset-bottom));
  inset-inline: var(--df);
  z-index: 70;
  margin: 0 auto;
  max-width: 360px;
  padding: 14px var(--df);
  border-radius: var(--df);
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  text-align: center;
  box-shadow: var(--shadow-raised);
  animation: toast-in 0.2s ease;
}

@keyframes toast-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 900px) {
  .toast { bottom: var(--xl); }
}

/* ---------------- Ledger: הכנסות / הוצאות (ledger.js) ---------------- */

.content-wide { max-width: 980px; }

.lg-head { margin-bottom: var(--md); }
.lg-title { font-size: 22px; font-weight: 600; color: var(--primary-dark); }
[data-theme="dark"] .lg-title { color: var(--text); }

.tabs {
  display: flex;
  border-bottom: 1px solid var(--outline);
  margin-bottom: var(--md);
}
.tab {
  flex: 1;
  padding: 12px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.tab-active { color: var(--primary); border-bottom-color: var(--primary); }

.seg { display: flex; gap: var(--sm); margin-bottom: var(--sm); }
.seg-btn {
  flex: 1;
  padding: 9px 8px;
  border-radius: var(--pill-radius);
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
}
.seg-active { background: var(--primary-container); color: var(--on-primary-container); border-color: transparent; font-weight: 500; }

.lg-hint { margin: 2px 0 var(--sm); }
.lg-card { padding: var(--lg); }
.lg-divider { border: none; border-top: 1px solid var(--outline); margin: var(--df) 0; }

.sec-title { display: flex; align-items: center; gap: var(--sm); font-size: 16px; font-weight: 600; margin: var(--sm) 0; }
.sec-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
}
.sub-title { font-size: 15px; font-weight: 600; margin: var(--sm) 0; }

.chip-wrap { display: flex; flex-wrap: wrap; gap: var(--sm); margin-bottom: var(--sm); }
.chip-assist { border-style: dashed; color: var(--primary); }
.chip-mark { font-size: 12px; margin-inline-start: 4px; }

.quick-row { display: flex; align-items: center; gap: var(--xs); margin-bottom: var(--sm); }
.quick-row .text-input { flex: 1; padding: 10px var(--md); }
.mini-form { padding: var(--md); border-radius: var(--df); background: var(--surface-variant); margin-bottom: var(--sm); }
.inline-actions { display: flex; gap: var(--sm); margin-top: var(--sm); }

.date-wrap { display: flex; gap: var(--sm); align-items: center; }
.date-wrap .text-input { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--md); }

.lg-save { margin-top: var(--df); }
.lg-save:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.entry-head { display: flex; align-items: center; justify-content: space-between; gap: var(--md); margin-bottom: var(--sm); }
.entry-head-end { display: flex; align-items: center; gap: var(--xs); }
.line-row { display: flex; align-items: flex-end; gap: var(--md); flex-wrap: wrap; }
.line-row .form-row { margin-bottom: var(--sm); }
.line-date { flex: 1.4 1 190px; }
.line-qty { flex: 0.6 1 90px; }
.line-amount { flex: 1 1 120px; }
.line-paid { display: flex; align-items: center; gap: var(--xs); padding-bottom: 20px; font-size: 14px; cursor: pointer; }
.line-paid input { width: 18px; height: 18px; accent-color: var(--primary); }
.line-sub { margin-bottom: var(--sm); }
.link-btn { background: none; border: none; color: var(--primary); font-size: 14px; cursor: pointer; padding: 4px 0; }
.total-row { display: flex; align-items: center; justify-content: space-between; gap: var(--md); }
.money { font-weight: 600; white-space: nowrap; }

.icon-btn-danger { color: var(--expense); }
.icon-btn-danger:hover { background: var(--expense-soft); color: var(--expense); }
.icon-btn svg { display: block; }

.filter-bar { margin-bottom: var(--md); }
.filter-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sm); }
.sort-select { width: auto; padding: 8px var(--md); font-size: 14px; }
.facet-row { display: flex; gap: var(--sm); flex-wrap: wrap; }
.facet-btn {
  flex: 1 1 110px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 8px; border: none; border-radius: var(--md);
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
}
[data-theme="dark"] .facet-btn { color: var(--text); }
.facet-open svg { transform: rotate(180deg); }
.facet-count { padding: 0 8px; border-radius: var(--pill-radius); background: var(--primary); color: #fff; font-size: 12px; }
.facet-panel {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px var(--md);
  margin-top: var(--sm); padding: var(--md); border-radius: var(--md); background: var(--primary-soft);
}
.facet-opt { display: flex; align-items: center; gap: var(--sm); padding: 5px 0; font-size: 14px; cursor: pointer; }
.facet-opt input { width: 17px; height: 17px; accent-color: var(--primary); }

.date-heading { margin: var(--df) 0 var(--sm); font-size: 16px; font-weight: 600; color: var(--primary-dark); }
[data-theme="dark"] .date-heading { color: var(--text); }
.lg-group { padding: var(--md) var(--df); margin-bottom: var(--sm); }
.group-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--md);
  width: 100%; background: none; border: none; color: inherit; font: inherit; text-align: start; cursor: pointer; padding: 0;
}
.group-main { display: flex; flex-direction: column; }

.entry-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--md);
  padding: var(--sm) 0; border-top: 1px solid var(--outline);
}
.group-head + .entry-row { margin-top: var(--sm); }
.lg-group > .row-title + .entry-row { border-top: none; }
.entry-info { min-width: 0; }
.entry-end { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.edit-box { padding: var(--md) 0; border-top: 1px solid var(--outline); }
.edit-box .form-row { margin-bottom: var(--sm); }

@media (max-width: 520px) {
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
  .date-heading { font-size: 15px; }
}

/* ---------------- מתג סנכרון ---------------- */

.sync-switch { display: inline-flex; align-items: center; gap: var(--sm); cursor: pointer; font-size: 13.5px; color: var(--text-muted); }
.sync-switch input { position: absolute; opacity: 0; pointer-events: none; }
.sync-track {
  position: relative; width: 42px; height: 24px; border-radius: var(--pill-radius);
  background: var(--outline); transition: background-color 0.18s ease;
}
.sync-track::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: inset-inline-start 0.18s ease;
}
.sync-switch input:checked + .sync-track { background: var(--income); }
.sync-switch input:checked + .sync-track::after { inset-inline-start: 21px; }
.sync-switch input:focus-visible + .sync-track { outline: 2px solid var(--primary); outline-offset: 2px; }
.sync-switch input:checked ~ .sync-label, .sync-switch:has(input:checked) .sync-label { color: var(--income); font-weight: 500; }

.sync-banner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--md); flex-wrap: wrap;
  margin-bottom: var(--md); padding: var(--md) var(--df); border-radius: var(--df);
  background: var(--warning-soft); color: var(--text); font-size: 14px;
}

/* ---------------- מסכי בית / סטטיסטיקות / הגדרות (screens.js) ---------------- */

.info-btn {
  display: inline-flex; align-items: center; vertical-align: middle;
  margin-inline-start: 4px; padding: 2px; border: none; background: none;
  color: var(--text-muted); cursor: pointer; border-radius: 50%;
}
.info-btn:hover { color: var(--primary); }

.sc-seg .seg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.sc-seg { margin-bottom: var(--md); }

/* כרטיס מדרג (GradientCard) */
.grad-card {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; border-radius: var(--card-radius);
  padding: var(--md) var(--df); margin-bottom: var(--md);
}
.grad-title { font-size: 16px; font-weight: 500; }
.grad-actions { display: flex; gap: var(--sm); margin-top: var(--sm); }
.grad-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.7); border-radius: var(--pill-radius);
  background: transparent; color: #fff; font-size: 14px; cursor: pointer;
}
.grad-btn:hover { background: rgba(255, 255, 255, 0.15); }
.grad-sub { font-size: 14px; opacity: 0.85; }
.grad-big { font-size: 26px; font-weight: 700; }

.stat-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.stat-label-row { font-size: 13.5px; font-weight: 500; color: var(--text-muted); margin: var(--sm) 0 6px; }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sm); margin-bottom: var(--md); }
.stat-wide { min-width: 0; }

/* קופה מהירה */
.qc-mode { display: flex; align-items: center; gap: var(--xs); margin-top: var(--md); }
.qc-mode-label { font-weight: 600; color: var(--primary-dark); }
[data-theme="dark"] .qc-mode-label { color: var(--text); }
.qc-cat { margin: var(--lg) 0 var(--sm); padding-bottom: 6px; border-bottom: 1px solid var(--outline); color: var(--primary-dark); }
[data-theme="dark"] .qc-cat { color: var(--text); }
.qc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: var(--sm); }
.qc-btn {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: var(--sm); border: none; border-radius: 10px;
  background: var(--income-soft); color: var(--income); cursor: pointer; text-align: center;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.qc-btn:hover { box-shadow: var(--shadow-raised); }
.qc-btn:active { transform: scale(0.96); }
.qc-name { font-size: 13px; font-weight: 700; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.qc-amt { font-size: 18px; font-weight: 700; }

/* שורות רכות (תזכורות / תזרים) */
.dash-sec { margin: var(--lg) 0 var(--md); }
.soft-row {
  display: flex; align-items: center; gap: var(--sm); padding: 8px var(--md);
  margin-bottom: 2px; border-radius: var(--md); background: var(--surface-variant);
}
.soft-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.soft-end { font-weight: 700; white-space: nowrap; }
.flow-total { padding: var(--sm) var(--md); border-radius: var(--md); margin-bottom: var(--sm); }

/* חובות */
.debts { margin: var(--lg) 0; }
.debts-head { display: flex; align-items: center; justify-content: space-between; gap: var(--md); }
.debts-title { display: inline-flex; align-items: center; gap: var(--sm); font-size: 18px; font-weight: 600; }
.debt-cat { display: flex; align-items: center; justify-content: space-between; margin: var(--md) 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--outline); }
.debt-cat-head { display: flex; align-items: center; gap: var(--sm); cursor: pointer; }
.debt-cat-name { font-weight: 700; color: var(--primary-dark); }
[data-theme="dark"] .debt-cat-name { color: var(--text); }
.debt-cat input, .exp-check, .debt-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; flex: 0 0 auto; }
.debt-date { font-size: 12.5px; font-weight: 700; color: var(--text-muted); margin: var(--sm) 0 4px; }
.debt-row { display: flex; align-items: center; justify-content: flex-end; gap: var(--sm); margin-bottom: 4px; }
.debt-amt { width: 110px; padding: 8px 10px; text-align: end; }
.pay-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--md);
  margin-top: var(--sm); padding: var(--sm) var(--md); border-radius: var(--md);
}

/* כרטיס מתקפל */
.sc-exp { padding: 0; margin-bottom: var(--sm); }
.sc-exp-head { display: flex; align-items: center; gap: var(--sm); padding: var(--md) var(--df); }
.sc-exp-toggle {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--md);
  background: none; border: none; padding: 0; color: inherit; font: inherit; text-align: start; cursor: pointer;
}
.sc-exp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sc-chev { color: var(--text-muted); display: flex; transition: transform 0.18s ease; }
.sc-chev-open { transform: rotate(180deg); }
.sc-exp-body { padding: 0 var(--df) var(--df); border-top: 1px solid var(--outline); padding-top: var(--md); }

/* דיאלוגים */
.sc-modal-wrap { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: var(--df); }
.sc-scrim { position: absolute; inset: 0; background: rgba(3, 7, 18, 0.5); }
.sc-modal {
  position: relative; width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
  background: var(--surface); border-radius: 24px; padding: var(--lg); box-shadow: var(--shadow-raised);
  animation: sheet-in 0.2s cubic-bezier(0.2, 0, 0, 1);
}
.sc-modal-title { margin-bottom: var(--md); }
.sc-modal-actions { display: flex; gap: var(--sm); margin-top: var(--lg); justify-content: flex-end; }
.sc-modal-actions .btn-block { width: 100%; }

/* סטטיסטיקות */
.range-bar { display: flex; align-items: flex-end; gap: var(--md); flex-wrap: wrap; margin-bottom: var(--md); }
.range-f { display: flex; flex-direction: column; gap: 4px; flex: 1 1 150px; }
.range-f .text-input { padding: 10px var(--md); }
.range-all { padding-bottom: 12px; }

.legend { display: flex; gap: 14px; margin-bottom: var(--sm); font-size: 12px; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.dot-inc { background: var(--income); }
.dot-exp { background: var(--expense); }
.dot-bal { background: var(--primary-dark); }
.gbc-detail { min-height: 28px; text-align: center; color: var(--text-muted); }
.gbc-detail b { color: var(--text); }
.gbc-scroll { overflow-x: auto; padding-bottom: 4px; }
.gbc { display: flex; }
.gbc-col { width: 44px; flex: 0 0 44px; cursor: pointer; transition: opacity 0.15s ease; }
.gbc-dim { opacity: 0.35; }
.gbc-bars { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding: 0 3px; }
.gb { flex: 1; min-height: 1px; border-radius: 2px 2px 0 0; }
.gb-inc { background: var(--income); }
.gb-exp { background: var(--expense); }
.gb-bal { background: var(--primary-dark); }
.gbc-lbl { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.donut { position: relative; width: 160px; height: 160px; margin: var(--sm) auto var(--md); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.stackbar { display: flex; gap: 2px; height: 28px; border-radius: 8px; overflow: hidden; margin: var(--sm) 0 var(--md); }
.stackbar i { display: block; height: 100%; }
.bk-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px var(--md); }
.bk-item { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bk-name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-sub { font-size: 11.5px; }
.chip-ic { display: inline-flex; vertical-align: middle; margin-inline-end: 4px; }
.odo { font-size: 24px; font-weight: 700; color: var(--primary); }

/* הגדרות */
.opt-list { display: flex; flex-direction: column; gap: var(--sm); }
.opt-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--md);
  padding: var(--sm) var(--md); border: none; border-radius: var(--md); text-align: start; cursor: pointer;
  background: var(--surface-variant); color: inherit; font: inherit;
}
.opt-active { background: var(--primary-container); }
.opt-label { display: block; font-weight: 600; }
.opt-desc { display: block; }
.act-row {
  display: flex; align-items: center; gap: var(--md); width: 100%; padding: 4px 0;
  background: none; border: none; color: var(--primary-dark); font: inherit; font-weight: 600; text-align: start; cursor: pointer;
}
[data-theme="dark"] .act-row { color: var(--text); }
.act-badge { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 12px; background: var(--primary-container); color: var(--on-primary-container); }
.act-label { flex: 1; }
.act-danger { color: var(--expense); }
.act-danger .act-badge { background: var(--expense-soft); color: var(--expense); }
.legal-link { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 6px 0; background: none; border: none; color: var(--primary-dark); font: inherit; font-weight: 600; cursor: pointer; }
[data-theme="dark"] .legal-link { color: var(--text); }
.legal-text { white-space: pre-wrap; line-height: 1.7; }
.tools-sep { display: flex; align-items: center; gap: var(--sm); margin: var(--lg) 0 var(--md); color: var(--text-muted); font-size: 13px; }
.tools-sep::before, .tools-sep::after { content: ""; flex: 1; height: 1px; background: var(--outline); }
.footer-note { text-align: center; margin-top: var(--xl); padding: var(--df) 0; }

.list-row, .list-edit { display: flex; align-items: center; gap: var(--sm); margin-bottom: var(--xs); padding: 4px var(--sm); border-radius: var(--md); background: var(--surface-variant); }
.list-edit .text-input { padding: 8px var(--md); }
.list-name { flex: 1; min-width: 0; display: flex; flex-direction: column; word-break: break-word; }
.list-btns { display: flex; align-items: center; flex: 0 0 auto; }
.list-btns.end { justify-content: flex-end; margin-bottom: var(--xs); }
.add-row { display: flex; align-items: center; gap: var(--sm); margin: var(--sm) 0; }
.add-row .text-input { flex: 1; padding: 10px var(--md); }
.add-btn { padding: 10px 14px; }
.veh-row { margin-top: var(--xs); }
.sub-panel { margin: var(--xs) 0 var(--sm); margin-inline-start: var(--xl); padding: var(--sm); border-radius: var(--df); background: var(--primary-soft); }
.rec-row { display: flex; align-items: center; gap: var(--xs); }
.rec-row > :first-child { flex: 1; min-width: 0; }
.new-vehicle { padding: var(--df); }
.sug-list { display: flex; flex-direction: column; max-height: 180px; overflow-y: auto; }
.sug { background: none; border: none; text-align: start; padding: 5px 0; color: inherit; font: inherit; font-size: 13.5px; cursor: pointer; }
.sug:hover { color: var(--primary); }

/* האפליקציות שלנו */
.app-card { border-inline-start: 6px solid var(--brand); }
.app-head { display: flex; align-items: center; gap: var(--md); }
.app-logo { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.app-info { flex: 1; min-width: 0; }
.app-name { display: flex; align-items: center; gap: var(--sm); font-size: 16px; font-weight: 800; color: var(--primary-dark); }
[data-theme="dark"] .app-name { color: var(--text); }
.app-status { padding: 2px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.app-status-amber { background: var(--warning-soft); color: var(--warning); }
.app-status-green { background: var(--income-soft); color: var(--income); }
.app-note { margin-top: var(--md); font-weight: 500; }
.app-card .btn-block { margin-top: var(--md); text-decoration: none; }

@media (max-width: 520px) {
  .bk-legend { grid-template-columns: 1fr; }
  .debt-amt { width: 96px; }
}

.row-main > .row-title, .row-main > .row-sub { display: block; }

/* ---------------- תפריט נגישות (a11y.js) ---------------- */
/* בטלפון הכפתור מעל הניווט התחתון; במסך רחב הניווט בצד, ולכן אותו מרווח לא מפריע */
.a11y-btn { position: fixed; inset-inline-start: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 90; width: 48px; height: 48px; border-radius: 999px; border: 2px solid var(--surface); background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-raised); }
.a11y-panel { position: fixed; inset-inline-start: 14px; bottom: calc(142px + env(safe-area-inset-bottom)); z-index: 90; width: min(280px, calc(100vw - 28px)); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); color: var(--text); border: 1px solid var(--outline); border-radius: 16px; box-shadow: var(--shadow-raised); }
.a11y-panel[hidden] { display: none; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 4px; }
.a11y-x { border: 0; background: transparent; color: var(--text-muted); font-size: 24px; line-height: 1; cursor: pointer; padding: 0 6px; }
.a11y-row { display: flex; gap: 8px; }
.a11y-row button { flex: 1; }
.a11y-panel button[data-a] { font: inherit; font-size: 15px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--outline); background: transparent; color: var(--text); cursor: pointer; text-align: start; }
.a11y-panel button[data-a]:hover { border-color: var(--primary); }
.a11y-panel button[aria-pressed="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }
.a11y-panel .a11y-reset { color: var(--text-muted); }
.a11y-panel a { font-size: 14px; padding: 4px 2px; color: var(--primary); }

html.a11y-size-1 .content, html.a11y-size-1 .lp-stage { zoom: 1.12; }
html.a11y-size-2 .content, html.a11y-size-2 .lp-stage { zoom: 1.25; }
html.a11y-size-3 .content, html.a11y-size-3 .lp-stage { zoom: 1.4; }
html.a11y-links a { text-decoration: underline !important; font-weight: 600; }
html.a11y-font body, html.a11y-font body * { font-family: Arial, Helvetica, sans-serif !important; letter-spacing: .01em; }
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
/* :root מעלה את הסגוליות, כי login.css נטען אחרי הקובץ הזה ומגדיר משתני מצב כהה משלו */
html.a11y-contrast:root {
  --bg: #000; --surface: #000; --surface-variant: #0b0b0b; --text: #fff; --text-muted: #f0f0f0; --outline: #fff;
  --primary: #ffd400; --primary-dark: #ffe45c; --primary-container: #000; --on-primary-container: #ffd400;
  --income: #4ade80; --expense: #ff6b6b;
  --lp-bg: #000; --lp-surface: #000; --lp-text: #fff; --lp-muted: #f0f0f0; --lp-primary: #ffd400; --lp-border: #fff;
  --lp-btn: #ffd400; --lp-btn-ink: #000;
}
html.a11y-contrast body, html.a11y-contrast .lp { background: #000; color: #fff; }
html.a11y-contrast .btn-primary, html.a11y-contrast .a11y-btn, html.a11y-contrast .a11y-panel button[aria-pressed="true"] { color: #000; }
html.a11y-contrast .lp-btn-main { background: #ffd400; color: #000; }
html.a11y-contrast .lp-grad { background: none; -webkit-text-fill-color: #ffd400; color: #ffd400; }
html.a11y-contrast a { color: #ffd400; }
