/* ======================================================
   VARIANTE B+ – warm & handwerklich (GLAS-STYLE)
   Sidebar perfekt + Content-Buttons farbig OHNE größer zu werden
   ====================================================== */

:root{
  --pageTop:#e3f3e8;     /* kräftigeres hellgrün */
  --pageBot:#eadfce;     /* kräftigeres hellbraun / holz */
  --panel:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --radius:22px;
  --shadow:0 14px 34px rgba(17,24,39,.18);
}

/* Reset */
*{box-sizing:border-box}
html,body{height:100%}

/* Hintergrund */
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(1100px 800px at 10% 0%, rgba(34,197,94,.25), transparent 60%),
    radial-gradient(1100px 800px at 90% 15%, rgba(180,83,9,.25), transparent 60%),
    linear-gradient(180deg,var(--pageTop) 0%, var(--pageBot) 100%);
}

/* Layout */
.shell{
  min-height:100vh;
  display:flex;
  gap:18px;
  padding:18px;
}
.sidebar{
  width:260px;
  flex:0 0 260px;
  display:flex;
  flex-direction:column;
  gap:14px;
  position:sticky;
  top:18px;
}
.main{
  flex:1;
  max-width:1100px;
}

/* Sidebar Kopf */
.brand{
  background:rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-radius:18px;
  padding:14px;
  box-shadow:0 12px 28px rgba(17,24,39,.20);
}
.brand .t{font-weight:900}
.brand .s{font-size:12px;color:var(--muted)}

/* Navigation */
.nav{
  display:flex;
  flex-direction:column;
  gap:12px;
}

/* === Sidebar Pills (UNVERÄNDERT / wie vorher) === */
.pill{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:11px 14px;
  border-radius:999px;

  background:linear-gradient(135deg, rgba(255,255,255,.38), rgba(255,255,255,.18));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  border:1px solid rgba(255,255,255,.55);
  color:#ffffff;

  font-weight:800;
  font-size:13px;
  cursor:pointer;

  box-shadow:
    0 18px 40px rgba(17,24,39,.45),
    inset 0 1px 0 rgba(255,255,255,.35);

  transition:transform .08s, box-shadow .08s, filter .08s;
}
.pill:hover{filter:brightness(1.08)}
.pill:active{
  transform:translateY(1px);
  box-shadow:
    0 12px 26px rgba(17,24,39,.45),
    inset 0 1px 0 rgba(255,255,255,.25);
}
.pill.active{outline:2px solid rgba(255,255,255,.8)}

.pill .left{display:flex;align-items:center;gap:10px}
.pill .ico{
  width:30px;height:30px;border-radius:50%;
  display:grid;place-items:center;
  background:rgba(255,255,255,.35);
  box-shadow: inset 0 1px 2px rgba(255,255,255,.6);
}

/* Modulfarben (Sidebar + optional data-modul in Content) */
.pill[data-modul="cockpit"]{ background-image:linear-gradient(135deg, rgba(22,101,52,.85), rgba(34,197,94,.85)); }
.pill[data-modul="stamm"]{   background-image:linear-gradient(135deg, rgba(15,118,110,.85), rgba(20,184,166,.85)); }
.pill[data-modul="kalku"]{   background-image:linear-gradient(135deg, rgba(29,78,216,.85), rgba(59,130,246,.85)); }
.pill[data-modul="projekt"]{ background-image:linear-gradient(135deg, rgba(122,74,46,.90), rgba(180,83,9,.90)); }
.pill[data-modul="planung"]{ background-image:linear-gradient(135deg, rgba(234,88,12,.90), rgba(245,158,11,.90)); }
.pill[data-modul="material"]{background-image:linear-gradient(135deg, rgba(161,98,7,.90), rgba(245,158,11,.90)); }
.pill[data-modul="finanz"]{  background-image:linear-gradient(135deg, rgba(127,29,29,.90), rgba(239,68,68,.90)); }
.pill[data-modul="docs"]{    background-image:linear-gradient(135deg, rgba(76,29,149,.90), rgba(139,92,246,.90)); }
.pill[data-modul="settings"]{background-image:linear-gradient(135deg, rgba(55,65,81,.90), rgba(107,114,128,.90)); }
.pill[data-modul="mobile"]{  background-image:linear-gradient(135deg, rgba(21,128,61,.90), rgba(134,239,172,.90)); }

