:root {
  color-scheme: light;
  --bg: #F3ECE1;
  --surface: #ffffff;
  --surface-soft: #F3ECE1;
  --text: #50654C;
  --muted: rgba(80, 101, 76, 0.70);
  --border: rgba(80,101,76,.12);
  --teal: #50654C;
  --teal-strong: #50654C;
  --brand-green: #50654C;
  --green: #4F8B57;
  --red: #C85757;
  --amber: #C49B3A;
  --ink: #50654C;
  --shadow: 0 16px 42px rgba(80, 101, 76, 0.08);
  --radius: 12px;
  --font: "IBM Plex Sans Arabic", "Cairo", "Inter", "Segoe UI", Tahoma, Arial, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #50654C;
  --surface: #2f3e2d;
  --surface-soft: #40523d;
  --text: #F3ECE1;
  --muted: rgba(243, 236, 225, 0.72);
  --border: rgba(243, 236, 225, 0.16);
  --teal: #F3ECE1;
  --teal-strong: #F3ECE1;
  --brand-green: #F3ECE1;
  --green: #86C68D;
  --red: #F08A8A;
  --amber: #E6C66B;
  --ink: #F3ECE1;
  --shadow: 0 18px 46px rgba(18, 26, 31, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
}

html.phone-preview-mode-root {
  background: #F3ECE1;
}

body.phone-preview-mode {
  width: min(390px, 100vw);
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: hidden;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(80, 101, 76, 0.08), 0 26px 70px rgba(80, 101, 76, 0.18);
}

body.auth-locked .app-shell {
  display: none;
}

body.auth-locked .auth-screen {
  display: grid;
}

body.app-locked .app-shell,
body.app-locked .auth-screen,
body.app-locked .currency-setup-screen,
body.app-locked .legal-acceptance-screen {
  display: none;
}

body.app-locked .app-lock-screen {
  display: grid;
}

body.currency-setup-locked .app-shell,
body.currency-setup-locked .auth-screen,
body.currency-setup-locked .app-lock-screen,
body.currency-setup-locked .legal-acceptance-screen {
  display: none;
}

body.currency-setup-locked .currency-setup-screen {
  display: grid;
}

body.legal-acceptance-locked .app-shell,
body.legal-acceptance-locked .auth-screen,
body.legal-acceptance-locked .app-lock-screen,
body.legal-acceptance-locked .currency-setup-screen {
  display: none;
}

body.legal-acceptance-locked .legal-acceptance-screen {
  display: grid;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-screen {
  display: none;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
  background: var(--brand-green);
}

.app-lock-screen {
  display: none;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
  background: var(--brand-green);
}

.currency-setup-screen {
  display: none;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
  background: var(--brand-green);
}

.legal-acceptance-screen {
  display: none;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
  background: var(--brand-green);
}

.auth-panel {
  width: min(420px, 100%);
  padding: 18px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-lock-panel {
  width: min(420px, 100%);
  padding: 18px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.currency-setup-panel {
  display: grid;
  gap: 12px;
  width: min(440px, 100%);
  padding: 18px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-acceptance-panel {
  display: grid;
  gap: 12px;
  width: min(440px, 100%);
  padding: 18px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-acceptance-panel p,
.auth-legal-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.8;
  text-align: center;
}

.auth-legal-note {
  margin-top: -2px;
}

.auth-legal-note a,
.legal-acceptance-links a,
.legal-settings-actions a,
.support-settings-actions a {
  color: var(--brand-green);
  font-weight: 900;
  text-decoration: none;
}

.legal-acceptance-links,
.legal-settings-actions,
.support-settings-actions,
.share-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.legal-acceptance-links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(80, 101, 76, 0.06);
}

.currency-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.currency-choice {
  display: grid;
  gap: 3px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #F3ECE1;
  cursor: pointer;
}

.currency-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.currency-choice strong {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 950;
}

.currency-choice span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.currency-choice:has(input:checked) {
  border-color: var(--teal);
  background: #F3ECE1;
  box-shadow: inset 0 0 0 1px rgba(80, 101, 76, 0.25);
}

.app-lock-form {
  display: grid;
  gap: 10px;
}

.app-lock-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.app-lock-form input {
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #F3ECE1;
  color: var(--text);
  text-align: center;
  font-size: 1.18rem;
  font-weight: 950;
  letter-spacing: 6px;
}

.app-lock-biometric-btn,
.app-lock-signout-btn {
  width: 100%;
  margin-top: 10px;
}

.auth-brand {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 18px;
  text-align: center;
}

.auth-logo {
  display: block;
  width: min(154px, 52vw);
  height: auto;
  object-fit: contain;
}

.auth-brand span,
.auth-status {
  color: var(--muted);
}

.auth-actions {
  display: grid;
  gap: 10px;
}

.auth-provider-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.auth-provider-btn:hover {
  border-color: var(--teal);
  color: var(--teal-strong);
}

.auth-provider-btn span {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-green);
  color: #fff;
  font-weight: 900;
}

.google-identity-button {
  display: flex;
  justify-content: center;
  min-height: 40px;
}

.google-identity-button:empty {
  display: none;
}

.auth-status {
  margin: 14px 0 0;
  font-size: 0.9rem;
  line-height: 1.7;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  overflow-x: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 10px 12px;
  background: var(--brand-green);
  color: #fff;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-bottom: 8px;
}

.sidebar-brand img {
  display: block;
  width: 34px;
  height: auto;
  object-fit: contain;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.primary-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-align: right;
}

.nav-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}

.budget-subnav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 0 6px;
}

.budget-subitem {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.budget-subitem.active,
.budget-subitem:hover {
  background: #fff;
  color: var(--teal-strong);
  border-color: transparent;
}

.auth-user-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.auth-user-mark {
  display: block;
  width: 28px;
  height: auto;
  object-fit: contain;
}

.auth-user-card span {
  min-width: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-card button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: #fff;
  color: var(--teal-strong);
  font-weight: 900;
}

.is-hidden {
  display: none !important;
}

.budget-page {
  display: none;
}

.budget-page.active {
  display: block;
  padding: 10px;
  border-radius: 18px;
  background: var(--brand-green);
}

.main {
  width: min(1440px, 100%);
  min-width: 0;
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
  background: var(--brand-green);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  position: relative;
}

.topbar > div:first-child {
  flex: 0 1 auto;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2vw, 2.25rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 0;
  font-size: 1.12rem;
  line-height: 1.35;
}

.month-control,
.filters,
.export-actions,
.project-export-actions,
.top-actions,
.command-row,
.backup-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.month-control {
  flex-wrap: nowrap;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.month-control input {
  min-width: 0;
}

.top-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
}

.period-control {
  position: relative;
  z-index: 8;
  display: flex;
  flex: 1 1 180px;
  justify-content: center;
  min-width: 0;
}

.period-control select {
  width: min(178px, 100%);
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 6px;
  background: #fff;
  color: var(--brand-green);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.custom-period-fields {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  display: grid;
  grid-template-columns: repeat(2, minmax(116px, 1fr)) 34px;
  gap: 8px;
  width: min(354px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.custom-period-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
}

.custom-period-fields input {
  min-height: 30px;
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 0.7rem;
}

.period-confirm-btn {
  align-self: end;
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  border: 1px solid var(--brand-green);
  border-radius: 10px;
  background: var(--brand-green);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 950;
  line-height: 1;
}

#currentPeriodTitle {
  color: #fff;
  font-size: clamp(1.08rem, 1.4vw, 1.58rem);
  white-space: nowrap;
}

.top-actions .primary-btn,
.top-actions .secondary-btn {
  border-color: rgba(255, 255, 255, 0.34);
  background: #fff;
  color: var(--brand-green);
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  line-height: 1;
}

.project-export-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
}

.compact-export-btn {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 0.72rem;
  line-height: 1;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 7px;
  background: #F3ECE1;
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
}

.icon-btn:hover {
  background: rgba(80, 101, 76, 0.12);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 8px 10px;
}

textarea {
  resize: vertical;
  padding: 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(80, 101, 76, 0.55);
  box-shadow: 0 0 0 3px rgba(80, 101, 76, 0.12);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

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

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi-card .label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.kpi-card .value {
  color: var(--text);
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.kpi-card .hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.kpi-income .value {
  color: var(--green);
}

.kpi-expense .value {
  color: var(--red);
}

.chart-box {
  min-height: 320px;
  overflow: hidden;
}

.chart-box svg {
  display: block;
  width: 100%;
  height: auto;
}

.donut-chart {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(190px, 230px);
  gap: 18px;
  align-items: center;
  min-height: 260px;
}

.donut-svg {
  max-width: 230px;
  justify-self: center;
}

.legend-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legend-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.legend-list strong,
.legend-list small {
  display: block;
  overflow-wrap: anywhere;
}

.legend-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-row,
.category-row,
.rate-row,
.insight-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.compact-row strong,
.category-row strong {
  display: block;
  margin-bottom: 4px;
}

.compact-row small,
.category-row small,
.meta-line {
  color: var(--muted);
}

.amount-income {
  color: var(--green);
  font-weight: 900;
}

.amount-expense {
  color: var(--red);
  font-weight: 900;
}

.entry-panel {
  max-width: 1080px;
}

.budget-entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: stretch;
}

.quick-entry-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.compact-budget-entry {
  grid-template-columns: 1fr;
}

.compact-entry-form {
  align-content: start;
  grid-template-columns: minmax(142px, 0.72fr) minmax(0, 1fr);
  gap: 10px;
}

.input-card {
  display: grid;
  gap: 8px;
  min-height: 46px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #F3ECE1;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.input-card input,
.input-card select {
  min-height: 34px;
  border-color: transparent;
  background: #fff;
  font-weight: 800;
}

.amount-card input {
  font-size: 1.16rem;
  font-weight: 900;
}

.amount-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.amount-card span {
  flex: 0 0 auto;
}

.amount-card input {
  flex: 1 1 auto;
  min-width: 0;
}

.category-card select {
  color: var(--teal-strong);
}

.note-card {
  grid-column: span 2;
}

.voice-review-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(80, 101, 76, 0.26);
  border-radius: 10px;
  background: #F3ECE1;
}

.voice-review-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  min-width: 0;
}

.voice-review-eyebrow {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.voice-review-type {
  font-size: 0.82rem;
  font-weight: 950;
}

.voice-review-type.income {
  color: var(--green);
}

.voice-review-type.expense {
  color: var(--red);
}

.voice-review-value {
  display: grid;
  justify-items: end;
  color: var(--text);
  font-weight: 950;
  line-height: 1.25;
}

.voice-review-value small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}

.voice-review-meta {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.voice-review-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-review-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.voice-review-actions .primary-btn,
.voice-review-actions .secondary-btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.74rem;
}

.recurring-panel {
  display: grid;
  gap: 10px;
}

.recurring-head {
  align-items: center;
  flex-direction: row;
  justify-content: space-between;
}

.recurring-toggle-btn {
  min-width: 64px;
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.76rem;
}

.recurring-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.recurring-summary div {
  display: grid;
  gap: 3px;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #F3ECE1;
}

.recurring-summary span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.recurring-summary strong {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 950;
  line-height: 1.2;
}

.recurring-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(80, 101, 76, 0.22);
  border-radius: 10px;
  background: #F3ECE1;
}

.recurring-kind-card,
.recurring-type-card,
.recurring-note-card,
.recurring-actions {
  grid-column: span 2;
}

.recurring-form .input-card {
  min-height: 40px;
  padding: 4px 6px;
  font-size: 0.72rem;
}

.recurring-form .input-card input {
  min-height: 30px;
  padding: 5px 6px;
  font-size: 0.82rem;
}

.recurring-installment-field {
  display: none;
}

.recurring-form.is-installment-mode .recurring-installment-field {
  display: grid;
}

.recurring-list {
  display: grid;
  gap: 8px;
}

.recurring-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.recurring-card.income {
  border-right: 3px solid var(--green);
}

.recurring-card.expense {
  border-right: 3px solid var(--red);
}

.recurring-card-main,
.recurring-card-side {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.recurring-card-main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-card-main small,
.recurring-card-side small,
.recurring-meta {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1.4;
}

.recurring-badge {
  color: var(--teal-strong);
  font-size: 0.68rem;
  font-weight: 950;
}

.recurring-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.recurring-meta span {
  min-height: 22px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #F3ECE1;
}

.recurring-card-side {
  justify-items: end;
  text-align: left;
}

.recurring-card-actions {
  display: flex;
  gap: 5px;
}

.recurring-card-actions .secondary-btn,
.recurring-card-actions .delete-btn {
  min-height: 28px;
  padding: 5px 7px;
  font-size: 0.66rem;
}

.recurring-empty {
  margin: 0;
  padding: 10px;
}

.hidden-fields {
  display: none;
}

.project-page {
  display: grid;
  gap: 14px;
  padding: 10px;
  border-radius: 18px;
  background: var(--brand-green);
}

.project-kpi-grid {
  margin-bottom: 0;
}

.project-entry-panel .compact-entry-form {
  margin: 0;
}

.project-entry-panel .compact-entry-form.is-disabled-by-access {
  opacity: 0.52;
}

.project-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 12px;
}

.project-add-form.is-hidden {
  display: none;
}

.project-add-form .input-card {
  min-height: 46px;
}

.project-add-form .primary-btn,
.project-add-form .secondary-btn {
  align-self: stretch;
  min-height: 46px;
}

.project-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: min(100%, 420px);
}

