:root{
  --gold:#c9a24a;
  --gold2:#e8d6a1;
  --link:#7cf0d6;

  /* Dark premium backdrop */
  --bg0:#0b1220;
  --bg1:#101a2e;
  --card:rgba(255,255,255,.10);
  --card2:rgba(255,255,255,.14);
  --border:rgba(255,255,255,.18);
  --text:#eaf2ff;
  --muted:rgba(234,242,255,.70);

  --shadow: 0 18px 55px rgba(0,0,0,.35);
  --shadow2: 0 10px 30px rgba(0,0,0,.25);
  --radius:18px;
  --radius2:14px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: var(--bg0);
}

/* ===== Auth wrapper for centered login ===== */
.auth-wrap{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}

/* ===== App shell (current layout) ===== */
.gh-topbar{
  position: sticky;
  top: 0;
  z-index: 999;
  display:flex;
  align-items:center;
  gap:16px;
  height: 56px;
  padding: 0 20px 0 272px;
  background: #0f1117;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.gh-brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color: var(--text);
  font-weight:800;
}
.gh-logo{
  width:28px;
  height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  background: rgba(255,255,255,.08);
  font-weight:900;
}
.gh-name{
  text-transform: uppercase;
  letter-spacing: .6px;
  font-size:12px;
}
.gh-search{
  display:flex;
  align-items:center;
  gap:8px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  padding:6px 10px;
  min-width:220px;
}
.gh-search-input{
  background: transparent;
  border: none;
  color: var(--text);
  font-size:12px;
  outline: none;
}
.gh-active{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.gh-active-pill{
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.16);
  font-size:12px;
}
.gh-active-pill--warn{
  background: rgba(245,158,11,.18);
  border-color: rgba(245,158,11,.3);
}
.gh-active-link{
  font-size:12px;
  color: var(--link);
}
.gh-toggle{
  margin-left:auto;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.16);
  border-radius:10px;
  color: var(--text);
  padding:6px 8px;
}
.gh-user{
  font-size:12px;
  opacity:.8;
}
.gh-mobile{
  display:none;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.16);
  border-radius:10px;
  color: var(--text);
  padding:6px 8px;
}