/* ======================================================
   CONTENT-BUTTONS (untergeordnete Buttons in Seiten)
   -> FARBE + GLAS + SCHATTEN
   -> ABER: Größe bleibt klein/normal (kein Aufblasen)
   -> Wir greifen NUR im .main ein, nicht in der Sidebar.
   ====================================================== */

/* Typische In-Page Buttons/Links farbig machen, ohne Layout zu verändern */
.main button,
.main a.btn,
.main a.button,
.main a.primary,
.main button.primary{
  /* Größe NICHT aufblasen */
  padding: 9px 12px;          /* kleiner als Sidebar */
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;

  /* Glas + Schatten */
  border: 1px solid rgba(255,255,255,.55);
  color: #fff;
  background-image: linear-gradient(135deg, rgba(22,101,52,.85), rgba(34,197,94,.85)); /* Default grün */
  box-shadow: 0 16px 34px rgba(17,24,39,.38), inset 0 1px 0 rgba(255,255,255,.30);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  cursor:pointer;
  text-decoration:none;
}

/* Hover/Active – dezent */
.main button:hover,
.main a.btn:hover,
.main a.button:hover,
.main a.primary:hover,
.main button.primary:hover{ filter:brightness(1.06) }

.main button:active,
.main a.btn:active,
.main a.button:active,
.main a.primary:active,
.main button.primary:active{
  transform: translateY(1px);
  box-shadow: 0 12px 24px rgba(17,24,39,.38), inset 0 1px 0 rgba(255,255,255,.20);
}

/* Wenn du in Content-Buttons später data-modul setzt, übernehmen sie automatisch Modulfarbe */
.main button[data-modul],
.main a.btn[data-modul],
.main a.button[data-modul],
.main a.primary[data-modul]{
  /* gleiche Modulfarben wie Sidebar */
}
.main [data-modul="stamm"]{    background-image:linear-gradient(135deg, rgba(15,118,110,.85), rgba(20,184,166,.85)); }
.main [data-modul="kalku"]{    background-image:linear-gradient(135deg, rgba(29,78,216,.85), rgba(59,130,246,.85)); }
.main [data-modul="projekt"]{  background-image:linear-gradient(135deg, rgba(122,74,46,.90), rgba(180,83,9,.90)); }
.main [data-modul="planung"]{  background-image:linear-gradient(135deg, rgba(234,88,12,.90), rgba(245,158,11,.90)); }
.main [data-modul="material"]{ background-image:linear-gradient(135deg, rgba(161,98,7,.90), rgba(245,158,11,.90)); }
.main [data-modul="finanz"]{   background-image:linear-gradient(135deg, rgba(127,29,29,.90), rgba(239,68,68,.90)); }
.main [data-modul="docs"]{     background-image:linear-gradient(135deg, rgba(76,29,149,.90), rgba(139,92,246,.90)); }
.main [data-modul="settings"]{ background-image:linear-gradient(135deg, rgba(55,65,81,.90), rgba(107,114,128,.90)); }
.main [data-modul="mobile"]{   background-image:linear-gradient(135deg, rgba(21,128,61,.90), rgba(134,239,172,.90)); }
.main [data-modul="cockpit"]{  background-image:linear-gradient(135deg, rgba(22,101,52,.85), rgba(34,197,94,.85)); }

/* Content */
.h1{color:#2f4f3a;font-size:22px;font-weight:950;margin:0}
.hsub{color:#5f6f65;font-size:12px;margin-top:4px}

.cardgrid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media(max-width:980px){
  .shell{flex-direction:column}
  .cardgrid{grid-template-columns:1fr}
}

/* Cards ruhig & hell */
.card{
  background:#ffffff;
  border-radius:22px;
  padding:16px;
  box-shadow:var(--shadow);
}
.muted{color:var(--muted);font-size:12px}

/* ==== OVERRIDE: Sidebar Pills neutral (keine Modul-Farben) ==== */
.sidebar .pill,
#app-sidebar .pill{
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
}

.sidebar .pill:hover,
#app-sidebar .pill:hover{
  background: rgba(255,255,255,0.09) !important;
}

.sidebar .pill.active,
#app-sidebar .pill.active{
  background: rgba(255,255,255,0.12) !important;
  border-color: rgba(255,255,255,0.18) !important;
}

