/* ==========================================================================
   barox Tools – Landingpage (baut auf barox-design-system.css auf)
   ========================================================================== */

:root {
  --navy-deep: #001a2e;
  --hero-grad: radial-gradient(120% 140% at 85% 0%, #014a7d 0%, var(--navy) 45%, var(--navy-deep) 100%);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

html { scroll-behavior: smooth; }
body { min-height: 100vh; }
.dots { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dots--full { position: fixed; }

.eyebrow {
  margin: 0 0 10px; font-size: .78rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--amber);
}

/* ------------------------------- Login ----------------------------------- */
.page-login {
  background: var(--hero-grad); color: var(--white);
  display: grid; place-items: center; overflow: hidden;
}
.login-wrap { position: relative; z-index: 1; width: 100%; padding: 24px 16px; display: grid; place-items: center; }
.login-card {
  width: min(460px, 100%);
  padding: 44px 40px 34px;
  border-radius: 18px;
  background: rgba(0, 29, 51, .55);
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: rise .9s var(--ease-out) both .15s;
}
.login-logo { height: 36px; width: auto; display: block; margin-bottom: 30px; }
.login-card h1 { color: var(--white); font-size: clamp(1.8rem, 6vw, 2.35rem); font-weight: 800; letter-spacing: -.01em; }
.login-card h1 span { color: var(--amber); }
.login-text { color: rgba(255, 255, 255, .78); margin: 0 0 26px; }
.login-alert {
  background: rgba(179, 38, 30, .18); border: 1px solid rgba(255, 120, 110, .45);
  color: #ffd9d5; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 18px; font-size: .92rem;
}
.btn-ms {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 14px 20px; border-radius: 10px;
  background: var(--white); color: var(--navy); text-decoration: none;
  font-weight: 700; font-size: 1rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  position: relative; overflow: hidden;
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.btn-ms::after { /* Lichtreflex */
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(247, 166, 0, .28), transparent);
  transform: skewX(-18deg); animation: sheen 4.5s ease-in-out infinite 1.5s;
}
.btn-ms:hover { color: var(--navy); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 0, 0, .32); }
.ms-logo { width: 20px; height: 20px; flex: none; }
.login-note {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin: 20px 0 0; font-size: .82rem; color: rgba(255, 255, 255, .55);
}
.login-note svg { width: 15px; height: 15px; }

/* ------------------------------ Header ----------------------------------- */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.app-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { height: 30px; width: auto; }
.brand-sub {
  font-family: var(--font-display); font-weight: 700; color: var(--navy-60);
  padding-left: 12px; border-left: 2px solid var(--amber); line-height: 1.1;
}
.user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user form { margin: 0; }
.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--navy); color: var(--amber);
  font-weight: 700; font-size: .85rem; box-shadow: 0 0 0 2px var(--white), 0 0 0 3px var(--amber);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-name { font-weight: 700; color: var(--navy); font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mail { color: var(--grey); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--navy);
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ------------------------------- Hero ------------------------------------ */
.hero-band {
  position: relative; overflow: hidden;
  background: var(--hero-grad); color: var(--white);
  padding: 64px 0 76px;
}
.hero-band::after { /* weicher Übergang in den Seitenhintergrund */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 40px;
  background: linear-gradient(to bottom, transparent, rgba(0, 26, 46, .25));
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-content > * { animation: rise .8s var(--ease-out) both; }
.hero-content > :nth-child(2) { animation-delay: .08s; }
.hero-content > :nth-child(3) { animation-delay: .16s; }
.hero-content > :nth-child(4) { animation-delay: .24s; }
.hero-band h1 { color: var(--white); font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 800; letter-spacing: -.015em; margin-bottom: .35em; }
.hero-band h1 span { color: var(--amber); }
.hero-lead { color: rgba(255, 255, 255, .8); font-size: 1.08rem; max-width: 58ch; margin: 0 0 28px; }

.search {
  display: flex; align-items: center; gap: 12px; max-width: 560px; margin: 0;
  padding: 6px 8px 6px 18px; border-radius: 14px;
  background: rgba(255, 255, 255, .97); color: var(--navy-60);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
  transition: box-shadow .2s, transform .2s var(--ease-out);
}
.search:focus-within { box-shadow: 0 14px 40px rgba(0, 0, 0, .28), 0 0 0 3px var(--amber); transform: translateY(-1px); }
.search svg { width: 20px; height: 20px; flex: none; }
.search input[type="search"] {
  border: 0; outline: 0; background: transparent; padding: 12px 0; font-size: 1.02rem; color: var(--ink);
}
.search input:focus { outline: 0; }
.search kbd {
  font-family: var(--font-text); font-size: .78rem; color: var(--navy-60);
  border: 1px solid var(--navy-20); border-bottom-width: 2px; border-radius: 6px; padding: 2px 8px;
}

/* ---------------------------- Dashboard ---------------------------------- */
.dash { padding-top: 40px; padding-bottom: 64px; }
.dash > .alert { margin-bottom: 24px; }
.cat { margin-bottom: 40px; }
.cat[hidden] { display: none; }
.cat-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.05rem; margin-bottom: 16px; color: var(--navy);
}
.cat-title svg { width: 20px; height: 20px; color: var(--amber-dark); }
.count {
  font-family: var(--font-text); font-size: .74rem; font-weight: 700; color: var(--navy-60);
  background: var(--navy-10); border-radius: 999px; padding: 1px 9px;
}

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.tool {
  position: relative; display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 20px 18px; border-radius: var(--radius-lg);
  background: var(--white); text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  overflow: hidden; isolation: isolate;
  transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out), border-color .22s;
  animation: rise .6s var(--ease-out) both;
  animation-delay: var(--d, 0s);
}
.tool::before { /* Bernstein-Kante wächst beim Hover */
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px;
  background: var(--amber); transform: scaleX(.18); transform-origin: left;
  transition: transform .35s var(--ease-out);
}
.tool::after { /* Lichtpunkt folgt der Maus */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(247, 166, 0, .10), transparent 60%);
  transition: opacity .25s;
}
.tool:hover, .tool:focus-visible {
  color: var(--ink); transform: translateY(-4px);
  box-shadow: var(--shadow-hover); border-color: var(--navy-20);
}
.tool:hover::before, .tool:focus-visible::before { transform: scaleX(1); }
.tool:hover::after { opacity: 1; }
.tool[hidden] { display: none; }

