:root {
  --petrol: #0f5c63;
  --petrol-dark: #0a4349;
  --petrol-soft: #e6f1f1;
  --green: #4caf7d;
  --green-dark: #2e8b5a;
  --ink: #16242a;
  --muted: #6b7f84;
  --line: #e2e9ea;
  --bg: #f4f7f7;
  --card: #ffffff;
  --danger: #c2453b;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(15, 92, 99, 0.08);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* --- Marke --- */
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.brand-name { letter-spacing: .2px; }
.brand-name strong { color: var(--petrol); }
.brand-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--green), var(--petrol));
  box-shadow: 0 0 0 4px var(--petrol-soft);
  animation: pulse 3.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--petrol-soft); }
  50% { box-shadow: 0 0 0 7px rgba(76, 175, 125, 0.18); }
}

/* --- Topbar --- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-chip {
  background: var(--petrol-soft); color: var(--petrol-dark);
  padding: 5px 12px; border-radius: 999px; font-weight: 600; font-size: .85rem;
}
.ghost {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 10px; padding: 6px 12px; cursor: pointer; font-size: .9rem;
  transition: all .18s ease;
}
.ghost:hover { color: var(--petrol); border-color: var(--petrol); transform: translateY(-1px); }
#refreshBtn.spin { animation: spin .6s ease; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Layout --- */
.layout {
  max-width: 1100px; margin: 0 auto; padding: 28px 24px;
  display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start;
}
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }

.section-head h2 { margin: 0 0 2px; font-size: 1.25rem; display: flex; align-items: center; gap: 10px; }
.section-sub { margin: 0 0 16px; color: var(--muted); font-size: .9rem; }
.count {
  background: var(--green); color: #fff; font-size: .8rem; font-weight: 600;
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* --- Inbox --- */
.inbox-group { margin-bottom: 20px; }
.inbox-group-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--petrol-dark); font-size: .9rem;
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px;
}
.inbox-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), opacity .4s ease, box-shadow .22s ease;
  animation: rise .35s ease backwards;
}
.inbox-item:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(15,92,99,.13); }
.inbox-item.done { opacity: 0; transform: translateX(40px) scale(.97); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.item-title { font-weight: 600; }
.item-sub { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.item-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn {
  border: none; border-radius: 10px; padding: 8px 14px; font-weight: 600;
  cursor: pointer; font-size: .85rem; transition: transform .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.approve { background: var(--green); color: #fff; }
.btn.block { background: #fff; color: var(--danger); border: 1px solid var(--danger); }

.empty {
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 32px; text-align: center; color: var(--green-dark); font-weight: 500;
}
.muted { color: var(--muted); font-size: .8rem; font-weight: 500; text-transform: none; letter-spacing: 0; }
.err { color: var(--danger); font-size: .8rem; font-weight: 500; text-transform: none; letter-spacing: 0; }

/* --- Projekt-Karten --- */
.project-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease;
  animation: rise .35s ease backwards;
}
.project-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(15,92,99,.13); }
.project-top { display: flex; align-items: center; justify-content: space-between; }
.project-top h3 { margin: 0; font-size: 1.02rem; }
.project-desc { color: var(--muted); font-size: .85rem; margin: 6px 0 12px; }
.project-foot { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; }
.project-foot a { color: var(--petrol); text-decoration: none; font-weight: 600; }
.project-foot a:hover { text-decoration: underline; }
.project-state { color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-ok { background: var(--green); box-shadow: 0 0 0 3px rgba(76,175,125,.2); }
.dot-not_configured { background: #d8b24a; box-shadow: 0 0 0 3px rgba(216,178,74,.2); }
.dot-placeholder { background: #c3ccce; }
.dot-error { background: var(--danger); box-shadow: 0 0 0 3px rgba(194,69,59,.2); }
.state-placeholder { opacity: .72; }

/* --- Shell: Reiter links, Inhalt rechts --- */
.shell {
  max-width: 1150px; margin: 0 auto; padding: 24px;
  display: grid; grid-template-columns: 230px 1fr; gap: 24px; align-items: start;
}
.sidenav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 84px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: 12px;
  padding: 11px 13px; cursor: pointer; font: inherit; color: var(--ink);
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.nav-item:hover { background: var(--card); border-color: var(--line); transform: translateX(2px); }
.nav-item.active { background: var(--petrol-soft); border-color: var(--petrol-soft); color: var(--petrol-dark); font-weight: 600; }
.nav-label { flex: 1; font-size: .95rem; }
.nav-badge {
  background: var(--green); color: #fff; font-size: .72rem; font-weight: 700;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidenav { flex-direction: row; overflow-x: auto; position: static; padding-bottom: 4px; }
  .nav-item { width: auto; white-space: nowrap; }
  .nav-item:hover { transform: none; }
}

/* --- Inhalt --- */
.content { min-height: 60vh; animation: rise .3s ease; }
.head h1 { margin: 0 0 4px; font-size: 1.5rem; }
.head .sub { margin: 0 0 20px; color: var(--muted); font-size: .92rem; }
.head .sub a { color: var(--petrol); font-weight: 600; text-decoration: none; }
.head .sub a:hover { text-decoration: underline; }
.loading { color: var(--muted); padding: 20px 0; }

/* --- Werkzeugleiste: Status-Reiter + Suche --- */
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.subtab {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; font: inherit; font-size: .88rem; color: var(--muted);
  display: inline-flex; align-items: center; gap: 7px; transition: all .16s ease;
}
.subtab:hover { border-color: var(--petrol); color: var(--petrol); }
.subtab.active { background: var(--petrol); border-color: var(--petrol); color: #fff; font-weight: 600; }
.subtab .pill {
  background: rgba(0,0,0,.08); border-radius: 999px; padding: 0 7px; font-size: .75rem; font-weight: 700;
  min-width: 18px; text-align: center;
}
.subtab.active .pill { background: rgba(255,255,255,.25); }
.search {
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 14px; font: inherit; font-size: .92rem;
  min-width: 220px; flex: 1; max-width: 320px; transition: border-color .16s ease, box-shadow .16s ease;
}
.search:focus { outline: none; border-color: var(--petrol); box-shadow: 0 0 0 4px var(--petrol-soft); }

/* --- Listenzeilen (Inbox + Nutzer) --- */
.userlist { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 16px; box-shadow: var(--shadow);
  transition: transform .2s cubic-bezier(.2,.8,.2,1), opacity .4s ease, box-shadow .2s ease;
  animation: rise .3s ease backwards;
}
.row:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(15,92,99,.13); }
.row.done { opacity: 0; transform: translateX(40px) scale(.97); }
.row-title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.row-sub { color: var(--muted); font-size: .84rem; margin-top: 3px; }
.row-actions { display: flex; gap: 8px; flex-shrink: 0; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.badge-pending { background: #fbf0d4; color: #8a6400; }
.badge-active { background: #e2f3e9; color: var(--green-dark); }
.badge-blocked { background: #f8dedb; color: var(--danger); }
.brand-chip, .chip {
  display: inline-block; background: var(--petrol-soft); color: var(--petrol-dark);
  font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; letter-spacing: .4px;
}
.row-title .chip { font-weight: 600; }
.empty.err { color: var(--danger); border-color: var(--danger); }

/* --- Info-Bereich --- */
.info-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); color: var(--ink); animation: rise .3s ease backwards;
}
.info-card p { margin: 0 0 12px; color: var(--muted); }
.info-card .live-link { color: var(--petrol); font-weight: 600; text-decoration: none; }
.info-card .live-link:hover { text-decoration: underline; }
.info-card.state-placeholder { opacity: .8; }

/* --- Einstellungen --- */
.nav-sep { height: 1px; background: var(--line); margin: 8px 10px; }
.dot-settings { background: var(--petrol); box-shadow: 0 0 0 3px var(--petrol-soft); }
.settings-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); animation: rise .3s ease backwards;
}
.settings-title {
  margin: 0 0 6px; font-size: .82rem; font-weight: 700; color: var(--petrol-dark);
  text-transform: uppercase; letter-spacing: .6px; display: flex; align-items: center; gap: 10px;
}
.setting { padding: 14px 0 6px; border-top: 1px solid var(--line); transition: background .4s ease; border-radius: 10px; }
.setting:first-of-type { border-top: none; }
.setting.flash { background: #eef8f2; }
.setting-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.setting-label { font-weight: 600; }
.source { font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.src-hub { background: #e2f3e9; color: var(--green-dark); }
.src-env { background: var(--petrol-soft); color: var(--petrol-dark); }
.src-none { background: #f0f0f0; color: var(--muted); }
.setting-desc { margin: 4px 0 10px; color: var(--muted); font-size: .86rem; }
.setting-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.setting-input {
  flex: 1; min-width: 240px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  font: inherit; font-size: .95rem; transition: border-color .16s ease, box-shadow .16s ease;
}
.setting-input:focus { outline: none; border-color: var(--petrol); box-shadow: 0 0 0 4px var(--petrol-soft); }
.btn.ghost-btn { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.btn.ghost-btn:hover { color: var(--petrol); border-color: var(--petrol); }
.setting-note { min-height: 18px; font-size: .82rem; margin-top: 8px; color: var(--muted); }
.setting-note.ok { color: var(--green-dark); font-weight: 600; }
.setting-note.err { color: var(--danger); font-weight: 600; }

/* --- Inbox-Gruppen (Übersicht) --- */
.inbox-group { margin-bottom: 22px; }

/* --- Login --- */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 70% -10%, #e9f4f3, var(--bg));
  padding: 20px;
}
.login-card {
  background: var(--card); border-radius: 22px; box-shadow: 0 18px 50px rgba(15,92,99,.14);
  padding: 36px 32px; width: 100%; max-width: 380px; border: 1px solid var(--line);
  animation: rise .5s ease;
}
.login-hint { color: var(--muted); margin: 14px 0 22px; font-size: .92rem; }
#loginForm { display: flex; flex-direction: column; gap: 14px; }
#loginForm label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--petrol-dark); }
#loginForm input {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 1rem;
  transition: border-color .18s ease, box-shadow .18s ease; font-family: inherit;
}
#loginForm input:focus { outline: none; border-color: var(--petrol); box-shadow: 0 0 0 4px var(--petrol-soft); }
#submit {
  margin-top: 6px; background: var(--petrol); color: #fff; border: none; border-radius: 12px;
  padding: 13px; font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: transform .15s ease, background .18s ease;
}
#submit:hover:not(:disabled) { background: var(--petrol-dark); transform: translateY(-1px); }
#submit:disabled { opacity: .7; cursor: default; }
.login-error { color: var(--danger); font-size: .88rem; margin: 2px 0 0; }
.shake { animation: shake .4s ease; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