.sidebar .pill .ico,
#app-sidebar .pill .ico{
  background: rgba(255,255,255,0.10) !important;
  box-shadow: none !important;
}

/* Falls es farbige Modul-Regeln via data-modul gibt, neutralisieren wir die auch */
.sidebar .pill[data-modul] .ico,
#app-sidebar .pill[data-modul] .ico{
  background: rgba(255,255,255,0.10) !important;
}

/* ==== SIDEBAR HELL & KOMPAKT ==== */

.sidebar {
  width: 220px !important; /* schmaler */
}

.sidebar .pill,
#app-sidebar .pill {
  background: #f4f4f6 !important;
  border: 1px solid #e2e2e7 !important;
  color: #222 !important;

  height: 36px !important;      /* niedriger */
  padding: 0 12px !important;   /* weniger Innenabstand */
  border-radius: 12px !important;

  font-size: 14px !important;
}

.sidebar .pill:hover {
  background: #e9e9ee !important;
}

.sidebar .pill.active {
  background: #dcdce2 !important;
  border-color: #d0d0d6 !important;
}

.sidebar .pill .ico {
  background: #e5e5ea !important;
  width: 22px !important;
  height: 22px !important;
  font-size: 13px !important;
  border-radius: 7px !important;
}

.sidebar .nav {
  gap: 8px !important;  /* weniger Abstand zwischen Pills */
}


/* ==== SIDEBAR FINAL FIX – Einheitlich & Rund ==== */

/* Sidebar überall identisch erzwingen */
#app-sidebar,
.sidebar {
  width: 220px !important;
  background: #ffffff !important;
}

/* Pills – komplett rund + minimal höher */
.sidebar .pill,
#app-sidebar .pill {
  height: 40px !important;            /* leicht höher */
  padding: 0 14px !important;
  border-radius: 999px !important;    /* wirklich rund */
  background: #f4f4f6 !important;
  border: 1px solid #e2e2e7 !important;
  color: #222 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;

  box-sizing: border-box !important;
}

/* Hover */
.sidebar .pill:hover {
  background: #ececf1 !important;
}

/* Active */
.sidebar .pill.active {
  background: #e2e2e8 !important;
  border-color: #d5d5dc !important;
}

/* Icon Kreis */
.sidebar .pill .ico {
  width: 24px !important;
  height: 24px !important;
  border-radius: 999px !important;
  background: #e5e5ea !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
}

/* Abstand zwischen Pills */
.sidebar .nav {
  gap: 10px !important;
}


/* ==== SIDEBAR LAYOUT FIX – Kein weißes Unterfeld ==== */

/* Verhindert weiße Box unter Sidebar */
#app-sidebar,
.sidebar {
  background: transparent !important;
  box-shadow: none !important;
}

/* Falls ein Layout-Wrapper die Sidebar einbettet */
.layout,
.shell,
.wrapper,
.page,
.main,
.sidebar-wrapper {
  background: transparent !important;
}

/* Hauptbereich klar trennen */
.content,
.main-content {
  background: #ffffff !important;
  border-radius: 16px !important;
}


/* ==== SCOPE FIX: Sidebar-Styles NUR innerhalb #app-sidebar ==== */

/* Sidebar Container */
#app-sidebar .sidebar{
  width: 220px !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Pills nur in der Sidebar */
#app-sidebar .pill{
  height: 40px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;

  background: #f4f4f6 !important;
  border: 1px solid #e2e2e7 !important;
  color: #222 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
}

#app-sidebar .pill:hover{ background:#ececf1 !important; }
#app-sidebar .pill.active{
  background:#e2e2e8 !important;
  border-color:#d5d5dc !important;
}

/* Icon-Kreis nur in der Sidebar */
#app-sidebar .pill .ico{
  width: 24px !important;
  height: 24px !important;
  border-radius: 999px !important;
  background: #e5e5ea !important;

  display:flex !important;
  align-items:center !important;
  justify-content:center !important;

  font-size: 14px !important;
  box-shadow: none !important;
}

/* Abstand in der Sidebar */
#app-sidebar .nav{ gap: 10px !important; }

/* WICHTIG: Falls Seiteninhalt auch "pill" nutzt, NICHT wie Sidebar aussehen lassen */
.content .pill, .main-content .pill{
  border-radius: 12px;
}