.tool-icon {
  width: 46px; height: 46px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--navy-10); color: var(--navy);
  transition: background .22s, color .22s, transform .35s var(--ease-out);
}
.tool-icon svg { width: 24px; height: 24px; }
.tool:hover .tool-icon { background: var(--navy); color: var(--amber); transform: rotate(-6deg) scale(1.05); }

.tool-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tool-name { font-family: var(--font-display); font-weight: 700; color: var(--navy); font-size: 1.04rem; line-height: 1.3; }
.tool-desc { color: var(--grey); font-size: .9rem; line-height: 1.45; margin-top: 4px; }
.tool-host {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 10px; font-size: .76rem; color: var(--navy-60);
  font-variant-numeric: tabular-nums;
}
.badge {
  font-size: .66rem; font-weight: 700; letter-spacing: .06em; color: var(--success);
  background: #e8f3e9; border-radius: 4px; padding: 1px 6px;
}
.tool-go { color: var(--navy-40); transition: color .2s, transform .3s var(--ease-out); }
.tool-go svg { width: 18px; height: 18px; }
.tool:hover .tool-go { color: var(--amber-dark); transform: translate(2px, -2px); }

/* Zuletzt verwendet */
.recent-list { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 16px 8px 9px; border-radius: 999px;
  background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow);
  text-decoration: none; color: var(--navy); font-weight: 500; font-size: .92rem;
  transition: transform .2s var(--ease-out), border-color .2s, box-shadow .2s;
  animation: rise .5s var(--ease-out) both; animation-delay: var(--d, 0s);
}
.chip .chip-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--amber); }
.chip .chip-icon svg { width: 15px; height: 15px; }
.chip:hover { color: var(--navy); transform: translateY(-2px); border-color: var(--amber); box-shadow: var(--shadow-hover); }