.sidebar{
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  padding: 72px 16px 16px;
  background: #0f1117;
  border-right:1px solid rgba(255,255,255,.08);
  overflow-y: auto;
  z-index: 998;
}
.sb-nav{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.sb-section summary{
  list-style:none;
  cursor:pointer;
  font-weight:700;
  font-size:12px;
  letter-spacing:.4px;
  text-transform:uppercase;
  color: rgba(255,255,255,.6);
  padding:6px 8px;
}
.sb-section summary::-webkit-details-marker{display:none}
.sb-link{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:10px;
  color: var(--text);
  text-decoration:none;
  font-size:13px;
}
.sb-link:hover{
  background: rgba(255,255,255,.08);
}
.sb-link.active{
  background: rgba(99,102,241,.18);
  border:1px solid rgba(99,102,241,.3);
}
.sb-badge{
  margin-left:auto;
  background: rgba(239,68,68,.2);
  border:1px solid rgba(239,68,68,.3);
  border-radius:999px;
  padding:2px 8px;
  font-size:11px;
}
.sb-footer{
  margin-top:16px;
  border-top:1px solid rgba(255,255,255,.08);
  padding-top:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* ===== Aufgaben selector (inline + popover) ===== */
.ts{
  position: relative;
  min-width: 220px;
}
.ts__trigger{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.ts__value{
  max-width: 220px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.ts__panel{
  position:absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(300px, 100vw - 32px);
  min-width: 260px;
  z-index: 2000;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(16,26,46,.98);
  box-shadow: var(--shadow2);
  padding: 10px;
  box-sizing: border-box;
}
.ts__list{
  max-height: 320px;
  overflow:auto;
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  padding:6px;
  background: rgba(255,255,255,.02);
}
/* Popover task list: show standard staffing option sets without inner scroll; scroll only when list is tall */
.ts--popover .ts__list:not(.ts__list--compact){
  max-height: min(75vh, 520px);
  overflow-y: auto;
  overflow-x: hidden;
}
.ts__list--compact{
  max-height: 200px;
}
.ts__option{
  display:flex;
  gap:8px;
  align-items:flex-start;
  padding:8px 6px;
  border-radius:10px;
}
/* Popover rows: checkbox / indicator left, label flush right of it (no reversed or stretched layout) */
.ts--popover .ts__option{
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 7px 8px;
}
.ts--popover .ts__option input[type="checkbox"]{
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--link);
}
.ts--popover .ts__option .ts__label{
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  line-height: 1.35;
}
.ts__option:hover{
  background: rgba(255,255,255,.06);
}
.ts__label{
  user-select:none;
}

/* Task selector component (inline: chip-style grid; popover: shell-anchored panel) */
.ts.ts--inline{
  min-width: 0;
}
.ts--inline .ts__list{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}
.ts--inline .ts__option{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
}
.ts__popover-shell{
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.ts--popover .ts__panel{
  top: calc(100% + 8px);
}
.ts__option:has(input:checked){
  background: rgba(100, 160, 255, 0.12);
}
.ts--inline .ts__option:has(input:checked){
  border-color: rgba(100, 160, 255, 0.45);
}
.ts[data-disabled="1"]{
  opacity: 0.55;
  pointer-events: none;
}
.ts__label--disabled{
  opacity: 0.7;
}

/* Tables must allow popovers to overflow. */
.staffing-table td{ overflow: visible; }
.staffing-table .ts.ts--popover{
  min-width: 0;
}
.planner-table .ts.ts--popover{
  min-width: 0;
}
.sb-context-title{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.4px;
  color: rgba(255,255,255,.6);
  margin-bottom:6px;
}
.sb-select{
  width:100%;
}
.sb-logout{
  color: var(--link);
  font-size:12px;
  text-decoration:none;
}

@media (max-width: 960px){
  .gh-topbar{
    padding-left: 16px;
  }
  .gh-mobile{
    display:inline-flex;
  }
  .sidebar{
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  body.sb-open .sidebar{
    transform: translateX(0);
  }
  .wrap{
    margin-left: 0;
  }
}

.pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 14px;
  color: rgba(255,255,255,0.95);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(10px);
  transition: all .15s ease;
}

.pill:hover{
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.24);
  transform: translateY(-1px);
}

.pill.admin{
  background: rgba(255, 215, 0, 0.14);
  border-color: rgba(255, 215, 0, 0.28);
}

.pill.danger{
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.28);
}

/* Admin sticky sub-nav */
.admin-subnav{
  position: sticky;
  top: 62px;
  z-index: 998;
  padding: 10px 16px;
  background: rgba(16, 26, 46, 0.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 2px 15px rgba(0,0,0,.20);
}

.admin-subnav-inner{
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.admin-pill{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  color: rgba(255,255,255,0.92);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  transition: all .15s ease;
}

.admin-pill:hover{
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.22);
}

.admin-pill.active{
  background: rgba(99,102,241,0.18);
  border-color: rgba(99,102,241,0.32);
}

/* Mobile responsive nav */
@media (max-width: 768px){
  .topnav-inner{
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .brand{
    justify-self: center;
  }
  .nav-links{
    justify-self: center;
  }
  .nav-user{
    justify-self: center;
  }
  .pill{
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* ===== Layout ===== */
.wrap{
  max-width:1100px;
  margin:0 auto;
  padding:24px 16px 40px;
  margin-left: 260px;
}

.wrap.wide{
  max-width: 1440px;
}

/* Event Orga tab: use full available desktop width inside app shell */
.wrap.full{
  max-width: none;
}

/* ===== Orga overlays (modal + drawer) ===== */
html.modal-open, html.modal-open body{
  overflow:hidden;
}
.orga-overlay{
  position:fixed;
  inset:0;
  z-index:1200;
}
.orga-overlay__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.55);
}
.orga-modal{
  position:absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  width: min(960px, calc(100vw - 24px));
  max-height: calc(100vh - 96px);
  overflow:auto;
  background: rgba(16,26,46,.98);
  border:1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px;
}
.orga-modal.orga-modal--xl{
  width: min(1240px, calc(100vw - 24px));
}
.orga-drawer{
  position:absolute;
  top: 56px;
  right: 0;
  height: calc(100vh - 56px);
  width: min(560px, 96vw);
  overflow:auto;
  background: rgba(16,26,46,.98);
  border-left:1px solid rgba(255,255,255,.16);
  box-shadow: var(--shadow);
  padding: 14px;
}
.orga-overlay__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.orga-overlay__title{
  font-weight:900;
}
.orga-overlay__close{
  white-space:nowrap;
}
.btn.danger{
  background: rgba(239,68,68,.18);
  border-color: rgba(239,68,68,.35);
}
.btn.danger:hover{
  background: rgba(239,68,68,.26);
  border-color: rgba(239,68,68,.45);
}
@media (max-width: 720px){
  .orga-modal{ top: 64px; width: calc(100vw - 16px); }
  .orga-modal.orga-modal--xl{ width: calc(100vw - 16px); }
  .orga-drawer{ width: 100vw; }
}

/* Consistent card spacing */
.card{
  background: var(--card);
  border:1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  padding:18px;
  margin: 16px 0;
}

.card:first-child{
  margin-top: 0;
}

h1{
  font-size:24px;
  margin:0 0 14px;
  letter-spacing:.2px;
}
h2{
  font-size:18px;
  margin:0 0 12px;
  opacity:.95;
}
.small{font-size:12px;color:var(--muted)}
.muted{color:var(--muted)}
hr{border:none;border-top:1px solid rgba(255,255,255,.10);margin:16px 0}

/* ===== Staffing presentation ===== */
.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.view-toggle{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.compact-group{
  padding:12px;
  margin-top:12px;
}
.compact-group-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.compact-title{
  font-weight:800;
}
.compact-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.compact-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  background: rgba(255,255,255,.06);
}
.row-main{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.row-title{
  font-weight:700;
  font-size:14px;
}
.row-meta{
  font-size:12px;
  color:var(--muted);
}
.compact-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

/* ===== Staffing calendar (namespaced) ===== */
.staffing-calendar{
  margin-top:8px;
}
.staffing-calendar__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.staffing-calendar__title{
  font-weight:800;
  font-size:16px;
}
.staffing-calendar__weekdays{
  display:grid;
  grid-template-columns:repeat(7, minmax(0,1fr));
  gap:6px;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.8px;
  color:var(--muted);
  margin-bottom:6px;
}
.staffing-calendar__grid{
  display:grid;
  grid-template-columns:repeat(7, minmax(0,1fr));
  grid-auto-rows:minmax(120px, auto);
  gap:6px;
}
.staffing-calendar__cell{
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  padding:8px;
  background: rgba(255,255,255,.05);
  display:flex;
  flex-direction:column;
  gap:6px;
  cursor:pointer;
}
.staffing-calendar__cell--outside{
  opacity:.45;
}
.staffing-calendar__cell--today{
  border-color: rgba(201,162,74,.55);
  box-shadow: 0 0 0 1px rgba(201,162,74,.35) inset;
}
.staffing-calendar__cell-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
}
.staffing-calendar__day-number{
  font-weight:800;
  font-size:13px;
}
.staffing-calendar__today{
  font-size:10px;
  color:var(--gold2);
  font-weight:700;
}
.staffing-calendar__cell-items{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.staffing-calendar__chip{
  display:flex;
  align-items:center;
  gap:6px;
  padding:2px 6px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  font-size:11px;
  max-width:100%;
  position: relative;
  overflow: hidden;
}
.staffing-calendar__chip::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:3px;
  background: var(--company-color, #8b8fa3);
  opacity: .95;
}
.staffing-calendar__chip-dot{
  width:7px;
  height:7px;
  border-radius:50%;
  background: var(--company-color, #8b8fa3);
  flex:0 0 auto;
}
.staffing-calendar__chip-text{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.staffing-calendar__more{
  background:none;
  border:none;
  color:var(--link);
  font-size:11px;
  padding:0;
  text-align:left;
  cursor:pointer;
}
.staffing-calendar__panel{
  margin-top:12px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:14px;
  padding:12px;
  background: rgba(255,255,255,.08);
  display:none;
}
.staffing-calendar__panel.is-open{
  display:block;
}
.staffing-calendar__panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.staffing-calendar__panel-title{
  font-weight:800;
}
.staffing-calendar__detail-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.staffing-calendar__detail-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:8px 10px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  background: rgba(255,255,255,.05);
}
.staffing-calendar__detail-main{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.staffing-calendar__detail-title{
  display:flex;
  align-items:center;
  gap:6px;
  font-weight:700;
  font-size:13px;
  flex-wrap:wrap;
}
.staffing-calendar__detail-meta{
  font-size:12px;
  color:var(--muted);
}
.staffing-calendar__detail-actions{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}
.company-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background: var(--company-color, #8b8fa3);
  flex:0 0 auto;
  display:inline-block;
}
.company-label{
  font-size:11px;
  font-weight:700;
  color:var(--text);
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
}
.company-label::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background: var(--company-color, #8b8fa3);
  display:inline-block;
}

/* ===== Alert/Message boxes with readable text and dark-glass theme ===== */
.msg{
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.10);
  border-radius: 14px;
  padding:14px 16px;
  color: var(--text);
  line-height: 1.6;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

.msg a{
  color: var(--link);
  text-decoration: underline;
}

.msg.ok, .msg.success{
  border-color:rgba(34,197,94,.40);
  background:rgba(34,197,94,.20);
  color: #d1fae5;
}

.msg.err, .msg.error, .msg.danger{
  border-color:rgba(239,68,68,.42);
  background:rgba(239,68,68,.20);
  color: #fecaca;
}

.msg.warn, .msg.warning{
  border-color:rgba(245,158,11,.40);
  background:rgba(245,158,11,.20);
  color: #fef3c7;
}

.msg.info{
  border-color:rgba(99,102,241,.38);
  background:rgba(99,102,241,.20);
  color: #e0e7ff;
}

/* Flash messages - Flask compatibility */
.flash{
  border-radius: var(--radius2);
  padding:14px 16px;
  border:1px solid rgba(255,255,255,.16);
  background: var(--card);
  margin-bottom:14px;
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

.flash.success{
  background: rgba(34,197,94,.20);
  border-color: rgba(34,197,94,.32);
  color: #d1fae5;
}

.flash.error{
  background: rgba(239,68,68,.20);
  border-color: rgba(239,68,68,.32);
  color: #fecaca;
}

/* ===== Events overview (events_list_de.html) ===== */
.eo-hero{
  padding: 18px 18px;
}

.eo-toolbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}

.eo-eyebrow{
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color: var(--muted);
  font-weight:800;
}

.eo-title{
  font-size:20px;
  font-weight:900;
  margin-top:4px;
}

.eo-toolbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.eo-filter-form{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin:0;
}

.eo-filter-select{
  min-width: 220px;
}

.eo-kpis{
  margin-top:16px;
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:12px;
}

.eo-kpi{
  border:1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding:12px 14px;
  background: rgba(255,255,255,.05);
}

.eo-kpi-label{
  font-size:12px;
  color: var(--muted);
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.eo-kpi-value{
  margin-top:6px;
  font-size:22px;
  font-weight:900;
  line-height: 1.1;
}

.eo-group-nav{
  margin-top:16px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.eo-group{
  scroll-margin-top: 86px;
}

.eo-group-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom: 12px;
}

.eo-event-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.eo-event-card{
  display:flex;
  align-items:stretch;
  justify-content:space-between;
  gap:14px;
  padding: 14px 14px;
  border:1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
}

.eo-event-card.is-active{
  border-color: rgba(34,197,94,.28);
  box-shadow: 0 0 0 1px rgba(34,197,94,.18) inset;
}

.eo-event-main{
  min-width: 0;
  flex: 1 1 auto;
}

.eo-event-meta-row{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom: 8px;
}

.eo-event-title{
  font-weight: 900;
  font-size: 16px;
}

.eo-event-subline{
  margin-top: 6px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  color: var(--muted);
  font-size: 13px;
}

.eo-event-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  flex: 0 0 auto;
}

.eo-event-actions form{
  margin:0;
}

@media (max-width: 900px){
  .eo-kpis{grid-template-columns: repeat(2, minmax(0,1fr));}
}

@media (max-width: 560px){
  .eo-kpis{grid-template-columns: 1fr;}
  .eo-event-card{flex-direction:column; align-items:stretch;}
  .eo-event-actions{justify-content:flex-start;}
  .eo-filter-select{min-width: 100%;}
}

.flash.info{
  background: rgba(99,102,241,.20);
  border-color: rgba(99,102,241,.32);
  color: #e0e7ff;
}

/* Alert classes for compatibility */
.alert{
  border-radius: 14px;
  padding:14px 16px;
  border:1px solid rgba(255,255,255,.16);
  background: var(--card);
  margin-bottom:14px;
  color: var(--text);
  line-height: 1.6;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

.alert-success{
  background: rgba(34,197,94,.20);
  border-color: rgba(34,197,94,.32);
  color: #d1fae5;
}

.alert-danger, .alert-error{
  background: rgba(239,68,68,.20);
  border-color: rgba(239,68,68,.32);
  color: #fecaca;
}

.alert-warning{
  background: rgba(245,158,11,.20);
  border-color: rgba(245,158,11,.32);
  color: #fef3c7;
}

.alert-info{
  background: rgba(99,102,241,.20);
  border-color: rgba(99,102,241,.32);
  color: #e0e7ff;
}

/* Dashboard status card - big and readable */
.status-big{
  padding: 20px;
  font-size: 17px;
  line-height: 1.8;
  font-weight: 600;
  border-radius: 16px;
  margin: 16px 0;
}

.status-big.status-in{
  background: rgba(34,197,94,.20);
  border: 2px solid rgba(34,197,94,.40);
  color: #d1fae5;
}

.status-big.status-out{
  background: rgba(239,68,68,.20);
  border: 2px solid rgba(239,68,68,.40);
  color: #fecaca;
}

.status-big.status-none{
  background: rgba(148,163,184,.16);
  border: 2px solid rgba(148,163,184,.32);
  color: #e2e8f0;
}

.status-card{
  padding:18px 16px;
  font-size:15px;
  line-height:1.6;
}

.status-card .mono{font-variant-numeric:tabular-nums}

.grid{
  display:grid;
  gap:14px;
}
@media(min-width:900px){
  .grid.cols-2{grid-template-columns: 1fr 1fr;}
  .grid.cols-3{grid-template-columns: 1fr 1fr 1fr;}
}

/* ===== Buttons ===== */
.btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.12);
  color:var(--text);
  padding:12px 16px;
  border-radius: 14px;
  cursor:pointer;
  font-weight:800;
  font-size: 14px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.24);
}
.btn:disabled{
  opacity:.50;
  cursor:not-allowed;
  transform:none;
  filter:saturate(.5);
}
.btn.ok, .btn.good, .btn.primary{
  background: rgba(34,197,94,.20);
  border-color: rgba(34,197,94,.35);
}
.btn.bad, .btn.danger{
  background: rgba(239,68,68,.20);
  border-color: rgba(239,68,68,.35);
}
.btn.warn, .btn.warning{
  background: rgba(245,158,11,.20);
  border-color: rgba(245,158,11,.35);
}
.btn.secondary{
  background: rgba(99,102,241,.18);
  border-color: rgba(99,102,241,.32);
}

/* ===== Inputs ===== */
input, select, textarea{
  width:100%;
  padding:12px 14px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.25);
  color: var(--text);
  outline:none;
  font-size: 14px;
}
input::placeholder, textarea::placeholder{color:rgba(234,234,234,.50)}
input:focus, select:focus, textarea:focus{
  border-color:rgba(246,200,120,.50);
  box-shadow:0 0 0 4px rgba(246,200,120,.12);
}

a{color:var(--link);text-decoration:none}
a:hover{text-decoration:underline}
a:visited{color:var(--link)}
label{display:block;font-weight:800;margin:12px 0 6px;font-size:14px}
.form-row{display:grid;gap:14px}
@media(min-width:900px){.form-row.cols-2{grid-template-columns:1fr 1fr}}
.help{font-size:12px;color:var(--muted);margin-top:6px}

/* Alerts - dark glass theme */
.alert, .msg{
  padding: 12px 14px;
  border-radius: var(--radius2);
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: var(--text);
  box-shadow: var(--shadow2);
}
.alert-success, .msg.ok{
  border-color: rgba(34,197,94,.35);
  background: rgba(34,197,94,.18);
  color: #d1fae5;
}
.alert-warning, .msg.warn{
  border-color: rgba(245,158,11,.35);
  background: rgba(245,158,11,.18);
  color: #fde68a;
}
.alert-danger, .msg.err{
  border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.18);
  color: #fecaca;
}
.alert-info, .msg.info{
  border-color: rgba(59,130,246,.35);
  background: rgba(59,130,246,.18);
  color: #bfdbfe;
}

/* ===== Tables ===== */
.table-wrap{
  overflow:auto;
  border-radius: var(--radius);
  border:1px solid rgba(255,255,255,.12);
  margin: 16px 0;
}
table{
  width:100%;
  border-collapse:collapse;
  min-width:720px;
  background: rgba(255,255,255,.04);
  table-layout: auto;
}
th,td{
  padding:12px 14px;
  text-align:left;
  border-bottom:1px solid rgba(255,255,255,.08);
  vertical-align: middle;
  word-break: break-word;
}
th{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:rgba(234,240,255,.80);
  background: rgba(255,255,255,.08);
  font-weight: 800;
}
tr:hover td{background: rgba(255,255,255,.06)}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  background: var(--card);
  border:1px solid rgba(255,255,255,.14);
  font-size:12px;
  font-weight:800;
  white-space: nowrap;
}
.badge.ok{
  background: rgba(34,197,94,.18);
  border-color: rgba(34,197,94,.30);
  color: #86efac;
}
.badge.err{
  background: rgba(239,68,68,.18);
  border-color: rgba(239,68,68,.30);
  color: #fca5a5;
}
.badge.warn{
  background: rgba(245,158,11,.18);
  border-color: rgba(245,158,11,.32);
  color: #fde68a;
}
.badge.info{
  background: rgba(59,130,246,.18);
  border-color: rgba(59,130,246,.32);
  color: #93c5fd;
}

/* Timesheet time colors */
.time-gps{
  color:#86efac;
  font-weight:900;
}
/* Edited timestamp = red */
.time-edit{
  color:#fca5a5;
  font-weight:900;
}
/* Manual timestamp = orange/yellow (alias time-manual for backward compat) */
.time-added,
.time-manual{
  color:#fde68a;
  font-weight:900;
}
/* Optional legacy helpers */
.time-in{color:#86efac;font-weight:900}
.time-out{color:#fca5a5;font-weight:900}

/* Manual shift row styling */
.row-manual{
  opacity: 0.85;
  font-size: 13px;
}

.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media (max-width:720px){.grid2{grid-template-columns:1fr}}

.row-ok{background:rgba(16,185,129,.10)}
.row-warn{background:rgba(245,158,11,.10)}
.row-open{background:rgba(59,130,246,.08)}

/* Responsive tables */
.table-wrap{overflow:auto; -webkit-overflow-scrolling: touch;}
@media (max-width: 680px){
  .table-wrap table{min-width: 680px;}
  th, td { padding: 10px 12px; }
}

/* KPI display */
.kpi{
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* Section spacing */
.section{
  margin-top: 16px;
}

.section:first-child{
  margin-top: 0;
}

/* Phase 2: Simple tables + KPI cards */
.table{width:100%;border-collapse:collapse;margin-top:10px}
.table th,.table td{padding:10px 12px;border-bottom:1px solid rgba(255,255,255,.08);text-align:left;vertical-align:top}
.table thead th{font-size:12px;letter-spacing:.02em;color:rgba(255,255,255,.70)}

/* Orga checklist — mobile scroll containment (scoped, does not affect other .table instances) */
.orga-table-wrap{overflow-x:auto}
.orga-table{min-width:800px}
.orga-table thead th{white-space:nowrap}
.orga-table th,.orga-table td{word-break:normal}

/* Inventory overview + monitor — scoped responsive fix (does not affect global .table) */
.inv-overview-table thead th,.inv-monitor-table thead th{white-space:nowrap}
.inv-overview-table th,.inv-overview-table td,.inv-monitor-table th,.inv-monitor-table td{word-break:normal}

/* Documents library — scoped responsive fix (does not affect global .table) */
.docs-library-table thead th{white-space:nowrap}
.docs-library-table th,.docs-library-table td{word-break:normal}

/* ===== Docs tab grouped sections (Phase 3) ===== */
.docs-filter-bar{
  display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end;
  margin-bottom:20px;padding:10px 12px;
  background:#f7f8fa;border:1px solid #e8eaf0;border-radius:6px;
}
.docs-section{margin-bottom:24px}
.docs-section-header{
  display:flex;align-items:center;gap:8px;
  font-weight:700;font-size:15px;
  margin-bottom:10px;padding-bottom:6px;
  border-bottom:2px solid #e8eaf0;
}
.docs-section--standplan .docs-section-header{
  border-bottom-color:#4a90d9;color:#1a4a7a;
}
.docs-section-count{
  background:#e8eaf0;border-radius:10px;
  padding:1px 8px;font-size:12px;font-weight:600;color:#555;
}
.docs-card-row{
  display:flex;align-items:flex-start;gap:12px;
  padding:10px 12px;border:1px solid #e8eaf0;border-radius:6px;
  margin-bottom:6px;background:#fff;flex-wrap:wrap;
}
.docs-card-row:hover{background:#f7f8fa}
.docs-section--standplan .docs-card-row{
  border-left:3px solid #4a90d9;padding-left:10px;
}
.docs-card-row__main{flex:1;min-width:180px}
.docs-card-row__title{font-weight:700;word-break:break-word}
.docs-card-row__meta{font-size:12px;opacity:.6;margin-top:2px}
.docs-card-row__tasks{display:flex;flex-wrap:wrap;gap:4px;font-size:12px}
.docs-card-row__side{
  display:flex;flex-direction:column;gap:4px;
  align-items:flex-end;flex-shrink:0;font-size:12px;
}
.docs-card-row__actions{
  display:flex;gap:6px;flex-shrink:0;align-items:flex-start;
}
.docs-empty{
  padding:14px 16px;background:#f7f8fa;
  border:1px dashed #d0d4dd;border-radius:6px;
  color:#666;font-size:13px;
}
.docs-add-panel{margin-top:24px}
.docs-add-panel>summary{
  cursor:pointer;font-weight:700;font-size:14px;
  padding:10px 0;border-top:1px solid #e8eaf0;
  list-style:none;
}
.docs-add-panel>summary::-webkit-details-marker{display:none}
.docs-add-panel>summary::before{content:"+ ";opacity:.5}
.docs-add-panel[open]>summary::before{content:"− ";opacity:.5}
@media(max-width:700px){
  .docs-card-row{flex-direction:column;gap:8px}
  .docs-card-row__side{align-items:flex-start}
  .docs-filter-bar{flex-direction:column}
}

.planner-defaults{
  border:1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  padding:10px;
  background: rgba(255,255,255,.03);
}

.planner-table th,
.planner-table td{
  padding:6px 8px;
  overflow: visible; /* task selector popovers must not be clipped */
}

.planner-table{
  min-width: 1100px;
}

.planner-table .pill{
  padding:4px 8px;
  font-size:12px;
}

.input-sm{
  padding:6px 8px;
  font-size:13px;
}

.kpi-card{min-width:160px;padding:12px 14px;border:1px solid rgba(255,255,255,.10);border-radius:14px;background:rgba(255,255,255,.03)}
.kpi-num{font-size:22px;font-weight:900;line-height:1.1;margin-top:4px}


.ctx-form{
  display: flex;
  justify-content: center;
}

.ctx-select{
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.95);
  font-weight: 600;
  max-width: 260px;
}

.ctx-select option{
  color: #111;
}

/* ===== Staffing dense table ===== */
.staffing-table { width:100%; border-collapse:collapse; }
.staffing-table th {
  font-size:11px; text-transform:uppercase; letter-spacing:.06em;
  color:rgba(234,240,255,.70); background:rgba(255,255,255,.06);
  padding:8px 10px; text-align:left; white-space:nowrap;
  position:sticky; top:0; z-index:1;
}
.staffing-table td { padding:8px 10px; font-size:13px; vertical-align:middle;
  border-bottom:1px solid rgba(255,255,255,.06); }
.staffing-table tr:hover td { background:rgba(255,255,255,.04); }
.staffing-table__group td {
  background:rgba(255,255,255,.06); font-weight:700;
  font-size:12px; padding:6px 10px; }

/* /staffing/ list: dense offer rows + dedicated Aufgabe column */
.staffing-table--offer-dense th,
.staffing-table--offer-dense td {
  padding: 5px 8px;
  font-size: 12px;
}
.staffing-table--offer-dense .staffing-table__group td {
  padding: 5px 8px;
  font-size: 11px;
}
.staffing-table__event-title {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  vertical-align: middle;
}
/* Dense offers: separate Event (ellipsis) from Aufgabe popover column */
.staffing-table--offer-dense td.staffing-table__event-title {
  max-width: 11rem;
  padding-right: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.staffing-table--offer-dense td.staffing-table__auf {
  padding-left: 14px;
  min-width: 8.5rem;
}
.staffing-table--offer-dense .ts.ts--popover {
  min-width: 0;
}
.staffing-apply-form__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}
.staffing-table__offer-actions-td .staffing-apply-form--dense {
  margin: 0;
}
.btn.btn-icon {
  padding: 4px 8px;
  min-width: 2rem;
  line-height: 1.2;
  font-size: 14px;
}
.staffing-offer-note-btn {
  flex-shrink: 0;
}
.staffing-offer-note-btn--filled {
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.55);
  border-radius: 8px;
}
.staffing-table__note-col {
  width: 2.75rem;
}
.staffing-table__note-cell {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.staffing-offer-note-popover {
  background: rgba(16, 26, 46, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow: var(--shadow2);
  padding: 10px;
}
.staffing-offer-note-popover[hidden] {
  display: none !important;
}
.staffing-offer-note-popover__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.staffing-offer-note-popover__ta {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  box-sizing: border-box;
}

/* ===== Mobile simplification (staff-facing staffing) ===== */
.staffing-mobile-primary { display: none; }
.staffing-event-title { display: block; }
.staffing-my-action-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* /staffing/my list: one-line row + floating popover for details (staffing_my_popover.js) */
.staffing-my-col-status {
  vertical-align: middle;
  min-width: 6.5rem;
}
.staffing-my-primary-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.staffing-my-table .staffing-my-pill--ended {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.staffing-my-table tr.is-removed td {
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid rgba(148, 163, 184, 0.4);
}
.staffing-my-table tr.is-removed td:not(:first-child) {
  border-left: none;
}
.staffing-my-details-trigger {
  font-size: 12px;
  padding: 4px 10px;
  min-height: 32px;
}
.staffing-my-action-popover-trigger {
  font-size: 12px;
  padding: 6px 12px;
  min-height: 36px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.38);
  color: rgba(255, 255, 255, 0.92);
}
.staffing-my-action-popover-trigger:hover {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.55);
}
.staffing-my-btn--caution {
  border: 1px solid rgba(248, 113, 113, 0.38);
  background: rgba(248, 113, 113, 0.1);
  color: #fecdd3;
}
.staffing-my-btn--caution:hover {
  background: rgba(248, 113, 113, 0.18);
}
.staffing-my-btn--submit-caution {
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(217, 119, 6, 0.22);
  color: #fde68a;
}
.staffing-my-btn--submit-caution:hover {
  background: rgba(217, 119, 6, 0.32);
}
.staffing-my-details__line + .staffing-my-details__line {
  margin-top: 6px;
}
.staffing-my-details__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 4px;
}
.staffing-my-popover__content {
  font-size: 12px;
  line-height: 1.45;
}
#staffing-my-popover-panel.staffing-my-popover {
  position: fixed;
  z-index: 6500;
  min-width: 240px;
  max-width: min(360px, calc(100vw - 20px));
  max-height: min(72vh, 440px);
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--bg1, #101a2e);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
#staffing-my-popover-panel.staffing-my-popover[hidden] {
  display: none !important;
}
.staffing-my-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.staffing-my-popover__title {
  font-size: 13px;
  font-weight: 700;
}
.staffing-my-popover__close {
  flex-shrink: 0;
}
.staffing-my-popover__body {
  overflow-y: auto;
  padding: 10px 12px 12px;
  -webkit-overflow-scrolling: touch;
}
.staffing-my-cancel-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.staffing-my-cancel-form__reason {
  width: 100%;
  box-sizing: border-box;
  min-height: 3.5rem;
  resize: vertical;
}
.staffing-my-col-action {
  vertical-align: middle;
  white-space: normal;
}

@media (max-width: 680px) {
  /* Show compact primary line; hide repeated columns to avoid crowding */
  .staffing-mobile-primary { display: block; }
  .staffing-my-table .staffing-col-day,
  .staffing-my-table .staffing-col-time,
  .staffing-my-table .staffing-col-company,
  .staffing-my-table .staffing-col-auf {
    display: none;
  }
  .staffing-my-table th.staffing-col-day,
  .staffing-my-table th.staffing-col-time,
  .staffing-my-table th.staffing-col-company,
  .staffing-my-table th.staffing-col-auf {
    display: none;
  }

  /* Offer dense table: keep it usable without horizontal crowding */
  .staffing-table--offer-dense .staffing-col-day,
  .staffing-table--offer-dense .staffing-col-time,
  .staffing-table--offer-dense .staffing-col-company,
  .staffing-table--offer-dense .staffing-table__auf,
  .staffing-table--offer-dense .staffing-col-caps {
    display: none;
  }
  .staffing-table--offer-dense th.staffing-col-day,
  .staffing-table--offer-dense th.staffing-col-time,
  .staffing-table--offer-dense th.staffing-col-company,
  .staffing-table--offer-dense th.staffing-col-caps,
  .staffing-table--offer-dense th:nth-child(5) { /* Aufgabe header (dense offer) */
    display: none;
  }

  .staffing-apply-form__row {
    flex-wrap: wrap;
  }
  .staffing-apply-form__row .btn {
    width: 100%;
  }

  /* Larger touch target for note button */
  .btn.btn-icon {
    padding: 10px 12px;
    font-size: 16px;
    min-width: 44px;
  }

  /* Keep popovers within viewport */
  .staffing-offer-note-popover {
    max-width: min(92vw, 520px);
  }
  .calendar-popover {
    max-width: min(92vw, 520px);
  }

  .staffing-my-details-trigger,
  .staffing-my-action-popover-trigger {
    min-height: 44px;
  }

  #staffing-my-popover-panel.staffing-my-popover {
    max-width: min(92vw, 360px);
  }
}

/* Event dashboard — Bewerbungen review (admin-style dense table) */
.staffing-table--event-review th,
.staffing-table--event-review td {
  padding: 5px 8px;
  font-size: 12px;
  vertical-align: middle;
}
.staffing-table__group--review td {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.staffing-review-group__slot {
  margin-right: 8px;
}
.pill--review-action {
  background: rgba(239, 68, 68, 0.28);
  font-weight: 800;
  font-size: 11px;
}
.pill--review-pending {
  background: rgba(234, 179, 8, 0.22);
  font-weight: 700;
  font-size: 11px;
  margin-left: 6px;
}
.pill--state-pending {
  background: rgba(234, 179, 8, 0.18);
}
.pill--state-reserve {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(125, 211, 252, 0.35);
}
.pill--fulfillment {
  margin-left: 4px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(241, 245, 249, 0.65);
}
.pill--fulfillment-empty,
.pill--fulfillment-underfilled {
  border-color: rgba(234, 179, 8, 0.45);
  background: rgba(254, 243, 199, 0.35);
}
.pill--fulfillment-filled {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(187, 247, 208, 0.35);
}
.pill--fulfillment-overfilled {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(254, 202, 202, 0.35);
}
.pill--review-urgent {
  background: rgba(220, 38, 38, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.45);
  font-weight: 800;
  font-size: 11px;
  color: inherit;
}
.pill--review-new {
  background: rgba(59, 130, 246, 0.28);
  border: 1px solid rgba(96, 165, 250, 0.45);
  font-weight: 800;
  font-size: 11px;
  margin-left: 4px;
}
.staffing-review-row--unseen td:first-child {
  box-shadow: inset 3px 0 0 rgba(59, 130, 246, 0.75);
}
.staffing-review-app-row.staffing-review-row--unseen {
  background: rgba(59, 130, 246, 0.06);
}
.staffing-tab-badge--new {
  margin-left: 4px;
  background: rgba(59, 130, 246, 0.28);
  border: 1px solid rgba(96, 165, 250, 0.4);
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 800;
}
.staffing-review-app-row--action {
  box-shadow: inset 3px 0 0 rgba(234, 179, 8, 0.85);
  background: rgba(234, 179, 8, 0.05);
}
.staffing-review-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.staffing-review-ausw {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 10rem;
}
.staffing-review-who {
  font-weight: 700;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Admin staffing tabs ===== */
.staffing-tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:16px; }
.staffing-tab {
  padding:7px 14px; border-radius:10px; font-size:13px; font-weight:700;
  background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.12);
  color:var(--text); cursor:pointer; }
.staffing-tab.is-active {
  background:rgba(99,102,241,.22); border-color:rgba(99,102,241,.38); }
.staffing-tab-badge {
  margin-left:6px; background:rgba(239,68,68,.25);
  border-radius:999px; padding:1px 6px; font-size:11px; }
.staffing-tab-badge--action {
  background: rgba(220, 38, 38, 0.32);
  border: 1px solid rgba(248, 113, 113, 0.4);
  font-weight: 800;
}
.staffing-local-alert-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.staffing-local-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}
.staffing-local-alert--review {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(220, 38, 38, 0.12);
}
.staffing-local-alert__badge {
  min-width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 900;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.25);
  padding: 0 10px;
}
.staffing-local-alert__body {
  flex: 1;
  min-width: 12rem;
}
.staffing-review-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.staffing-review-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  margin-bottom: 10px;
}
.staffing-review-filter-chip {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-decoration: none;
  color: inherit;
  opacity: 0.88;
}
.staffing-review-filter-chip:hover {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.28);
}
.staffing-review-filter-chip.is-active {
  border-color: rgba(255, 200, 100, 0.45);
  background: rgba(255, 200, 100, 0.1);
  opacity: 1;
  font-weight: 600;
}
.staffing-review-filter-chip--reset {
  border-style: dashed;
}
.staffing-table--admin-review-compact th,
.staffing-table--admin-review-compact td {
  padding: 4px 8px;
  font-size: 12px;
  vertical-align: middle;
}
.staffing-review-status-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  line-height: 1.25;
}
.staffing-review-aging-hint {
  cursor: help;
  opacity: 0.75;
  font-size: 12px;
  margin-left: 2px;
}
.staffing-review-auf-col {
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.staffing-review-cancel-reason {
  vertical-align: middle;
}
.staffing-review-reason-text {
  margin-right: 4px;
}
.staffing-review-filter-empty a {
  font-weight: 600;
}
.staffing-review-aging-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
}
.pill--review-aging {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.pill--review-aging--fill {
  border-color: rgba(255, 140, 90, 0.35);
  background: rgba(255, 140, 90, 0.1);
}
.staffing-tab-panel { display:none; }
.staffing-tab-panel.is-active { display:block; }
.staffing-tab { text-decoration:none; display:inline-flex; align-items:center; }

/* ===== Floating calendar popover ===== */
.calendar-popover {
  position: fixed;
  z-index: 50;
  background: var(--bg1, #101a2e);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
  padding: 14px;
  min-width: 280px;
  max-width: 340px;
  max-height: 70vh;
  overflow-y: auto;
}
.calendar-popover[hidden] { display:none; }
.calendar-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.calendar-popover__title {
  font-weight: 700;
  font-size: 14px;
}
.calendar-popover__close {
  flex-shrink: 0;
}

/* Make calendar/week roots relatively positioned for popover */
[data-calendar-root] {
  position: relative;
}

/* ===== Week view grid ===== */
.staffing-week__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 10px;
}
.staffing-week__col {
  min-width: 0;
}
.staffing-week__col-head {
  padding: 6px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  border-bottom: 2px solid rgba(255,255,255,.10);
  margin-bottom: 4px;
}
.staffing-week__col-head--today {
  border-bottom-color: var(--gold);
  color: var(--gold);
}
.staffing-week__wd {
  display: block;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--muted);
}
.staffing-week__day {
  display: block;
  font-size: 13px;
}
.staffing-week__cells {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.staffing-week__entry {
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255,255,255,.06);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
  transition: background .12s;
}
.staffing-week__entry:hover {
  background: rgba(255,255,255,.12);
}
.staffing-week__empty {
  font-size: 11px;
  text-align: center;
  padding: 4px 0;
}
@media (max-width: 700px) {
  .staffing-week__grid {
    grid-template-columns: repeat(7, minmax(40px, 1fr));
    overflow-x: auto;
  }
}

