/* ── Reset & Variables ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #23b5a0;
  --primary-dark:  #1c9583;
  --primary-light: rgba(35, 181, 160, 0.12);
  --success:       #2dd4a8;
  --success-light: rgba(45, 212, 168, 0.12);
  --danger:        #f87171;
  --danger-light:  rgba(248, 113, 113, 0.12);
  --warning:       #fbbf24;
  --warning-light: rgba(251, 191, 36, 0.12);
  --neutral:       #6889a8;
  --neutral-light: rgba(255, 255, 255, 0.06);
  --sidebar-bg:    #0a1628;
  --sidebar-hover: #112240;
  --sidebar-text:  #6889a8;
  --sidebar-active:#23b5a0;
  --bg:            #0c1a2e;
  --bg-input:      #071020;
  --card:          #112240;
  --text:          #ccd6e6;
  --text-muted:    #6889a8;
  --border:        #1e3a5f;
  --radius:        8px;
  --radius-lg:     12px;
  --shadow:        0 2px 16px rgba(0, 0, 0, .45);
  --shadow-md:     0 4px 24px rgba(0, 0, 0, .5);
  --shadow-lg:     0 10px 40px rgba(0, 0, 0, .6);
  --sidebar-w:     240px;
  --topbar-h:      56px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Login Page ─────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #0d2557 0%, #1648a6 45%, #1a7a6a 100%);
  padding: 24px;
}

.login-card {
  background: var(--card);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.1);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-icon {
  width: 64px;
  height: 64px;
  background: var(--primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: white;
}

.login-icon svg { width: 30px; height: 30px; }

.login-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-header p  { color: var(--text-muted); font-size: 13px; }

/* ── App Shell ──────────────────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 50;
  transition: transform .25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  background: linear-gradient(160deg, #0d2557 0%, #1648a6 55%, #1a7a6a 100%);
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.brand-icon svg { width: 18px; height: 18px; }

.brand-name {
  display: block;
  font-weight: 700;
  color: #f1f5f9;
  font-size: 14px;
  line-height: 1.2;
}

.brand-sub {
  display: block;
  font-size: 11px;
  color: var(--sidebar-text);
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  user-select: none;
  margin-bottom: 2px;
}

.nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.nav-item.active { background: rgba(35,181,160,.15); color: #5eecd8; }
.nav-item.active .nav-icon { color: var(--primary); }

.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

.nav-divider { height: 1px; background: rgba(255,255,255,.06); margin: 8px 0; }

.sidebar-footer { padding: 12px 8px; border-top: 1px solid rgba(255,255,255,.06); }

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.btn-logout svg { width: 16px; height: 16px; }
.btn-logout:hover { background: var(--sidebar-hover); color: #fca5a5; }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 40;
}

/* ── Main & Topbar ──────────────────────────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

#topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  color: var(--text-muted);
  align-items: center;
  justify-content: center;
}

.menu-btn:hover { background: rgba(255,255,255,.08); }
.menu-btn svg { width: 20px; height: 20px; }

#pageTitle { font-size: 16px; font-weight: 700; flex: 1; }

.topbar-actions { display: flex; gap: 8px; align-items: center; }

.year-select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-input);
  cursor: pointer;
  outline: none;
}

.year-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(35,181,160,.2); }

#content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-body  { padding: 20px; }
.card-title { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }

/* ── Summary Cards ──────────────────────────────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  float: right;
  margin: -4px 0 0 8px;
}

.stat-icon svg { width: 18px; height: 18px; }

.c-green  { color: var(--success); }
.c-red    { color: var(--danger); }
.c-blue   { color: var(--primary); }
.c-orange { color: var(--warning); }
.c-muted  { color: var(--text-muted); }

.bg-green  { background: var(--success-light); color: var(--success); }
.bg-red    { background: var(--danger-light); color: var(--danger); }
.bg-blue   { background: var(--primary-light); color: var(--primary); }
.bg-orange { background: var(--warning-light); color: var(--warning); }

/* ── Dashboard Grid ─────────────────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
}

/* ── Chart ──────────────────────────────────────────────────────────────── */
.chart-wrap {
  overflow-x: auto;
  padding: 0 0 8px;
}

.chart-legend {
  display: flex;
  gap: 16px;
  padding: 0 4px 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  transition: background .1s;
}

tbody tr:hover { background: var(--neutral-light); }

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