.empty { text-align: center; color: var(--grey); padding: 40px 0; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--navy); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--amber-dark); }

/* Keine Freigaben */
.no-access { text-align: center; padding: 56px 16px; animation: rise .6s var(--ease-out) both; }
.no-access-icon {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px;
  display: grid; place-items: center; background: var(--navy-10); color: var(--navy);
}
.no-access-icon svg { width: 30px; height: 30px; }
.no-access p { color: var(--grey); max-width: 46ch; margin: 0 auto; }

/* --------------------------- Admin-Seite --------------------------------- */
.icon-btn.is-active { background: var(--navy); color: var(--amber); border-color: var(--navy); }
.icon-btn--amber { background: var(--amber); border-color: var(--amber); color: var(--navy); flex: none; height: auto; }
.icon-btn--amber:hover { background: var(--amber-light); border-color: var(--amber-light); color: var(--navy); }

.admin { padding-top: 32px; padding-bottom: 56px; }
.admin-head h1 { margin-bottom: .2em; }
.admin-head .lead { margin: 0 0 24px; }
.admin > .alert { margin-bottom: 20px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px;
  font-size: .88rem; font-weight: 500; color: var(--navy-60); text-decoration: none;
}
.back svg { width: 16px; height: 16px; }

.admin-grid { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }
.panel {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 20px;
}
.people { position: sticky; top: 88px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; gap: 12px; }
.add-user label { font-size: .85rem; }
.add-row { display: flex; gap: 8px; }
.add-row input { min-width: 0; }
.hint { color: var(--grey); font-size: .84rem; margin: 6px 0 0; }
.people-filter { font-size: .9rem !important; }
.people-list { overflow-y: auto; margin: 0 -8px; padding: 0 8px; display: flex; flex-direction: column; gap: 2px; }

