:root{
  --bg:#f6f8fb;
  --card:#ffffff;
  --card2:#fbfcff;
  --text:#0f172a;
  --muted:#5b6474;
  --line:#e3e8f2;
  --accent:#2563eb;
  --accent2:#0ea5e9;
  --good:#16a34a;
  --warn:#d97706;
  --bad:#dc2626;
  --pink:#db2777;
  --shadow: 0 10px 26px rgba(15, 23, 42, .08);
  --radius:14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:var(--sans);
  background:
    radial-gradient(900px 500px at 10% 0%, rgba(37,99,235,.10), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(14,165,233,.10), transparent 60%),
    var(--bg);
  color:var(--text);
}
a{color:inherit}
button,input,select,textarea{font:inherit;color:inherit}
.app{min-height:100vh;display:flex;flex-direction:column}
.topbar{
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(10px);
  position:sticky;top:0;z-index:10;
}
.brand{display:flex;align-items:center;gap:10px;font-weight:900;letter-spacing:.2px}
.dot{width:12px;height:12px;border-radius:4px;background:var(--accent);display:inline-block}
.pill{
  font-family:var(--mono);
  font-size:12px;
  padding:4px 8px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--muted);
  background:rgba(255,255,255,.8);
}
.userbox{display:flex;align-items:center;gap:10px;color:var(--muted)}
.btn{
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(255,255,255,.9));
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  transition:.12s transform, .12s box-shadow, .12s opacity;
  box-shadow: 0 4px 12px rgba(15,23,42,.06);
}
.btn:hover{transform:translateY(-1px); box-shadow: 0 10px 20px rgba(15,23,42,.10)}
.btn:active{transform:translateY(0px); opacity:.9}
.btn.primary{
  border-color: rgba(37,99,235,.35);
  background: linear-gradient(180deg, rgba(37,99,235,.16), rgba(37,99,235,.08));
}
.btn.danger{
  border-color: rgba(220,38,38,.28);
  background: linear-gradient(180deg, rgba(220,38,38,.14), rgba(220,38,38,.06));
}
.layout{
  display:grid;
  grid-template-columns: 320px 1fr;
  gap:14px;
  padding:18px;
  flex:1;
}
.sidebar,.main{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.sidebar{
  padding:14px;
  height: calc(100vh - 74px);
  position:sticky;
  top:74px;
  overflow:auto;
}
.main{padding:14px; min-height: 400px}

.panelTitle{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px;
  padding:6px 2px 12px;
  border-bottom:1px solid var(--line);
  margin-bottom:12px;
}
h2{margin:0;font-size:18px}
.sub{color:var(--muted);font-size:12px}

.navgrid{display:grid;grid-template-columns: 1fr 1fr;gap:10px}
.navcard{
  border:1px solid var(--line);
  background: var(--card2);
  border-radius:14px;
  padding:12px;
  cursor:pointer;
  transition:.12s transform, .12s box-shadow;
  box-shadow: 0 3px 10px rgba(15,23,42,.05);
  text-decoration:none;
}
.navcard:hover{transform: translateY(-1px); box-shadow: 0 10px 18px rgba(15,23,42,.08)}
.navtitle{font-weight:900}
.navdesc{font-size:12px;color:var(--muted);margin-top:4px;line-height:1.3}

.home{
  display:flex;flex-direction:column;
  align-items:center;justify-content:center;
  min-height: 560px;
  gap:14px;padding:10px;text-align:center;
}
.logoWrap{
  width:min(560px, 80%);
  aspect-ratio: 2.2 / 1;
  display:grid;place-items:center;
  border-radius: 22px;
  border:1px solid rgba(37,99,235,.18);
  background:
    radial-gradient(700px 280px at 50% 0%, rgba(37,99,235,.18), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,1), rgba(255,255,255,.8));
  box-shadow: var(--shadow);
}
.logo{
  font-weight: 1000;
  letter-spacing: .4px;
  font-size: clamp(26px, 4vw, 44px);
  line-height:1.0;
}
.logo small{
  display:block;
  margin-top:10px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing:.2px;
  font-weight:600;
}
.hint{color:var(--muted);font-size:13px;max-width: 760px;line-height:1.5}

