
:root{
  --bg:#f5f7f9;
  --surface:#ffffff;
  --surface-soft:#f8fafc;
  --line:#e1e6eb;
  --line-strong:#d4dae1;
  --text:#34373b;
  --muted:#777f88;
  --navy:#214a82;
  --navy-deep:#173966;
  --cyan:#2fa0b9;
  --cyan-soft:#e8f7fa;
  --charcoal:#4b4d50;
  --success:#318b5b;
  --warning:#c47a1a;
  --danger:#b94b4b;
  --shadow:0 8px 28px rgba(24,48,75,.07);
  --shadow-soft:0 3px 16px rgba(24,48,75,.05);
  --radius:18px;
}
*{box-sizing:border-box}
html{background:var(--bg)}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font:15px/1.5 "Segoe UI",Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}
button,input,select{font:inherit}
button{transition:.16s ease}
.hidden{display:none!important}
a{color:var(--navy)}
h1,h2,h3,.eyebrow{
  font-family:"Hightower Text",Georgia,"Times New Roman",serif;
  color:var(--charcoal);
  letter-spacing:.08em;
}
h1{font-size:32px;margin:0;font-weight:500}
h2{font-size:21px;margin:0 0 14px;font-weight:500}
p{color:var(--muted);margin:5px 0}

/* LOGIN */
.authgate{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
  background:
    radial-gradient(circle at 18% 16%,rgba(47,160,185,.08),transparent 28%),
    radial-gradient(circle at 85% 80%,rgba(33,74,130,.06),transparent 30%),
    #fff;
}
.authcard{
  width:min(490px,100%);
  background:rgba(255,255,255,.98);
  border:1px solid var(--line);
  border-radius:24px;
  padding:34px;
  box-shadow:0 24px 80px rgba(20,45,72,.12);
}
.brand-lockup img{display:block;max-width:100%;object-fit:contain}
.authbrand.brand-lockup img{width:270px;max-height:145px;margin:0 auto 8px}
.os-chip{
  display:inline-block;
  border:1px solid rgba(33,74,130,.18);
  background:#f3f7fb;
  color:var(--navy);
  padding:4px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.12em;
}
.authbrand{text-align:center;margin-bottom:28px}
.authcard h2{text-align:center;font-size:27px;margin-top:10px}
.authcard p{text-align:center;margin-bottom:20px}
.authcard label{display:block;margin:14px 0 6px;color:#626971;font-size:12px;font-weight:600}
.authcard input{
  width:100%;
  border:1px solid var(--line-strong);
  background:#fff;
  color:var(--text);
  border-radius:12px;
  padding:12px 13px;
  outline:none;
}
.authcard input:focus{border-color:var(--cyan);box-shadow:0 0 0 3px rgba(47,160,185,.12)}
.wide{width:100%;margin-top:18px}
.error{color:var(--danger);margin-top:12px;min-height:18px}

/* APP SHELL */
.app{display:grid;grid-template-columns:250px minmax(0,1fr);min-height:100vh}
.sidebar{
  background:var(--surface);
  border-right:1px solid var(--line);
  padding:22px 15px;
  position:sticky;
  top:0;
  height:100vh;
  box-shadow:3px 0 18px rgba(20,45,72,.03);
  z-index:3;
}
.sidebar-brand{
  text-align:center;
  margin:2px 6px 24px;
  padding-bottom:18px;
  border-bottom:1px solid var(--line);
}
.sidebar-brand img{width:195px;max-height:105px;margin:0 auto 7px}
.sidebar-brand .os-chip{font-size:10px}
.sidebar nav button{
  display:flex;
  align-items:center;
  width:100%;
  border:0;
  background:transparent;
  color:#545b63;
  padding:11px 14px;
  text-align:left;
  border-radius:12px;
  margin:4px 0;
  font-weight:500;
}
.sidebar nav button:hover{background:#f4f8fb;color:var(--navy)}
.sidebar nav button.active{
  background:linear-gradient(90deg,#eaf2fb,#f1f7fb);
  color:var(--navy-deep);
  font-weight:700;
}
.foot{
  position:absolute;
  bottom:18px;
  left:16px;
  right:16px;
  color:#6f7780;
  font-size:12px;
  border-top:1px solid var(--line);
  padding-top:14px;
}
.logout,.install-btn{width:100%;margin-top:9px}
.install-btn{background:var(--cyan-soft);border-color:#c8e9ef;color:#187c90}

main{padding:26px 30px 42px;min-width:0}
.top{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:18px}
.card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:19px;
  margin-bottom:16px;
  box-shadow:var(--shadow-soft);
}
.hero-card{
  min-height:190px;
  background:
    linear-gradient(112deg,#fff 0%,#fff 56%,#f6fbfd 100%);
  border:1px solid var(--line);
  border-radius:22px;
  padding:28px 32px;
  margin-bottom:18px;
  position:relative;
  overflow:hidden;
  box-shadow:var(--shadow);
  display:flex;
  align-items:center;
}
.hero-card:after{
  content:"";
  position:absolute;
  right:-30px;bottom:-65px;
  width:420px;height:200px;
  border:1px solid rgba(47,160,185,.12);
  border-radius:50%;
  transform:rotate(-8deg);
}
.hero-copy{position:relative;z-index:2;max-width:640px}
.eyebrow{
  font-size:15px;
  color:var(--navy);
  letter-spacing:.25em;
  margin-bottom:7px;
}
.hero-card h1{font-size:38px;color:#46484b}
.hero-card #todayDate{font-size:14px;margin-top:10px}
.hero-subline{
  font-family:"Microsoft Himalaya","Segoe Script",Georgia,serif;
  color:#62676d;
  font-size:24px;
  letter-spacing:.06em;
  margin-top:4px;
}
.hero-mark{
  position:absolute;
  right:40px;
  width:265px;
  max-height:165px;
  object-fit:contain;
  opacity:.95;
  z-index:1;
}
.kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.kpi{min-height:112px}
.kpi span{display:block;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.08em}
.kpi strong{font-size:31px;font-weight:500;display:block;margin-top:8px;color:var(--navy-deep)}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.week{display:grid;grid-template-columns:repeat(7,minmax(150px,1fr));gap:10px;overflow:auto;padding-bottom:4px}
.day{
  min-height:310px;
  border:1px solid var(--line);
  background:var(--surface-soft);
  border-radius:14px;
  padding:11px;
}
.day.today{outline:2px solid rgba(47,160,185,.28);background:#fbfeff}
.dayhead{
  font-family:"Hightower Text",Georgia,serif;
  letter-spacing:.05em;
  color:#4c5055;
  font-weight:600;
  margin-bottom:9px
}
.date{display:block;color:var(--muted);font:11px "Segoe UI",Arial,sans-serif;margin-top:2px}
.shift{
  background:#fff;
  border:1px solid var(--line);
  border-left:4px solid var(--cyan);
  border-radius:10px;
  padding:9px 10px;
  margin-bottom:8px;
  cursor:pointer;
  box-shadow:0 2px 9px rgba(25,55,83,.04);
}
.shift:hover{transform:translateY(-1px);box-shadow:0 5px 16px rgba(25,55,83,.07)}
.shift strong{color:#3f464c}
.shift .time{font-size:12px;color:var(--muted);margin-top:3px}
.shift .flex{font-size:11px;color:var(--cyan);margin-top:4px}
button,.button{
  border:1px solid var(--line-strong);
  background:#fff;
  color:#545c64;
  padding:9px 13px;
  border-radius:10px;
  cursor:pointer;
  text-decoration:none;
  display:inline-block;
}
button:hover,.button:hover{border-color:#bfcbd6;background:#f8fafc}
.primary{
  background:linear-gradient(180deg,#285b99,#214a82);
  border-color:var(--navy);
  color:#fff;
  font-weight:700;
}
.primary:hover{background:var(--navy-deep);color:#fff}
.danger{color:var(--danger)}
.actions{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}
table{width:100%;border-collapse:collapse}
th,td{text-align:left;padding:12px 9px;border-bottom:1px solid var(--line);vertical-align:top}
th{color:#737b84;font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.04em}
tbody tr:hover{background:#fbfcfd}
.tableScroll,.auditwrap{overflow:auto}
.modalbg{
  position:fixed;inset:0;background:rgba(20,31,42,.45);
  display:flex;align-items:center;justify-content:center;padding:20px;z-index:10;
  backdrop-filter:blur(3px)
}
.modalbox{
  width:min(590px,100%);
  background:#fff;
  border:1px solid var(--line);
  border-radius:20px;
  padding:22px;
  box-shadow:0 25px 80px rgba(20,31,42,.18)
}
.form{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.field{display:flex;flex-direction:column;gap:6px}
.full{grid-column:1/-1}
label{font-size:12px;color:#6d747c;font-weight:600}
input,select{
  background:#fff;border:1px solid var(--line-strong);color:var(--text);
  padding:10px;border-radius:10px;width:100%;outline:none
}
input:focus,select:focus{border-color:var(--cyan);box-shadow:0 0 0 3px rgba(47,160,185,.1)}
.modalactions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
.statusbox{
  padding:13px;border:1px solid #dbe6ed;background:#f8fbfd;
  border-radius:12px;color:#626b74;line-height:1.7
}
.hint{font-size:12px;line-height:1.5}
.switchrow{margin:14px 0}.switchrow input{width:auto;margin-right:8px}
.empty{color:#98a0a8;padding:20px;text-align:center}
.sectionhead{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.rolepill{
  font-size:10px;padding:3px 8px;border:1px solid #cfe5eb;border-radius:999px;
  color:#1b8297;background:#effafd;text-transform:uppercase;letter-spacing:.05em
}
.auditdetails{max-width:440px;font-size:11px;color:var(--muted);white-space:pre-wrap;word-break:break-word}
.public-footer{background:transparent!important}

/* PWA/standalone polish */
@media (display-mode: standalone){
  body{overscroll-behavior:none}
  .sidebar{padding-top:26px}
}
@media(max-width:1050px){
  .kpis{grid-template-columns:repeat(2,1fr)}
  .hero-mark{width:210px;opacity:.35}
}
@media(max-width:900px){
  .app{grid-template-columns:1fr}
  .sidebar{height:auto;position:static;border-right:0;border-bottom:1px solid var(--line)}
  .sidebar-brand{display:none}
  .sidebar nav{display:flex;overflow:auto;gap:4px}
  .sidebar nav button{width:auto;white-space:nowrap}
  .foot{position:static;margin-top:12px}
  main{padding:18px}
  .grid2{grid-template-columns:1fr}
  .kpis{grid-template-columns:1fr 1fr}
  .hero-card{padding:24px;min-height:160px}
  .hero-card h1{font-size:30px}
}
@media(max-width:600px){
  .kpis{grid-template-columns:1fr}
  .form{grid-template-columns:1fr}
  .full{grid-column:auto}
  .hero-mark{display:none}
  .hero-subline{font-size:21px}
  .authcard{padding:25px 20px}
}


/* =========================================================
   V2.2.2 - LEBENSWERK BRANDING POLISH
   ========================================================= */
:root{
  --lw-blue:#214a82;
  --lw-blue-dark:#173966;
  --lw-cyan:#2e9eb8;
  --lw-charcoal:#505154;
  --lw-white:#ffffff;
  --lw-offwhite:#f7f9fb;
}

/* Real LEBENSWERK vector assets */
.sidebar-brand img{
  width:210px;
  max-height:116px;
  object-fit:contain;
}
.authbrand.brand-lockup img{
  width:285px;
  max-height:190px;
  object-fit:contain;
}

/* Typography */
h1,h2,h3,.eyebrow,.dayhead{
  font-family:"Hightower Text","Baskerville","Times New Roman",serif;
}
.hero-subline{
  font-family:"Microsoft Himalaya","Segoe Print","Baskerville",serif;
  font-size:27px;
  letter-spacing:.105em;
  color:#606266;
}
.hero-intro{
  font-size:15px;
  color:#656c73;
  margin:10px 0 4px;
}

/* Dashboard hero */
.hero-card{
  background:
    radial-gradient(circle at 78% 28%,rgba(46,158,184,.07),transparent 28%),
    linear-gradient(112deg,#fff 0%,#fff 58%,#f8fbfd 100%);
  min-height:205px;
}
.hero-card h1{
  font-size:41px;
  letter-spacing:.15em;
  color:var(--lw-charcoal);
}
.hero-mark{
  width:300px;
  max-height:185px;
  right:48px;
  filter:drop-shadow(0 8px 12px rgba(35,53,70,.06));
}

/* More refined card system */
.card,.kpi,.hero-card,.day{
  transition:transform .22s cubic-bezier(.2,.7,.3,1),box-shadow .22s ease,border-color .22s ease;
}
.card:hover{
  border-color:#d5dfe7;
  box-shadow:0 12px 34px rgba(26,53,79,.075);
}
.kpi:hover{
  transform:translateY(-2px);
}
.kpi{
  position:relative;
  overflow:hidden;
}
.kpi:before{
  content:"";
  position:absolute;
  top:0;left:0;right:0;height:3px;
  background:linear-gradient(90deg,var(--lw-cyan),var(--lw-blue));
  opacity:.65;
}
.kpi strong{
  font-variant-numeric:tabular-nums;
}

/* Navigation refinement */
.sidebar nav button{
  position:relative;
  overflow:hidden;
}
.sidebar nav button.active:before{
  content:"";
  position:absolute;
  left:0;top:8px;bottom:8px;width:3px;
  border-radius:5px;
  background:var(--lw-cyan);
}
.sidebar nav button:hover{
  transform:translateX(2px);
}

/* Buttons */
.primary{
  box-shadow:0 5px 14px rgba(33,74,130,.14);
}
.primary:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 20px rgba(33,74,130,.18);
}
button:active,.button:active{
  transform:translateY(0) scale(.985);
}

/* Tables and shifts */
tbody tr{
  transition:background-color .15s ease;
}
.shift{
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
}

/* Subtle page entrance */
main > section:not(.hidden){
  animation:lwPageIn .28s ease both;
}
.card,.hero-card{
  animation:lwCardIn .34s ease both;
}
.kpis .card:nth-child(2){animation-delay:.035s}
.kpis .card:nth-child(3){animation-delay:.07s}
@keyframes lwPageIn{
  from{opacity:0;transform:translateY(5px)}
  to{opacity:1;transform:none}
}
@keyframes lwCardIn{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:none}
}
@media (prefers-reduced-motion:reduce){
  *,*:before,*:after{
    animation-duration:.001ms!important;
    animation-iteration-count:1!important;
    transition-duration:.001ms!important;
  }
}

/* Modal polish */
.modalbox{
  animation:lwModalIn .18s ease both;
}
@keyframes lwModalIn{
  from{opacity:0;transform:translateY(7px) scale(.99)}
  to{opacity:1;transform:none}
}

/* Mobile hero */
@media(max-width:1050px){
  .hero-mark{right:22px;width:235px}
}
@media(max-width:600px){
  .hero-card h1{font-size:31px;letter-spacing:.11em}
  .hero-intro{font-size:14px}
  .hero-subline{font-size:22px}
}


/* =========================================================
   V2.2.3 - MOBILE / SMARTPHONE RESPONSIVENESS
   Desktop is intentionally unchanged.
   ========================================================= */

.mobile-header,
.mobile-nav-backdrop,
.mobile-drawer-close{
  display:none;
}

/* Give touch devices friendlier hit areas without changing desktop layout */
@media (pointer:coarse){
  button,.button,input,select{
    min-height:44px;
  }
}

/* Tablet + smartphone app shell */
@media(max-width:900px){
  html,body{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
  }

  body{
    padding-top:env(safe-area-inset-top,0px);
    padding-left:env(safe-area-inset-left,0px);
    padding-right:env(safe-area-inset-right,0px);
  }

  .app{
    display:block;
    min-height:100dvh;
  }

  /* Native-app-like mobile top bar */
  .mobile-header{
    display:flex;
    position:fixed;
    z-index:30;
    top:env(safe-area-inset-top,0px);
    left:0;
    right:0;
    height:64px;
    align-items:center;
    justify-content:space-between;
    padding:8px 14px 8px 16px;
    background:rgba(255,255,255,.96);
    border-bottom:1px solid var(--line);
    box-shadow:0 5px 22px rgba(28,49,70,.06);
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
  }
  .mobile-header img{
    width:182px;
    height:43px;
    object-fit:contain;
    object-position:left center;
  }
  .mobile-menu-btn{
    width:46px;
    height:46px;
    min-height:46px;
    padding:0;
    display:grid;
    place-items:center;
    border:1px solid var(--line);
    border-radius:13px;
    background:#fff;
    color:var(--lw-blue-dark);
    font-size:24px;
    line-height:1;
    box-shadow:0 3px 12px rgba(25,50,76,.05);
  }

  /* Sidebar becomes an off-canvas app drawer */
  .sidebar{
    display:flex;
    flex-direction:column;
    position:fixed;
    z-index:50;
    top:0;
    bottom:0;
    left:0;
    width:min(86vw,330px);
    height:100dvh;
    padding:
      calc(18px + env(safe-area-inset-top,0px))
      16px
      calc(16px + env(safe-area-inset-bottom,0px));
    border-right:1px solid var(--line);
    border-bottom:0;
    background:#fff;
    box-shadow:18px 0 55px rgba(15,33,52,.15);
    transform:translateX(-105%);
    transition:transform .24s cubic-bezier(.2,.75,.25,1);
    overflow-y:auto;
  }
  .app.mobile-nav-open .sidebar{
    transform:translateX(0);
  }

  .mobile-nav-backdrop{
    display:block;
    position:fixed;
    z-index:40;
    inset:0;
    background:rgba(18,29,40,.38);
    opacity:0;
    pointer-events:none;
    transition:opacity .2s ease;
    backdrop-filter:blur(2px);
    -webkit-backdrop-filter:blur(2px);
  }
  .app.mobile-nav-open .mobile-nav-backdrop{
    opacity:1;
    pointer-events:auto;
  }

  .sidebar-brand{
    display:block;
    position:relative;
    margin:0 2px 18px;
    padding:3px 38px 18px 0;
  }
  .sidebar-brand img{
    width:210px;
    margin:0;
  }
  .sidebar-brand .os-chip{
    margin-top:6px;
  }
  .mobile-drawer-close{
    display:grid;
    place-items:center;
    position:absolute;
    top:0;
    right:0;
    width:38px;
    height:38px;
    min-height:38px;
    padding:0;
    border-radius:11px;
    font-size:27px;
    font-weight:300;
    line-height:1;
    color:#69717a;
    background:#f7f9fb;
  }

  .sidebar nav{
    display:block;
    overflow:visible;
    flex:1 0 auto;
  }
  .sidebar nav button{
    width:100%;
    min-height:48px;
    margin:4px 0;
    padding:12px 14px;
    white-space:normal;
    font-size:15px;
  }
  .sidebar nav button:hover{
    transform:none;
  }

  .foot{
    position:static;
    margin-top:auto;
    padding-top:15px;
  }
  .foot .logout,
  .foot .install-btn{
    min-height:46px;
  }

  main{
    width:100%;
    min-width:0;
    padding:
      calc(82px + env(safe-area-inset-top,0px))
      14px
      calc(28px + env(safe-area-inset-bottom,0px));
  }

  /* Headings/buttons stack cleanly */
  .top{
    align-items:flex-start;
    flex-direction:column;
    gap:12px;
    margin-bottom:14px;
  }
  .top > button,
  .top > .primary{
    width:100%;
  }
  h1{
    font-size:27px;
    line-height:1.14;
  }
  h2{
    font-size:19px;
  }

  /* Dashboard */
  .hero-card{
    min-height:auto;
    padding:22px 20px;
    border-radius:18px;
    margin-bottom:13px;
  }
  .hero-card h1{
    font-size:30px;
    letter-spacing:.11em;
  }
  .hero-intro{
    margin-top:8px;
    max-width:92%;
  }
  .hero-subline{
    font-size:21px;
    line-height:1.1;
    letter-spacing:.06em;
    margin-top:8px;
  }
  .hero-mark{
    display:none;
  }

  .kpis{
    grid-template-columns:1fr 1fr;
    gap:10px;
  }
  .kpi{
    min-height:96px;
    padding:15px;
  }
  .kpi strong{
    font-size:27px;
  }
  .kpi.adminOnly:not(.hidden){
    grid-column:1/-1;
  }

  .card{
    border-radius:16px;
    padding:16px;
    margin-bottom:12px;
  }

  /* Schichtplan: actual mobile day cards instead of 7 squeezed columns */
  .toolbar{
    flex-direction:column;
    align-items:stretch;
    gap:11px;
  }
  .toolbar > strong{
    order:-1;
    text-align:center;
    color:var(--lw-blue-dark);
    font-size:14px;
  }
  .toolbar > div{
    display:grid;
    grid-template-columns:48px 1fr 48px;
    gap:7px;
  }
  .toolbar > div button{
    width:100%;
    min-width:0;
    padding:9px 7px;
  }

  .week{
    display:block;
    overflow:visible;
    padding:0;
  }
  .day{
    min-height:0;
    margin:0 0 11px;
    padding:13px;
    border-radius:14px;
  }
  .day.today{
    outline:2px solid rgba(47,160,185,.32);
  }
  .dayhead{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    margin-bottom:10px;
    padding-bottom:8px;
    border-bottom:1px solid var(--line);
    font-size:17px;
  }
  .dayhead .date{
    display:inline;
    margin:0;
    font-size:12px;
  }
  .day > button:last-child{
    width:100%;
    min-height:42px;
    margin-top:3px;
    color:var(--lw-blue);
    border-style:dashed;
    background:#fbfdff;
  }

  .shift{
    padding:12px;
    margin-bottom:8px;
    border-radius:11px;
  }
  .shift strong{
    font-size:15px;
  }
  .shift .time{
    font-size:13px;
  }

  /* System page */
  .grid2{
    grid-template-columns:1fr;
    gap:0;
  }
  .actions{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }
  .actions > *{
    width:100%;
    text-align:center;
  }
  .switchrow label{
    display:flex;
    align-items:flex-start;
    gap:8px;
    line-height:1.4;
  }
  .switchrow input{
    flex:0 0 auto;
    margin-top:3px;
  }
}

/* Narrow phones */
@media(max-width:600px){
  /* Prevent mobile browsers from zooming form fields */
  input,select,textarea{
    font-size:16px;
  }

  .authgate{
    align-items:flex-start;
    padding:
      calc(30px + env(safe-area-inset-top,0px))
      14px
      calc(20px + env(safe-area-inset-bottom,0px));
  }
  .authcard{
    width:100%;
    padding:24px 18px;
    border-radius:20px;
  }
  .authbrand.brand-lockup img{
    width:245px;
    max-height:158px;
  }

  .mobile-header img{
    width:165px;
  }

  main{
    padding-left:10px;
    padding-right:10px;
  }

  .hero-card{
    padding:19px 17px;
  }
  .hero-card h1{
    font-size:27px;
  }
  .eyebrow{
    font-size:12px;
  }
  .hero-intro{
    max-width:100%;
  }

  .kpis{
    grid-template-columns:1fr 1fr;
  }
  .kpi{
    padding:13px;
    min-height:90px;
  }
  .kpi span{
    font-size:10px;
  }
  .kpi strong{
    font-size:25px;
  }

  /* Mobile tables become readable cards */
  .mobile-table-card{
    padding:0;
    background:transparent;
    border:0;
    box-shadow:none;
    overflow:visible;
  }
  .responsive-table{
    display:block;
    width:100%;
  }
  .responsive-table thead{
    display:none;
  }
  .responsive-table tbody{
    display:block;
  }
  .responsive-table tr{
    display:block;
    margin:0 0 10px;
    padding:8px 13px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:14px;
    box-shadow:var(--shadow-soft);
  }
  .responsive-table td{
    display:grid;
    grid-template-columns:110px minmax(0,1fr);
    gap:10px;
    align-items:start;
    width:100%;
    padding:9px 0;
    border-bottom:1px solid #edf0f3;
    overflow-wrap:anywhere;
  }
  .responsive-table td:last-child{
    border-bottom:0;
  }
  .responsive-table td::before{
    color:#7b838b;
    font-size:11px;
    line-height:1.45;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.045em;
  }

  .employees-table td:nth-child(1)::before{content:"Name"}
  .employees-table td:nth-child(2)::before{content:"Rolle"}
  .employees-table td:nth-child(3)::before{content:"Wochenstd."}
  .employees-table td:nth-child(4)::before{content:"Aktiv"}
  .employees-table td:nth-child(5)::before{content:"Aktion"}

  .tasks-table td:nth-child(1)::before{content:"Tätigkeit"}
  .tasks-table td:nth-child(2)::before{content:"Kategorie"}
  .tasks-table td:nth-child(3)::before{content:"Rhythmus"}
  .tasks-table td:nth-child(4)::before{content:"Zuständig"}

  .users-table td:nth-child(1)::before{content:"Name"}
  .users-table td:nth-child(2)::before{content:"Benutzer"}
  .users-table td:nth-child(3)::before{content:"Rolle"}
  .users-table td:nth-child(4)::before{content:"Aktiv"}
  .users-table td:nth-child(5)::before{content:"Aktion"}

  .audit-table td:nth-child(1)::before{content:"Zeit"}
  .audit-table td:nth-child(2)::before{content:"Benutzer"}
  .audit-table td:nth-child(3)::before{content:"Aktion"}
  .audit-table td:nth-child(4)::before{content:"Bereich"}
  .audit-table td:nth-child(5)::before{content:"Details"}

  .responsive-table td button{
    width:100%;
  }
  .auditdetails{
    max-width:none;
    font-size:11px;
  }
  .tableScroll,.auditwrap{
    overflow:visible;
  }

  /* Forms as native-feeling bottom sheets */
  .modalbg{
    align-items:flex-end;
    padding:0;
  }
  .modalbox{
    width:100%;
    max-width:none;
    max-height:91dvh;
    overflow-y:auto;
    border-radius:22px 22px 0 0;
    padding:20px 16px calc(16px + env(safe-area-inset-bottom,0px));
  }
  .modalbox h2{
    font-size:21px;
    margin-bottom:16px;
  }
  .form{
    grid-template-columns:1fr;
    gap:11px;
  }
  .full{
    grid-column:auto;
  }
  .field input,
  .field select{
    min-height:47px;
  }
  .modalactions{
    position:sticky;
    bottom:calc(-16px - env(safe-area-inset-bottom,0px));
    z-index:2;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin:18px -4px -4px;
    padding:12px 4px calc(4px + env(safe-area-inset-bottom,0px));
    background:linear-gradient(to bottom,rgba(255,255,255,.88),#fff 18%);
    backdrop-filter:blur(6px);
    -webkit-backdrop-filter:blur(6px);
  }
  .modalactions button{
    width:100%;
    min-height:46px;
  }
  .modalactions .danger:first-child{
    grid-column:1/-1;
  }

  .statusbox{
    overflow-wrap:anywhere;
  }
}

/* Very small devices */
@media(max-width:380px){
  .mobile-header img{width:145px}
  .kpis{grid-template-columns:1fr}
  .kpi.adminOnly:not(.hidden){grid-column:auto}
  .hero-card h1{font-size:25px;letter-spacing:.08em}
  .responsive-table td{grid-template-columns:96px minmax(0,1fr)}
}

/* Landscape phones: keep header compact */
@media(max-height:520px) and (max-width:900px) and (orientation:landscape){
  .mobile-header{height:54px}
  .mobile-header img{height:36px}
  main{padding-top:70px}
  .sidebar-brand img{width:175px}
}

/* Don't animate drawer if user asks for reduced motion */
@media (prefers-reduced-motion:reduce){
  .sidebar,.mobile-nav-backdrop{transition:none!important}
}