.project-select {
  min-height: 38px;
  max-width: 280px;
  border-color: rgba(80, 101, 76, 0.16);
  background: #fff;
  color: var(--text);
  font-weight: 900;
}

.project-icon-btn {
  flex: 0 0 38px;
  border: 1px solid rgba(80, 101, 76, 0.14);
  background: #fff;
  color: var(--brand-green);
}

.project-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.project-icon-btn.danger {
  border-color: #f0c7ce;
  background: #fff6f7;
  color: var(--red);
}

.project-section-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(80, 101, 76, 0.12);
  border-radius: 14px;
  background: #F3ECE1;
}

.project-section-tab {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(80, 101, 76, 0.62);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.project-section-tab.active {
  background: #fff;
  color: var(--brand-green);
  box-shadow: 0 8px 22px rgba(80, 101, 76, 0.08);
}

.project-section-tab.is-hidden,
[data-project-section-panel].is-hidden {
  display: none !important;
}

.project-share-panel {
  margin-bottom: 0;
}

.project-share-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 1.2fr) auto;
  gap: 8px;
  align-items: stretch;
}

.project-share-email-card input {
  text-align: left;
}

.project-share-permission-card {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-share-permission-card legend {
  padding-inline: 4px;
}

.project-share-submit {
  align-self: stretch;
  min-width: 118px;
}

.project-share-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.project-share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(80, 101, 76, 0.12);
  border-radius: 12px;
  background: #F3ECE1;
}