.amount-cell { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-green  { background: var(--success-light); color: var(--success); }
.badge-red    { background: var(--danger-light);  color: var(--danger); }
.badge-blue   { background: var(--primary-light); color: var(--primary); }
.badge-orange { background: var(--warning-light); color: var(--warning); }
.badge-gray   { background: var(--neutral-light); color: var(--neutral); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active { transform: scale(.98); }
.btn svg { width: 15px; height: 15px; }

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

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover { background: #15803d; }

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); color: var(--danger); }

.btn-ghost {
  background: rgba(255,255,255,.08);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255,255,255,.12); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

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

/* ── Forms ──────────────────────────────────────────────────────────────── */
.field {
  margin-bottom: 16px;
}

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

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-input);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(35,181,160,.2);
}

.field textarea { resize: vertical; min-height: 80px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  cursor: pointer;
}

.field-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.field-check label {
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
}

/* ── Section Header ─────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h3 {
  font-size: 15px;
  font-weight: 700;
}

/* ── Filter Bar ─────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-bar select,
.filter-bar input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-input);
  outline: none;
}

.filter-bar select:focus,
.filter-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(35,181,160,.2);
}

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
}

.modal-box {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  z-index: 1;
}

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

.modal-header h3 { font-size: 16px; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: var(--text-muted);
  display: flex;
}

.modal-close svg { width: 18px; height: 18px; }
.modal-close:hover { background: rgba(255,255,255,.08); color: var(--text); }

.modal-body { padding: 24px; }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ── Toasts ─────────────────────────────────────────────────────────────── */
.toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: slideIn .2s ease;
  pointer-events: auto;
  max-width: 320px;
}

.toast-success { background: #166534; color: #bbf7d0; }
.toast-error   { background: #991b1b; color: #fecaca; }
.toast-info    { background: #1e3a8a; color: #bfdbfe; }

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

/* ── Misc Helpers ───────────────────────────────────────────────────────── */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state p { font-size: 15px; margin-bottom: 16px; }

.error-msg {
  background: var(--danger-light);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

/* ── EÜR Table ──────────────────────────────────────────────────────────── */
.eur-section { margin-bottom: 8px; }
.eur-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding: 10px 14px 6px;
}

.eur-total td {
  font-weight: 700;
  background: rgba(255,255,255,.06);
  font-size: 14px;
}

.eur-gewinn td {
  font-size: 16px;
  font-weight: 800;
  background: var(--primary-light);
  color: #2dd4a8;
}

/* ── Profit view ────────────────────────────────────────────────────────── */
.partner-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.partner-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.partner-card.highlighted { border-color: var(--primary); }

.partner-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}

.partner-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  color: var(--text-muted);
}

.partner-row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.partner-total {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 0 0;
  margin-top: 8px;
  border-top: 2px solid var(--border);
}

/* ── Settings Sections ──────────────────────────────────────────────────── */
.settings-section {
  margin-bottom: 24px;
}

.settings-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(-100%);
    z-index: 50;
  }

  #sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .menu-btn { display: flex; }

  #content { padding: 16px; }

  .summary-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .partner-cards { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-box { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 90vh; overflow-y: auto; }
  .toasts { bottom: 16px; right: 16px; left: 16px; }
}

@media (max-width: 480px) {
  .summary-grid { grid-template-columns: 1fr; }
  #topbar { padding: 0 14px; }
  .stat-value { font-size: 20px; }
}

/* ── Nav Badge ──────────────────────────────────────────────────────────── */
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ── Stat Diff (Vorjahresvergleich) ─────────────────────────────────────── */
.stat-diff {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
}
.stat-diff.up   { color: var(--success); }
.stat-diff.down { color: var(--danger); }
.stat-diff.neutral { color: var(--text-muted); }

/* ── Kleinunternehmer Progress Bar ──────────────────────────────────────── */
.ku-warning {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.ku-warning.warn { border-color: var(--warning); background: var(--warning-light); }
.ku-warning.crit { border-color: var(--danger);  background: var(--danger-light); }

.ku-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 13px;
}
.ku-title  { font-weight: 700; }
.ku-amount { font-weight: 600; font-variant-numeric: tabular-nums; }

.progress-track {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}
.progress-bar.safe { background: var(--success); }
.progress-bar.warn { background: var(--warning); }
.progress-bar.crit { background: var(--danger); }