/* ===== Apply form (inline / in <details>) ===== */
.staffing-apply-details summary {
  cursor: pointer;
  list-style: none;
}
.staffing-apply-details summary::-webkit-details-marker { display: none; }
.staffing-apply-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.staffing-apply-form--open {
  padding: 8px 0 4px;
}
.staffing-apply-tasks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.staffing-apply-radio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
}
.staffing-apply-radio:has(input:checked) {
  background: rgba(99,102,241,.22);
  border-color: rgba(99,102,241,.38);
}

/* ===== Staffing calendar chip: colored label ===== */
.staffing-calendar__chip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  overflow: hidden;
  white-space: nowrap;
}

/* ===== Admin staffing: date-based row coloring ===== */
.staffing-table tr.is-past-day td {
  opacity: 0.5;
}
.staffing-table tr.is-today {
  background: rgba(99, 102, 241, 0.08);
}
.staffing-table tr.is-today td {
  font-weight: 600;
}
.staffing-table tr.is-hidden-demand td {
  opacity: 0.65;
}

/* ===== REMOVED assignment row (admin / other tables; /staffing/my uses calmer row in .staffing-my-table) ===== */
.staffing-table:not(.staffing-my-table) tr.is-removed td {
  background: rgba(192, 57, 43, 0.08);
  border-left: 3px solid #c0392b;
}
.staffing-table:not(.staffing-my-table) tr.is-removed td:not(:first-child) {
  border-left: none;
}
.pill--danger {
  background: #c0392b;
  color: #fff;
}