.project-share-row strong,
.project-share-row small {
  display: block;
}

.project-share-row strong {
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.project-share-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.project-share-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.project-share-actions .secondary-btn,
.project-share-actions .danger-btn {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.72rem;
}

.project-share-empty,
.project-share-notice,
.project-access-empty {
  padding: 12px;
  border: 1px dashed rgba(80, 101, 76, 0.18);
  border-radius: 12px;
  background: #F3ECE1;
  color: var(--muted);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.6;
}

.project-share-notice {
  margin: 10px 0 0;
  border-style: solid;
  color: var(--amber);
}

.readonly-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.offers-page {
  padding: 10px;
  border-radius: 18px;
  background: var(--brand-green);
}

.offers-head {
  align-items: flex-start;
}

.offers-filters {
  min-width: min(100%, 420px);
}

.offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.offer-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(80, 101, 76, 0.06);
}

.offer-card.is-expired {
  opacity: 0.62;
}

.offer-card-head,
.offer-meta,
.offer-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.offer-category {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #F3ECE1;
  color: var(--teal-strong);
  font-size: 0.72rem;
  font-weight: 900;
}

.offer-card-head strong {
  color: var(--green);
  font-size: 0.98rem;
  font-weight: 900;
}

.offer-card h3 {
  margin: 0;
  color: var(--brand-green);
  font-size: 1.08rem;
}

.offer-card p {
  margin: 0;
  color: var(--text);
  font-weight: 900;
  line-height: 1.6;
}

.offer-card small,
.offer-meta {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.offer-status {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  direction: rtl;
  unicode-bidi: isolate;
}

.offer-status time {
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
}

.offer-status.is-expired {
  color: var(--red);
  font-weight: 900;
}

.offer-meta a {
  color: var(--teal-strong);
  font-weight: 900;
  text-decoration: none;
}

.offer-code-row {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.offer-code-row code {
  direction: ltr;
  max-width: 48%;
  padding: 7px 9px;
  border-radius: 7px;
  background: #F3ECE1;
  color: var(--brand-green);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.offer-code-row .secondary-btn {
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}

.admin-offers-panel {
  margin-top: 14px;
}

.admin-offer-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.admin-offer-wide {
  grid-column: span 3;
}

.admin-offer-expiry-card {
  direction: rtl;
  text-align: right;
}

.admin-offer-expiry-card span {
  direction: rtl;
  unicode-bidi: isolate;
}

.admin-offer-expiry-card #adminOfferExpiryInput {
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext;
}

.admin-offer-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #F3ECE1;
  color: var(--text);
  font-weight: 900;
}

.admin-offer-toggle input {
  width: 18px;
  min-height: 18px;
}

.admin-offer-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.admin-offer-actions button {
  min-height: 44px;
}

.admin-offers-list {
  display: grid;
  gap: 8px;
}

.admin-offer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.admin-offer-row.is-disabled {
  opacity: 0.62;
}

.admin-offer-row strong,
.admin-offer-row span,
.admin-offer-row small {
  display: block;
  overflow-wrap: anywhere;
}

.admin-offer-row span,
.admin-offer-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.admin-offer-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.admin-offer-row-actions button {
  min-height: 32px;
  padding: 6px 9px;
}

.settings-panel {
  max-width: 560px;
  margin-inline: auto;
}

.settings-list {
  display: grid;
  gap: 10px;
}

.settings-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #F3ECE1;
}

.settings-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.settings-row strong {
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
  color: var(--text);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.settings-row small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
}

.settings-sync-row strong {
  direction: rtl;
  text-align: right;
  color: var(--teal-strong);
}

.currency-settings-row strong,
.fiscal-settings-row strong {
  direction: rtl;
  text-align: right;
  color: var(--teal-strong);
}

.currency-settings-row select,
.fiscal-settings-row select {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-weight: 900;
}

.theme-settings-row strong {
  direction: rtl;
  text-align: right;
  color: var(--teal-strong);
}

.theme-settings-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.theme-settings-control label {
  position: relative;
  min-width: 0;
}

.theme-settings-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.theme-settings-control span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}

.theme-settings-control label:has(input:checked) span {
  border-color: var(--brand-green);
  background: var(--brand-green);
  color: #fff;
}

.settings-sync-row small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
}

.app-lock-settings-row small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
}

.app-lock-settings-row strong {
  direction: rtl;
  text-align: right;
}

.app-lock-settings-actions {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) auto auto auto;
  gap: 7px;
  align-items: stretch;
}

.app-lock-settings-actions input {
  min-height: 34px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  text-align: center;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 4px;
}

.app-lock-settings-actions .secondary-btn {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.consent-settings-row strong {
  direction: rtl;
  text-align: right;
}

.consent-settings-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.consent-settings-actions .secondary-btn {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 0.7rem;
}

.support-settings-row strong,
.share-settings-row strong {
  direction: rtl;
  text-align: right;
  color: var(--teal-strong);
}

.support-settings-actions,
.share-settings-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: flex-start;
}

.support-settings-actions .secondary-btn,
.legal-settings-actions .secondary-btn,
.share-settings-actions .secondary-btn {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 0.72rem;
}

.support-settings-actions .secondary-btn,
.share-settings-actions .secondary-btn {
  justify-content: center;
  min-width: 0;
  text-align: center;
  white-space: normal;
}

.share-settings-actions {
  grid-template-columns: 1fr;
}

.account-delete-settings-row {
  border-color: rgba(200, 87, 87, 0.26);
  background: rgba(200, 87, 87, 0.05);
}

.account-delete-settings-row strong {
  direction: rtl;
  text-align: right;
  color: var(--red);
}

.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid rgba(200, 87, 87, 0.36);
  border-radius: 12px;
  background: #fff6f7;
  color: var(--red);
  font-weight: 900;
}

.danger-btn:hover {
  background: #ffecef;
}

.danger-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.settings-delete-account-btn {
  justify-self: start;
  padding: 8px 14px;
}

body.is-offline .settings-sync-row strong {
  color: var(--amber);
}

.settings-logout-btn {
  justify-self: start;
}