/* ==== SIDEBAR POSITION FIX (wie BWA) ==== */

/* Sidebar immer an exakt gleicher Stelle */
#app-sidebar{
  position: fixed !important;
  left: 16px !important;
  top: 16px !important;
  width: 220px !important;
  height: calc(100vh - 32px) !important;
  z-index: 50 !important;
}

/* Sidebar-Box soll die volle Höhe nutzen */
#app-sidebar .sidebar{
  height: 100% !important;
}

/* Inhalt auf allen Seiten gleich weit nach rechts schieben */
body{
  margin: 0 !important;
}

.content,
.main-content{
  margin-left: 260px !important; /* 220 Sidebar + 40 Abstand */
  margin-top: 16px !important;
  margin-right: 16px !important;
  margin-bottom: 16px !important;
  min-height: calc(100vh - 32px) !important;
  box-sizing: border-box !important;
}

/* Mobile/kleine Screens: Sidebar oben statt links */
@media (max-width: 980px){
  #app-sidebar{
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    width: auto !important;
    height: auto !important;
    margin: 12px !important;
  }
  .content,
  .main-content{
    margin-left: 12px !important;
    margin-right: 12px !important;
    margin-top: 0 !important;
    margin-bottom: 12px !important;
  }
}


/* ============================================================
   GLOBAL DESIGN POLICY – Keine Modul-Farben mehr
   Alle Pills & Buttons neutral
   ============================================================ */

/* Basis Buttons */
.btn,
button,
input[type="button"],
input[type="submit"] {
  background: #f4f4f6 !important;
  color: #222 !important;
  border: 1px solid #e2e2e7 !important;
  border-radius: 12px !important;
}

/* Hover */
.btn:hover,
button:hover {
  background: #ececf1 !important;
}

/* Active */
.btn:active,
button:active {
  background: #e2e2e8 !important;
}

/* Alle Farbvarianten neutralisieren */
.btnBlue,
.btnGreen,
.btnRed,
.btnOrange,
.btnPrimary,
.btnSuccess,
.btnDanger,
.btnWarning,
.blue,
.green,
.red,
.orange {
  background: #f4f4f6 !important;
  color: #222 !important;
  border: 1px solid #e2e2e7 !important;
}

/* Pills außerhalb der Sidebar */
.content .pill,
.main-content .pill {
  background: #f4f4f6 !important;
  border: 1px solid #e2e2e7 !important;
  color: #222 !important;
  border-radius: 12px !important;
}

/* Keine Modul-Farben über data-modul */
[data-modul] .pill,
.pill[data-modul] {
  background: #f4f4f6 !important;
  color: #222 !important;
}


/* ==== CONTENT PILLS: kleiner + Breite nach Inhalt ==== */
/* Gilt nur im Seiteninhalt, NICHT für die Sidebar */
.content .pill,
.main-content .pill{
  display: inline-flex !important;     /* nicht volle Breite */
  width: auto !important;             /* Breite nach Inhalt */
  height: 30px !important;            /* kleiner in der Höhe */
  padding: 0 10px !important;         /* kompakter */
  border-radius: 999px !important;    /* schön rund */
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  line-height: 1 !important;
  white-space: nowrap !important;     /* kein Umbruch im Pill */
}

/* Wenn irgendwo .pill als Block kommt: neutralisieren */
.content .pill{ margin: 4px 8px 4px 0 !important; }

/* Optional: Icons im Pill etwas kleiner */
.content .pill .ico,
.main-content .pill .ico{
  width: 18px !important;
  height: 18px !important;
  font-size: 12px !important;
  border-radius: 999px !important;
}

/* ==== CARD PILLS: überall wie Stammdaten-Unterkarte ==== */
/* Gilt nur innerhalb von Karten/Boxen, nicht für Sidebar */
.card .pill,
.card .btn,
.card button,
.box .pill,
.box .btn,
.box button,
.panel .pill,
.panel .btn,
.panel button{
  display: inline-flex !important;
  width: auto !important;           /* Breite nach Inhalt */
  height: 30px !important;          /* kompakt */
  padding: 0 10px !important;
  border-radius: 999px !important;  /* rund */
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  line-height: 1 !important;
  white-space: nowrap !important;

  background: #f4f4f6 !important;
  color: #222 !important;
  border: 1px solid #e2e2e7 !important;
}