/* ===== Kapazität modal ===== */
.capacity-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  max-width: min(96vw, 780px);
  max-height: 90vh;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: var(--card-bg, #1a1a2e);
  color: inherit;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.capacity-modal:not([open]) { display: none; }
.capacity-modal[open] {
  display: flex;
  flex-direction: column;
}
.capacity-modal::backdrop {
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}
.capacity-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.capacity-modal__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.capacity-modal__close {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  opacity: 0.6;
  transition: opacity .15s;
}
.capacity-modal__close:hover { opacity: 1; }
.capacity-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Staffing capacity modal shared layout (.scm) */
.scm__header .scm__title {
  margin: 0;
}
.scm__meta {
  margin-top: 4px;
  font-size: 12px;
}
.scm__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.scm__section-heading {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}
.scm__assigned-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}
.scm__assigned-count {
  font-weight: 600;
  opacity: 0.85;
  font-size: 14px;
}
.scm__worker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.scm__worker-list--compact {
  max-height: min(38vh, 260px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 2px 0;
}
.scm__worker-row {
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.scm__worker-row:last-child {
  border-bottom: none;
}
.scm__worker-row-inner {
  display: grid;
  grid-template-columns: minmax(5rem, 1.15fr) minmax(3.5rem, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  padding: 6px 10px;
  min-height: 36px;
}
.scm__worker-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scm__worker-task {
  font-size: 12px;
  line-height: 1.25;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scm__worker-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.scm__icon-btn {
  margin: 0;
  padding: 2px 7px;
  min-width: 28px;
  height: 28px;
  font-size: 14px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.scm__icon-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}
.scm__icon-btn--active {
  border-color: rgba(100, 180, 255, 0.45);
  background: rgba(100, 180, 255, 0.08);
}
.scm__icon-btn--danger:hover {
  border-color: rgba(231, 76, 60, 0.5);
  background: rgba(231, 76, 60, 0.12);
}
.scm__pop-panel {
  margin: 0;
  padding: 0;
}
.scm__panel-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(18, 28, 48, 0.98);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.scm__panel-form--remove {
  border-color: rgba(231, 76, 60, 0.35);
  background: rgba(40, 18, 22, 0.95);
}
.scm__panel-label {
  margin: 0;
}
.scm__note-field {
  width: 100%;
  resize: vertical;
  min-height: 4.5rem;
}
.scm__task-inline--panel .ts__list {
  max-height: 140px;
  overflow-y: auto;
}
.scm__add-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

/* Remove sub-form inside modal */
.cap-remove-details summary {
  list-style: none;
  cursor: pointer;
}
.cap-remove-details summary::-webkit-details-marker { display: none; }
.cap-remove-form {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: rgba(192,57,43,.08);
  border-radius: 8px;
  border: 1px solid rgba(192,57,43,.2);
}

/* User search combobox (shared .us namespace; wrapper-relative panel) */
.us {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
}
.us__input {
  width: 100%;
  max-width: 100%;
}
.us__results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  z-index: 2100;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(16, 26, 46, 0.98);
  box-shadow: var(--shadow2);
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 0;
}
.us__item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
}
.us__item:hover,
.us__item.is-active {
  background: rgba(255, 255, 255, 0.08);
}
.us__empty {
  padding: 8px 12px;
  font-size: 13px;
  opacity: 0.75;
}
.us[data-disabled="1"] .us__input {
  opacity: 0.65;
  cursor: not-allowed;
}

/* User search suggestions */
.cap-user-suggestions-list {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--card-bg, #1a1a2e);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  z-index: 200;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
.cap-user-suggestions-list li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}
.cap-user-suggestions-list li:hover {
  background: rgba(255,255,255,.07);
}

/* ===== Admin Einsatzmatrix (monthly staffing) ===== */
.staffing-matrix-scroll {
  overflow-x: auto;
  margin-top: 10px;
  max-width: 100%;
}
.staffing-matrix {
  border-collapse: collapse;
  font-size: 11px;
  min-width: min(100%, 720px);
}
.staffing-matrix__corner,
.staffing-matrix__row-head {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--card-bg, #1a1a2e);
  text-align: left;
  font-weight: 700;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}
.staffing-matrix__corner {
  z-index: 4;
}
.staffing-matrix__day-head {
  padding: 4px 3px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 36px;
  vertical-align: bottom;
  background: rgba(255, 255, 255, 0.03);
}
.staffing-matrix__day-head--weekend {
  background: rgba(255, 255, 255, 0.06);
}
.staffing-matrix__day-num {
  display: block;
  font-weight: 800;
  font-size: 12px;
}
.staffing-matrix__day-wd {
  display: block;
  font-size: 9px;
  opacity: 0.75;
}
.staffing-matrix__td {
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
  text-align: center;
}
.staffing-matrix__empty {
  opacity: 0.25;
}
.staffing-matrix-cell-wrap {
  position: relative;
  outline: none;
}
.staffing-matrix-cell-wrap:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 200, 100, 0.55);
  border-radius: 6px;
}
.staffing-matrix-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 32px;
  max-width: 48px;
  padding: 3px 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.2);
  cursor: default;
}
.staffing-matrix-cell__bars {
  display: flex;
  gap: 2px;
  width: 100%;
  justify-content: center;
}
.staffing-matrix-cell__bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  min-width: 6px;
  max-width: 10px;
}
.staffing-matrix-cell__code {
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.02em;
}
.staffing-matrix-cell__more {
  font-size: 9px;
  font-weight: 700;
  opacity: 0.9;
}
.staffing-matrix-popover {
  display: none;
  position: fixed;
  z-index: 5000;
  left: 0;
  top: 0;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 16px));
  max-height: min(70vh, 360px);
  overflow-y: auto;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--bg1, #101a2e);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  text-align: left;
  visibility: hidden;
}
.staffing-matrix-popover.is-open {
  display: block;
  visibility: visible;
}
.staffing-review-event-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}
.staffing-review-event-link:hover {
  opacity: 0.92;
}
.staffing-review-actions-cell form {
  margin: 0;
}
.staffing-matrix-popover__block {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.staffing-matrix-popover__block:last-child {
  border-bottom: none;
}
.staffing-matrix-popover__title {
  font-weight: 800;
  font-size: 12px;
}
.staffing-matrix-popover__meta {
  font-size: 11px;
  margin-top: 2px;
  line-height: 1.35;
}

/* Aurora-style pagination (discrete list tables) */
.aurora-pagination-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}
.aurora-pagination {
  display: inline-block;
}
.aurora-pagination__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}
.aurora-pagination__cell {
  display: flex;
  align-items: stretch;
  margin: 0;
  padding: 0;
}
.aurora-pagination__cell + .aurora-pagination__cell {
  border-left: 1px solid var(--border);
}
.aurora-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  background: transparent;
}
a.aurora-pagination__btn:hover {
  background: rgba(255, 255, 255, 0.08);
}
.aurora-pagination__btn.is-current {
  background: rgba(201, 162, 74, 0.22);
  color: var(--gold2);
  cursor: default;
}
.aurora-pagination__btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.aurora-pagination__gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0 6px;
  font-size: 13px;
  color: var(--muted);
  user-select: none;
}

