/**
 * Buchhaltung · Auswertungen – Premium Finanzzentrale (Final)
 */

.acc-reports-page {
  --acc-rep-radius: 16px;
  --acc-rep-radius-sm: 12px;
  --acc-rep-border: rgba(12, 18, 34, 0.05);
  --acc-rep-muted: #a1aab4;
  --acc-rep-text: #0c1222;
  --acc-rep-sub: #5c6578;
}

.acc-reports-page .acc-hero h1 {
  font-size: 1.875rem;
  letter-spacing: -0.035em;
}

.acc-reports-page .acc-hero-lead {
  max-width: 44rem;
  font-size: 0.96875rem;
}

.acc-reports-page .acc-hero {
  margin-bottom: 1.35rem;
}

.acc-reports-page .acc-rep-workspace,
.acc-reports-page .acc-rep-kpis,
.acc-reports-page .acc-rep-toolbar,
.acc-reports-page .acc-rep-tabs {
  width: 100%;
}

/* Report-Tabs */
.acc-rep-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.5rem;
}

.acc-rep-tab {
  min-height: 38px;
  padding: 0 0.95rem;
  border-radius: 10px;
  border: 1px solid var(--acc-rep-border);
  background: rgba(255, 255, 255, 0.8);
  color: #64748b;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.acc-rep-tab:hover {
  background: #fff;
  border-color: rgba(12, 18, 34, 0.09);
  color: #334155;
}

.acc-rep-tab.is-active {
  background: #fff;
  border-color: rgba(12, 18, 34, 0.1);
  color: var(--acc-rep-text);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(12, 18, 34, 0.04);
}

/* KPI Cards */
.acc-rep-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.35rem;
}

.acc-rep-kpi {
  padding: 1rem 1.1rem 1.05rem;
  border-radius: var(--acc-rep-radius-sm);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--acc-rep-border);
  box-shadow: 0 1px 3px rgba(12, 18, 34, 0.025);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.acc-rep-kpi:hover {
  box-shadow: 0 4px 14px rgba(12, 18, 34, 0.05);
  transform: translateY(-1px);
}

.acc-rep-kpi--highlight {
  background: linear-gradient(180deg, #fff 0%, #fafbff 100%);
  border-color: rgba(59, 130, 246, 0.12);
}

.acc-rep-kpi-label {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--acc-rep-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.acc-rep-kpi-value {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--acc-rep-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.acc-rep-kpi-value.is-positive {
  color: #059669;
}

.acc-rep-kpi-value.is-negative {
  color: #b45353;
}

/* Filter toolbar – wie Rechnungsseite */
.acc-rep-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.85rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(12, 18, 34, 0.05);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(12, 18, 34, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.acc-rep-toolbar .acc-control label {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--acc-rep-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.28rem;
}

.acc-rep-toolbar .acc-control select,
.acc-rep-toolbar .acc-control input {
  min-height: 38px;
  min-width: 128px;
  border: 1px solid rgba(12, 18, 34, 0.07);
  border-radius: 9px;
  background: #f8fafc;
  font-size: 0.8125rem;
  padding: 0 0.75rem;
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.acc-rep-toolbar .acc-control select:hover,
.acc-rep-toolbar .acc-control input:hover {
  background: #fff;
  border-color: rgba(12, 18, 34, 0.11);
}

.acc-rep-toolbar .acc-control select:focus,
.acc-rep-toolbar .acc-control input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.07);
  background: #fff;
}

.acc-rep-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  padding-left: 0.25rem;
}

.acc-rep-btn-ghost {
  min-height: 38px;
  padding: 0 0.9rem;
  border-radius: 9px;
  border: 1px solid rgba(12, 18, 34, 0.08);
  background: #fff;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.acc-rep-btn-ghost:hover {
  background: #f8fafc;
  border-color: rgba(12, 18, 34, 0.12);
}

.acc-rep-btn-pdf {
  min-height: 44px;
  padding: 0 1.15rem;
  border-radius: 12px;
  border: none;
  background: #0c1222;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(12, 18, 34, 0.1), 0 2px 8px rgba(12, 18, 34, 0.06);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.acc-rep-btn-pdf:hover {
  background: #1a2332;
  box-shadow: 0 2px 4px rgba(12, 18, 34, 0.12);
}

/* Content */
.acc-rep-workspace {
  min-height: 320px;
}

.acc-rep-panel {
  animation: acc-rep-in 0.24s ease;
}

@keyframes acc-rep-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Bilanz */
.acc-rep-bilanz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.acc-rep-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--acc-rep-border);
  border-radius: var(--acc-rep-radius);
  padding: 1.35rem 1.45rem 1.2rem;
  box-shadow: 0 2px 10px rgba(12, 18, 34, 0.03);
}

