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

:root {
  --bg: #000000;
  --bg-card: #0a0a0a;
  --bg-elevated: #111111;
  --bg-input: #141414;
  --bg-hover: #1a1a1a;
  --border: #222222;
  --border-subtle: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #888888;
  --text-muted: #555555;
  --accent: #ffffff;
  --accent-dim: rgba(255,255,255,0.08);
  --income: #4ade80;
  --expense: #f87171;
  --debt-positive: #60a5fa;
  --debt-negative: #fb923c;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --nav-height: 64px;
  --header-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --transition: 200ms ease;
}

html {
  font-size: 16px;
  background: var(--bg);
  color: var(--text-primary);
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  height: 100%;
  overflow: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== SCREENS ===== */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ===== AUTH ===== */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 32px 24px;
  background: var(--bg);
  gap: 16px;
}

.auth-logo {
  color: var(--text-primary);
  margin-bottom: 8px;
  opacity: 0.9;
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.auth-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.btn-signin {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  width: 100%;
  max-width: 320px;
  justify-content: center;
}

.btn-signin:hover {
  background: var(--bg-hover);
  border-color: #444;
}

.auth-note {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  max-width: 280px;
}

/* ===== HEADER ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--header-height);
  padding-top: var(--safe-top);
  background: var(--bg);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.header-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== ICON BUTTONS ===== */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ===== SYNC INDICATOR ===== */
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 4px;
  transition: background var(--transition);
}

.sync-dot.online {
  background: var(--income);
}

.sync-dot.offline {
  background: var(--text-muted);
}

.sync-dot.syncing {
  background: #fbbf24;
  animation: pulse 1s infinite;
}

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

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  display: flex;
  align-items: center;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg);
  border-top: 1px solid var(--border-subtle);
  order: 3;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: color var(--transition);
  position: relative;
}

.nav-item span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.nav-item.active {
  color: var(--text-primary);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 0 0 2px 2px;
}

/* ===== MAIN CONTENT ===== */
.app-main {
  flex: 1;
  overflow: hidden;
  position: relative;
  order: 2;
}

/* ===== PAGES ===== */
.page {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px 80px;
  -webkit-overflow-scrolling: touch;
}

.page.active {
  display: block;
}

/* ===== TOTAL CARD ===== */
.total-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.total-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.total-amount {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.total-currency-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.currency-select-inline {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  padding: 4px 8px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.currency-select-inline:focus {
  border-color: #444;
  color: var(--text-primary);
}

.total-rate-note {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== SECTIONS ===== */
.dashboard-section {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-text {
  font-size: 13px;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
}

.btn-text:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ===== ACCOUNTS LIST ===== */
.accounts-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}

.account-item:hover {
  background: var(--bg-elevated);
}

.account-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.account-info {
  flex: 1;
  min-width: 0;
}

.account-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-type {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.account-balance {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.account-currency {
  font-size: 13px;
  color: var(--text-secondary);
  margin-left: 3px;
}

/* ===== DEBT SECTION ===== */
.debt-summary {
  font-size: 14px;
  color: var(--text-secondary);
}

.debt-subsection {
  margin-bottom: 16px;
}

.debt-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.debt-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.debt-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  cursor: pointer;
  transition: background var(--transition);
  gap: 12px;
}

.debt-item:hover {
  background: var(--bg-elevated);
}

.debt-person {
  flex: 1;
  min-width: 0;
}

.debt-person-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.debt-person-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.debt-amount-col {
  text-align: right;
  flex-shrink: 0;
}

.debt-amount {
  font-size: 15px;
  font-weight: 600;
}

.debt-amount.owe-me { color: var(--debt-positive); }
.debt-amount.i-owe { color: var(--debt-negative); }
.debt-amount.closed { color: var(--text-muted); text-decoration: line-through; }

.debt-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== TRANSACTIONS LIST ===== */
.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  cursor: pointer;
  transition: background var(--transition);
}

.transaction-item:hover {
  background: var(--bg-elevated);
}

.tx-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.tx-icon.income {
  color: var(--income);
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.2);
}

.tx-icon.expense {
  color: var(--expense);
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.2);
}

.tx-info {
  flex: 1;
  min-width: 0;
}

.tx-category {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.tx-amount {
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}

.tx-amount.income { color: var(--income); }
.tx-amount.expense { color: var(--expense); }

/* ===== EMPTY STATE ===== */
.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-card);
}

/* ===== PAGE TOOLBAR ===== */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.btn-icon-primary {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-icon-primary:hover {
  background: var(--bg-hover);
}

/* ===== FILTER TABS ===== */
.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border);
}

