/* Dieselben Farben wie die App - L01 Cloud Blue. */
:root{
  color-scheme:light;
  --bg:#F5F7FB;
  --panel:#FFFFFF;
  --text:#172033;
  --muted:#667085;
  --line:#DCE3EE;
  --line-strong:#8D95A3;
  --primary:#356DF3;
  --primary-ink:#3165E2;
  --primary-text:#FFFFFF;
  --primary-soft:#EBF0FE;
  --accent:#7657E8;
  --accent-ink:#7254E1;
  --accent-soft:#F1EEFD;
  --danger:#C0271C;
  --scrim:rgba(23,32,51,.42);
  --shadow:0 1px 2px rgba(23,32,51,.06);
}
@media(prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    /* D02 Graphite Indigo */
    --bg:#111318; --panel:#191D25; --text:#E7EAF0; --muted:#9AA3B2;
    --line:#2B313D; --line-strong:#636973;
    --primary:#7C8CFF; --primary-ink:#7C8CFF; --primary-text:#111318; --primary-soft:#1E2437;
    --accent:#A78BFA; --accent-ink:#A78BFA; --accent-soft:#241E38;
    --danger:#F08078; --scrim:rgba(5,6,9,.66);
    --shadow:0 1px 2px rgba(0,0,0,.45);
  }
}
:root[data-theme="dark"]{
  color-scheme:dark;
  /* D02 Graphite Indigo */
  --bg:#111318; --panel:#191D25; --text:#E7EAF0; --muted:#9AA3B2;
  --line:#2B313D; --line-strong:#636973;
  --primary:#7C8CFF; --primary-ink:#7C8CFF; --primary-text:#111318; --primary-soft:#1E2437;
  --accent:#A78BFA; --accent-ink:#A78BFA; --accent-soft:#241E38;
  --danger:#F08078; --scrim:rgba(5,6,9,.66);
  --shadow:0 1px 2px rgba(0,0,0,.45);
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text)}
body{
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:16px;
  line-height:1.4;
}
button,input{font:inherit}
button{cursor:pointer}
button:disabled,input:disabled{cursor:not-allowed;opacity:.58}
.hidden{display:none!important}
.status-message{min-height:20px;margin:10px 0;font-size:13px;color:var(--muted)}
.status-message:empty{display:none}
.status-message.error{color:var(--danger)}
.status-message.success{color:var(--primary-ink)}
.status-message.loading::before{content:"";display:inline-block;width:10px;height:10px;margin-right:7px;border:2px solid var(--line);border-top-color:var(--primary);border-radius:50%;animation:spin .7s linear infinite}
.content[aria-busy="true"]{cursor:progress}
@keyframes spin{to{transform:rotate(360deg)}}

/* Login */
.login-screen{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:22px;
}
/* Bis die Sitzungsprüfung antwortet, ist weder Login noch Oberfläche zu sehen. */
#bootScreen{
  opacity:0;
  animation:boot-in .18s ease-out .12s forwards;
}
@keyframes boot-in{to{opacity:1}}
.boot{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
}
.boot .logo{margin:0}
.boot-bar{
  width:120px;
  height:3px;
  border-radius:2px;
  background:var(--line);
  overflow:hidden;
}
.boot-bar span{
  display:block;
  width:40%;
  height:100%;
  border-radius:2px;
  background:var(--primary);
  animation:boot-slide 1.1s ease-in-out infinite;
}
@keyframes boot-slide{
  from{transform:translateX(-110%)}
  to{transform:translateX(320%)}
}
@media(prefers-reduced-motion:reduce){
  #bootScreen{opacity:1;animation:none}
  .boot-bar span{animation:none;width:100%;opacity:.55}
}