.analytics-consent-banner {
  position: fixed;
  z-index: 1000;
  right: 14px;
  bottom: 86px;
  left: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  max-width: 820px;
  margin-inline: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: #50654C;
  color: #fff;
  box-shadow: 0 20px 60px rgba(80, 101, 76, 0.28);
}

.analytics-consent-banner strong,
.analytics-consent-dialog h2 {
  font-size: 0.98rem;
  line-height: 1.3;
}

.analytics-consent-banner p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  line-height: 1.6;
}

.analytics-consent-actions,
.analytics-consent-custom {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}

.analytics-consent-actions button,
.analytics-consent-custom button,
.analytics-consent-dialog button {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 7px;
  background: #fff;
  color: #50654C;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
}

.analytics-consent-custom {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.analytics-consent-custom label,
.analytics-consent-dialog label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.analytics-consent-modal {
  position: fixed;
  z-index: 1001;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(80, 101, 76, 0.5);
}

.analytics-consent-dialog {
  display: grid;
  gap: 12px;
  width: min(420px, 100%);
  padding: 18px;
  border-radius: 10px;
  background: #50654C;
  color: #fff;
}

.admin-panel {
  min-height: calc(100vh - 48px);
}

.admin-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.admin-kpi {
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #F3ECE1;
}

.admin-kpi span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-kpi strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 900;
}

.admin-email-kpi strong,
.admin-user-email,
.admin-detail-email {
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}

.admin-email-kpi strong {
  font-size: clamp(0.72rem, 1.35vw, 0.94rem);
}

.admin-user-email {
  display: block;
  max-width: 100%;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 900;
}

.admin-role-label {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.admin-table-wrap {
  margin-bottom: 12px;
}

.admin-schema-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #f3d19b;
  border-radius: var(--radius);
  background: #fff7ed;
  color: #50654C;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.7;
}

.admin-user-row {
  cursor: pointer;
}

.admin-user-row:hover {
  background: #F3ECE1;
}

.admin-user-row.selected {
  background: #F3ECE1;
  box-shadow: inset 3px 0 0 var(--teal);
}

.admin-details {
  display: grid;
  gap: 10px;
}

.admin-detail-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.admin-operations-card {
  width: 100%;
  max-width: 780px;
  margin-inline: auto;
}

.admin-detail-card h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.admin-operations-title {
  text-align: center;
}

.admin-operation-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 360px);
  margin: 0 auto 10px;
}

.admin-operation-tab {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
}

.admin-operation-tab.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.admin-operation-tab:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.admin-project-select {
  display: block;
  width: min(100%, 360px);
  min-height: 38px;
  margin: 0 auto 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 900;
}

.admin-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-detail-head h3 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(0.78rem, 1.5vw, 1rem);
}

.admin-clear-btn {
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
}

.admin-mini-list {
  display: grid;
  gap: 8px;
}

.admin-mini-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border-radius: 7px;
  background: #F3ECE1;
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-mini-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-mini-row small,
.admin-subtext {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.5;
}

.presence-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.presence-badge.online {
  background: rgba(79, 139, 87, 0.14);
  color: #4F8B57;
}

.presence-badge.offline {
  background: #F3ECE1;
  color: rgba(80, 101, 76, 0.70);
}

.mode-tabs,
.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #F3ECE1;
}

.mode-tab,
.segmented span {
  min-height: 32px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.mode-tab.active,
.segmented input:checked + span {
  background: #fff;
  color: var(--teal-strong);
  box-shadow: 0 1px 8px rgba(80, 101, 76, 0.09);
}

.mode-panel {
  display: none;
}

.mode-panel.active {
  display: block;
}

.entry-form,
.category-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.entry-form label,
.category-form label,
.command-box label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.segmented {
  grid-column: span 2;
  width: max-content;
  margin: 0;
  border: 1px solid var(--border);
}

.compact-entry-form .type-card {
  grid-column: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 5px;
}

.compact-entry-form .amount-card {
  grid-column: auto;
}

.segmented legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.segmented label {
  display: block;
}

.segmented input {
  position: absolute;
  width: 1px;
  min-height: 0;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.span-2 {
  grid-column: span 2;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.conversion-preview {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.file-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 7px;
  font-weight: 900;
  white-space: nowrap;
}

.primary-btn {
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
}

.primary-btn:hover {
  background: var(--teal-strong);
}

.secondary-btn,
.file-btn span {
  border: 1px solid rgba(80, 101, 76, 0.28);
  background: var(--surface-soft);
  color: var(--teal-strong);
}

.ghost-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
}

.command-box {
  display: grid;
  gap: 12px;
}

.preview-card {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #F3ECE1;
  color: var(--muted);
}

.preview-card.ready {
  background: #F3ECE1;
  color: var(--text);
  border-color: rgba(80, 101, 76, 0.25);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
}

.voice-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.voice-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 160px;
  height: 160px;
  border: 0;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 18px 40px rgba(80, 101, 76, 0.22);
}

.voice-btn svg {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.voice-btn.floating {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  width: 64px;
  height: 64px;
  box-shadow: 0 16px 34px rgba(80, 101, 76, 0.3);
  touch-action: none;
}

.voice-btn.dragging {
  cursor: grabbing;
}

.voice-btn.is-hidden {
  display: none;
}

.voice-btn.compact {
  width: 86px;
  height: 86px;
  flex: 0 0 auto;
}

.voice-btn.compact .voice-ring {
  inset: 9px;
}

.voice-btn strong {
  position: relative;
  z-index: 1;
}

.voice-ring {
  position: absolute;
  inset: 14px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
}

.voice-btn.listening .voice-ring {
  animation: pulse 1.1s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.92);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

.voice-content {
  display: grid;
  gap: 10px;
}

.voice-status {
  min-height: 24px;
  color: var(--muted);
  font-weight: 800;
}

.table-wrap {
  overflow-x: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
}

.tx-date,
.tx-time {
  display: block;
  white-space: nowrap;
}

.tx-date {
  color: var(--text);
  font-weight: 900;
}

.tx-time {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.tx-main-amount,
.tx-original {
  display: block;
  white-space: nowrap;
}

.tx-original {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.pill.expense {
  background: #fff1f3;
  color: var(--red);
}

.pill.income {
  background: #F3ECE1;
  color: var(--green);
}

.delete-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #f0c7ce;
  border-radius: 7px;
  background: #fff6f7;
  color: var(--red);
  font-weight: 900;
}

#transactionsPanel,
#projectTransactionsPanel {
  padding: 14px;
}

#transactionsPanel .panel-head,
#projectTransactionsPanel .panel-head {
  margin-bottom: 10px;
}

#transactionsPanel table,
#projectTransactionsPanel table {
  font-size: 0.76rem;
}

#transactionsPanel th,
#transactionsPanel td,
#projectTransactionsPanel th,
#projectTransactionsPanel td {
  padding: 8px 5px;
}