.filter-tab {
  padding: 6px 14px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.filter-tab.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px + var(--safe-bottom));
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--text-primary);
  color: var(--bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  z-index: 50;
  transition: transform var(--transition), box-shadow var(--transition);
}

.fab:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(0,0,0,0.8);
}

.fab:active {
  transform: scale(0.96);
}

/* ===== SIDEBAR ===== */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

.sidebar.active {
  transform: translateX(0);
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-user-email {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  word-break: break-all;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  overflow-y: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.sidebar-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-nav-item.danger {
  color: var(--expense);
}

.sidebar-nav-item.danger:hover {
  background: rgba(248,113,113,0.08);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 4px;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  backdrop-filter: blur(3px);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(40px);
  transition: transform 200ms ease;
  padding-bottom: var(--safe-bottom);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-sm {
  max-width: 400px;
  border-radius: var(--radius);
  transform: scale(0.95);
  margin: auto;
}

.modal-overlay.active .modal-sm {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus {
  border-color: #444;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.input-with-select {
  display: flex;
  gap: 8px;
}

.input-with-select .form-input {
  flex: 1;
}

.form-select-sm {
  padding: 12px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  min-width: 72px;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
}

.form-select-sm:focus {
  border-color: #444;
}

.form-select-sm option {
  background: var(--bg-card);
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== TYPE TOGGLE ===== */
.type-toggle {
  display: flex;
  gap: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.type-btn {
  flex: 1;
  padding: 9px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.type-btn.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ===== RADIO GROUP ===== */
.radio-group {
  display: flex;
  gap: 16px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text-primary);
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}

.radio-label:has(input:checked) {
  border-color: #555;
}

.radio-label input[type="radio"] {
  display: none;
}

.radio-custom {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  position: relative;
  transition: border-color var(--transition);
}

.radio-label:has(input:checked) .radio-custom {
  border-color: var(--text-primary);
}

.radio-label:has(input:checked) .radio-custom::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: var(--text-primary);
  border-radius: 50%;
}

/* ===== BUTTONS ===== */
.btn-primary {
  flex: 1;
  padding: 13px;
  background: var(--text-primary);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  flex: 1;
  padding: 13px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-secondary.full-width {
  width: 100%;
  flex: none;
  text-align: center;
}

.btn-danger {
  flex: 1;
  padding: 13px;
  background: rgba(248,113,113,0.15);
  color: var(--expense);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-danger:hover {
  background: rgba(248,113,113,0.25);
}

/* ===== SETTINGS ===== */
.settings-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.settings-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 8px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 400px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  animation: toastIn 200ms ease forwards;
  pointer-events: all;
}

.toast.success { border-left: 3px solid var(--income); }
.toast.error { border-left: 3px solid var(--expense); }
.toast.info { border-left: 3px solid var(--debt-positive); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== CONFIRM DIALOG ===== */
.confirm-message {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== SWIPE ACTIONS ===== */
.swipeable {
  position: relative;
  overflow: hidden;
}

.swipe-actions {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: stretch;
}

.swipe-action {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  cursor: pointer;
  border: none;
  font-size: 12px;
  font-weight: 500;
  gap: 4px;
  flex-direction: column;
}

.swipe-action.edit {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.swipe-action.delete {
  background: rgba(248,113,113,0.15);
  color: var(--expense);
}

/* ===== ITEM ACTIONS (long press / swipe) ===== */
.item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.action-btn.delete:hover {
  background: rgba(248,113,113,0.15);
  color: var(--expense);
  border-color: rgba(248,113,113,0.3);
}

/* ===== STATUS BADGE ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
}

.status-badge.active {
  background: rgba(96, 165, 250, 0.1);
  color: var(--debt-positive);
}

.status-badge.closed {
  background: rgba(85,85,85,0.2);
  color: var(--text-muted);
}

/* ===== OFFLINE BANNER ===== */
.offline-banner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(251,191,36,0.1);
  border-bottom: 1px solid rgba(251,191,36,0.2);
  color: #fbbf24;
  font-size: 13px;
  font-weight: 500;
}

.offline-banner.visible {
  display: flex;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 0;
  background: transparent;
}

/* ===== UTILS ===== */
.hidden { display: none !important; }
.text-income { color: var(--income); }
.text-expense { color: var(--expense); }

/* ===== RESPONSIVE ===== */
@media (min-width: 480px) {
  .modal-overlay {
    align-items: center;
  }
  .modal {
    border-radius: var(--radius);
    max-height: 85vh;
  }
}

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