/* Scherer PWA - Modern Mobile CSS */
:root {
  --primary: #0d9f6e;
  --primary-dark: #057a55;
  --primary-light: #ecfdf5;
  --primary-gradient: linear-gradient(135deg, #0d9f6e 0%, #057a55 100%);
  --danger: #e02424;
  --danger-light: #fde8e8;
  --warning: #e3a008;
  --warning-light: #fdf6b2;
  --info: #3f83f8;
  --info-light: #e1effe;
  --success: #0e9f6e;
  --success-light: #def7ec;
  --text: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --bg: #f9fafb;
  --bg-elevated: #ffffff;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --radius-full: 9999px;
  --tab-height: 60px;
  --header-height: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  line-height: 1.5;
}

/* ========== App Shell ========== */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

/* ========== Header ========== */
.app-header {
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding: 0 16px;
  background: var(--primary-gradient);
  color: white;
  flex-shrink: 0;
  z-index: 100;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(13,159,110,0.25);
}
.app-header .back-btn {
  display: none;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 20px;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  cursor: pointer;
  line-height: 1;
  transition: background var(--transition-fast);
}
.app-header .back-btn:active { background: rgba(255,255,255,0.3); }
.app-header.has-back .back-btn { display: flex; align-items: center; justify-content: center; }
.app-header .title {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.app-header .header-actions {
  display: flex;
  gap: 6px;
}
.app-header .header-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 18px;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}
.app-header .header-btn:active { background: rgba(255,255,255,0.3); }

/* ========== Content Area ========== */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tab-height) + var(--safe-bottom) + 8px);
  scroll-behavior: smooth;
}

/* ========== Tab Bar ========== */
.tab-bar {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tab-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: none;
  color: var(--text-light);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 0;
  transition: color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.tab-item .tab-icon { font-size: 22px; line-height: 1; transition: transform var(--transition-fast); }
.tab-item.active { color: var(--primary); font-weight: 600; }
.tab-item.active .tab-icon { transform: scale(1.1); }
.tab-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

/* ========== More Menu Overlay ========== */
.more-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  align-items: flex-end;
}
.more-overlay.open { display: flex; }
.more-sheet {
  width: 100%;
  background: var(--bg-elevated);
  border-radius: 20px 20px 0 0;
  padding: 12px 16px calc(16px + var(--safe-bottom));
  max-height: 70vh;
  overflow-y: auto;
  animation: sheetUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.more-sheet .sheet-handle {
  width: 36px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  margin: 4px auto 20px;
}
.more-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.more-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 4px 12px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-align: center;
  transition: background var(--transition-fast);
}
.more-item:active { background: var(--primary-light); }
.more-item .more-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 14px;
  transition: transform var(--transition-fast);
}
.more-item:active .more-icon { transform: scale(0.92); }

/* ========== Login Page ========== */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(180deg, var(--bg) 0%, #e8f5ee 100%);
}
.login-page .logo {
  width: 280px;
  max-width: 82%;
  height: auto;
  margin-bottom: 32px;
  padding: 16px 20px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}
.login-page h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.login-form { width: 100%; max-width: 360px; }
.login-form .form-group { margin-bottom: 14px; }
.login-form input {
  width: 100%;
  height: 52px;
  padding: 0 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  background: var(--card-bg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.login-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(13,159,110,0.1);
}
.login-form .login-btn {
  width: 100%;
  height: 52px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 4px 12px rgba(13,159,110,0.3);
  letter-spacing: -0.01em;
}
.login-form .login-btn:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(13,159,110,0.3);
}
.login-error {
  color: var(--danger);
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  display: none;
}

/* ========== Cards ========== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin: 8px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.card-subtitle { font-size: 13px; color: var(--text-muted); }
.card-body { font-size: 14px; line-height: 1.6; }
.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

/* ========== KPI Cards ========== */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 16px;
}
.kpi-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.kpi-card:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-xs);
}
.kpi-card:active::before { opacity: 1; }
.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.kpi-card.wide { grid-column: span 2; }

