:root{
      --brand:#FEBD00;

      --bg:#F6F7F9;
      --panel:#FFFFFF;
      --panel2:#FAFAFB;
      --text:#111827;
      --muted:#6B7280;
      --border:#E5E7EB;

      --shadow:0 10px 30px rgba(17,24,39,.08);
      --shadow2:0 6px 18px rgba(17,24,39,.06);
      --ring:0 0 0 4px rgba(254,189,0,.35);

      --radius:16px;
      --radius-sm:12px;

      --sidebar-w:284px;
      --sidebar-w-collapsed:76px;

      --topbar-h:76px;

      --tap:56px;

      --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
      --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
    }

    *{ box-sizing:border-box; }
    html,body{ height:100%; }
    body{
      margin:0;
      font-family:var(--sans);
      background:var(--bg);
      color:var(--text);
    }

    a{ color:inherit; text-decoration:none; }
    button{ font:inherit; }

    .app{
      min-height:100vh;
      display:grid;
      grid-template-columns: var(--sidebar-w) 1fr;
    }

    .sidebar{
      position:sticky;
      top:0;
      height:100vh;
      background:linear-gradient(180deg, var(--panel) 0%, var(--panel2) 100%);
      border-right:1px solid var(--border);
      padding:14px 12px;
      display:flex;
      flex-direction:column;
      gap:12px;
    }

    .brand{
      display:flex;
      align-items:center;
      gap:10px;
      padding:10px 10px;
      border-radius:14px;
    }

    .brand__logo{
      width:34px;
      height:34px;
      border-radius:10px;
      background:var(--brand);
      border:1px solid var(--brand);
      display:grid;
      place-items:center;
      overflow:hidden;
      flex:0 0 auto;
    }

    .brand__logo img{
      width:100%;
      height:100%;
      display:block;
      object-fit:contain;
      padding:4px;
      filter:none;
    }

    .brand__txt{
      display:flex;
      flex-direction:column;
      min-width:0;
    }
    .brand__name{
      font-weight:900;
      letter-spacing:.2px;
      line-height:1.1;
    }
    .brand__sub{
      font-size:12px;
      color:var(--muted);
      line-height:1.2;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }

    .sidebar__actions{
      display:flex;
      gap:8px;
      padding:0 6px;
    }

    .iconbtn{
      height:var(--tap);
      min-width:var(--tap);
      border-radius:12px;
      border:1px solid var(--border);
      background:var(--panel);
      box-shadow:var(--shadow2);
      display:inline-flex;
      align-items:center;
      justify-content:center;
      cursor:pointer;
      transition:transform .06s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
    }
    .iconbtn:hover{
      transform:translateY(-1px);
      box-shadow:var(--shadow);
      border-color:rgba(17,24,39,.12);
    }
    .iconbtn:active{ transform:translateY(0); }
    .iconbtn:focus{ outline:none; box-shadow:var(--shadow2), var(--ring); border-color:rgba(254,189,0,.55); }

    .nav{
      display:flex;
      flex-direction:column;
      gap:6px;
      padding:0 6px;
    }

    .nav__item{
      height:46px;
      border-radius:14px;
      display:flex;
      align-items:center;
      gap:12px;
      padding:0 14px;
      color:var(--text);
      border:1px solid transparent;
      cursor:pointer;
      transition:background .12s ease, border-color .12s ease, transform .06s ease;
      user-select:none;
    }

    .nav__item:hover{
      background:rgba(17,24,39,.04);
      border-color:rgba(17,24,39,.06);
    }

    .nav__item[aria-current="page"]{
      background:var(--brand);
      border-color:var(--brand);
      color:#111;
    }
    .nav__item[aria-current="page"] .nav__icon{
      color:#111;
    }

    .nav__icon{
      width:22px;
      height:22px;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      color:rgba(17,24,39,.85);
      flex:0 0 auto;
    }

    .nav__label{
      font-weight:800;
      letter-spacing:.1px;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }

    .sidebar__spacer{ flex:1; }
    .sidebar__foot{
      padding:10px 6px 4px;
      color:var(--muted);
      font-size:12px;
    }

    .main{
      min-height:100vh;
      display:flex;
      flex-direction:column;
    }

    .topbar{
      position:sticky;
      top:0;
      z-index:20;

      min-height:var(--topbar-h);
      height:auto;

      background:rgba(246,247,249,.8);
      backdrop-filter:saturate(1.4) blur(10px);
      border-bottom:1px solid var(--border);

      display:flex;
      align-items:center;

      padding:10px 18px;
      gap:12px;
    }

    .topbar__left{
      display:flex;
      align-items:center;
      gap:12px;
      min-width:0;
      flex:1;
    }

    .pagehead{
      display:flex;
      flex-direction:column;
      min-width:0;
    }
    .pagehead__title{
      font-weight:950;
      letter-spacing:.2px;
      line-height:1.1;
      font-size:18px;
    }
    .pagehead__sub{
      font-size:12px;
      color:var(--muted);
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
      line-height:1.2;
      margin-top:2px;
    }

    .topbar__right{
      display:flex;
      align-items:center;
      gap:10px;
    }

    .pillbtn{
      height:var(--tap);
      min-height:var(--tap);

      border-radius:999px;
      border:1px solid var(--border);
      background:var(--panel);
      box-shadow:var(--shadow2);

      display:inline-flex;
      align-items:center;
      gap:10px;

      padding:0 16px;
      cursor:pointer;

      transition:transform .06s ease, box-shadow .12s ease, border-color .12s ease;
      max-width:520px;
    }
    .pillbtn:hover{
      transform:translateY(-1px);
      box-shadow:var(--shadow);
      border-color:rgba(17,24,39,.12);
    }
    .pillbtn:active{ transform:translateY(0); }
    .pillbtn:focus{ outline:none; box-shadow:var(--shadow2), var(--ring); border-color:rgba(254,189,0,.55); }

    .pillbtn__txt{
      min-width:0;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;

      font-weight:800;
      font-size:13px;
      line-height:1.1;
      color:rgba(17,24,39,.92);
    }

    .avatar{
      width:30px;height:30px;
      border-radius:10px;
      display:grid;
      place-items:center;
      background:var(--brand);
      border:1px solid var(--brand);
      color:#111;
      font-weight:950;
      font-size:12px;
      flex:0 0 auto;
    }

    .menu{
      position:absolute;
      right:0;
      top:calc(var(--tap) + 12px);
      width:min(860px, calc(100vw - 24px));
      background:var(--panel);
      border:1px solid var(--border);
      border-radius:16px;
      box-shadow:var(--shadow);
      padding:8px;
    }

    #userMenu.menu{
      width:min(520px, calc(100vw - 24px));
    }

    .menu__header{
      padding:10px 10px 8px;
      border-bottom:1px solid var(--border);
      display:flex;
      flex-direction:column;
      gap:2px;
    }

    .menu__title{ font-weight:950; }
    .menu__desc{ font-size:12px; color:var(--muted); }

    .menu__list{
      padding:6px 0;
      display:flex;
      flex-direction:column;
      gap:6px;
    }

    .menu__item{
      width:100%;
      text-align:left;
      border:1px solid transparent;
      background:transparent;
      border-radius:12px;
      padding:10px 10px;
      display:flex;
      align-items:center;
      gap:10px;
      cursor:pointer;
      transition:background .12s ease, border-color .12s ease;
    }

    .menu__item:hover{
      background:rgba(17,24,39,.04);
      border-color:rgba(17,24,39,.06);
    }

    .menu__icon{
      width:30px;height:30px;
      border-radius:12px;
      display:grid;
      place-items:center;
      background:rgba(17,24,39,.04);
      border:1px solid rgba(17,24,39,.06);
      color:rgba(17,24,39,.8);
      flex:0 0 auto;
    }

    .pill{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      padding:4px 10px;
      border-radius:999px;
      border:1px solid var(--border);
      background:rgba(17,24,39,.03);
      font-size:12px;
      font-weight:800;
      color:rgba(17,24,39,.85);
      white-space:nowrap;
    }
    .pill--brand{
      background:var(--brand);
      border-color:var(--brand);
      color:#111;
    }

    
    .pill--ok{ background:rgba(34,197,94,.18); border-color:rgba(34,197,94,.45); color:#111; }
    .pill--bad{ background:rgba(239,68,68,.14); border-color:rgba(239,68,68,.45); color:#111; }
.menu__item--ctx{
      align-items:flex-start;
    }
    .menu__item--ctx .menu__icon{
      margin-top:2px;
    }
    .ctxName{
      font-weight:900;
      line-height:1.2;
      white-space:normal;
      overflow:visible;
      text-overflow:clip;
      word-break:break-word;
    }
    .ctxMeta{
      margin-top:2px;
      font-size:12px;
      color:var(--muted);
      line-height:1.2;
      white-space:normal;
      overflow:visible;
      text-overflow:clip;
      word-break:break-word;
    }

    .ctxGrid{
      display:grid;
      grid-template-columns: minmax(360px, 1.15fr) minmax(420px, 1.35fr);
      gap:12px;
      padding:10px 10px 8px;
    }

    .ctxCol{
      border:1px solid var(--border);
      border-radius:14px;
      background:linear-gradient(180deg, rgba(17,24,39,.02) 0%, rgba(255,255,255,1) 100%);
      padding:10px;
      display:flex;
      flex-direction:column;
      gap:8px;
      min-height:320px;
    }

    .ctxCol__head{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      padding:0 2px;
    }

    .ctxCol__title{
      font-size:12px;
      font-weight:950;
      color:rgba(17,24,39,.8);
      letter-spacing:.2px;
      text-transform:uppercase;
    }

    .ctxList{
      display:flex;
      flex-direction:column;
      gap:6px;
      overflow:auto;
      max-height:52vh;
      padding-right:2px;
    }

    .ctxSearch{
      height:42px;
      border-radius:12px;
      border:1px solid var(--border);
      background:var(--panel);
      padding:0 10px;
      outline:none;
      font-weight:700;
      color:rgba(17,24,39,.9);
    }
    .ctxSearch::placeholder{ color:rgba(107,114,128,.85); font-weight:700; }
    .ctxSearch:focus{ box-shadow:var(--ring); border-color:rgba(254,189,0,.55); }

    .content{
      padding:18px;
      outline:none;
    }

    .grid{
      display:grid;
      grid-template-columns: repeat(12, 1fr);
      gap:14px;
      align-items:stretch;
    }

    .card{
      grid-column: span 4;
      background:var(--panel);
      border:1px solid var(--border);
      border-radius:var(--radius);
      box-shadow:var(--shadow2);
      padding:14px 14px;
      min-height:110px;
      display:flex;
      flex-direction:column;
      gap:8px;
    }

    .card__top{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
    }

    .card__title{
      font-weight:950;
      letter-spacing:.2px;
    }

    .card__value{
      font-family:var(--mono);
      font-size:12px;
      color:rgba(17,24,39,.75);
      word-break:break-word;
    }

    .muted{ color:var(--muted); }
    .small{ font-size:12px; }

    .hero{
      background:linear-gradient(135deg, rgba(254,189,0,.22) 0%, rgba(255,255,255,1) 60%, rgba(17,24,39,.02) 100%);
      border:1px solid rgba(17,24,39,.08);
      border-radius:var(--radius);
      box-shadow:var(--shadow2);
      padding:16px;
      margin-bottom:14px;
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap:12px;
    }

    .hero__h{
      font-weight:950;
      font-size:18px;
      margin:0 0 4px 0;
    }
    .hero__p{
      margin:0;
      color:rgba(17,24,39,.75);
      font-size:13px;
      line-height:1.35;
      max-width:800px;
    }

    .toastHost{
      position:fixed;
      left:50%;
      bottom:14px;
      transform:translateX(-50%);
      z-index:80;

      width:min(520px, calc(100vw - 24px));
      display:flex;
      flex-direction:column;
      gap:10px;

      pointer-events:none;
      align-items:stretch;
    }

    .toast{
      pointer-events:none;
      background:var(--panel);
      border:1px solid var(--border);
      border-radius:14px;
      box-shadow:var(--shadow);
      padding:10px 12px;
      display:flex;
      align-items:center;
      gap:10px;
      color:rgba(17,24,39,.88);
      font-weight:800;
      font-size:13px;
      width:100%;
    }

    .toast__dot{
      width:10px;height:10px;
      border-radius:999px;
      background:var(--brand);
      box-shadow:0 0 0 4px rgba(254,189,0,.22);
      flex:0 0 auto;
    }

    .app[data-sidebar="collapsed"]{
      grid-template-columns: var(--sidebar-w-collapsed) 1fr;
    }
    .app[data-sidebar="collapsed"] .brand__txt{ display:none; }
    .app[data-sidebar="collapsed"] .nav__label{ display:none; }
    .app[data-sidebar="collapsed"] .nav__item{ justify-content:center; padding:0; }
    .app[data-sidebar="collapsed"] .sidebar__actions{ justify-content:center; }
    .app[data-sidebar="collapsed"] .sidebar__foot{ display:none; }

    .mobileToggle{ display:none; }

    @media (max-width: 980px){
      .app{ grid-template-columns: 1fr; }
      .sidebar{
        position:fixed;
        left:0; top:0;
        transform:translateX(-105%);
        transition:transform .18s ease;
        z-index:60;
        width:min(90vw, 320px);
      }
      .app[data-sidebar="expanded"] .sidebar{ transform:translateX(0); }
      .mobileToggle{ display:inline-flex; }
      .topbar{ padding:10px 12px; }
      .grid{ grid-template-columns: repeat(6, 1fr); }
      .card{ grid-column: span 6; }
      .pillbtn{ max-width: 70vw; }
    }

    @media (max-width: 640px){
      .menu{ width:min(860px, calc(100vw - 16px)); }
      #userMenu.menu{ width:min(520px, calc(100vw - 16px)); }
      .ctxGrid{ grid-template-columns: 1fr; }
      .ctxCol{ min-height: 220px; }
      .ctxList{ max-height: 38vh; }
    }

    .icon{ width:20px; height:20px; display:block; }

    /* DocuWare Gate (Overlay) */
    .dwGate{
      position:fixed;
      inset:0;
      z-index:120;
      background:rgba(17,24,39,.42);
      display:flex;
      align-items:center;
      justify-content:center;
      padding:16px;
    }
    .dwGate__card{
      width:min(520px, calc(100vw - 24px));
      background:var(--panel);
      border:1px solid var(--border);
      border-radius:16px;
      box-shadow:var(--shadow);
      padding:14px 14px;
    }
    .dwGate__title{
      margin:0 0 6px 0;
      font-weight:950;
      letter-spacing:.2px;
    }
    .dwGate__p{
      margin:0;
      color:rgba(17,24,39,.75);
      font-size:13px;
      line-height:1.35;
    }
    .dwGate__actions{
      margin-top:12px;
      display:flex;
      justify-content:flex-end;
      gap:10px;
    }
    .dwGate__btn{
      height:46px;
      border-radius:14px;
      border:1px solid var(--border);
      background:var(--panel);
      box-shadow:var(--shadow2);
      padding:0 16px;
      font-weight:900;
      cursor:pointer;
      transition:transform .06s ease, box-shadow .12s ease, border-color .12s ease;
    }
    .dwGate__btn:hover{
      transform:translateY(-1px);
      box-shadow:var(--shadow);
      border-color:rgba(17,24,39,.12);
    }
    .dwGate__btn:active{ transform:translateY(0); }
    .dwGate__btn:focus{
      outline:none;
      box-shadow:var(--shadow2), var(--ring);
      border-color:rgba(254,189,0,.55);
    }
    .dwGate__btn--brand{
      background:var(--brand);
      border-color:var(--brand);
      color:#111;
    }

/* Personal – Filterlayout (smooth) */
.pFilters{
  display:grid;
  grid-template-columns:repeat(12, 1fr);
  gap:12px 14px;
  align-items:end;
}

.pCol{
  display:block;
  grid-column:span 12;
  min-width:0;
}

/* wichtig: Inputs füllen die Grid-Zelle komplett */
.pFilters .ctxSearch{
  width:100%;
}

.pFilters .small.muted{
  margin-bottom:6px;
}

/* Zeile 1: 2 + 3 + 3 + 2 + 2 = 12 */
.pCol--pn{ grid-column:span 2; }
.pCol--nachname{ grid-column:span 3; }
.pCol--vorname{ grid-column:span 3; }
.pCol--eingestellt{ grid-column:span 2; }
.pCol--status{ grid-column:span 2; }

/* Zeile 2: 4 + 4 + 4 = 12 */
.pCol--eintritt{ grid-column:span 4; }
.pCol--austritt{ grid-column:span 4; }
.pCol--geburt{ grid-column:span 4; }

/* Date-Paare kompakter */
.pDate2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}

/* Date-Inputs kleiner/ruhiger */
.pDate2 .ctxSearch{
  height:38px;
  padding:0 10px;
  font-size:13px;
  border-radius:12px;
}

/* kleine optische Stabilität bei Datum */
.pFilters input[type="date"]{
  font-variant-numeric:tabular-nums;
}

@media (max-width: 980px){
  .pCol--pn,
  .pCol--nachname,
  .pCol--vorname,
  .pCol--eingestellt,
  .pCol--status,
  .pCol--eintritt,
  .pCol--austritt,
  .pCol--geburt{ grid-column:span 12; }

  .pDate2{ grid-template-columns:1fr 1fr; }
}


/* Reset-Button (neutral, wie restliche UI) */
.btn{
  height:42px;
  border-radius:14px;
  border:1px solid var(--border);
  background:var(--panel);
  box-shadow:var(--shadow2);
  padding:0 14px;
  font-weight:900;
  cursor:pointer;
  transition:transform .06s ease, box-shadow .12s ease, border-color .12s ease;
}
.btn:hover{
  transform:translateY(-1px);
  box-shadow:var(--shadow);
  border-color:rgba(17,24,39,.12);
}
.btn:active{ transform:translateY(0); }
.btn:focus{
  outline:none;
  box-shadow:var(--shadow2), var(--ring);
  border-color:rgba(254,189,0,.55);
}

/* Mobile: Filter untereinander */
@media (max-width: 980px){
  .pCol--pn,
  .pCol--nachname,
  .pCol--vorname,
  .pCol--eingestellt,
  .pCol--status,
  .pCol--eintritt,
  .pCol--austritt,
  .pCol--geburt{ grid-column:span 12; }
}
/* Personal – Filterlayout (Desktop nebeneinander) */
.pFilters{
  display:grid;
  grid-template-columns:repeat(12, 1fr);
  gap:10px;
}
.pCol{ display:block; grid-column:span 12; }

/* Zeile 1: 2 + 3 + 3 + 2 + 2 = 12 */
.pCol--pn{ grid-column:span 2; }
.pCol--nachname{ grid-column:span 3; }
.pCol--vorname{ grid-column:span 3; }
.pCol--eingestellt{ grid-column:span 2; }
.pCol--status{ grid-column:span 2; }

/* Zeile 2: 4 + 4 + 4 = 12 */
.pCol--eintritt{ grid-column:span 4; }
.pCol--austritt{ grid-column:span 4; }
.pCol--geburt{ grid-column:span 4; }

.pDate2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}