.person {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px;
  text-decoration: none; color: var(--ink); border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.person[hidden] { display: none; }
.person:hover { background: var(--bg); color: var(--ink); }
.person.is-active { background: var(--navy-10); border-color: var(--navy-20); }
.person--defaults { background: #fff8e8; border-color: #fde7b0; }
.person--defaults:hover { background: #fff3d6; }
.person--defaults.is-active { background: #ffefc7; border-color: var(--amber); }
.person--defaults .person-avatar { background: var(--amber); color: var(--navy); }
.person-avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center; background: var(--navy); color: var(--amber);
  font-size: .76rem; font-weight: 700;
}
.person-avatar svg { width: 18px; height: 18px; }
.person-avatar--lg { width: 52px; height: 52px; font-size: 1rem; }
.person-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.person-name { font-weight: 600; color: var(--navy); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-mail { color: var(--grey); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill {
  flex: none; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 2px 9px;
  background: var(--navy-10); color: var(--navy-80); font-variant-numeric: tabular-nums;
}
.pill--admin { background: var(--navy); color: var(--amber); }
.pill--all { background: #e8f3e9; color: var(--success); }

.editor { min-height: 420px; }
.editor h2 { margin-bottom: .15em; }
.editor-person { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.editor-person .hint { margin: 0; }
.editor-empty { text-align: center; padding: 70px 16px; }

.check-group { border: 0; padding: 0; margin: 22px 0 0; }
.check-group legend {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 0; margin-bottom: 10px;
  font-family: var(--font-display); font-weight: 700; color: var(--navy); font-size: .95rem;
}
.group-actions { margin-left: auto; font-family: var(--font-text); font-weight: 400; font-size: .8rem; color: var(--navy-40); }
.group-actions .link-btn { font-size: .8rem; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 8px; }
.check {
  position: relative; display: flex; align-items: center; gap: 10px; margin: 0;
  padding: 10px 12px; border-radius: 10px; cursor: pointer; user-select: none;
  border: 1px solid var(--line); background: var(--white); font-weight: 500; color: var(--ink);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check:hover { border-color: var(--navy-40); }
.check:has(input:focus-visible) { outline: 3px solid var(--amber); outline-offset: 2px; }
.check-icon {
  width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: var(--navy-10); color: var(--navy); transition: background .15s, color .15s;
}
.check-icon svg { width: 18px; height: 18px; }
.check-name { flex: 1; font-size: .9rem; line-height: 1.3; }
.check-tag { font-size: .66rem; font-weight: 700; color: var(--amber-dark); text-transform: uppercase; letter-spacing: .05em; }
.check-box {
  width: 20px; height: 20px; flex: none; border-radius: 6px; display: grid; place-items: center;
  border: 2px solid var(--navy-40); color: transparent; transition: background .15s, border-color .15s, color .15s;
}
.check-box svg { width: 14px; height: 14px; stroke-width: 3; }
.check:has(input:checked) { border-color: var(--navy); background: #f7f9fb; box-shadow: inset 3px 0 0 var(--amber); }
.check:has(input:checked) .check-icon { background: var(--navy); color: var(--amber); }
.check:has(input:checked) .check-box { background: var(--navy); border-color: var(--navy); color: var(--white); }
.check.is-locked { cursor: default; opacity: .75; }
.tool-checks { transition: opacity .2s; }
.tool-checks.is-disabled { opacity: .35; pointer-events: none; }

.switch { display: flex; align-items: center; gap: 12px; margin: 4px 0 0; cursor: pointer; font-weight: 400; color: var(--ink); }
.switch input { position: absolute; opacity: 0; }
.switch-track {
  position: relative; width: 44px; height: 24px; flex: none; border-radius: 999px;
  background: var(--navy-20); transition: background .2s;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--white); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease-out);
}
.switch input:checked + .switch-track { background: var(--success); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--amber); outline-offset: 2px; }

.editor-actions {
  position: sticky; bottom: 0; margin: 22px -20px -20px; padding: 14px 20px;
  background: rgba(255, 255, 255, .94); border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  display: flex; justify-content: flex-end;
}
.delete-form { margin-top: 30px; }
.link-btn--danger { display: inline-flex; align-items: center; gap: 6px; color: var(--error); font-size: .88rem; }
.link-btn--danger svg { width: 16px; height: 16px; }
.link-btn--danger:hover { color: #7a1710; }

.admin-note {
  display: flex; gap: 10px; align-items: flex-start; margin: 26px 0 0;
  font-size: .84rem; color: var(--grey); max-width: 90ch;
}
.admin-note svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }

@media (max-width: 860px) {
  .admin-grid { grid-template-columns: 1fr; }
  .people { position: static; max-height: none; }
  .people-list { max-height: 300px; }
}

/* ------------------------------ Footer ----------------------------------- */
.app-footer { background: var(--navy); color: var(--navy-20); padding: 26px 0; font-size: .85rem; }
.app-footer-inner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.app-footer img { height: 20px; width: auto; }
.footer-hint { margin-left: auto; color: var(--navy-40); }

/* ---------------------------- Animationen -------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes sheen {
  0%, 70% { left: -60%; }
  100%    { left: 130%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------------------------- Responsive --------------------------------- */
@media (max-width: 640px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .dash { padding-top: 28px; }
  .user-meta { display: none; }
  .brand-logo { height: 26px; }
  .hero-band { padding: 44px 0 52px; }
  .search kbd { display: none; }
  .login-card { padding: 34px 24px 26px; }
  .footer-hint { margin-left: 0; }
}