/* Staffing required_count quantity stepper (shared) */
.staffing-qty-stepper {
  display: inline-flex;
  align-items: stretch;
  vertical-align: middle;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}
.staffing-qty-stepper--inline {
  flex: 0 1 auto;
}
.staffing-qty-stepper__btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  min-height: 2.1rem;
  padding: 0 6px;
  margin: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.staffing-qty-stepper__btn:hover {
  background: rgba(255, 255, 255, 0.08);
}
.staffing-qty-stepper__btn:focus-visible {
  outline: 2px solid var(--gold2);
  outline-offset: 2px;
  z-index: 1;
}
.staffing-qty-stepper__input {
  flex: 1 1 auto;
  min-width: 2.5rem;
  max-width: 3.25rem;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding-left: 4px !important;
  padding-right: 4px !important;
}
.staffing-qty-stepper__input:focus {
  outline: none;
  box-shadow: none;
}
.staffing-qty-stepper__input:focus-visible {
  outline: 2px solid var(--gold2);
  outline-offset: -2px;
}
.staffing-qty-stepper__input::-webkit-outer-spin-button,
.staffing-qty-stepper__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.staffing-qty-stepper__input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

/* ================================================================
   RESPONSIVE REMEDIATION PASS
   Viewport targets: 320 · 360 · 390 · 412 · 768 · 820 · 1024 · 1280 · 1440
   ================================================================ */