#transactionsPanel th:nth-child(3),
#transactionsPanel td:nth-child(3),
#projectTransactionsPanel th:nth-child(3),
#projectTransactionsPanel td:nth-child(3) {
  padding-inline: 10px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#transactionsPanel .tx-col-date,
#projectTransactionsPanel .tx-col-date {
  width: 28%;
}

#transactionsPanel .tx-col-value,
#projectTransactionsPanel .tx-col-value {
  width: 27%;
}

#transactionsPanel .tx-col-note,
#projectTransactionsPanel .tx-col-note {
  width: auto;
}

#transactionsPanel .tx-col-action,
#projectTransactionsPanel .tx-col-action {
  width: 52px;
}

#transactionsPanel th:last-child,
#transactionsPanel td:last-child,
#projectTransactionsPanel th:last-child,
#projectTransactionsPanel td:last-child {
  padding-inline: 3px;
  text-align: center;
  overflow: visible;
}

#transactionsPanel .tx-date,
#transactionsPanel .tx-time,
#transactionsPanel .tx-main-amount,
#transactionsPanel .tx-original,
#projectTransactionsPanel .tx-date,
#projectTransactionsPanel .tx-time,
#projectTransactionsPanel .tx-main-amount,
#projectTransactionsPanel .tx-original {
  font-size: 0.72rem;
}

#transactionsPanel .delete-btn,
#projectTransactionsPanel .delete-btn {
  margin-inline: auto;
  width: 42px;
  height: 28px;
  border-radius: 6px;
  font-size: 0.68rem;
  line-height: 1;
}

.category-form {
  grid-template-columns: 1fr;
}

.inline-category-form {
  margin-bottom: 14px;
}

.category-list,
.rates-list,
.insight-grid {
  display: grid;
  gap: 10px;
}

.category-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.category-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.category-main div {
  min-width: 0;
}

.category-main strong,
.category-main small {
  overflow-wrap: anywhere;
}

.rate-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 180px);
}

.report-chart {
  min-height: 280px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
}

.report-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.report-table th,
.report-table td {
  padding: 8px;
  border: 1px solid var(--border);
  text-align: right;
  vertical-align: top;
}

.report-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.compact-chart {
  min-height: 240px;
}

.printable-only {
  display: none;
}

.insight-card {
  align-items: flex-start;
}

.schema-note {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #F3ECE1;
}

.schema-note p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.8;
}

.file-btn input {
  display: none;
}

.notice {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(80, 101, 76, 0.22);
  border-radius: var(--radius);
  background: #F3ECE1;
  color: var(--teal-strong);
  font-weight: 800;
}

.notice.show {
  display: flex;
}