/* Mobile: untereinander */
@media (max-width: 980px){
  .pCol--pn,
  .pCol--nachname,
  .pCol--vorname,
  .pCol--eingestellt,
  .pCol--status,
  .pCol--eintritt,
  .pCol--austritt,
  .pCol--geburt{ grid-column:span 12; }
}

/* Personal Detail – Tabs */
.pdTabs,
.pdSubTabs{
  display:flex;
  gap:8px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  padding:6px 2px;
  margin-top:8px;
}

.pdTabs::-webkit-scrollbar,
.pdSubTabs::-webkit-scrollbar{ height:8px; }
.pdTabs::-webkit-scrollbar-thumb,
.pdSubTabs::-webkit-scrollbar-thumb{
  background:rgba(17,24,39,.08);
  border-radius:999px;
}

.pdTab{
  flex:0 0 auto;
  border:1px solid var(--border);
  background:var(--panel);
  box-shadow:var(--shadow2);
  border-radius:999px;
  padding:8px 12px;
  font-weight:950;
  font-size:13px;
  cursor:pointer;
  white-space:nowrap;
  transition:transform .06s ease, box-shadow .12s ease, border-color .12s ease;
}

.pdTab:hover{
  transform:translateY(-1px);
  box-shadow:var(--shadow);
}

.pdTab[aria-selected="true"]{
  border-color:rgba(254,189,0,.55);
  box-shadow:var(--shadow2), var(--ring);
}

.pdPanel{
  border:1px solid var(--border);
  background:var(--panel);
  box-shadow:var(--shadow2);
  border-radius:18px;
  padding:14px;
}

.pdGrid{
  display:grid;
  grid-template-columns:repeat(12, 1fr);
  gap:10px 14px;
  align-items:start;
}

.pdField{
  grid-column:span 6;
  min-width:0;
}
@media (max-width: 980px){
  .pdField{ grid-column:span 12; }
}

/* Fix: HTML hidden-Attribut muss immer gewinnen (sonst bleiben Overlays offen) */
[hidden]{
  display:none !important;
}

/* Extra-sicher für unsere Overlays/Menus */
.dwGate[hidden]{
  display:none !important;
}
.menu[hidden]{
  display:none !important;
}