/* --- Global small-button variant (replaces per-template overrides) --- */
.btn.btn-sm,
.btn.sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 10px;
}

/* --- Mobile sidebar overlay backdrop (tap-to-close) --- */
.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 990;
  background: rgba(0,0,0,.45);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
body.sb-open .sb-overlay {
  display: block;
}

/* --- Topbar: constrain active-event area on tablet/mobile --- */
@media (max-width: 960px) {
  .gh-search { display: none; }
  .gh-active {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }
  .gh-active-pill {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
  }
  /* gh-user: truncate long names */
  .gh-user {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
  }
}

/* On phones ≤480 px, simplify topbar to brand + mobile-toggle only */
@media (max-width: 480px) {
  .gh-active { display: none; }
  .gh-user   { display: none; }
  .gh-toggle { display: none; }
}

/* --- Wrap: less padding on small phones --- */
@media (max-width: 480px) {
  .wrap {
    padding-left: 12px;
    padding-right: 12px;
  }
  .card {
    padding: 14px;
  }
}

/* --- container class (legacy; used in cash_detail_de) --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  margin-left: 260px;
}
@media (max-width: 960px) {
  .container { margin-left: 0; }
}

/* --- Admin sub-nav: allow horizontal scroll on narrow screens --- */
@media (max-width: 680px) {
  .admin-subnav-inner {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
  .admin-pill { flex-shrink: 0; }
}

/* --- Responsive grid utilities (replaces inline 4/3/2-col grids) ---
   .filter-grid   : 4 → 2 → 1 col  (filter bars, audit forms)
   .form-grid-2   : 2 → 1 col       (side-by-side fields)
   .form-grid-3   : 3 → 2 → 1 col  (quote / wide forms)
   .form-grid-auto: auto-fit ≥160 px (services create)
   ----------------------------------------------------------------- */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}