.notice-action {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid rgba(80, 101, 76, 0.28);
  border-radius: 7px;
  background: #fff;
  color: var(--teal-strong);
  font-weight: 900;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .sidebar {
    position: sticky;
    z-index: 5;
    top: 0;
    align-self: start;
    width: 100%;
    min-width: 0;
    height: auto;
    padding: 10px 12px;
    overflow-x: hidden;
  }

  .nav-list {
    grid-template-columns: minmax(0, 1fr);
    overflow-x: hidden;
  }

  .nav-item {
    justify-content: center;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-user-card {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
  }
}

@media (max-width: 780px) {
  .app-shell {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }

  .main {
    padding: 16px;
  }

  .primary-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 35;
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
    gap: 5px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(80, 101, 76, 0.98);
    box-shadow: 0 -12px 30px rgba(80, 101, 76, 0.28);
  }

  .sidebar-brand,
  .auth-user-card {
    display: none;
  }

  .panel-head,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 8px;
  }

  .period-control {
    flex: 1 1 112px;
  }

  .period-control select {
    width: 118px;
    min-height: 30px;
    padding: 5px 6px;
    font-size: 0.64rem;
  }

  .custom-period-fields {
    width: min(320px, calc(100vw - 20px));
    grid-template-columns: repeat(2, minmax(0, 1fr)) 32px;
    gap: 6px;
  }

  .custom-period-fields input {
    font-size: 0.64rem;
  }

  .period-confirm-btn {
    width: 32px;
    height: 30px;
    border-radius: 9px;
    font-size: 0.78rem;
  }

  #currentPeriodTitle {
    font-size: 1.25rem;
  }

  .top-actions .primary-btn,
  .top-actions .secondary-btn {
    min-width: 52px;
    min-height: 30px;
    padding: 6px 8px;
    font-size: 0.7rem;
  }

  .month-control {
    align-self: stretch;
  }

  .grid-two,
  .entry-form,
  .quick-entry-form,
  .budget-entry-grid,
  .admin-kpis,
  .voice-layout {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    padding: 16px;
  }

  .currency-setup-panel {
    padding: 16px;
  }

  .currency-choice-grid {
    grid-template-columns: 1fr;
  }

  .project-toolbar {
    width: 100%;
    min-width: 0;
  }

  .project-select {
    flex: 1 1 auto;
    max-width: none;
  }

  .project-add-form {
    grid-template-columns: 1fr;
  }

  .compact-entry-form {
    grid-template-columns: minmax(132px, 0.72fr) minmax(0, 1fr);
  }

  .span-2,
  .segmented {
    grid-column: auto;
  }

  .compact-entry-form .type-card,
  .compact-entry-form .amount-card {
    grid-column: auto;
  }

  .compact-entry-form .note-card,
  .compact-entry-form .form-actions {
    grid-column: span 2;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .kpi-card {
    min-height: 104px;
    padding: 12px;
  }

  .kpi-card .value {
    font-size: 1.25rem;
  }

  .donut-chart {
    grid-template-columns: 1fr;
  }

  .voice-btn {
    width: 132px;
    height: 132px;
  }

  .voice-btn.compact {
    width: 76px;
    height: 76px;
  }

  .voice-btn.floating {
    width: 58px;
    height: 58px;
    right: 16px;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .voice-btn svg {
    width: 26px;
    height: 26px;
  }

  .nav-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav-item {
    min-height: 46px;
    padding: 7px 4px;
    gap: 4px;
    flex-direction: column;
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    font-weight: 900;
    line-height: 1.15;
  }

  .nav-icon {
    width: 23px;
    height: 23px;
  }

  .nav-item.active {
    border-color: transparent;
    background: #fff;
    color: var(--teal-strong);
  }
}

@media (max-width: 780px) {
  body.is-budget-view .main,
  body.is-project-view .main {
    padding: 10px;
  }

  body.is-budget-view .topbar {
    margin-bottom: 8px;
  }

  body.is-budget-view #currentPeriodTitle {
    font-size: 0.92rem;
    line-height: 1.2;
  }

  body.is-budget-view .period-control {
    flex-basis: 106px;
  }

  body.is-budget-view .period-control select {
    width: 108px;
    min-height: 28px;
    padding: 5px 5px;
    font-size: 0.6rem;
  }

  body.is-budget-view .top-actions .primary-btn,
  body.is-budget-view .top-actions .secondary-btn {
    min-width: 46px;
    min-height: 28px;
    padding: 5px 7px;
    font-size: 0.64rem;
  }

  body.is-budget-view .budget-page.active,
  body.is-project-view .project-page {
    padding: 8px;
    border-radius: 14px;
  }

  body.is-budget-view .panel,
  body.is-project-view .panel {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 12px;
  }

  body.is-budget-view .panel-head,
  body.is-project-view .panel-head {
    gap: 8px;
    margin-bottom: 8px;
  }

  body.is-budget-view h2,
  body.is-project-view h2 {
    font-size: 0.92rem;
    line-height: 1.25;
  }

  body.is-budget-view .kpi-grid,
  body.is-project-view .project-kpi-grid {
    gap: 7px;
    margin-bottom: 8px;
  }

  body.is-budget-view .kpi-card,
  body.is-project-view .kpi-card {
    min-height: 72px;
    padding: 8px;
    border-radius: 10px;
    box-shadow: none;
  }

  body.is-budget-view .kpi-card .label,
  body.is-project-view .kpi-card .label {
    gap: 6px;
    margin-bottom: 5px;
    font-size: 0.66rem;
    line-height: 1.25;
  }

  body.is-budget-view .kpi-card .value,
  body.is-project-view .kpi-card .value {
    font-size: clamp(0.88rem, 4.5vw, 1.12rem);
    line-height: 1.12;
    word-break: break-word;
  }

  body.is-budget-view .kpi-card .hint,
  body.is-project-view .kpi-card .hint {
    margin-top: 5px;
    font-size: 0.62rem;
    line-height: 1.25;
  }

  body.is-budget-view .compact-entry-form,
  body.is-project-view .compact-entry-form {
    grid-template-columns: minmax(108px, 0.66fr) minmax(0, 1fr);
    gap: 7px;
  }

  body.is-budget-view .input-card,
  body.is-project-view .input-card {
    gap: 4px;
    min-height: 40px;
    padding: 4px 6px;
    font-size: 0.7rem;
    line-height: 1.25;
  }

  body.is-budget-view .input-card input,
  body.is-budget-view .input-card select,
  body.is-project-view .input-card input,
  body.is-project-view .input-card select {
    min-height: 30px;
    padding: 5px 6px;
    font-size: 0.86rem;
    line-height: 1.2;
  }

  body.is-budget-view .amount-card,
  body.is-project-view .amount-card {
    gap: 7px;
  }

  body.is-budget-view .amount-card input,
  body.is-project-view .amount-card input {
    font-size: 1rem;
  }

  body.is-budget-view .segmented,
  body.is-project-view .segmented {
    padding: 3px;
  }

  body.is-budget-view .mode-tab,
  body.is-budget-view .segmented span,
  body.is-project-view .mode-tab,
  body.is-project-view .segmented span {
    min-height: 30px;
    padding: 5px 7px;
    font-size: 0.7rem;
    line-height: 1.2;
  }

  body.is-budget-view .segmented label,
  body.is-project-view .segmented label {
    display: flex;
    align-items: center;
    line-height: 1.1;
  }

  body.is-budget-view .form-actions,
  body.is-project-view .form-actions {
    gap: 7px;
  }

  body.is-budget-view .primary-btn,
  body.is-budget-view .secondary-btn,
  body.is-project-view .primary-btn,
  body.is-project-view .secondary-btn {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 0.76rem;
    line-height: 1.2;
  }

  body.is-budget-view .voice-review-card {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  body.is-budget-view .voice-review-main {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body.is-budget-view .voice-review-value {
    grid-column: 1 / -1;
    justify-items: start;
  }

  body.is-budget-view .voice-review-actions {
    justify-content: stretch;
  }

  body.is-budget-view .voice-review-actions button {
    flex: 1 1 0;
  }

  body.is-budget-entry-page {
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.is-budget-entry-page .app-shell {
    min-height: 100dvh;
    overflow: visible;
  }

  body.is-budget-entry-page .main {
    display: block;
    min-height: auto;
    overflow: visible;
  }

  body.is-budget-entry-page #budgetView,
  body.is-budget-entry-page .budget-page.active {
    min-height: auto;
    overflow: visible;
  }

  body.is-budget-entry-page .budget-page.active {
    display: grid;
    gap: 7px;
  }

  body.is-budget-entry-page .quick-panel {
    min-height: auto;
    overflow: visible;
  }

  body.is-budget-entry-page .quick-panel .panel-head {
    margin-bottom: 6px;
  }

  body.is-budget-view .recurring-panel {
    gap: 7px;
  }

  body.is-budget-view .recurring-summary {
    gap: 6px;
  }

  body.is-budget-view .recurring-summary div {
    min-height: 48px;
    padding: 6px;
  }

  body.is-budget-view .recurring-summary span {
    font-size: 0.6rem;
    line-height: 1.25;
  }

  body.is-budget-view .recurring-summary strong {
    font-size: 0.72rem;
    line-height: 1.25;
    word-break: break-word;
  }

  body.is-budget-view .recurring-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 7px;
  }

  body.is-budget-view .recurring-kind-card,
  body.is-budget-view .recurring-type-card,
  body.is-budget-view .recurring-note-card,
  body.is-budget-view .recurring-actions {
    grid-column: span 2;
  }

  body.is-budget-view .recurring-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    padding: 8px;
  }

  body.is-budget-view .recurring-card-side {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: right;
  }

  body.is-budget-view .recurring-card-actions {
    flex: 0 0 auto;
  }

  body.is-budget-entry-page .note-card {
    min-height: 42px;
  }

  body.is-project-view .project-page {
    gap: 8px;
  }

  body.is-project-view .project-toolbar {
    gap: 5px;
  }

  body.is-project-view .project-select {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 0.78rem;
    line-height: 1.2;
  }

  body.is-project-view .project-icon-btn {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  body.is-project-view .project-icon-btn svg {
    width: 16px;
    height: 16px;
  }

  body.is-project-view .project-add-form {
    gap: 7px;
    margin-bottom: 8px;
  }

  body.is-project-view .project-section-tabs {
    gap: 5px;
    padding: 3px;
    border-radius: 12px;
  }

  body.is-project-view .project-section-tab {
    min-height: 32px;
    font-size: 0.74rem;
  }

  body.is-project-view .project-add-form .input-card,
  body.is-project-view .project-add-form .primary-btn,
  body.is-project-view .project-add-form .secondary-btn {
    min-height: 38px;
  }

  body.is-budget-records-page #transactionsPanel,
  body.is-project-view #projectTransactionsPanel {
    padding: 9px;
  }

  body.is-project-view #projectTransactionsPanel .panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  body.is-project-view #projectTransactionsPanel .project-export-actions {
    justify-self: end;
  }

  body.is-project-view #projectTransactionsPanel .compact-export-btn {
    min-width: 48px;
    min-height: 28px;
    padding: 5px 7px;
    font-size: 0.64rem;
  }

  body.is-budget-records-page #transactionsPanel .filters,
  body.is-project-view #projectTransactionsPanel .filters {
    grid-column: 1 / -1;
    gap: 5px;
    width: 100%;
  }

  body.is-budget-records-page #transactionsPanel .filters select,
  body.is-budget-records-page #transactionsPanel .filters input,
  body.is-project-view #projectTransactionsPanel .filters select,
  body.is-project-view #projectTransactionsPanel .filters input {
    min-height: 32px;
    padding: 5px 6px;
    font-size: 0.72rem;
  }

  body.is-budget-records-page #transactionsPanel table,
  body.is-project-view #projectTransactionsPanel table {
    font-size: 0.68rem;
  }

  body.is-budget-records-page #transactionsPanel th,
  body.is-budget-records-page #transactionsPanel td,
  body.is-project-view #projectTransactionsPanel th,
  body.is-project-view #projectTransactionsPanel td {
    padding: 6px 4px;
    line-height: 1.35;
  }

  body.is-budget-records-page #transactionsPanel .tx-date,
  body.is-budget-records-page #transactionsPanel .tx-time,
  body.is-budget-records-page #transactionsPanel .tx-main-amount,
  body.is-budget-records-page #transactionsPanel .tx-original,
  body.is-project-view #projectTransactionsPanel .tx-date,
  body.is-project-view #projectTransactionsPanel .tx-time,
  body.is-project-view #projectTransactionsPanel .tx-main-amount,
  body.is-project-view #projectTransactionsPanel .tx-original {
    font-size: 0.66rem;
    line-height: 1.3;
  }

  body.is-budget-records-page #transactionsPanel .delete-btn,
  body.is-project-view #projectTransactionsPanel .delete-btn {
    width: 36px;
    height: 26px;
    font-size: 0.62rem;
  }

  body.is-project-view .project-share-form {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  body.is-project-view .project-share-permission-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.is-project-view .project-share-permission-card span {
    min-height: 30px;
    padding: 5px 4px;
    font-size: 0.66rem;
  }

  body.is-project-view .project-share-row {
    align-items: stretch;
    flex-direction: column;
    padding: 9px;
  }

  body.is-project-view .project-share-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  body.is-project-view .project-share-actions .secondary-btn,
  body.is-project-view .project-share-actions .danger-btn {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 0.66rem;
  }

  .analytics-consent-banner {
    grid-template-columns: 1fr;
    bottom: calc(78px + env(safe-area-inset-bottom));
    padding: 12px;
  }

  .offers-page {
    padding: 8px;
  }

  .offers-panel {
    padding: 10px;
  }

  .offers-filters {
    width: 100%;
    min-width: 0;
  }

  .offers-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .offer-card {
    gap: 8px;
    padding: 11px;
  }

  .offer-card h3 {
    font-size: 0.96rem;
  }

  .offer-card p {
    font-size: 0.82rem;
  }

  .offer-code-row code {
    max-width: 52%;
    font-size: 0.74rem;
  }

  .admin-offer-form {
    grid-template-columns: 1fr;
  }

  .admin-offer-wide {
    grid-column: auto;
  }

  .admin-offer-actions,
  .admin-offer-row,
  .admin-offer-row-actions {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .app-lock-settings-actions {
    grid-template-columns: 1fr;
  }

  .app-lock-settings-actions .secondary-btn {
    width: 100%;
  }
}

.brand-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--bg);
  pointer-events: none;
  animation: brandSplashFade 300ms ease-out 300ms forwards;
}