.acc-rep-card--aktiv {
  background: linear-gradient(180deg, #fafcff 0%, #ffffff 100%);
  border-color: rgba(59, 130, 246, 0.1);
}

.acc-rep-card--passiv {
  background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
  border-color: rgba(100, 116, 139, 0.1);
}

.acc-rep-card--ertrag {
  background: linear-gradient(180deg, #fafffe 0%, #ffffff 100%);
  border-color: rgba(5, 150, 105, 0.08);
}

.acc-rep-card--aufwand {
  background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
  border-color: rgba(100, 116, 139, 0.08);
}

.acc-rep-card-head {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--acc-rep-muted);
  margin: 0 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(12, 18, 34, 0.05);
}

.acc-rep-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.52rem 0;
}

.acc-rep-line + .acc-rep-line {
  border-top: 1px solid rgba(12, 18, 34, 0.03);
}

.acc-rep-line-label {
  font-size: 0.9375rem;
  color: #475569;
  font-weight: 500;
}

.acc-rep-line-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--acc-rep-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.acc-rep-line-subtotal {
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(12, 18, 34, 0.08) !important;
}

.acc-rep-line-subtotal .acc-rep-line-label {
  font-weight: 600;
  color: #334155;
  font-size: 0.875rem;
}

.acc-rep-line-subtotal .acc-rep-line-value {
  font-size: 1.0625rem;
  font-weight: 700;
}

.acc-rep-line-sum {
  margin-top: 0.85rem;
  padding: 1rem 0 0.15rem;
  border-top: 2px solid rgba(12, 18, 34, 0.07) !important;
}

.acc-rep-line-sum .acc-rep-line-label {
  font-weight: 700;
  color: var(--acc-rep-text);
  font-size: 0.9375rem;
}

.acc-rep-card--aktiv .acc-rep-line-sum .acc-rep-line-value {
  color: #2563eb;
}

.acc-rep-card--passiv .acc-rep-line-sum .acc-rep-line-value {
  color: #475569;
}

.acc-rep-line-sum .acc-rep-line-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.acc-rep-balance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.acc-rep-balance--ok {
  background: rgba(240, 253, 249, 0.85);
  border: 1px solid rgba(5, 150, 105, 0.12);
  color: #059669;
}

.acc-rep-balance--warn {
  background: rgba(255, 251, 251, 0.9);
  border: 1px solid rgba(185, 28, 28, 0.1);
  color: #b45353;
}

.acc-rep-balance-icon {
  font-size: 0.8125rem;
  opacity: 0.85;
}

/* Erfolgsrechnung */
.acc-rep-erfolg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.acc-rep-erfolg-block h4 {
  margin: 0 0 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--acc-rep-muted);
}

.acc-rep-erfolg-footer {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.acc-rep-erfolg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.75rem;
  color: var(--acc-rep-muted);
  padding: 0 0.15rem;
}

.acc-rep-erfolg-meta-sep {
  opacity: 0.45;
}

.acc-rep-result {
  padding: 1.25rem 1.5rem;
  border-radius: var(--acc-rep-radius);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--acc-rep-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.acc-rep-result--hero {
  padding: 1.35rem 1.55rem;
}

.acc-rep-result-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.acc-rep-result-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--acc-rep-text);
  letter-spacing: -0.02em;
}