.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.field{display:flex;flex-direction:column;gap:6px;min-width:220px;flex:1}
label{color:var(--muted);font-size:12px}
input,select,textarea{
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
  background: #fff;
  outline:none;
}
textarea{min-height:84px;resize:vertical}
input:focus,select:focus,textarea:focus{
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.split{display:grid;grid-template-columns: 340px 1fr;gap:12px;align-items:start}
.list{
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  background: #fff;
}
.listHeader{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  color:var(--muted);
  font-size:12px;
  display:flex;justify-content:space-between;align-items:center;
  background: #fafcff;
}
.listItem{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  cursor:pointer;
  display:flex;gap:10px;justify-content:space-between;align-items:flex-start;
}
.listItem:hover{background: rgba(37,99,235,.05)}
.listItem.active{background: rgba(37,99,235,.10); outline:1px solid rgba(37,99,235,.18)}
.listItem:last-child{border-bottom:none}
.small{font-size:12px;color:var(--muted);line-height:1.35}
.tag{
  font-size:11px;
  font-family:var(--mono);
  border:1px solid var(--line);
  padding:3px 6px;
  border-radius:999px;
  color:var(--muted);
  background: rgba(255,255,255,.9);
  white-space:nowrap;
}

table{
  width:100%;
  border-collapse:collapse;
  overflow:hidden;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
}
th,td{
  padding:10px 10px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:top;
  font-size:13px;
}
th{color:var(--muted); font-size:12px; background:#fafcff}
tr:last-child td{border-bottom:none}

.muted{color:var(--muted)}
.mono{font-family:var(--mono)}

.note{
  border:1px solid rgba(217,119,6,.25);
  background: rgba(217,119,6,.08);
  border-radius:14px;
  padding:12px;
  color: #7a4a00;
  font-size:13px;
  line-height:1.45;
}
.ok{
  border:1px solid rgba(22,163,74,.22);
  background: rgba(22,163,74,.08);
  border-radius:14px;
  padding:12px;
  color: #0b3a1c;
  font-size:13px;
  line-height:1.45;
}

.hr{height:1px;background:var(--line);margin:12px 0}
.tiny{font-size:11px;color:var(--muted)}
.kpi{display:flex;gap:10px;flex-wrap:wrap}
.kpi .box{
  border:1px solid var(--line);
  background: #fff;
  border-radius:14px;
  padding:10px;
  min-width: 160px;
  box-shadow: 0 6px 14px rgba(15,23,42,.06);
}
.kpi .box .n{font-weight:1000;font-size:18px}
.kpi .box .l{color:var(--muted);font-size:12px}

/* Modal */
.modalBack{
  position:fixed; inset:0;
  background: rgba(15,23,42,.45);
  display:none; align-items:center; justify-content:center;
  padding:18px; z-index:999;
}
.modal{
  width:min(980px, 100%);
  max-height: min(82vh, 860px);
  overflow:auto;
  background: #fff;
  border:1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding:14px;
}
.modalHead{
  display:flex; justify-content:space-between; align-items:center;
  border-bottom:1px solid var(--line);
  padding-bottom:10px; margin-bottom:12px;
}
.grid3{display:grid;grid-template-columns: repeat(3, 1fr);gap:10px}
.imgCard{
  border:1px solid var(--line);
  border-radius:14px;
  background: #fff;
  overflow:hidden;
  box-shadow: 0 6px 16px rgba(15,23,42,.06);
}
.imgCard img{width:100%; height: 170px; object-fit:cover; display:block}
.imgCard .cap{padding:8px 10px; font-size:12px; color:var(--muted)}

/* Plantafel */
.plantafelWrap{
  display:grid;
  grid-template-columns: 1fr 320px;
  gap:12px; align-items:start;
}
.plantafel{
  border:1px solid var(--line);
  border-radius: 14px;
  overflow:auto;
  background: #fff;
  box-shadow: var(--shadow);
}
.ptGrid{
  min-width: 980px;
  display:grid;
  grid-template-columns: 260px repeat(7, 1fr);
}
.ptCell{
  border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);
  padding:10px;
  min-height:56px;
  font-size:12px;
  background:#fff;
}
.ptCell.header{
  position:sticky; top:0; z-index:2;
  background:#f7faff;
  color:var(--muted);
  font-size:12px;
}
.ptCell.resource{
  position:sticky; left:0; z-index:1;
  background:#f7faff;
  display:flex; flex-direction:column; gap:4px;
}
.ptCell.corner{
  position:sticky; left:0; top:0; z-index:3;
  background:#eef4ff;
  font-weight:1000;
}
.ptCell.clickable{cursor:pointer}
.ptCell.clickable:hover{background: rgba(37,99,235,.05)}
.block{
  border-radius:10px;
  padding:8px 8px;
  border:1px solid rgba(15,23,42,.10);
  line-height:1.25;
  display:flex; flex-direction:column; gap:3px;
  box-shadow: 0 5px 14px rgba(15,23,42,.06);
}
.block .t{font-weight:900;font-size:12px}
.block .s{color:rgba(15,23,42,.75);font-size:11px}
.block.weekend{ background: rgba(14,165,233,.14); border-color: rgba(14,165,233,.22); }
.block.holiday{ background: rgba(217,119,6,.14); border-color: rgba(217,119,6,.22); }
.block.order{ background: rgba(219,39,119,.14); border-color: rgba(219,39,119,.22); }
.block.vacReq{ background: rgba(217,119,6,.12); border-color: rgba(217,119,6,.20); }
.block.vacOk{ background: rgba(22,163,74,.12); border-color: rgba(22,163,74,.20); }

.sidePanel{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  background:#fff;
  box-shadow: var(--shadow);
}

@media (max-width: 1050px){
  .layout{grid-template-columns: 1fr}
  .sidebar{position:relative; top:auto; height:auto}
  .split{grid-template-columns: 1fr}
  .plantafelWrap{grid-template-columns: 1fr}
  .ptGrid{min-width: 920px}
}


/* Section cards (Std buchen) */
.sectionCard{
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 6px solid rgba(37,99,235,.35);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(15,23,42,.06);
}
.sectionCard .panelTitle{ padding: 0 2px 10px; margin: 0; }
.sectionCard table{ background: rgba(255,255,255,.65); border-radius: 12px; overflow: hidden; }

.sec-effort{ background: #f5f8ff; border-left-color: rgba(59,130,246,.7); }
.sec-material{ background: #f3faf6; border-left-color: rgba(34,197,94,.7); }
.sec-images{ background: #fff7ed; border-left-color: rgba(249,115,22,.7); }
.sec-booked{ background: #f8fafc; border-left-color: rgba(100,116,139,.65); }


/* Plantafel */
.planTable th{ position: sticky; top: 0; background: rgba(248,250,252,.92); z-index: 1; }
.planTable td.res{ background: rgba(248,250,252,.7); position: sticky; left: 0; z-index: 1; border-right:1px solid var(--border); }
.planTable td.cell{ min-width: 150px; cursor: pointer; }
.planTable td.weekend{ background: rgba(59,130,246,.08); }
.planTable td.order{ background: rgba(34,197,94,.10); }
.planTable td.vac{ background: rgba(249,115,22,.12); }
.planTable td.vacreq{ background: rgba(168,85,247,.10); }
.tinyBtn{ padding:6px 10px; font-size:12px; }
.grid3{ display:grid; grid-template-columns: repeat(3,1fr); gap:12px; }
.imgCard{ border:1px solid var(--border); border-radius:14px; overflow:hidden; background:#fff; }
.imgCard img{ width:100%; height:220px; object-fit:cover; display:block; }
.imgCard .cap{ padding:10px; }


/* -------------------- Mobile Übersichtlichkeit: einklappbare Bereiche -------------------- */
.mobileFold{
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  padding: 10px 12px;
}
.mobileFold summary{
  list-style: none;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-weight: 900;
}
.mobileFold summary::-webkit-details-marker{ display:none; }
.mobileFold summary::after{
  content: "▾";
  font-size: 14px;
  color: var(--muted);
}
.mobileFold[open] summary::after{ content:"▴"; }

@media (min-width: 981px){
  /* Desktop: keep folds open and hide summary line */
  .mobileFold{ padding:0; border:none; background:transparent; }
  .mobileFold summary{ display:none; }
}

@media (max-width: 980px){
  .split{ grid-template-columns: 1fr !important; }
  .split > div{ min-width: 0; }
  .stickyActions{
    position: sticky;
    bottom: 10px;
    z-index: 5;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 14px 34px rgba(15,23,42,.12);
  }
  .stickyActions .btn{ flex:1; }
}


/* -------------------- Mobile: Navigation einklappbar + Plantafel kompakt -------------------- */
@media (max-width: 980px){
  .sidebar{ width:100%; }
  .navgrid{ grid-template-columns: 1fr 1fr; }
  .navcard{ padding: 12px; }
}

/* Plantafel mobile day view */
.dayTabs{
  display:flex;
  flex-wrap: wrap;
  gap:8px;
  margin: 6px 0 12px;
}
.dayTab{
  border:1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor:pointer;
}
.dayTab.active{
  border-color: rgba(37,99,235,.35);
  box-shadow: 0 0 0 4px rgba(37,99,235,.08);
}
.planList{
  display:flex;
  flex-direction: column;
  gap:10px;
}
.planRow{
  display:flex;
  align-items: center;
  justify-content: space-between;
  gap:10px;
  border:1px solid var(--border);
  border-radius: 16px;
  padding: 10px 12px;
  background: var(--card);
}
.planRow .who{ min-width: 0; }
.planRow .who b{ display:block; }
.planRow .who .tiny{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.planBadge{
  border:1px solid var(--border);
  border-radius: 14px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
  max-width: 56%;
  text-align:left;
}
.planBadge.weekend{ background: rgba(59,130,246,.10); }
.planBadge.order{ background: rgba(34,197,94,.12); }
.planBadge.vac{ background: rgba(249,115,22,.14); }
.planBadge.req{ background: rgba(168,85,247,.12); }



/* -------------------- Logo (Login + Header) -------------------- */
.loginLogoWrap{
  display:flex;
  justify-content:center;
  margin: 6px 0 14px;
}
.loginLogoImg{
  width: 500px;
  height: 220px;
  max-width: 100%;
  object-fit: contain;
  display:block;
}
.topLogo{
  height: 26px;
  width: auto;
  object-fit: contain;
  display:block;
}
.brandTitle{ font-weight: 900; }


/* -------------------- Layout v2: Fokus Content, Navigation als Rail -------------------- */
@media (max-width: 980px){
  /* Sidebar becomes slim rail; content gets the focus */
  .layout{
    grid-template-columns: 68px 1fr !important;
    gap: 12px !important;
  }
  .sidebar{
    width: 68px !important;
    padding: 10px 8px !important;
    position: sticky;
    top: 12px;
    height: calc(100vh - 24px);
    overflow: auto;
  }
  .sidebar h3, .sidebar .subtitle, .sidebar .hr, .sidebar .backendNote{
    display:none !important;
  }

  .navgrid{
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .navcard{
    padding: 10px !important;
    border-radius: 16px !important;
    text-align: center !important;
    min-height: 54px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    flex-direction: column !important;
    gap: 4px !important;
  }
  .navtitle, .navdesc{ display:none !important; }
  .navicon{
    font-size: 18px;
    line-height: 1;
  }
  .navbadge{
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(15,23,42,.04);
  }

  .content{
    padding: 12px !important;
  }
  .panelTitle{
    position: sticky;
    top: 10px;
    z-index: 4;
    background: rgba(248,250,252,.86);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px 12px;
    margin-bottom: 12px;
  }
  .sectionCard{
    border-radius: 18px !important;
  }
}

/* Desktop: icon hidden (cards already have text) */
.navicon{ display:none; }
@media (min-width: 981px){
  .navicon{ display:none !important; }
}