.brand-splash img {
  width: min(132px, 34vw);
  height: auto;
  object-fit: contain;
}

@keyframes brandSplashFade {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.auth-screen,
.app-lock-screen,
.currency-setup-screen,
.main,
.budget-page.active,
.project-page,
.offers-page {
  background: var(--bg);
}

.sidebar {
  border-left: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.nav-item {
  color: var(--brand-green);
  opacity: 0.4;
}

.nav-item:hover,
.nav-item.active {
  border-color: var(--border);
  background: #fff;
  color: var(--brand-green);
  opacity: 1;
}

.budget-subitem {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.52);
  color: var(--brand-green);
  opacity: 0.62;
}

.budget-subitem.active,
.budget-subitem:hover {
  background: #fff;
  color: var(--brand-green);
  opacity: 1;
}

.auth-user-card {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.58);
}

.auth-user-card span {
  color: var(--muted);
}

.panel,
.kpi-card,
.auth-panel,
.app-lock-panel,
.currency-setup-panel,
.offer-card,
.recurring-card,
.admin-offer-row {
  border-color: var(--border);
  background: #fff;
}

#currentPeriodTitle,
h1,
h2,
h3,
.kpi-card .value,
.offer-card h3 {
  color: var(--text);
}

input,
select,
textarea,
.input-card,
.auth-provider-btn,
.currency-choice,
.project-select {
  border-color: rgba(80, 101, 76, 0.18);
  border-radius: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(80, 101, 76, 0.12);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.file-btn span,
.auth-provider-btn,
.primary-link,
.secondary-link,
.header-action {
  border-radius: 14px;
}

.primary-btn {
  border-color: var(--brand-green);
  background: var(--brand-green);
  color: #fff;
}

.primary-btn:hover {
  background: #4a5d46;
}

.primary-btn:active {
  background: #445640;
}

.primary-btn:disabled,
.secondary-btn:disabled,
.auth-provider-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.secondary-btn,
.file-btn span {
  border-color: var(--brand-green);
  background: #fff;
  color: var(--brand-green);
}

.voice-btn {
  background: var(--brand-green);
  color: #fff;
  box-shadow: 0 16px 34px rgba(80, 101, 76, 0.28);
}

.nav-icon,
.project-icon-btn svg,
.voice-btn svg {
  stroke: currentColor;
}

.recurring-card-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.recurring-card-actions .secondary-btn,
.recurring-card-actions .delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 54px;
  min-width: 54px;
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.recurring-card-actions .delete-btn {
  border-color: rgba(200, 87, 87, 0.32);
  background: #fff6f7;
  color: var(--red);
}

html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"].phone-preview-mode-root {
  background: var(--bg);
  color: var(--text);
}

html[data-theme="dark"] body.phone-preview-mode {
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(243, 236, 225, 0.14), 0 26px 70px rgba(18, 26, 31, 0.28);
}

html[data-theme="dark"] .brand-splash,
html[data-theme="dark"] .auth-screen,
html[data-theme="dark"] .app-lock-screen,
html[data-theme="dark"] .currency-setup-screen,
html[data-theme="dark"] .legal-acceptance-screen,
html[data-theme="dark"] .main,
html[data-theme="dark"] .budget-page.active,
html[data-theme="dark"] .project-page,
html[data-theme="dark"] .offers-page {
  background: var(--bg);
}

html[data-theme="dark"] .sidebar {
  border-left-color: var(--border);
  background: #43573f;
  color: var(--text);
}

html[data-theme="dark"] .sidebar-brand,
html[data-theme="dark"] .auth-user-mark,
html[data-theme="dark"] .auth-logo {
  padding: 4px;
  border-radius: 12px;
  background: rgba(243, 236, 225, 0.94);
}

html[data-theme="dark"] .auth-logo {
  padding: 8px;
}

html[data-theme="dark"] .nav-item {
  color: rgba(243, 236, 225, 0.54);
}