.acc-rep-result-hint {
  font-size: 0.75rem;
  color: var(--acc-rep-muted);
  font-weight: 400;
}

.acc-rep-result-value {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.acc-rep-result.is-profit {
  background: rgba(240, 253, 249, 0.7);
  border-color: rgba(5, 150, 105, 0.14);
}

.acc-rep-result.is-profit .acc-rep-result-value {
  color: #059669;
}

.acc-rep-result.is-loss {
  background: rgba(255, 251, 251, 0.85);
  border-color: rgba(185, 28, 28, 0.12);
}

.acc-rep-result.is-loss .acc-rep-result-value {
  color: #b45353;
}

/* Forderungen */
.acc-rep-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.acc-rep-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--acc-rep-radius-sm);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--acc-rep-border);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.acc-rep-list-item:hover {
  box-shadow: 0 4px 14px rgba(12, 18, 34, 0.05);
  transform: translateY(-0.5px);
}

.acc-rep-list-main strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--acc-rep-text);
  margin-bottom: 0.15rem;
}

.acc-rep-list-main span {
  font-size: 0.75rem;
  color: var(--acc-rep-muted);
}

.acc-rep-list-amt {
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--acc-rep-text);
  letter-spacing: -0.03em;
}

.acc-rep-badge {
  display: inline-flex;
  margin-top: 0.25rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.acc-rep-badge--open {
  background: rgba(185, 28, 28, 0.07);
  color: #b45353;
}

/* Cashflow */
.acc-rep-flow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Monatsübersicht – Finanztrend */
.acc-rep-month-chart {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--acc-rep-border);
  border-radius: var(--acc-rep-radius);
  padding: 1.15rem 1.25rem 1rem;
  box-shadow: 0 2px 10px rgba(12, 18, 34, 0.03);
}

.acc-rep-month-head {
  display: grid;
  grid-template-columns: 4.75rem 1fr 7.5rem;
  gap: 0.85rem;
  padding: 0 0.85rem 0.55rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--acc-rep-muted);
}

.acc-rep-month-head span:last-child {
  text-align: right;
}

.acc-rep-month-list {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.acc-rep-month-row {
  display: grid;
  grid-template-columns: 4.75rem 1fr 7.5rem;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem 0.85rem;
  border-radius: 9px;
  transition: background 0.15s ease;
}

.acc-rep-month-row:hover {
  background: rgba(12, 18, 34, 0.02);
}

.acc-rep-month-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
}

.acc-rep-month-bar-wrap {
  height: 4px;
  border-radius: 999px;
  background: rgba(12, 18, 34, 0.05);
  overflow: hidden;
}

.acc-rep-month-bar {
  height: 100%;
  border-radius: 999px;
  min-width: 4px;
  transition: width 0.35s ease;
}

.acc-rep-month-bar.is-positive {
  background: linear-gradient(90deg, rgba(5, 150, 105, 0.55), rgba(52, 211, 153, 0.75));
}

.acc-rep-month-bar.is-negative {
  background: linear-gradient(90deg, rgba(180, 83, 83, 0.45), rgba(248, 113, 113, 0.65));
}

.acc-rep-month-bar.is-neutral {
  background: rgba(148, 163, 184, 0.35);
  width: 6px !important;
}

.acc-rep-month-result {
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--acc-rep-text);
  text-align: right;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.acc-rep-month-result.is-positive {
  color: #059669;
}

.acc-rep-month-result.is-negative {
  color: #b45353;
}

.acc-rep-month-result.is-neutral,
.acc-rep-month-row.is-neutral .acc-rep-month-result {
  color: var(--acc-rep-muted);
}

.acc-rep-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--acc-rep-muted);
  font-size: 0.9375rem;
  border-radius: var(--acc-rep-radius);
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed rgba(12, 18, 34, 0.07);
}

