/* style_neu.css (clean + consistent) */

/* ===== Reset + Typo ===== */
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, Calibri, "Segoe UI", Helvetica, sans-serif;
}

html, body{
  height: 100%;
  margin: 0;
}

body{
  background-color: #f4f6f9;
  background: linear-gradient(180deg, #111827 0%, #0b1220 100%);

  /* Dashboard Layout: Body scrollt NICHT */
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ===== TOPBAR ===== */
.topbar{
  height: 72px;
  flex: 0 0 72px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  padding: 14px 26px;
  color: #fff;

 
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.logo{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 180px;
}
.logo img{
  height: 40px;
  display:block;
}

.title{
  min-width: 0;
}
.title h1{
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .2px;
  color: rgba(255,255,255,.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* rechter Bereich im Header */
.user-area{
  position: relative;
  display:flex;
  align-items:center;
  gap: 10px;
}

/* User Button (Avatar + Name) */
.user-menu{ position: relative; }

.user-btn{
  display:flex;
  align-items:center;
  gap: 10px;

  padding: 8px 12px;
  border-radius: 12px;

  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);

  cursor:pointer;
  color: rgba(255,255,255,.92);
  font-size: 14px;
  font-weight: 700;

  transition: transform .08s ease, background .2s ease, border-color .2s ease;
}

.user-btn:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.18);
}

.user-btn:active{ transform: translateY(1px); }

.user-btn:focus{ outline: none; }
.user-btn:focus-visible{
  outline: 3px solid rgba(96,165,250,.55);
  outline-offset: 2px;
}

/* Avatar-Kreis */
.user-icon{
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display:grid;
  place-items:center;

  background: rgba(96,165,250,.18);
  border: 1px solid rgba(96,165,250,.35);
  color: rgba(255,255,255,.95);
  font-size: 16px;
  line-height: 1;
}

.user-btn .username{
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dropdown */
.user-dropdown{
  position:absolute;
  right:0;
  top: calc(100% + 10px);
  min-width: 240px;

  background: #0b1220;
  color:#fff;

  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 14px 40px rgba(0,0,0,.35);

  padding: 8px;
  display:none;
  z-index: 999;
}

.user-dropdown a{
  display:flex;
  align-items:center;
  gap: 10px;

  padding: 10px 10px;
  border-radius: 10px;

  color: rgba(255,255,255,.92);
  text-decoration:none;
  font-size: 14px;
  font-weight: 700;

  transition: background .15s ease, color .15s ease;
}

.user-dropdown a:hover{
  background: rgba(255,255,255,.08);
}

.user-dropdown .divider{
  height: 1px;
  background: rgba(255,255,255,.10);
  margin: 6px 4px;
}

.user-dropdown .logout-link{
  color: rgba(248,113,113,.95);
}
.user-dropdown .logout-link:hover{
  background: rgba(248,113,113,.12);
}

/* optional: kleines "Dreieck" am Dropdown */
.user-dropdown::before{
  content:"";
  position:absolute;
  right: 16px;
  top: -7px;
  width: 12px;
  height: 12px;
  background: #0b1220;
  border-left: 1px solid rgba(255,255,255,.10);
  border-top: 1px solid rgba(255,255,255,.10);
  transform: rotate(45deg);
}

/* ===== LAYOUT ===== */
.container{
  flex: 1 1 auto;
  display: flex;

  /* entscheidend: verhindert, dass body/container scrollen */
  min-height: 0;
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar{
  width: 240px;
  flex: 0 0 240px;

  
  padding: 18px 12px;

  border-right: 1px solid rgba(255,255,255,.06);

  /* Sidebar soll NICHT scrollen */
  overflow: hidden;
}

.sidebar ul{
  list-style: none;
  display:flex;
  flex-direction:column;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.sidebar ul li a{
  display:flex;
  align-items:center;
  gap: 10px;

  padding: 11px 12px;
  border-radius: 12px;

  color: rgba(226,232,240,.88);
  text-decoration:none;

  font-size: 14px;
  font-weight: 700;

  transition: background .15s ease, color .15s ease, transform .08s ease;
}

.sidebar ul li a:hover{
  background: rgba(255,255,255,.06);
  color: #fff;
}

.sidebar ul li.active a{
  background: rgba(37,99,235,.22);
  color: #fff;
  border: 1px solid rgba(96,165,250,.25);
}

.sidebar ul li a:focus{ outline:none; }
.sidebar ul li a:focus-visible{
  outline: 3px solid rgba(96,165,250,.55);
  outline-offset: 2px;
}

/* Kontakt-Text in Sidebar */
.sidebar .ueberschrift2{
  margin-top: 18px;
  padding: 10px 12px 6px;
  color: rgba(255,255,255,.78);
  font-weight: 800;
  letter-spacing: .2px;
}
.sidebar .feldtext4{
  padding: 0 12px;
  margin: 6px 0;
  color: rgba(226,232,240,.78);
  line-height: 1.45;
  font-size: 13px;
}
.sidebar a[href^="mailto:"]{
  color: rgba(96,165,250,.9);
  text-decoration:none;
}
.sidebar a[href^="mailto:"]:hover{
  text-decoration: underline;
}

/* ===== CONTENT ===== */
.content{
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;      /* WICHTIG für overflow in Flex-Layouts */
  overflow: auto;     /* NUR hier scrollt es */

  padding: 30px;
  background-color: #f9fafb;
  border-top-left-radius: 25px;
}

.content h2{
  margin-bottom: 15px;
  font-weight: 800;
}

/* ===== LOGIN ===== */
.login-content{
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box{
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.login-box h2{
  margin-bottom: 20px;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  color: #1f2937;
}

.form-group{
  margin-bottom: 16px;
}

.form-group label{
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
  font-size: 14px;
  color: #374151;
}

.form-group input{
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  transition: 0.2s;
}

.form-group input:focus{
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  outline: none;
}

.login-btn{
  width: 100%;
  padding: 12px;
  background: #2563eb;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  color: white;
  cursor: pointer;
  transition: 0.2s;
}

.login-btn:hover{
  background: #1d4ed8;
}

.error{
  background: #fee2e2;
  color: #b91c1c;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* ===== CARD GRID (Objektübersicht) ===== */
.objekt-page{
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Toolbar */
.objekt-toolbar{
  flex-shrink: 0;
}

#objektSuche{
  width: 100%;
  max-width: 500px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 14px;
}
#objektSuche:focus{
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

#objektCount{
  margin-top: 8px;
  font-size: 14px;
  color: #6b7280;
}

/* Hinweis:
   .content scrollt bereits. Daher braucht .objekt-results KEIN eigenes overflow.
   Wenn du doch nur den Ergebnisbereich scrollen willst, sag Bescheid. */
.objekt-results{
  flex: 1;
}

/* Grid */
.card-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

/* Card */
.card{
  display: block;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: #111827;

    box-shadow: 0px 0px 20px rgba(0,0,0,0.25);
  transition: transform .18s ease, box-shadow .18s ease;
}

.card:hover{
  #transform: translateY(-4px);
    box-shadow: 0px 0px 20px rgba(0,0,0,0.5);
}

.card-image{
  height: 180px;
  background: #f3f4f6;
  overflow: hidden;
}
.card-image img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body{
  padding: 16px;
}
.card-body h3{
  font-size: 16px;
  font-weight: 800;
  color: #1f2937;
  line-height: 1.3;
}

/* ===== OVERLAY (Popup) ===== */
.overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  z-index: 9999;
}
.overlay-panel{
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(1000px, 92vw);
  max-height: 85vh;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  overflow: hidden;
}
.overlay-content{
  padding: 16px;
  max-height: 85vh;
  overflow: auto;
}
.overlay-close{
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #f2f2f2;
  font-size: 22px;
  line-height: 36px;
  cursor: pointer;
}

.popup-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}
.popup-date{
  font-size:14px;
  color:#990000;
}
.popup-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

body.no-scroll{
  overflow: hidden;
}

/* ===== Responsive ===== */
@media (max-width: 900px){
  .sidebar{
    width: 210px;
    flex-basis: 210px;
  }
}

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

.form-card{
  background:#fff;
  border-radius:16px;
  padding:18px;
  box-shadow: 0 10px 25px rgba(0,0,0,.08);
}

.form-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.fg label{
  display:block;
  font-weight:800;
  font-size: 13px;
  margin-bottom: 6px;
  color:#374151;
}

.fg input, .fg select{
  width:100%;
  border:1px solid #d1d5db;
  border-radius:10px;
  padding: 10px 12px;
  font-size:14px;
  background:#fff;
}

.fg input:focus, .fg select:focus{
  outline:none;
  border-color:#2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.hint{
  margin-top: 6px;
  font-size: 12px;
  color:#6b7280;
  line-height: 1.35;
}

.subhead{
  margin: 18px 0 10px;
  font-size: 16px;
  font-weight: 900;
  color:#111827;
}

.form-actions{
  margin-top: 16px;
  display:flex;
  justify-content:flex-end;
}

.btn-primary{
  background:#2563eb;
  color:#fff;
  border:0;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 900;
  cursor:pointer;
}
.btn-primary:hover{ background:#1d4ed8; }

.notice-ok{
  background:#dcfce7;
  color:#166534;
  border:1px solid #bbf7d0;
  padding:10px 12px;
  border-radius:10px;
  margin: 0 0 12px;
  font-weight: 800;
}

.notice-err{
  background:#fee2e2;
  color:#7f1d1d;
  border:1px solid #fecaca;
  padding:10px 12px;
  border-radius:10px;
  margin: 0 0 12px;
}

.notice-err ul{
  margin: 8px 0 0 18px;
}

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

/* ===== Email Chips (Outlook-like) ===== */
.chips{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  padding: 10px 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background:#fff;
  min-height: 42px;
  cursor: text;
}

.chips:focus-within{
  border-color:#2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.chips-list{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
}

.chips-input{
  border: 0;
  outline: none;
  font-size: 14px;
  padding: 4px 6px;
  min-width: 180px;
  flex: 1 1 180px;
}

.chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37,99,235,.12);
  border: 1px solid rgba(37,99,235,.20);
  color:#1f2937;
  font-weight: 700;
  font-size: 13px;
}

.chip-bad{
  background: rgba(248,113,113,.14);
  border-color: rgba(248,113,113,.35);
}

.chip-x{
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: rgba(17,24,39,.65);
  padding: 0;
}
.chip-x:hover{
  color: rgba(17,24,39,.95);
}

.notice-ok{
  background:#dcfce7;
  color:#166534;
  border:1px solid #bbf7d0;
  padding:10px 12px;
  border-radius:10px;
  margin: 0 0 12px;
  font-weight: 800;
}
.notice-err{
  background:#fee2e2;
  color:#7f1d1d;
  border:1px solid #fecaca;
  padding:10px 12px;
  border-radius:10px;
  margin: 0 0 12px;
}

/* ===== Admin Subnav (horizontal) ===== */
.admin-subnav{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin: 10px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0,0,0,.10);
}
.admin-subnav a{
  text-decoration:none;
  font-weight:900;
  font-size: 13px;
  color:#111827;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(17,24,39,.04);
}
.admin-subnav a:hover{ background: rgba(17,24,39,.07); }
.admin-subnav a.active{
  background: rgba(37,99,235,.14);
  border: 1px solid rgba(37,99,235,.20);
}

/* ===== Tables ===== */
.table-toolbar{
  display:flex;
  gap:10px;
  align-items:center;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}
.table-toolbar__label{ font-weight: 900; }
.table-toolbar__input{
  flex: 1;
  min-width: 240px;
  max-width: 520px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 10px;
  font-size: 14px;
}
.table-toolbar__input:focus{
  outline: none;
  border-color: rgba(37,99,235,.65);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.table-toolbar__count{ opacity: .75; font-size: .95em; }

.table-card{
  background:#fff;
  border-radius:16px;
  padding: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,.08);
  overflow:auto;
}

.tbl{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 820px;
}

.tbl thead th{
  text-align:left;
  font-size: 13px;
  font-weight: 900;
  color:#374151;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(0,0,0,.10);
  background: #f9fafb;
  position: sticky;
  top: 0;
  z-index: 1;
}

.tbl tbody td{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  vertical-align: middle;
}

.tbl tbody tr:hover{
  background: rgba(17,24,39,.03);
}

.num{ text-align:right; font-variant-numeric: tabular-nums; }

.actions{
  white-space: nowrap;
}
.btn-link{
  display:inline-block;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 900;
  font-size: 13px;
  text-decoration:none;
  color:#2563eb;
  background: rgba(37,99,235,.10);
  margin-right: 6px;
}
.btn-link:hover{ background: rgba(37,99,235,.16); }

.badge{
  display:inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.badge-ok{ background:#dcfce7; color:#166534; border:1px solid #bbf7d0; }
.badge-off{ background:#f3f4f6; color:#374151; border:1px solid #e5e7eb; }

.money-pos{ color:#065f46; font-weight: 900; }
.money-neg{ color:#991b1b; font-weight: 900; }

.row-inaktiv{ opacity: .85; }
.subline{ margin: 6px 0 6px; }


/* Offener Saldo Card */
.finanzen .saldo-card{
  display:flex;
  gap:16px;
  align-items:center;
  justify-content:space-between;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 14px;
  padding: 14px;
  background: rgba(176,0,32,.06);
  margin: 0 0 14px;
}
.finanzen .saldo-card .left{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.finanzen .saldo-card .title{
  font-weight:800;
}
.finanzen .saldo-card .amount{
  font-size: 22px;
  font-weight: 900;
  color:#b00020;
}
.finanzen .saldo-card .meta{
  color: rgba(0,0,0,.65);
  font-size: 13px;
  line-height: 1.35;
}
.finanzen .saldo-card img{
  display:block;
  width: 150px;
  height: 150px;
  border-radius: 10px;
  background:#fff;
  border: 1px solid rgba(0,0,0,.10);
 
}
@media (max-width: 720px){
  .finanzen .saldo-card{ flex-direction:column; align-items:flex-start; }
  .finanzen .saldo-card img{ width: 180px; height: 180px; }
}

/* Fieldset Rahmen "Bezahlen mit Code" */
.finanzen fieldset.paybox{
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 14px;
  padding: 12px;
  margin: 0 0 14px;
  background: #fff;
}
.finanzen fieldset.paybox legend{
  padding: 0 10px;
  font-weight: 800;
  color:#111;
}