/* ═══════════════════════════════════════════════════════════
   Gebührenerhebung · Bezirk Ried im Innkreis
   style.css – konsistentes Design Login ↔ App
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Blau-Grau Palette (Login-Farben, jetzt App-weit) */
  --brand:         #2e5470;
  --brand-mid:     #3d6a8a;
  --brand-light:   #5a8bb3;

  /* Surfaces – helle Töne passend zum blauen Gradient */
  --bg:       #2e5470;
  --surface:  rgba(255,255,255,0.10);
  --surface2: rgba(255,255,255,0.07);
  --surface3: rgba(255,255,255,0.13);
  --border:   rgba(255,255,255,0.15);
  --border2:  rgba(255,255,255,0.25);

  /* Text – weiß/hell auf blauem Hintergrund */
  --text1:  #ffffff;
  --text2:  rgba(255,255,255,0.80);
  --text3:  rgba(255,255,255,0.50);

  /* Akzentfarben */
  --violet:  #7c5cbf;
  --violet2: #5b6df8;
  --teal:    #2dd4bf;
  --amber:   #f59e0b;
  --emerald: #10b981;
  --rose:    #f43f5e;

  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(0,0,0,0.30);
}

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

html, body {
  height: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 15px;
  background: linear-gradient(160deg, #5a8bb3 0%, #3d6a8a 40%, #2e5470 100%);
  background-attachment: fixed;
  color: var(--text1);
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════
   LOADING BAR
   ══════════════════════════════════════════════════════════ */
.loading-bar {
  position: fixed; top: 0; left: 0;
  width: 0; height: 3px;
  background: linear-gradient(90deg, var(--violet), var(--teal));
  z-index: 10000;
}
.loading-bar.active { animation: lb 1.2s ease infinite; }
@keyframes lb { 0%{width:10%} 50%{width:70%} 100%{width:90%} }

/* ══════════════════════════════════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════════════════════════════════ */
#loginScreen {
  display: none;
  position: fixed; inset: 0;
  justify-content: center;
  align-items: center;
  z-index: 500;
}
.login-glow { display: none; }

.login-box {
  width: 100%;
  max-width: 340px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,0.35);
}