/* ========== List Items ========== */
.list-container { padding: 0 16px; }
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--card-bg);
  margin-bottom: 0;
  cursor: pointer;
  gap: 14px;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-light);
}
.list-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.list-item:last-child { border-radius: 0 0 var(--radius) var(--radius); margin-bottom: 10px; border-bottom: none; }
.list-item:only-child { border-radius: var(--radius); border-bottom: none; }
.list-item:active { background: var(--primary-light); }
.list-container > .list-item:first-child {
  box-shadow: var(--shadow-xs);
}
.list-item .item-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}
.list-item:active .item-icon { transform: scale(0.92); }
.list-item .item-content { flex: 1; min-width: 0; }
.list-item .item-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  letter-spacing: -0.01em;
}
.list-item .item-sub {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.list-item .item-right { text-align: right; flex-shrink: 0; }
.list-item .item-amount { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.list-item .item-amount.positive { color: var(--success); }
.list-item .item-amount.negative { color: var(--danger); }

/* ========== Search Bar ========== */
.search-bar {
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}
.search-bar input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 15px;
  background: var(--card-bg);
  color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.442.656a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 16px center;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(13,159,110,0.08);
}
.search-bar input::placeholder { color: var(--text-light); }

/* ========== Forms ========== */
.form-page { padding: 16px; }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-group textarea {
  height: 100px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.5;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(13,159,110,0.08);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-light); }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  gap: 8px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  letter-spacing: -0.01em;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 2px 8px rgba(13,159,110,0.25);
}
.btn-primary:active { box-shadow: 0 1px 4px rgba(13,159,110,0.2); }
.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 2px 8px rgba(224,36,36,0.2);
}
.btn-danger:active { background: #c81e1e; }
.btn-secondary {
  background: var(--border-light);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:active { background: var(--border); }
.btn-block { width: 100%; }
.btn-sm { height: 38px; font-size: 14px; padding: 0 16px; border-radius: var(--radius-xs); }
.btn-fab {
  position: fixed;
  bottom: calc(var(--tab-height) + var(--safe-bottom) + 20px);
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: white;
  border: none;
  font-size: 28px;
  box-shadow: 0 6px 20px rgba(13,159,110,0.35);
  cursor: pointer;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.btn-fab:active {
  transform: scale(0.9);
  box-shadow: 0 3px 10px rgba(13,159,110,0.3);
}

/* ========== Status Badges ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
}
.badge-success { background: var(--success-light); color: #03543f; }
.badge-warning { background: var(--warning-light); color: #723b13; }
.badge-danger { background: var(--danger-light); color: #9b1c1c; }
.badge-info { background: var(--info-light); color: #1e429f; }
.badge-muted { background: var(--border-light); color: var(--text-muted); }

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: calc(var(--safe-top) + 16px);
  left: 16px;
  right: 16px;
  padding: 14px 20px;
  border-radius: var(--radius);
  color: white;
  font-size: 14px;
  font-weight: 600;
  z-index: 1000;
  text-align: center;
  animation: toastIn 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.toast.success { background: rgba(14,159,110,0.95); }
.toast.error { background: rgba(224,36,36,0.95); }
.toast.info { background: rgba(63,131,248,0.95); }
@keyframes toastIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ========== Loading ========== */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== Confirm Dialog ========== */
.dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.dialog-overlay.open { display: flex; }
.dialog-box {
  background: var(--bg-elevated);
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: dialogIn 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes dialogIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.dialog-box h3 { margin-bottom: 8px; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.dialog-box p { margin-bottom: 24px; color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions .btn { flex: 1; height: 44px; }

/* ========== Empty State ========== */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.8; }
.empty-state p { font-size: 15px; line-height: 1.5; }

/* ========== Pull to refresh ========== */
.ptr-indicator {
  text-align: center;
  padding: 8px;
  color: var(--text-muted);
  font-size: 13px;
  display: none;
}

/* ========== Section Headers ========== */
.section-header {
  padding: 20px 16px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========== Detail View ========== */
.detail-section { margin: 8px 16px; }
.detail-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  align-items: flex-start;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); font-weight: 500; }
.detail-value { font-weight: 600; text-align: right; max-width: 60%; color: var(--text); word-break: break-word; }
.detail-actions {
  display: flex;
  gap: 10px;
  padding: 16px 0;
}
.detail-actions .btn { flex: 1; }

/* ========== Positionen Table ========== */
.pos-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}
.pos-table th {
  text-align: left;
  padding: 10px 10px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pos-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  color: var(--text-secondary);
}
.pos-table .text-right { text-align: right; }
.pos-table tfoot td {
  font-weight: 800;
  border-top: 2px solid var(--border);
  border-bottom: none;
  color: var(--text);
  padding-top: 12px;
}

/* ========== Positionen Editor ========== */
.pos-editor .pos-item {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  border: 2px solid var(--border);
  transition: border-color var(--transition-fast);
}
.pos-item:focus-within { border-color: var(--primary); }
.pos-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.pos-item-header strong { font-size: 13px; color: var(--text-muted); font-weight: 700; }
.pos-item-remove {
  background: var(--danger-light);
  border: none;
  color: var(--danger);
  font-size: 16px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}
.pos-item-remove:active { transform: scale(0.9); }
.pos-item .form-row { gap: 8px; }
.pos-item input, .pos-item select {
  height: 42px;
  font-size: 14px;
}

/* ========== Autocomplete ========== */
.autocomplete-wrapper { position: relative; }
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow-lg);
  display: none;
}
.autocomplete-list.open { display: block; }
.autocomplete-item {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:active { background: var(--primary-light); }

/* ========== Calendar ========== */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
}
.cal-nav {
  background: var(--border-light);
  border: none;
  font-size: 20px;
  color: var(--primary);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}
.cal-nav:active { background: var(--border); }
.cal-title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: 0 16px 16px;
}
.cal-day-name {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 0;
  text-transform: uppercase;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: background var(--transition-fast);
}
.cal-day:active { background: var(--primary-light); }
.cal-day.today {
  background: var(--primary);
  color: white;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(13,159,110,0.3);
}
.cal-day.has-events::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  bottom: 4px;
}
.cal-day.today.has-events::after { background: white; }
.cal-day.other-month { color: var(--text-light); opacity: 0.5; }