@media (max-width: 900px) {
  .filter-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .filter-grid { grid-template-columns: 1fr; }
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 560px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  align-items: start;
}
@media (max-width: 900px) {
  .form-grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .form-grid-3 { grid-template-columns: 1fr; }
}

/* span-2 / span-3 full-row pattern: clamp to all columns in compact layouts */
@media (max-width: 900px) {
  .form-grid-3 [style*="grid-column:span 3"],
  .form-grid-3 [style*="grid-column: span 3"] {
    grid-column: 1 / -1;
  }
  .form-grid-3 [style*="grid-column:span 2"],
  .form-grid-3 [style*="grid-column: span 2"] {
    grid-column: 1 / -1;
  }
}

.form-grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px,1fr));
  gap: 10px;
  align-items: end;
}

/* --- Event dashboard: planner defaults grid 4-col → responsive --- */
/* Inline style override: repeat(4, minmax(0,1fr)) inside .planner-defaults */
@media (max-width: 900px) {
  .planner-defaults [style*="grid-template-columns:repeat(4"],
  .planner-defaults [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}
@media (max-width: 560px) {
  .planner-defaults [style*="grid-template-columns:repeat(4"],
  .planner-defaults [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: 1fr;
  }
}

/* --- Event dashboard: docs tab 2-col grid → 1-col on mobile --- */
@media (max-width: 560px) {
  .grid[style*="grid-template-columns:1fr 1fr"],
  .grid[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* --- Min-width filter selects: allow shrinking on mobile --- */
@media (max-width: 680px) {
  select[style*="min-width"] {
    min-width: 0 !important;
    width: 100%;
  }
  input[style*="min-width:220px"],
  input[style*="min-width: 220px"] {
    min-width: 0 !important;
    width: 100%;
  }
}

/* --- Inventory admin: table-wrap for any bare table with inline min-width --- */
table[style*="min-width"] {
  /* Tables with inline min-width must already be inside .table-wrap.
     Add -webkit-overflow-scrolling for smooth iOS scroll. */
  -webkit-overflow-scrolling: touch;
}

/* --- Billing quote: fixed-width input overrides on mobile --- */
@media (max-width: 680px) {
  input[style*="width:200px"],
  input[style*="width: 200px"],
  input[style*="width:110px"],
  input[style*="width: 110px"] {
    width: 100% !important;
  }
}

/* --- cash_admin filter form: full-width on mobile --- */
@media (max-width: 680px) {
  .wrap form[method="get"] select,
  .wrap form[method="GET"] select {
    min-width: 0;
  }
}

/* --- Table-wrap: ensure smooth touch scroll everywhere --- */
.table-wrap {
  -webkit-overflow-scrolling: touch;
}

/* --- Staffing week view: allow horizontal scroll container --- */
@media (max-width: 700px) {
  .staffing-week__grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* --- Event dashboard: stations/members form flex fields ---
   inline min-width values are inside flex-wrap so they wrap correctly;
   below 480px, collapse to full-width for comfort. --- */
@media (max-width: 480px) {
  .event-form-flex [style*="min-width"] {
    min-width: 0 !important;
    width: 100%;
    flex: 1 1 100% !important;
  }
}

/* --- Event header row classes (consolidate common event-dashboard inline flex) --- */
.event-header-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}
.event-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* --- Presence (admin) / shifts: filter input shrinks on mobile --- */
@media (max-width: 680px) {
  .admin-filter-row {
    flex-wrap: wrap;
  }
  .admin-filter-row select,
  .admin-filter-row input[type="text"],
  .admin-filter-row input[type="month"],
  .admin-filter-row input[type="date"] {
    flex: 1 1 100%;
    min-width: 0;
  }
}

/* Ensure eo-filter-select doesn't cause overflow on mobile */
@media (max-width: 560px) {
  .eo-filter-select { min-width: 0; width: 100%; }
  .eo-filter-form { flex-direction: column; align-items: stretch; }
  .eo-toolbar-actions { width: 100%; justify-content: flex-start; }
}

/* Smooth touch scroll for any overflow-x:auto container */
[style*="overflow-x:auto"],
[style*="overflow-x: auto"],
[style*="overflow:auto"],
[style*="overflow: auto"] {
  -webkit-overflow-scrolling: touch;
}

/* --- CRITICAL CASCADE FIX: .wrap base rule (line 467) comes AFTER the
   @media (max-width:960px) reset at line 359, so last-rule-wins means
   margin-left:260px was always applied even at mobile viewports.
   Re-declare the reset here (end of file = highest source order) so
   it correctly overrides the base rule at narrow viewports. --- */
@media (max-width: 960px) {
  .wrap {
    margin-left: 0 !important;
  }
}

/* --- events-list: .eo-event-card flex-direction:column fires at 560px
   but at 768px the actions strip (5 buttons) still overflows at 768px
   when the sidebar is hidden. Add an 820px column-collapse breakpoint. --- */
@media (max-width: 820px) {
  .eo-event-card {
    flex-direction: column;
    align-items: stretch;
  }
  .eo-event-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* ================================================================
   END RESPONSIVE REMEDIATION PASS
   ================================================================ */

/* ================================================================
   EVENT OVERVIEW DASHBOARD  (scoped .ov-* — no side-effects)
   ================================================================ */

/* Meta strip */
.ov-meta-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.ov-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100px;
}
.ov-label {
  opacity: .55;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 10px;
}

/* KPI grid */
.ov-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.ov-kpi-card {
  background: var(--bg1);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ov-kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
  opacity: .55;
}
.ov-kpi-value {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
}
.ov-kpi-denom {
  font-size: 13px;
  font-weight: 400;
  opacity: .45;
}
.ov-kpi-hint {
  font-size: 11px;
  opacity: .65;
  margin-top: 1px;
}

/* Alerts */
.ov-alerts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.ov-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  border-left: 3px solid transparent;
}
.ov-alert-warn {
  background: rgba(230,177,0,.09);
  border-left-color: #e6b100;
}
.ov-alert-muted {
  background: var(--bg1);
  border-left-color: var(--muted, #6b7280);
}

/* Module cards */
.ov-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.ov-module-card {
  background: var(--bg1);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: background .15s;
  border: 1px solid transparent;
}
.ov-module-card:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.08);
}
.ov-mod-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .6;
}
.ov-mod-status { font-size: 14px; font-weight: 600; }
.ov-mod-metric { font-size: 11px; opacity: .6; }