.acc-rep-status {
  font-size: 0.6875rem;
  color: var(--acc-rep-muted);
  margin: -0.35rem 0 1rem;
  min-height: 1rem;
  letter-spacing: 0.01em;
}

.acc-rep-status.is-error {
  color: #b45353;
}

@media (max-width: 1200px) {
  .acc-rep-kpi-value {
    font-size: 1.45rem;
  }
  .acc-rep-line-sum .acc-rep-line-value {
    font-size: 1.35rem;
  }
}

@media (max-width: 1100px) {
  .acc-rep-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .acc-rep-kpis,
  .acc-rep-bilanz-grid,
  .acc-rep-erfolg-grid,
  .acc-rep-flow-grid {
    grid-template-columns: 1fr;
  }
  .acc-rep-toolbar-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
  .acc-rep-kpi-value {
    font-size: 1.3rem;
  }
  .acc-rep-result-value {
    font-size: 1.5rem;
  }
  .acc-rep-month-head,
  .acc-rep-month-row {
    grid-template-columns: 3.5rem 1fr 5.5rem;
    gap: 0.5rem;
  }
}

@media print {
  .acc-app-tabs,
  .acc-rep-tabs,
  .acc-rep-toolbar,
  nav,
  .v-nav-inner {
    display: none !important;
  }
  .acc-rep-card,
  .acc-rep-result,
  .acc-rep-month-chart {
    break-inside: avoid;
  }
}

/* Trust & Data Quality v1.2 */
.acc-rep-trust-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.acc-rep-trust-chip--live {
  background: rgba(22, 163, 74, 0.1);
  color: #166534;
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.acc-rep-trust-chip--partial {
  background: rgba(217, 119, 6, 0.1);
  color: #92400e;
  border: 1px solid rgba(217, 119, 6, 0.22);
}

.acc-rep-trust-chip--empty,
.acc-rep-trust-chip--preview {
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.18);
}

.acc-rep-trust {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.45;
}

.acc-rep-trust strong {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.acc-rep-trust-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 0.35rem;
  border-radius: 50%;
}

.acc-rep-trust--live {
  background: rgba(22, 163, 74, 0.06);
  border: 1px solid rgba(22, 163, 74, 0.18);
  color: #14532d;
}

.acc-rep-trust--live .acc-rep-trust-dot {
  background: #16a34a;
}

.acc-rep-trust--partial {
  background: rgba(217, 119, 6, 0.06);
  border: 1px solid rgba(217, 119, 6, 0.2);
  color: #78350f;
}

.acc-rep-trust--partial .acc-rep-trust-dot {
  background: #d97706;
}

.acc-rep-trust--empty,
.acc-rep-trust--preview {
  background: rgba(100, 116, 139, 0.06);
  border: 1px solid rgba(100, 116, 139, 0.15);
  color: #334155;
}

.acc-rep-trust--empty .acc-rep-trust-dot,
.acc-rep-trust--preview .acc-rep-trust-dot {
  background: #94a3b8;
}

.acc-rep-est-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(217, 119, 6, 0.12);
  color: #92400e;
  vertical-align: middle;
}

.acc-rep-disclaimer {
  margin: 0.85rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #94a3b8;
}

.acc-rep-empty--guided {
  padding: 2rem 1.5rem;
  text-align: center;
  border: 1px dashed rgba(12, 18, 34, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
}

.acc-rep-empty-lead {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #0c1222;
}

.acc-rep-empty-hint {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
}

.acc-rep-empty-hint a {
  color: #0c1222;
  font-weight: 600;
}

.acc-rep-kpi-value.is-muted {
  color: #94a3b8;
}

.acc-rep-line-label--muted {
  color: #94a3b8;
  font-style: italic;
}

.acc-rep-line--muted .acc-rep-line-value {
  color: #94a3b8;
}

@media (prefers-reduced-motion: reduce) {
  .acc-rep-panel {
    animation: none !important;
  }
}