html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .nav-item.active {
  border-color: var(--border);
  background: rgba(243, 236, 225, 0.12);
  color: var(--text);
}

html[data-theme="dark"] .budget-subitem {
  border-color: var(--border);
  background: rgba(243, 236, 225, 0.08);
  color: rgba(243, 236, 225, 0.68);
}

html[data-theme="dark"] .budget-subitem.active,
html[data-theme="dark"] .budget-subitem:hover {
  background: rgba(243, 236, 225, 0.94);
  color: #50654C;
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .auth-panel,
html[data-theme="dark"] .app-lock-panel,
html[data-theme="dark"] .currency-setup-panel,
html[data-theme="dark"] .legal-acceptance-panel,
html[data-theme="dark"] .offer-card,
html[data-theme="dark"] .recurring-card,
html[data-theme="dark"] .admin-offer-row,
html[data-theme="dark"] .analytics-consent-dialog {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] .settings-row,
html[data-theme="dark"] .input-card,
html[data-theme="dark"] .currency-choice,
html[data-theme="dark"] .recurring-meta span,
html[data-theme="dark"] .mode-tabs,
html[data-theme="dark"] .segmented,
html[data-theme="dark"] .project-section-tabs,
html[data-theme="dark"] .project-share-row,
html[data-theme="dark"] .project-share-empty,
html[data-theme="dark"] .project-share-notice,
html[data-theme="dark"] .project-access-empty,
html[data-theme="dark"] .compact-row,
html[data-theme="dark"] .category-row,
html[data-theme="dark"] .rate-row,
html[data-theme="dark"] .insight-card,
html[data-theme="dark"] .admin-schema-notice,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .voice-review-card,
html[data-theme="dark"] .offer-code-row code {
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--text);
}

html[data-theme="dark"] .project-section-tab {
  color: rgba(243, 236, 225, 0.62);
}

html[data-theme="dark"] .project-section-tab.active {
  background: #F3ECE1;
  color: #50654C;
  box-shadow: none;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .currency-settings-row select,
html[data-theme="dark"] .fiscal-settings-row select,
html[data-theme="dark"] .app-lock-settings-actions input {
  border-color: rgba(243, 236, 225, 0.20);
  background: #253323;
  color: var(--text);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: rgba(243, 236, 225, 0.48);
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  border-color: rgba(243, 236, 225, 0.72);
  box-shadow: 0 0 0 3px rgba(243, 236, 225, 0.14);
}

html[data-theme="dark"] .primary-btn {
  border-color: #F3ECE1;
  background: #F3ECE1;
  color: #50654C;
}

html[data-theme="dark"] .primary-btn:hover {
  background: #e6ded1;
}

html[data-theme="dark"] .primary-btn:active {
  background: #d8d0c4;
}

html[data-theme="dark"] .secondary-btn,
html[data-theme="dark"] .ghost-btn,
html[data-theme="dark"] .file-btn span,
html[data-theme="dark"] .auth-provider-btn {
  border-color: rgba(243, 236, 225, 0.28);
  background: transparent;
  color: var(--text);
}

html[data-theme="dark"] .theme-settings-control span {
  border-color: var(--border);
  background: #253323;
  color: var(--text);
}

html[data-theme="dark"] .theme-settings-control label:has(input:checked) span {
  border-color: #F3ECE1;
  background: #F3ECE1;
  color: #50654C;
}

html[data-theme="dark"] .top-actions .primary-btn,
html[data-theme="dark"] .top-actions .secondary-btn,
html[data-theme="dark"] .project-export-actions .primary-btn,
html[data-theme="dark"] .project-export-actions .secondary-btn {
  border-color: rgba(243, 236, 225, 0.36);
  background: #F3ECE1;
  color: #50654C;
}

html[data-theme="dark"] .period-control select {
  border-color: rgba(243, 236, 225, 0.36);
  background: #F3ECE1;
  color: #50654C;
}

html[data-theme="dark"] .custom-period-fields {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] .period-confirm-btn {
  border-color: #F3ECE1;
  background: #F3ECE1;
  color: #50654C;
}

html[data-theme="dark"] .auth-provider-btn span {
  background: #F3ECE1;
  color: #50654C;
}

html[data-theme="dark"] .delete-btn,
html[data-theme="dark"] .recurring-card-actions .delete-btn {
  border-color: rgba(240, 138, 138, 0.36);
  background: rgba(240, 138, 138, 0.12);
  color: var(--red);
}

html[data-theme="dark"] .account-delete-settings-row {
  border-color: rgba(240, 138, 138, 0.34);
  background: rgba(240, 138, 138, 0.10);
}

html[data-theme="dark"] .danger-btn {
  border-color: rgba(240, 138, 138, 0.38);
  background: rgba(240, 138, 138, 0.12);
  color: var(--red);
}

html[data-theme="dark"] .danger-btn:hover {
  background: rgba(240, 138, 138, 0.18);
}

html[data-theme="dark"] .icon-btn {
  background: rgba(243, 236, 225, 0.12);
  color: var(--text);
}

html[data-theme="dark"] .icon-btn:hover {
  background: rgba(243, 236, 225, 0.18);
}

html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] table {
  color: var(--text);
}

html[data-theme="dark"] th,
html[data-theme="dark"] td {
  border-color: var(--border);
}

html[data-theme="dark"] .notice {
  background: #F3ECE1;
  color: #50654C;
}

html[data-theme="dark"] .voice-btn {
  background: #F3ECE1;
  color: #50654C;
  box-shadow: 0 16px 34px rgba(18, 26, 31, 0.26);
}

html[data-theme="dark"] .analytics-consent-banner {
  color: var(--text);
}

@media (max-width: 780px) {
  .primary-nav {
    border-top-color: var(--border);
    background: rgba(243, 236, 225, 0.98);
  }

  .nav-item {
    border-color: transparent;
    background: transparent;
  }

  html[data-theme="dark"] .primary-nav {
    border-top-color: var(--border);
    background: rgba(67, 87, 63, 0.98);
  }

  html[data-theme="dark"] .nav-item {
    color: rgba(243, 236, 225, 0.54);
  }

  html[data-theme="dark"] .nav-item.active {
    background: rgba(243, 236, 225, 0.14);
    color: var(--text);
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .notice,
  .voice-btn.floating,
  .quick-panel,
  .chart-panel,
  #transactionsPanel,
  #categoriesPanel,
  .settings-grid,
  .top-actions,
  .export-actions {
    display: none !important;
  }

  .app-shell,
  .main {
    display: block;
    padding: 0;
  }

  #budgetView,
  #printableReport {
    display: block !important;
  }

  body.printing-project-report #budgetView,
  body.printing-project-report .project-panel,
  body.printing-project-report .project-entry-panel,
  body.printing-project-report #projectTransactionsPanel {
    display: none !important;
  }

  body.printing-project-report #projectView,
  body.printing-project-report #projectPrintableReport {
    display: block !important;
  }

  .panel,
  .kpi-card,
  .report-chart,
  .insight-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