.login-logo {
  text-align: center;
  padding: 32px 28px 24px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
}
.login-logo .logo-icon-img {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 22px;
  width: 88px; height: 88px;
  font-size: 3.2rem;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.login-logo h1 { font-size: 1.25rem; font-weight: 700; color: #fff; margin-bottom: 4px; }
.login-logo p  { font-size: 0.8rem; color: rgba(255,255,255,0.75); }

.login-form-area {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  padding: 24px 28px 28px;
}

.login-error {
  display: none;
  background: rgba(231,76,60,0.1);
  border: 1px solid #e74c3c;
  border-radius: var(--radius-sm);
  color: #c0392b;
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e3a5f;
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  background: #fff;
  border: 1.5px solid #c5d3df;
  border-radius: 8px;
  color: #1a1a1a;
  padding: 11px 14px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus {
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px rgba(61,106,138,0.18);
}

/* ══════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px;
  border: none; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, filter .2s, transform .15s;
  width: 100%;
}
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; width: auto; }
.btn-xs { padding: 4px 10px; font-size: 0.78rem; width: auto; }

.btn-violet { background: linear-gradient(135deg, var(--brand-mid), var(--brand)); color: #fff; font-size: 1rem; font-weight: 700; padding: 13px 18px; }
.btn-teal   { background: linear-gradient(135deg, #2dd4bf, #3b82f6); color: #fff; }
.btn-rose   { background: linear-gradient(135deg, var(--rose), #dc2626); color: #fff; }
.btn-ghost  { background: rgba(255,255,255,0.12); color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,0.20); color: var(--text1); }

/* ══════════════════════════════════════════════════════════
   APP SHELL – vollbild, sidebar + content
   ══════════════════════════════════════════════════════════ */
#app {
  display: none;
  flex-direction: row;
  min-height: 100vh;
  width: 100%;
}

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: rgba(20,40,60,0.55);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-mark { display: flex; align-items: center; gap: 10px; }
.logo-icon-sm { font-size: 1.6rem; }
.logo-mark h2 { font-size: 0.92rem; font-weight: 700; color: #fff; }
.logo-mark p  { font-size: 0.70rem; color: var(--text3); }

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

.nav-label {
  font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--text3);
  padding: 10px 10px 4px;
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  background: none; border: none;
  border-radius: var(--radius-sm);
  color: var(--text2);
  padding: 9px 12px;
  font-size: 0.86rem; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.nav-item:hover  { background: rgba(255,255,255,0.10); color: #fff; }
.nav-item.active {
  background: rgba(255,255,255,0.18);
  color: #fff; font-weight: 600;
  box-shadow: inset 3px 0 0 rgba(255,255,255,0.6);
}
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: #fff;
  flex-shrink: 0;
}
.user-name  { font-size: 0.86rem; font-weight: 600; color: #fff; }
.user-rolle { font-size: 0.72rem; color: var(--text3); }

/* ── Content area – nutzt die volle Breite ── */
.content {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - 220px);
}

.topbar {
  position: sticky; top: 0;
  background: rgba(20,40,60,0.60);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 13px 28px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 50;
}
.topbar-title { font-size: 1.05rem; font-weight: 700; color: #fff; }
.topbar-actions { display: flex; gap: 8px; }

/* ── Panels ── */
.panel { display: none; padding: 24px 28px; flex-direction: column; gap: 20px; }
.panel.active { display: flex; }

/* ── Cards ── */
.card {
  background: rgba(255,255,255,0.10);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.card-title {
  font-size: 0.95rem; font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.badge {
  background: rgba(255,255,255,0.20);
  color: #fff;
  font-size: 0.72rem; padding: 3px 8px;
  border-radius: 99px; font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   SEARCH INPUT
   ══════════════════════════════════════════════════════════ */
.search-input {
  width: 100%;
  background: rgba(255,255,255,0.10);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 9px 14px;
  font-size: 0.88rem;
  outline: none;
  margin-bottom: 14px;
  font-family: inherit;
  transition: border-color .2s, background .2s;
}
.search-input::placeholder { color: var(--text3); }
.search-input:focus { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.15); }

/* ══════════════════════════════════════════════════════════
   GEMEINDEN GRID
   ══════════════════════════════════════════════════════════ */
.gemeinden-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.gem-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  padding: 7px 12px;
  font-size: 0.82rem; font-family: inherit;
  cursor: pointer;
  transition: all .15s;
}
.gem-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }
.gem-btn.active { background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.5); color: #fff; font-weight: 600; }

.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot.has { background: var(--emerald); }
.dot.no  { background: rgba(255,255,255,0.2); }

/* ══════════════════════════════════════════════════════════
   FORM SECTIONS
   ══════════════════════════════════════════════════════════ */
.form-section { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 12px; }

.fs-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 16px;
  background: rgba(255,255,255,0.08);
  cursor: pointer;
  font-size: 0.88rem; font-weight: 600; color: #fff;
  user-select: none;
}
.fs-header .chevron { transition: transform .2s; font-size: 1.1rem; }
.fs-header.open .chevron { transform: rotate(90deg); }

.fs-body { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px; }
.fs-body.hidden { display: none; }

.fg { flex: 1 1 240px; min-width: 200px; }
.fg label {
  display: block; font-size: 0.74rem; font-weight: 600;
  color: var(--text3); margin-bottom: 5px;
  text-transform: uppercase; letter-spacing: .05em;
}
.fg input, .fg select, .fg textarea {
  width: 100%;
  background: rgba(255,255,255,0.10);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #fff;
  padding: 8px 10px;
  font-size: 0.88rem; font-family: inherit;
  outline: none; resize: vertical;
  transition: border-color .2s;
}
.fg input:focus, .fg select:focus, .fg textarea:focus { border-color: rgba(255,255,255,0.5); }
.fg select option { background: #2e5470; color: #fff; }
.fg input::placeholder { color: var(--text3); }

/* ══════════════════════════════════════════════════════════
   TABLE
   ══════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
thead { position: sticky; top: 0; z-index: 2; }
th {
  background: rgba(255,255,255,0.12);
  padding: 9px 10px;
  text-align: left; font-size: 0.74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text2); white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  color: var(--text2); white-space: nowrap;
  max-width: 200px; overflow: hidden; text-overflow: ellipsis;
}
tr:hover td { background: rgba(255,255,255,0.05); color: #fff; }
.v-ja   { color: var(--emerald); font-weight: 600; }
.v-nein { color: var(--rose);    font-weight: 600; }
.v-empty{ color: rgba(255,255,255,0.2); }

/* ══════════════════════════════════════════════════════════
   VERGLEICH
   ══════════════════════════════════════════════════════════ */
.vgl-controls { display: flex; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.vgl-controls > div { flex: 1; min-width: 220px; }

.ms-box { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.ms-hdr { background: rgba(255,255,255,0.08); padding: 7px 12px; font-size: 0.75rem; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; }
.ms-body { max-height: 240px; overflow-y: auto; padding: 6px 0; }
.ms-item { display: flex; align-items: center; gap: 8px; padding: 6px 14px; font-size: 0.84rem; color: var(--text2); cursor: pointer; transition: background .1s; }
.ms-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.ms-item input[type=checkbox] { accent-color: #fff; }

/* ══════════════════════════════════════════════════════════
   AUSWERTUNG
   ══════════════════════════════════════════════════════════ */
.stats-row { display: flex; gap: 14px; flex-wrap: wrap; }
.stat-card {
  flex: 1; min-width: 140px;
  padding: 20px; border-radius: var(--radius); text-align: center;
  border: 1px solid rgba(255,255,255,0.15);
}
.stat-card.violet  { background: linear-gradient(135deg, rgba(76,45,138,0.7), rgba(124,92,191,0.7)); }
.stat-card.teal    { background: linear-gradient(135deg, rgba(14,116,144,0.7), rgba(45,212,191,0.7)); }
.stat-card.amber   { background: linear-gradient(135deg, rgba(146,64,14,0.7), rgba(245,158,11,0.7)); }
.stat-card.emerald { background: linear-gradient(135deg, rgba(6,95,70,0.7), rgba(16,185,129,0.7)); }
.stat-val   { font-size: 2.2rem; font-weight: 800; color: #fff; }
.stat-label { font-size: 0.78rem; color: rgba(255,255,255,.75); margin-top: 4px; }

.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row   { display: flex; align-items: center; gap: 12px; }
.bar-label { width: 180px; font-size: 0.79rem; color: var(--text2); text-align: right; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; background: rgba(255,255,255,0.10); border-radius: 4px; height: 24px; overflow: hidden; }
.bar-fill  { height: 100%; border-radius: 4px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; min-width: 30px; transition: width .4s ease; }
.bar-val   { font-size: 0.72rem; font-weight: 700; color: rgba(255,255,255,.9); }

.donut-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.donut-card {
  flex: 1; min-width: 240px;
  display: flex; align-items: center; gap: 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
}
.donut-title { font-size: 0.82rem; font-weight: 600; color: #fff; margin-bottom: 6px; }
.donut-stat  { display: flex; flex-direction: column; gap: 4px; }
.donut-row   { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text2); }
.donut-dot   { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.donut-info  { flex: 1; }

/* Selects – solider Hintergrund damit Options lesbar sind */
select {
  background: #1e3a52 !important;
  color: #fff !important;
}
select option {
  background: #1e3a52;
  color: #fff;
}

/* ══════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: rgba(20,40,60,0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-left: 4px solid var(--emerald);
  color: #fff;
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 0.88rem; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s;
  z-index: 9999; max-width: 320px;
}
.toast.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.toast.err  { border-left-color: var(--rose); }

/* ══════════════════════════════════════════════════════════
   SPINNER
   ══════════════════════════════════════════════════════════ */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { width: 100%; min-height: auto; position: relative; }
  .content { margin-left: 0; width: 100%; }
  .bar-label { width: 100px; }
  .panel { padding: 16px; }
}