.login-card{
  width:min(100%,390px);
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:16px;
  padding:26px;
  box-shadow:var(--shadow);
}
.logo{
  font-weight:850;
  font-size:24px;
  letter-spacing:-.04em;
  margin-bottom:4px;
}
.login-sub{color:var(--muted);margin-bottom:22px}
.field{margin-bottom:13px}
.field label{
  display:block;
  font-size:13px;
  font-weight:700;
  margin:0 0 6px;
}
.input{
  width:100%;
  min-height:44px;
  border:1px solid var(--line-strong);   /* Bedienelement, 3:1 (WCAG 1.4.11) */
  background:var(--bg);
  color:var(--text);
  border-radius:10px;
  padding:10px 12px;
  outline:none;
}
.input:focus{border-color:var(--primary)}
.primary,.ghost,.danger-btn,.icon-btn{
  border:1.5px solid var(--line);
  background:transparent;
  color:var(--text);
  border-radius:12px;
  min-height:48px;
  padding:0 16px;
  font-weight:600;
  transition:transform .12s cubic-bezier(.2,.7,.3,1), background .15s, border-color .15s;
}
.primary:active,.ghost:active,.danger-btn:active,.icon-btn:active{transform:translateY(1px)}
:focus-visible{outline:3px solid var(--primary);outline-offset:2px;border-radius:10px}
.primary{
  background:var(--primary);
  border-color:var(--primary);
  color:var(--primary-text);
  font-weight:750;
}
.danger-btn{color:var(--danger)}
.icon-btn{
  width:40px;
  padding:0;
  display:grid;
  place-items:center;
}
.login-card .primary{width:100%}
/* App */
.shell{max-width:980px;margin:0 auto;padding:18px}
.topbar{
  position:sticky;
  top:12px;
  z-index:20;
  display:flex;
  align-items:center;
  gap:10px;
  min-height:54px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:14px;
  padding:7px 10px;
  box-shadow:var(--shadow);
}
.brand{font-weight:850;letter-spacing:-.03em}
.admin-badge{
  font-size:12px;
  font-weight:750;
  color:var(--primary-ink);
  background:var(--primary-soft);
  border-radius:999px;
  padding:5px 8px;
}
.spacer{flex:1}
.content{
  margin-top:14px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:15px;
  padding:18px;
  box-shadow:var(--shadow);
}
.head{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:14px;
}
.head h1{
  margin:0;
  font-size:21px;
  letter-spacing:-.02em;
  flex:1;
}
.search-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  margin-bottom:14px;
}
.user-list{
  display:flex;
  flex-direction:column;
}
.user-row{
  display:grid;
  grid-template-columns:40px minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  min-height:62px;
  padding:9px 2px;
  border-bottom:1px solid var(--line);
}
.avatar{
  width:36px;
  height:36px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:var(--accent-soft);
  color:var(--accent-ink);
  font-size:12px;
  font-weight:850;
}
.user-main{min-width:0}
.user-main strong{
  display:block;
  font-size:16px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.user-main small{
  display:block;
  color:var(--muted);
  margin-top:1px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.user-actions{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.status{
  display:inline-flex;
  align-items:center;
  gap:5px;
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
}
.dot{
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--primary);
}
.dot.off{background:var(--line-strong)}
.empty{
  text-align:center;
  color:var(--muted);
  padding:30px 12px;
}

/* Sheet */
.backdrop{
  position:fixed;
  inset:0;
  display:none;
  background:var(--scrim);
  z-index:100;
}
.backdrop.open{display:block}
.sheet{
  position:absolute;
  left:50%;
  bottom:0;
  transform:translateX(-50%);
  width:min(100%,520px);
  background:var(--panel);
  border:1px solid var(--line);
  border-bottom:0;
  border-radius:18px 18px 0 0;
  padding:14px 14px max(18px,env(safe-area-inset-bottom));
}
/* Rückfrage im Dialog statt im Browserfenster. */
.ask{margin:0 0 18px;font-size:15px;line-height:1.5;color:var(--text)}
.ask-actions{display:flex;gap:10px}
.ask-actions button{flex:1;min-width:0}
.sheet-handle{
  width:42px;height:4px;border-radius:999px;background:var(--line);
  margin:0 auto 12px;
}
.sheet-head{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:14px;
}
.sheet-head h2{
  margin:0;
  font-size:20px;
  flex:1;
}
.form-grid{display:grid;gap:10px}
.note{
.note-lead{margin-bottom:12px}
  font-size:12px;
  color:var(--muted);
}
.success{
  margin-top:10px;
  background:var(--accent-soft);
  color:var(--accent-ink);
  border-radius:10px;
  padding:10px 11px;
  font-size:13px;
}

@media(max-width:680px){
  .shell{padding:0}
  .topbar{
    top:0;
    border-radius:0;
    border-left:0;
    border-right:0;
    border-top:0;
    box-shadow:none;
  }
  .content{
    margin-top:0;
    border-radius:0;
    border-left:0;
    border-right:0;
    border-bottom:0;
    box-shadow:none;
    padding:14px 12px;
  }
  .search-row{grid-template-columns:1fr}
  .search-row .primary{width:100%}
  .user-row{
    grid-template-columns:38px minmax(0,1fr);
    gap:9px;
    align-items:start;
  }
  .user-actions{
    grid-column:2;
    justify-content:flex-start;
  }
  .user-actions button{flex:1}
}