/* ========== Banking ========== */
.balance-card {
  background: linear-gradient(135deg, #0d9f6e 0%, #047857 50%, #065f46 100%);
  color: white;
  border-radius: 18px;
  padding: 26px 22px;
  margin: 12px 16px;
  box-shadow: 0 8px 24px rgba(5,120,87,0.3);
  position: relative;
  overflow: hidden;
}
.balance-card::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.balance-card::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.balance-label { font-size: 13px; opacity: 0.8; font-weight: 500; position: relative; z-index: 1; }
.balance-amount {
  font-size: 34px;
  font-weight: 800;
  margin: 6px 0;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}
.balance-iban {
  font-size: 12px;
  opacity: 0.6;
  font-family: 'SF Mono', SFMono-Regular, 'Cascadia Code', monospace;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
}

/* ========== Page Tabs ========== */
.page-tabs {
  display: flex;
  padding: 10px 16px;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.page-tabs::-webkit-scrollbar { display: none; }
.page-tab {
  padding: 8px 18px;
  border: 2px solid var(--border);
  background: var(--card-bg);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.page-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(13,159,110,0.25);
}

/* ========== Week View ========== */
.week-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  margin: 8px 16px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.week-header {
  background: var(--primary-light);
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
}
.week-cell {
  background: var(--card-bg);
  padding: 6px;
  min-height: 60px;
  font-size: 12px;
}
.week-label {
  background: var(--card-bg);
  padding: 6px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

/* ========== Utility ========== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.font-bold { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 0; height: 0; }

/* ========== iOS input zoom fix ========== */
@supports (-webkit-touch-callout: none) {
  input[type="text"], input[type="number"], input[type="email"],
  input[type="tel"], input[type="password"], input[type="date"],
  select, textarea { font-size: 16px !important; }
}

/* ========== Welcome Card (Dashboard) ========== */
.welcome-card {
  background: var(--primary-gradient);
  color: white;
  border-radius: var(--radius);
  padding: 22px 20px;
  margin: 12px 16px 4px;
  box-shadow: 0 4px 16px rgba(13,159,110,0.25);
  position: relative;
  overflow: hidden;
}
.welcome-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -15%;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.welcome-card .welcome-label {
  font-size: 14px;
  opacity: 0.85;
  font-weight: 500;
}
.welcome-card .welcome-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 2px 0 6px;
}
.welcome-card .badge { background: rgba(255,255,255,0.2); color: white; }

/* Spanischer Nachrichten-Ticker (RSS) */
.es-news-ticker{display:flex;align-items:center;height:28px;flex-shrink:0;overflow:hidden;background:linear-gradient(90deg,#c0392b,#a93226);color:#fff;font-size:12.5px;border-bottom:1px solid rgba(0,0,0,.18);z-index:90;}
.es-news-label{flex-shrink:0;background:rgba(0,0,0,.28);font-weight:700;padding:0 10px;height:100%;display:flex;align-items:center;gap:5px;letter-spacing:.4px;text-transform:uppercase;font-size:10px;}
.es-news-viewport{flex:1;overflow:hidden;position:relative;height:100%;}
.es-news-track{position:absolute;top:0;left:0;white-space:nowrap;display:inline-flex;align-items:center;height:100%;will-change:transform;animation:esNewsScroll linear infinite;padding-left:100%;}
.es-news-track.paused{animation-play-state:paused;}
.es-news-item{display:inline-flex;align-items:center;padding:0 4px;color:#fff;text-decoration:none;}
a.es-news-item:active{text-decoration:underline;}
.es-news-item .src{opacity:.65;font-size:10px;margin-left:5px;font-style:italic;}
.es-news-sep{opacity:.45;padding:0 12px;}
.es-news-radio{flex-shrink:0;background:rgba(0,0,0,.22);border:none;color:#fff;cursor:pointer;height:100%;padding:0 11px;font-size:14px;line-height:1;display:flex;align-items:center;}
.es-news-radio.playing{background:rgba(255,255,255,.28);}
@keyframes esNewsScroll{from{transform:translateX(0);}to{transform:translateX(-50%);}}
