/* e+k Plattform · Klickdummy · App-Rahmen, interaktive Bausteine und Responsive.
   Baut auf ek.css (Render-Designsystem) auf und ändert dessen Optik nicht. */

html,body{height:100%}
body{background:#fff}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;text-align:inherit}
.btn,.chip,[data-act],[data-go]{cursor:pointer}
.btn:hover{filter:brightness(.97)}
.btn.fill:hover,.btn.bord:hover,.btn.ink:hover{filter:brightness(1.12)}
.btn:focus-visible,.chip:focus-visible,a:focus-visible,button:focus-visible{outline:2px solid var(--bord);outline-offset:2px}
.btn[disabled]{opacity:.45;pointer-events:none}
img{max-width:100%}
input,select,textarea{font:inherit;color:inherit}

/* ---------------------------------------------------------------- Rahmen */
.app{height:100vh;height:100dvh}
.brand{text-decoration:none}
.topbar{min-width:0}
.topbar .crumb{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:block}
.topbar .crumb a{opacity:.9}.topbar .crumb a:hover{opacity:1;text-decoration:underline}
.topbar .crumb .sep{opacity:.6;margin:0 4px}
.topbar .search{color:rgba(255,255,255,.85);cursor:text;flex:none}
.topbar .search:hover{border-bottom-color:#fff}
.topbar .ib,.topbar .me{color:#fff;flex:none}
.topbar .me{white-space:nowrap}
.hamb,.tb-rose{display:none;color:#fff}
.main{overflow-y:auto;overflow-x:hidden;padding-bottom:48px;scroll-behavior:auto}
.side{overflow-y:auto}
.side-main{display:flex;flex-direction:column}
.side a:hover{color:var(--ink);background:rgba(27,43,75,.035)}
.side a.dev{font-size:13.5px;font-weight:500;padding-top:7px;padding-bottom:7px}
.side .photo.ph,.photo.ph{display:inline-grid;place-items:center;background:var(--blue-10)!important;color:var(--blue);font-size:11px;font-weight:600}
.photo.ph span{opacity:.8}
.side .foot{text-decoration:none;padding-top:18px}
.side-veil{display:none}

/* Unternavigation als Links */
.subnav{position:sticky;top:0;z-index:4;gap:16px}
.subnav-in{display:flex;gap:26px;align-items:center;min-width:0;overflow-x:auto;scrollbar-width:none;height:100%}
.subnav-in::-webkit-scrollbar{display:none}
.subnav-in a{height:52px;display:flex;align-items:center;border-bottom:2px solid transparent;color:var(--grey);flex:none}
.subnav-in a:hover{color:var(--ink)}
.subnav-in a.on{color:var(--ink);border-bottom-color:var(--bord)}
.subnav-in .sn{font-size:11px;color:var(--grey2);margin-left:4px}
.subnav-r{margin-left:auto;flex:none}

/* Seitenkopf */
.pagehead{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap}
.pagehead .ph-l{min-width:0;flex:1 1 320px}
.pagehead h1{margin-top:8px}
.pagehead .ph-r{display:flex;gap:8px;flex-wrap:wrap;margin-left:auto}

/* Klickbare Zeilen und Karten */
.click{cursor:pointer;transition:background .12s}
.click:hover{background:var(--soft2)}
tr.click:hover td{background:var(--soft2)}
tr.sel td,.sel{background:var(--blue-5)}
.chip{cursor:pointer}
.chip:hover{border-color:var(--blue)}

/* ---------------------------------------------------------------- Formularfelder */
.fld{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--grey);font-weight:500;margin-bottom:14px;min-width:0}
.fld input,.fld select,.fld textarea{font-size:14px;color:var(--ink);border:1px solid var(--line2);background:#fff;padding:9px 11px;border-radius:2px;width:100%;font-weight:400}
.fld input:focus,.fld select:focus,.fld textarea:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px var(--blue-10)}
.fgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}
.chk{display:flex;align-items:center;gap:10px;font-size:13.5px;padding:6px 0;cursor:pointer}
.chk input{width:16px;height:16px;accent-color:var(--blue)}
.inp{font-size:14px;border:1px solid var(--line2);padding:8px 11px;border-radius:2px;background:#fff;min-width:0}
.inp:focus{outline:none;border-color:var(--blue)}

/* ---------------------------------------------------------------- Dialoge */
.modal-veil{position:fixed;inset:0;background:rgba(17,28,51,.48);z-index:100;display:flex;align-items:flex-start;justify-content:center;padding:72px 16px 16px;overflow-y:auto;animation:fade .14s ease}
.modal{background:#fff;width:100%;max-width:620px;box-shadow:0 30px 80px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100dvh - 96px);min-width:0}
.modal.size-s{max-width:440px}.modal.size-l{max-width:900px}.modal.size-xl{max-width:1100px}
.modal-h{display:flex;align-items:flex-start;gap:16px;padding:20px 24px 16px;border-bottom:1px solid var(--line)}
.modal-h>div{min-width:0;flex:1}
.modal-x{width:32px;height:32px;display:grid;place-items:center;color:var(--grey);margin:-4px -8px 0 auto;flex:none}
.modal-x:hover{color:var(--ink)}
.modal-b{padding:20px 24px;overflow-y:auto;min-height:0}
.modal-f{display:flex;gap:8px;justify-content:flex-end;padding:14px 24px;border-top:1px solid var(--line);flex-wrap:wrap;background:var(--soft2)}
.modal-veil.side{justify-content:flex-end;align-items:stretch;padding:0}
.modal-veil.side .modal{max-height:none;height:100%;max-width:420px;animation:slidein .18s ease}
@keyframes fade{from{opacity:0}to{opacity:1}}
@keyframes slidein{from{transform:translateX(30px);opacity:.6}to{transform:none;opacity:1}}
.persona-list{display:flex;flex-direction:column}
.persona{display:flex;align-items:center;gap:12px;padding:9px 10px;margin:0 -10px;border-radius:2px}
.persona:hover{background:var(--soft2)}
.persona.on{background:var(--blue-5);box-shadow:inset 3px 0 0 var(--bord)}
.persona b{display:block;font-size:14px}.persona small{display:block;font-size:12px;color:var(--grey)}
.menu-links{display:flex;flex-direction:column}
.menu-links a{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid var(--line);font-size:14px;font-weight:500}
.menu-links a:hover{color:var(--bord)}
.notif{display:flex;flex-direction:column}
.notif a{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--line);align-items:flex-start}
.notif a .ic{margin-top:2px;color:var(--grey)}
.notif a.unread .ic{color:var(--bord)}
.notif b{display:block;font-size:13.5px;font-weight:500}.notif a.unread b{font-weight:600}
.notif small{display:block;font-size:12px;color:var(--grey);margin-top:2px}

.toast{position:fixed;right:24px;bottom:24px;z-index:200;background:var(--ink);color:#fff;padding:12px 16px;display:flex;align-items:center;gap:10px;font-size:13.5px;box-shadow:0 12px 30px rgba(0,0,0,.25);max-width:calc(100vw - 32px);animation:fade .15s ease}
.toast button{color:#fff;text-decoration:underline;font-weight:600;margin-left:8px}

/* ---------------------------------------------------------------- Geräte-Bühne (Mieter-App, iPad, Team-App) */
body[data-layout=phone],body[data-layout=tablet]{background:var(--soft)}
.stage{min-height:100vh;min-height:100dvh;display:grid;grid-template-columns:minmax(260px,380px) minmax(0,1fr);background:linear-gradient(135deg,var(--soft) 0%,#ECE8E0 100%)}
.stage-side{padding:36px 40px;display:flex;flex-direction:column;border-right:1px solid var(--line);background:rgba(255,255,255,.55);min-height:100vh;min-height:100dvh}
.stage-back{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:500;color:var(--blue)}
.stage-links{display:flex;flex-direction:column;margin-top:26px;border-top:1px solid var(--ink)}
.stage-links a{padding:10px 0;border-bottom:1px solid var(--line);font-size:14px;font-weight:500;color:var(--ink2)}
.stage-links a:hover,.stage-links a.on{color:var(--bord)}
.stage-links a.on{font-weight:600}
.stage-dev{display:flex;align-items:center;justify-content:center;padding:12px;height:100vh;height:100dvh;overflow:hidden;position:sticky;top:0}
.dev-phone,.dev-tablet{flex:none;transform-origin:center center;background:#0a0a0b;box-shadow:0 0 0 2px #8a8a8f,0 40px 90px rgba(17,28,51,.28)}
.dev-phone{width:414px;height:868px;border-radius:62px;padding:12px}
.dev-tablet{width:1220px;height:860px;border-radius:44px;padding:20px}
.dev-screen{width:100%;height:100%;overflow:hidden;position:relative;background:#fff;border-radius:50px}
.dev-tablet .dev-screen{border-radius:24px}
.dev-screen .m{width:100%;height:100%}
.dev-screen .mb{overflow-y:auto;overflow-x:hidden;scrollbar-width:none}
.dev-screen .mb::-webkit-scrollbar{display:none}
.dev-phone .dev-screen:before{content:"";position:absolute;top:11px;left:50%;transform:translateX(-50%);width:120px;height:34px;border-radius:20px;background:#000;z-index:20}
.sbar.light{color:#fff;position:absolute;top:0;left:0;right:0;z-index:5}
.tabs a{display:flex;flex-direction:column;align-items:center;gap:4px;font-size:10.5px;color:var(--grey);font-weight:500;position:relative}
.tabs a.on{color:var(--bord)}
.tabs a.on:before{content:"";position:absolute;top:-9px;left:50%;transform:translateX(-50%);width:26px;height:3px;border-radius:2px;background:var(--bord)}
.m .mc.click:hover{background:#fbfaf8}

/* ---------------------------------------------------------------- Allgemeine Hilfsklassen für Module */
.wrapd{padding:24px 40px 0}
.empty{padding:28px;text-align:center;color:var(--grey);font-size:13.5px;border:1px dashed var(--line2)}
.sp{flex:1}
.nowrap{white-space:nowrap}
.mt8{margin-top:8px}.mt16{margin-top:16px}.mt24{margin-top:24px}
.demo-note{padding:6px 28px 0 56px;font-size:11px;color:var(--grey2)}

/* ---------------------------------------------------------------- Responsive: Tablet quer / kleiner Laptop */
@media (max-width:1280px){
  .app{grid-template-columns:220px minmax(0,1fr)}
  .side a{padding-left:22px;padding-right:18px}
  .side .grp{padding-left:22px}
  .brand{padding:0 22px}
  .topbar{padding:0 22px;gap:14px}
  .topbar .search{width:240px}
  .wrapd{padding:22px 28px 0}
  .subnav{padding:0 28px}
}
@media (max-width:1060px){
  .topbar .me .nm{display:none}
  .topbar .search{width:auto}
  .topbar .search .lbl,.topbar .search .k{display:none}
  .stage{grid-template-columns:minmax(0,1fr)}
  .stage-side{min-height:0;border-right:0;border-bottom:1px solid var(--line);padding:22px 24px}
  .stage-side p.muted{display:none}
  .stage-links{flex-direction:row;flex-wrap:wrap;gap:4px 18px;border-top:0;margin-top:14px}
  .stage-links a{border:0;padding:4px 0}
  .stage-dev{height:auto;min-height:70vh;position:static;padding:24px 12px}
}

/* ---------------------------------------------------------------- Responsive: Tablet hoch und Smartphone */
@media (max-width:900px){
  .app{grid-template-columns:minmax(0,1fr);grid-template-rows:60px minmax(0,1fr)}
  .brand{display:none}
  .topbar{grid-column:1;padding:0 12px 0 6px;gap:6px}
  .hamb{display:grid;place-items:center;width:42px;height:42px;flex:none}
  .tb-rose{display:block;flex:none}.tb-rose img{width:20px;display:block}
  .topbar .crumb{flex:1;font-size:13.5px;margin-left:6px}
  .topbar .crumb>*:not(:last-child),.topbar .crumb .sep{display:none}
  .topbar .search{margin-left:0;border:0;padding:6px}
  .side{position:fixed;left:0;top:0;bottom:0;width:280px;max-width:86vw;z-index:60;transform:translateX(-100%);transition:transform .2s ease;box-shadow:0 0 40px rgba(0,0,0,.2);padding-top:18px}
  .app.nav-open .side{transform:none}
  .app.nav-open .side-veil{display:block;position:fixed;inset:0;background:rgba(17,28,51,.4);z-index:55}
  .main{grid-column:1}
  .wrapd{padding:18px 16px 0}
  .subnav{padding:0 16px;height:48px}
  .subnav-in{gap:20px}
  .subnav-in a{height:48px}
  .subnav-r{display:none}
  .h-xl{font-size:34px}
  .h-l{font-size:27px}
  .num-xl{font-size:30px}
  .kpirow{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .kpirow>div:nth-child(odd){border-left:0!important;padding-left:0!important}
  .kpirow>div{border-bottom:1px solid var(--line)}
  .fgrid{grid-template-columns:minmax(0,1fr)}
  /* Geräte-Bühne: iPad-Ansichten ohne Rahmen in voller Breite */
  body[data-layout=tablet] .stage-dev{padding:0;display:block;min-height:0}
  body[data-layout=tablet] .dev-tablet{width:100%;height:auto;min-height:100dvh;border-radius:0;padding:0;box-shadow:none;transform:none!important}
  body[data-layout=tablet] .dev-screen{border-radius:0;height:auto;min-height:100dvh;overflow:visible}
  body[data-layout=tablet] .dev-screen .m{height:auto;min-height:100dvh;overflow:visible}
  body[data-layout=tablet] .dev-screen .mb{overflow:visible}
}

/* Tabellen werden auf schmalen Bildschirmen zu Karten */
@media (max-width:760px){
  table.t.cardable thead{display:none}
  table.t.cardable,table.t.cardable tbody,table.t.cardable tr,table.t.cardable td{display:block;width:100%}
  table.t.cardable tr{border-bottom:1px solid var(--line);padding:10px 0}
  table.t.cardable td{border:0;padding:3px 0;white-space:normal;display:flex;justify-content:space-between;gap:12px;text-align:right!important;overflow-wrap:anywhere}
  table.t.cardable td:before{content:attr(data-label);color:var(--grey);font-size:11px;letter-spacing:.06em;text-transform:uppercase;text-align:left;flex:none;max-width:45%}
  table.t.cardable td[data-label=""]:before{content:none}
  table.t.cardable td:first-child{font-weight:500;text-align:left!important;justify-content:flex-start}
  table.t.cardable td:first-child:before{display:none}
  .modal-veil{padding:0;align-items:flex-end}
  .modal{max-height:92dvh}
  .modal-h,.modal-b,.modal-f{padding-left:18px;padding-right:18px}
  .toast{left:16px;right:16px;bottom:16px}
}

/* Smartphone-Apps: auf dem Handy direkt im Vollbild */
@media (max-width:560px){
  body[data-layout=phone] .stage{display:block;background:#fff}
  body[data-layout=phone] .stage-side{display:none}
  body[data-layout=phone] .stage-dev{padding:0;display:block;height:100dvh;position:static}
  body[data-layout=phone] .dev-phone{width:100%;height:100dvh;border-radius:0;padding:0;box-shadow:none;transform:none!important}
  body[data-layout=phone] .dev-screen{border-radius:0}
  body[data-layout=phone] .dev-screen:before{display:none}
  body[data-layout=phone] .stage-back-m{display:flex}
  .h-xl{font-size:30px}
  .topbar .crumb{font-size:13px}
}
.stage-back-m{display:none}
@media (max-width:560px){
  body[data-layout=phone] .dev-screen .sbar{visibility:hidden;height:20px}
  body[data-layout=phone] .dev-screen .sbar.light{display:none}
}

/* Dialoge und Meldungen innerhalb des Geräterahmens */
.modal-veil.in-dev{position:absolute;padding:56px 12px 12px;z-index:300}
.modal-veil.in-dev .modal{max-height:calc(100% - 70px)}
.dev-phone .modal-veil.in-dev{align-items:flex-end;padding:0}
.dev-phone .modal-veil.in-dev .modal{max-height:88%;border-radius:18px 18px 0 0}
.modal-veil.in-dev.side .modal{max-width:min(420px,92%)}
.toast.in-dev{position:absolute;left:16px;right:16px;bottom:96px;z-index:310;border-radius:12px;justify-content:center}
.dev-tablet .toast.in-dev{left:auto;right:24px;bottom:24px;border-radius:2px}