.ku-sub { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

/* ── Tab Group ──────────────────────────────────────────────────────────── */
.tab-group {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius);
  width: fit-content;
  margin-bottom: 16px;
}
.tab-btn {
  padding: 6px 14px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.tab-btn.active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ── Fahrtkosten Rechner ────────────────────────────────────────────────── */
.fk-result {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 16px 0;
}
.fk-result-label  { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.fk-result-amount { font-size: 28px; font-weight: 800; color: var(--primary); line-height: 1; }
.fk-result-detail { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Wiederkehrende Ausgaben ────────────────────────────────────────────── */
.recurring-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.recurring-item:last-child { border-bottom: none; }
.recurring-meta { flex: 1; min-width: 0; }
.recurring-name { font-weight: 600; font-size: 14px; }
.recurring-info { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.recurring-due-soon { color: var(--warning); font-weight: 600; }
.recurring-overdue  { color: var(--danger);  font-weight: 600; }
.recurring-amount { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* ── Rechnungen ─────────────────────────────────────────────────────────── */
.inv-overdue { color: var(--danger); font-weight: 600; }
.inv-due-soon { color: var(--warning); font-weight: 600; }

/* ── Receipt Link ───────────────────────────────────────────────────────── */
.receipt-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.receipt-link:hover { text-decoration: underline; }
.receipt-link svg { width: 14px; height: 14px; }

.receipt-upload-btn {
  padding: 4px 6px;
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity .15s, color .15s;
}
.receipt-upload-btn:hover { opacity: 1; color: var(--primary); background: var(--primary-light); }
.receipt-upload-btn svg { width: 14px; height: 14px; display: block; }

/* ── Anlage S ───────────────────────────────────────────────────────────── */
.as-result-card {
  background: linear-gradient(160deg, #0f2d1e 0%, #0d3328 40%, #0c2a3a 100%);
  border: 1px solid rgba(35, 181, 160, 0.3);
  margin-bottom: 0;
}
.as-result-card:hover { border-color: rgba(35, 181, 160, 0.45); box-shadow: 0 4px 28px rgba(35, 181, 160, 0.12); }
.as-result-title {
  font-size: 14px;
  font-weight: 700;
  color: #2dd4a8;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(35, 181, 160, 0.2);
}
.as-result-table { width: 100%; border-collapse: collapse; }
.as-result-table tr { border-bottom: 1px solid rgba(35, 181, 160, 0.1); }
.as-result-table tr:last-child { border-bottom: none; }
.as-result-table td { padding: 8px 0; font-size: 13.5px; }
.as-result-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.as-row-muted td { color: var(--text-muted); }
.as-row-total td { font-weight: 700; color: var(--text); padding-top: 10px; }
.as-row-accent td:last-child { color: var(--primary); }
.as-row-divider td { padding: 2px 0 !important; border: none !important; }
.as-row-divider hr { height: 1px; background: rgba(35, 181, 160, 0.15); border: none; margin: 0; }
.as-row-final td { font-weight: 800; font-size: 15px; padding-top: 14px; padding-bottom: 2px; color: #f0f6ff; }
.as-row-final td:last-child { color: #2dd4a8; font-size: 18px; text-shadow: 0 0 20px rgba(45, 212, 168, .3); }
.as-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(35, 181, 160, 0.06);
  border-radius: 6px;
  border-left: 3px solid #1c9583;
  line-height: 1.5;
}
.as-note-result {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 14px;
  padding: 8px 12px;
  background: rgba(35, 181, 160, 0.08);
  border-radius: 6px;
  border-left: 3px solid #1c9583;
  line-height: 1.55;
}
.as-note-result strong { color: #e8eef7; }
.as-print-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #1648a6, #1c9583);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
  margin-top: 16px;
  box-shadow: var(--shadow);
}
.as-print-btn:hover { opacity: 0.9; }
.as-expense-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 10px;
  animation: slideIn .15s ease;
}
.as-expense-item:last-child { border-bottom: none; margin-bottom: 0; }
.as-expense-grid {
  display: grid;
  grid-template-columns: 1fr 150px 36px;
  gap: 10px;
  align-items: end;
  margin-bottom: 8px;
}
.as-partner-select {
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  padding: 7px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}
.as-partner-select:focus { border-color: var(--primary); }
.as-remove-btn {
  padding: 5px 9px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  line-height: 1;
}
.as-remove-btn:hover { color: var(--danger); background: var(--danger-light); border-color: transparent; }
.as-table { width: 100%; border-collapse: collapse; }
.as-table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
.as-table tbody td { padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.as-table tbody tr:last-child td { border-bottom: none; }
.as-gbr-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(35, 181, 160, .15);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}

@media (max-width: 600px) {
  .as-expense-grid { grid-template-columns: 1fr 100px 30px; }
}

@media print {
  .as-no-print { display: none !important; }
  .as-print-btn { display: none !important; }
  #sidebar, #topbar { display: none !important; }
  #main { overflow: visible !important; }
  #content { overflow: visible !important; padding: 0 !important; }
  .as-result-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff !important; }
  .card { background: #fff !important; border-color: #ccc !important; }
}