/* Tone utilities */
.ov-tone-ok    { color: #4ade80; }
.ov-tone-warn  { color: #e6b100; }
.ov-tone-err   { color: #f87171; }
.ov-tone-muted { opacity: .55; }

/* Responsive */
@media (max-width: 600px) {
  .ov-kpi-grid    { grid-template-columns: repeat(2, 1fr); }
  .ov-module-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 380px) {
  .ov-kpi-grid    { grid-template-columns: 1fr; }
  .ov-module-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   END EVENT OVERVIEW DASHBOARD
   ================================================================ */

/* ================================================================
   PASS 2 MOBILE REMEDIATION — scoped per route/partial
   Routes: /admin/presence, /admin/requests, /admin/hours,
           /documents/admin/files, /events/<id>?tab=participants,
           /events/<id>?tab=docs, /staffing/
   ================================================================ */

/* --- /admin/presence: 6-col live-presence table --- */
.presence-table thead th { white-space: nowrap; }
.presence-table th, .presence-table td { word-break: normal; }

/* --- /admin/presence: work-context badges (Phase 10) --- */
.work-context-cell { display:flex; flex-wrap:wrap; gap:4px; }
.badge.wc-badge { padding:3px 7px; font-size:11px; font-weight:600; white-space:nowrap; background:rgba(99,102,241,.12); border-color:rgba(99,102,241,.25); color:#a5b4fc; }
.badge.wc-badge.wc-assigned { background:rgba(34,197,94,.12); border-color:rgba(34,197,94,.25); color:#86efac; }
.badge.wc-badge.wc-unplanned { background:rgba(156,163,175,.10); border-color:rgba(156,163,175,.20); color:#9ca3af; }
.badge.wc-badge.wc-note { max-width:200px; overflow:hidden; text-overflow:ellipsis; }

/* --- /admin/requests: corrections + missing-shifts tables --- */
.requests-table thead th { white-space: nowrap; }
.requests-table th, .requests-table td { word-break: normal; }

/* --- /admin/hours: employee hours summary table --- */
.hours-table thead th { white-space: nowrap; }
.hours-table th, .hours-table td { word-break: normal; }

/* --- /documents/admin/files: 8-col admin file library table --- */
.admin-files-table thead th { white-space: nowrap; }
.admin-files-table th, .admin-files-table td { word-break: normal; }

/* --- /events/<id>?tab=participants: participant snapshot table --- */
.participants-table thead th { white-space: nowrap; }
.participants-table th, .participants-table td { word-break: normal; }

/* --- /events/<id>?tab=docs: 9-col event docs table --- */
.event-docs-table thead th { white-space: nowrap; }
.event-docs-table th, .event-docs-table td { word-break: normal; }

/* --- /staffing/ list + /staffing/my: suppress the global
   .table-wrap table{min-width:680px} override.
   These tables use responsive column-hiding at ≤680px so the
   global min-width forces unnecessary horizontal scroll. --- */
@media (max-width: 680px) {
  .table-wrap .staffing-table { min-width: 0; }
}

/* --- event participants quick-add: collapse min-width inputs on phones --- */
@media (max-width: 430px) {
  .participants-quickadd input,
  .participants-quickadd select {
    min-width: 0 !important;
    width: 100%;
  }
}

/* ================================================================
   END PASS 2 MOBILE REMEDIATION
   ================================================================ */
