/* Urlaubsplanung – Frosted Glass auf BT-Blau (Design wie BT VertriebOS) */
:root {
  --navy: #0A2138;
  --orange: #E88B00;
  --orange-hover: #F59B12;
  --text: #F3F6FA;
  --text-2: rgba(232, 239, 247, .74);
  --muted: rgba(232, 239, 247, .52);
  --stroke: rgba(255, 255, 255, .14);
  --stroke-2: rgba(255, 255, 255, .26);
  --ok: #3CC48A;
  --bad: #FFB4A8;
  --radius: 24px;
  --radius-sm: 12px;
  --font: "Epilogue", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #0A2138; }
body { margin: 0; min-height: 100vh; color: var(--text); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
svg { display: block; }
::selection { background: var(--orange); color: var(--navy); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ---------- Glas ---------- */
.glass {
  background: linear-gradient(160deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,.04) 100%), rgba(10,33,56,.32);
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 30px 60px -30px rgba(0,0,0,.6);
  border-radius: var(--radius);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--stroke); background: rgba(255,255,255,.07);
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; color: var(--text);
  transition: background .15s, border-color .15s, color .15s, transform .1s; white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,.14); border-color: var(--stroke-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: default; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: var(--navy); font-weight: 700; }
.btn-primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: var(--navy); font-weight: 700; }
.btn-ok:hover { background: #55d39c; border-color: #55d39c; }
.btn-danger:hover { color: var(--bad); border-color: rgba(255,180,168,.5); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13.5px; }
.btn-block { width: 100%; height: 50px; font-size: 15px; }
.btn-icon { width: 34px; padding: 0; height: 34px; }

/* ---------- Formularfelder ---------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field > span em { font-style: normal; font-weight: 400; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--stroke); border-radius: var(--radius-sm);
  background: rgba(6, 22, 38, .35); color: var(--text); outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s; color-scheme: dark;
}
.field textarea { height: auto; min-height: 70px; padding: 11px 14px; resize: vertical; line-height: 1.45; }
.field input::placeholder, .field textarea::placeholder { color: rgba(232,239,247,.32); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--orange); background: rgba(6,22,38,.5); box-shadow: 0 0 0 3px rgba(232,139,0,.18); }
.field select { appearance: none; cursor: pointer; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9d4e0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.field select option { background: #0A2138; color: var(--text); }
.field small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.field small button { all: unset; cursor: pointer; color: var(--orange); font-weight: 600; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--orange); flex: none; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr 1fr; }
.span2 { grid-column: span 2; }
.seg { display: flex; border: 1px solid var(--stroke); border-radius: var(--radius-sm); overflow: hidden; height: 44px; background: rgba(6,22,38,.35); }
.seg label { flex: 1; display: grid; place-items: center; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text-2); position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--orange); color: var(--navy); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--orange); outline-offset: -2px; }
.daypick { display: flex; gap: 6px; flex-wrap: wrap; }
.daypick label { position: relative; width: 44px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--stroke); background: rgba(6,22,38,.35); font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--text-2); }
.daypick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.daypick label:has(input:checked) { background: var(--orange); border-color: var(--orange); color: var(--navy); }
.daypick.wide label { width: auto; padding: 0 14px; }
.warn { padding: 12px 14px; border-radius: 14px; background: rgba(232,139,0,.14); border: 1px solid rgba(232,139,0,.35); font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.warn b { display: block; color: #FFC56B; font-weight: 700; }
.warn ul { margin: 4px 0; padding-left: 18px; color: var(--text); }
.warn span { display: block; }
.req .warn { margin-top: 8px; max-width: 560px; }
.form-error { margin: 0; color: var(--bad); font-weight: 600; font-size: 14px; }

/* ---------- Login ---------- */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: 100%; max-width: 410px; padding: 34px 30px 30px; display: flex; flex-direction: column; gap: 18px; }
.gate-logo { width: 132px; height: auto; display: block; }
.gate-title { margin: 8px 0 0; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.gate-sub { margin: -12px 0 4px; color: var(--text-2); }
.gate-sub b { color: var(--text); font-weight: 600; }
.gate-link { all: unset; align-self: center; cursor: pointer; font-size: 13.5px; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.gate-link:hover { color: var(--text); }
.gate-link:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 4px; }
.gate-card.shake { animation: shake .35s; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

/* ---------- Kopfzeile ---------- */
.topbar { max-width: 1320px; margin: 0 auto; padding: 26px 28px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { height: 34px; width: auto; display: block; }
.brand-sep { width: 1px; height: 26px; background: var(--stroke-2); }
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.whoami { text-align: right; font-size: 13.5px; line-height: 1.35; color: var(--text-2); min-width: 0; }
.whoami b { display: block; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Seiten ---------- */
.view { max-width: 1320px; margin: 0 auto; padding: 44px 28px 150px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.page-head h1 { margin: 0; font-size: clamp(34px, 4.6vw, 56px); line-height: 1; font-weight: 700; letter-spacing: -.035em; }
.page-head p { margin: 12px 0 0; color: var(--text-2); }
.head-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.head-tools .field select { height: 40px; border-radius: 999px; min-width: 104px; font-weight: 600; }
.card { padding: 24px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
.card-head .count { color: var(--orange); }
.card-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.card-tools .field select { height: 36px; border-radius: 999px; font-size: 13.5px; }
.empty { margin: 4px 0; color: var(--text-2); }
.loading { display: grid; place-items: center; padding: 18vh 0; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.18); border-top-color: var(--orange); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Kennzahlen ---------- */
.stats { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { padding: 20px 22px; display: flex; flex-direction: column; gap: 2px; min-width: 0; border-radius: 20px; }
.stat span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.stat b { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 12.5px; }
.stat.accent b { font-size: 52px; color: var(--orange); }

/* ---------- Anträge ---------- */
.reqs { display: flex; flex-direction: column; }
.req { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 14px; align-items: center; padding: 14px 4px; border-top: 1px solid rgba(255,255,255,.08); }
.req:first-child { border-top: 0; }
.req-main { min-width: 0; }
.req-who { font-size: 12.5px; font-weight: 600; color: var(--orange); }
.req-date { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.req-meta { color: var(--text-2); font-size: 13.5px; }
.req-note { margin-top: 4px; font-size: 13.5px; color: var(--text-2); overflow-wrap: anywhere; }
.req-note b { color: var(--muted); font-weight: 600; }
.req-actions { display: flex; gap: 6px; }
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.chip-pending { background: rgba(232,139,0,.18); color: #FFC56B; }
.chip-approved { background: rgba(60,196,138,.18); color: #7FE0B5; }
.chip-rejected { background: rgba(255,120,100,.16); color: var(--bad); }
.chip-cancelled { background: rgba(255,255,255,.08); color: var(--muted); }

/* ---------- Team-Tabelle ---------- */
.tbl-wrap { overflow-x: auto; margin: 0 -8px; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 820px; }
.tbl th { text-align: right; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 8px; white-space: nowrap; }
.tbl td { text-align: right; padding: 12px 8px; border-top: 1px solid rgba(255,255,255,.08); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; white-space: normal; }
.tbl td:first-child b { display: block; font-weight: 700; }
.tbl td:first-child span { font-size: 13px; color: var(--muted); }
.tbl .rest { font-weight: 700; color: var(--orange); font-size: 17px; }
.tbl .differs { color: #FFC56B; font-weight: 700; }
.tbl tr.inactive td { opacity: .45; }
.tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: rgba(255,255,255,.1); color: var(--text-2); vertical-align: 1px; }

/* ---------- Kalender ---------- */
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav b { min-width: 150px; text-align: center; font-size: 16px; }
.cal-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px 4px; }
.cal { display: grid; gap: 3px; align-items: center; min-width: 760px; }
.cal-name { font-weight: 600; font-size: 14px; padding-right: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-h { text-align: center; font-size: 11px; color: var(--muted); line-height: 1.25; font-variant-numeric: tabular-nums; }
.cal-h b { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.cal-h.today b { color: var(--orange); }
.cal-c { height: 30px; border-radius: 6px; background: rgba(255,255,255,.07); position: relative; overflow: hidden; }
.cal-c.off { background: rgba(6,22,38,.4); }
.cal-c i { position: absolute; inset: 0; }
.cal-c i.am { right: 50%; }
.cal-c i.pm { left: 50%; }
.cal-c i.approved { background: var(--orange); }
.cal-c i.pending { background: repeating-linear-gradient(135deg, rgba(232,139,0,.75) 0 4px, rgba(232,139,0,.25) 4px 8px); }
.cal-c i.sonder { background: #6FA8DC; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend .cal-c { width: 22px; height: 14px; border-radius: 4px; display: inline-block; }

/* ---------- Dialog ---------- */
.dlg {
  width: min(600px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; color: var(--text);
  background: linear-gradient(160deg, rgba(255,255,255,.10), rgba(255,255,255,.03)), #0F2B47;
  border: 1px solid var(--stroke-2); border-radius: var(--radius); box-shadow: 0 40px 80px -30px rgba(0,0,0,.8);
}
.dlg::backdrop { background: rgba(4, 14, 26, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.dlg form { padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.dlg h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.dlg p { margin: 0; color: var(--text-2); }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.dlg-foot .left { margin-right: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.dlg hr { border: 0; border-top: 1px solid rgba(255,255,255,.1); margin: 2px 0; width: 100%; }
.preview-days { padding: 14px 16px; border-radius: 16px; background: rgba(6,22,38,.4); border: 1px solid rgba(255,255,255,.06); }
.preview-days b { font-size: 22px; color: var(--orange); letter-spacing: -.02em; }
.preview-days small { display: block; color: var(--text-2); font-size: 13px; margin-top: 2px; }
.secret { padding: 16px; border-radius: 16px; background: rgba(6,22,38,.5); border: 1px dashed var(--stroke-2); font: 600 20px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; text-align: center; user-select: all; }

/* ---------- Pillen-Navigation ---------- */
.pillnav {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 50; display: flex; align-items: center; gap: 4px; padding: 6px; max-width: calc(100vw - 16px);
  background: linear-gradient(160deg, rgba(255,255,255,.16), rgba(255,255,255,.05)), rgba(10,33,56,.45);
  -webkit-backdrop-filter: blur(26px) saturate(190%); backdrop-filter: blur(26px) saturate(190%);
  border: 1px solid rgba(255,255,255,.22); border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 20px 50px -18px rgba(0,0,0,.7);
}
.pillnav a, .pill-icon {
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 999px;
  color: rgba(255,255,255,.82); text-decoration: none; font-weight: 600; font-size: 14.5px; white-space: nowrap;
  transition: background .2s, color .2s; border: 0; background: none; cursor: pointer; position: relative;
}
.pillnav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pillnav a:hover, .pill-icon:hover { color: #fff; background: rgba(255,255,255,.12); }
.pillnav a.active { background: var(--orange); color: var(--navy); }
.pillnav .pill-icon { width: 48px; flex: none; padding: 0; justify-content: center; margin-left: 2px; }
.pill-icon::before { content: ""; position: absolute; left: -3px; top: 13px; bottom: 13px; width: 1px; background: rgba(255,255,255,.22); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: var(--navy); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.pillnav a.active .badge { background: var(--navy); color: var(--orange); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 90;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: #fff; color: var(--navy); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  transition: opacity .2s, transform .2s; box-shadow: 0 16px 40px -12px rgba(0,0,0,.6); max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat.accent { grid-column: span 2; }
  .pillnav a { padding: 0 14px; gap: 0; }
  .pillnav a > span:not(.badge) { display: none; }
  .pillnav a.active > span:not(.badge) { display: inline; margin-left: 7px; }
  .pillnav a .badge { position: absolute; top: 2px; right: 0; }
}
@media (max-width: 640px) {
  .topbar { padding: 18px 16px 0; }
  .brand img { height: 28px; }
  .view { padding: 28px 16px 130px; }
  .card { padding: 18px; }
  .g2 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .req { grid-template-columns: minmax(0, 1fr) auto; }
  .req-actions { grid-column: span 2; }
  .dlg form { padding: 20px; }
  .whoami span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