/* Abstand zwischen mehreren Pills in einer Card */
.card .pill,
.card .btn,
.card button{
  margin: 4px 8px 4px 0 !important;
}

/* Hover/Active in Cards */
.card .pill:hover,
.card .btn:hover,
.card button:hover{
  background: #ececf1 !important;
}
.card .pill:active,
.card .btn:active,
.card button:active{
  background: #e2e2e8 !important;
}

/* Icons in Card-Pills etwas kleiner */
.card .pill .ico,
.card .btn .ico,
.card button .ico{
  width: 18px !important;
  height: 18px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
}


/* =====================================================
   GLOBAL CONTENT SHIFT – nichts mehr unter Sidebar
   ===================================================== */

/* Sidebar Maße */
:root{
  --sidebar-width: 220px;
  --sidebar-gap: 40px;
}

/* Sidebar bleibt fix */
#app-sidebar{
  position: fixed !important;
  left: 16px !important;
  top: 16px !important;
  width: var(--sidebar-width) !important;
  height: calc(100vh - 32px) !important;
}

/* ALLES im Body nach rechts schieben */
body{
  margin: 0 !important;
}

/* Universeller Content-Shift */
.content,
.main-content,
main,
.page,
.wrapper,
.shell,
.container{
  margin-left: calc(var(--sidebar-width) + var(--sidebar-gap)) !important;
  margin-top: 16px !important;
  margin-right: 24px !important;
  box-sizing: border-box !important;
}

/* Karten nie unter Sidebar */
.card,
.box,
.panel{
  position: relative !important;
  z-index: 1 !important;
}

/* Mobile */
@media (max-width: 980px){
  #app-sidebar{
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    width: auto !important;
    height: auto !important;
    margin: 12px !important;
  }

  .content,
  .main-content,
  main,
  .page,
  .wrapper,
  .shell,
  .container{
    margin-left: 16px !important;
    margin-right: 16px !important;
  }
}


/* =====================================================
   PAGE LAYOUT SYSTEM (Apple-Style)
   - Sidebar fixed bleibt wie bisher
   - Rechts: maximal breit, responsive
   - Oben: Action-Pills in einer Reihe
   - Oben: Input-Cards horizontal, umbrechend
   ===================================================== */

:root{
  --page-max: 1400px;      /* maximale Lesebreite, wirkt "ruhiger" */
  --card-gap: 16px;
  --card-pad: 18px;
}

/* Standard: rechter Bereich wird maximal nutzbar */
.page-shell{
  width: 100%;
  max-width: var(--page-max);
  margin: 16px auto;
  padding: 0;
  box-sizing: border-box;
}

/* Page Header */
.page-header{
  margin: 8px 0 14px 0;
}
.page-title{
  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;
  margin: 0;
}
.page-subtitle{
  margin: 6px 0 0 0;
  opacity: .72;
}

/* Action Bar (Pills oben) */
.action-bar{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 14px 0 14px 0;
}

/* Input Cards oben horizontal */
.input-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--card-gap);
  margin-bottom: var(--card-gap);
}

/* Card Grundstil (falls ihr schon .card habt, wird das nur ergänzen) */
.ui-card{
  background: rgba(255,255,255,.85);
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
  padding: var(--card-pad);
  box-sizing: border-box;
}

/* Spalten-Helfer: damit Karten “so groß wie möglich” werden */
.col-12{ grid-column: span 12; }
.col-8{  grid-column: span 8; }
.col-6{  grid-column: span 6; }
.col-5{  grid-column: span 5; }
.col-4{  grid-column: span 4; }
.col-3{  grid-column: span 3; }

/* Main Content: große Karte(n) */
.main-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--card-gap);
}

/* Responsive Breakpoints */
@media (max-width: 1200px){
  :root{ --page-max: 100%; }
  .col-8{ grid-column: span 12; }
  .col-6{ grid-column: span 12; }
  .col-5{ grid-column: span 12; }
  .col-4{ grid-column: span 6; }
  .col-3{ grid-column: span 6; }
}
@media (max-width: 720px){
  .col-4{ grid-column: span 12; }
  .col-3{ grid-column: span 12; }
  .page-title{ font-size: 28px; }
}

