:root {
  color-scheme: dark;
  --bg: #070a12;
  --bg-soft: #0c1020;
  --panel: rgba(18, 23, 42, .78);
  --panel-solid: #12172a;
  --panel-hover: #171d34;
  --text: #f7f8ff;
  --muted: #9aa3b9;
  --border: rgba(255,255,255,.085);
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 24px 70px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 80% -10%, rgba(139,92,246,.23), transparent 34%),
    radial-gradient(circle at 10% 20%, rgba(236,72,153,.11), transparent 28%),
    linear-gradient(180deg, #080b15 0%, var(--bg) 100%);
}
body.light {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-soft: #eceff7;
  --panel: rgba(255,255,255,.82);
  --panel-solid: #fff;
  --panel-hover: #f5f6fb;
  --text: #171927;
  --muted: #667085;
  --border: rgba(19,26,50,.09);
  --shadow: 0 24px 60px rgba(38,43,70,.12);
  background: radial-gradient(circle at 80% -10%, rgba(139,92,246,.16), transparent 36%), #f6f7fb;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }

.shell { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 24px 18px;
  border-right: 1px solid var(--border); background: rgba(7,10,18,.72); backdrop-filter: blur(22px);
  z-index: 30;
}
body.light .sidebar { background: rgba(255,255,255,.76); }
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 26px; font-weight: 900; letter-spacing: .3px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(135deg,var(--accent),var(--accent-2)); box-shadow: 0 0 34px rgba(139,92,246,.35); }
.brand-name span { background: linear-gradient(90deg,#a78bfa,#f472b6); color: transparent; -webkit-background-clip: text; background-clip: text; }
.nav-section { margin: 16px 0; }
.nav-label { padding: 0 12px 8px; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 13px; margin: 4px 0; border-radius: 12px; color: var(--muted); transition: .2s ease; }
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(139,92,246,.12); }
.nav-link .icon { width: 24px; text-align: center; }
.sidebar-footer { position: absolute; left: 18px; right: 18px; bottom: 18px; }
.server-pill { padding: 13px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.online { background: var(--success); box-shadow: 0 0 14px var(--success); }
.dot.offline { background: var(--danger); }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 16px clamp(18px,4vw,48px); border-bottom: 1px solid var(--border); background: rgba(7,10,18,.63); backdrop-filter: blur(20px); }
body.light .topbar { background: rgba(246,247,251,.72); }
.mobile-menu { display: none; }
.search { flex: 1; position: relative; max-width: 620px; }
.search input { width: 100%; padding: 12px 44px 12px 42px; color: var(--text); border: 1px solid var(--border); border-radius: 14px; background: var(--panel); outline: none; }
.search input:focus { border-color: rgba(139,92,246,.55); box-shadow: 0 0 0 4px rgba(139,92,246,.1); }
.search::before { content: "⌕"; position: absolute; left: 15px; top: 9px; color: var(--muted); font-size: 1.35rem; }
.keycap { position: absolute; right: 12px; top: 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 7px; padding: 2px 7px; font-size: .72rem; }
.top-actions { margin-left: auto; display: flex; gap: 10px; }
.icon-btn { width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; }
.icon-btn:hover { background: var(--panel-hover); }

.content { width: min(1400px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 70px; }
.hero { display: grid; grid-template-columns: 1.35fr .65fr; gap: 24px; align-items: stretch; }
.hero-card, .panel { border: 1px solid var(--border); border-radius: 24px; background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018)); box-shadow: var(--shadow); }
.hero-card { position: relative; overflow: hidden; padding: clamp(26px,5vw,54px); }
.hero-card::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; right: -70px; top: -95px; background: radial-gradient(circle,rgba(139,92,246,.45),transparent 65%); }
.eyebrow { color: #c4b5fd; font-size: .8rem; font-weight: 900; text-transform: uppercase; letter-spacing: .14em; }
h1 { margin: 13px 0 14px; font-size: clamp(2.2rem,5vw,4.8rem); line-height: .98; letter-spacing: -.05em; }
.gradient { background: linear-gradient(90deg,#a78bfa,#f472b6); color: transparent; -webkit-background-clip: text; background-clip: text; }
.hero p { max-width: 680px; margin: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 0 17px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel); cursor: pointer; transition: .2s ease; }
.btn:hover { transform: translateY(-2px); background: var(--panel-hover); }
.btn.primary { border-color: transparent; background: linear-gradient(135deg,var(--accent),var(--accent-2)); color: #fff; box-shadow: 0 14px 32px rgba(139,92,246,.25); }
.status-card { padding: 22px; display: flex; flex-direction: column; justify-content: space-between; }
.status-ring { width: 128px; height: 128px; margin: 6px auto 18px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--success) 0 96%, rgba(255,255,255,.08) 96%); position: relative; }
.status-ring::before { content: ""; width: 96px; height: 96px; border-radius: 50%; background: var(--panel-solid); position: absolute; }
.status-ring strong { position: relative; font-size: 1.55rem; }

.section { margin-top: 30px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head h2 { margin: 0; font-size: 1.45rem; }
.section-head p { margin: 5px 0 0; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.filter.active { color: #fff; border-color: transparent; background: linear-gradient(135deg,var(--accent),var(--accent-2)); }

.app-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.app-card { position: relative; min-height: 210px; padding: 22px; border: 1px solid var(--border); border-radius: 20px; background: var(--panel); overflow: hidden; transition: .22s ease; }
.app-card:hover { transform: translateY(-5px); border-color: rgba(139,92,246,.45); background: var(--panel-hover); box-shadow: 0 18px 45px rgba(0,0,0,.22); }
.app-card.featured::before { content: "Empfohlen"; position: absolute; top: 14px; right: 14px; padding: 5px 9px; border-radius: 999px; font-size: .68rem; color: #ddd6fe; background: rgba(139,92,246,.17); border: 1px solid rgba(139,92,246,.26); }
.app-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 17px; font-size: 1.8rem; background: linear-gradient(145deg,rgba(139,92,246,.2),rgba(236,72,153,.08)); border: 1px solid rgba(139,92,246,.2); }
.app-card h3 { margin: 18px 0 8px; font-size: 1.15rem; }
.app-card p { margin: 0; min-height: 48px; color: var(--muted); line-height: 1.5; }
.app-meta { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .83rem; }
.favorite { position: absolute; left: 76px; top: 24px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.15rem; }
.favorite.active { color: var(--warning); }

.dashboard-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.panel { padding: 22px; }
.panel h3 { margin: 0 0 18px; }
.metric-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.metric { padding: 16px; border-radius: 16px; background: rgba(255,255,255,.028); border: 1px solid var(--border); }
.metric small { display: block; color: var(--muted); margin-bottom: 7px; }
.metric strong { font-size: 1.25rem; }
.bar { height: 7px; margin-top: 12px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.07); }
.bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--accent),var(--accent-2)); transition: width .5s ease; }
.service-list { display: grid; gap: 10px; }
.service-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 13px; border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,.025); }

.announcements { display: grid; gap: 12px; }
.notice { padding: 15px 16px; border-radius: 15px; border: 1px solid var(--border); background: rgba(255,255,255,.026); }
.notice.success { border-color: rgba(52,211,153,.22); }
.notice.warning { border-color: rgba(251,191,36,.22); }
.notice h4 { margin: 0 0 6px; }
.notice p { margin: 0; color: var(--muted); line-height: 1.5; }

.notes-wrap { display: grid; grid-template-columns: 1fr .8fr; gap: 16px; }
.notes { width: 100%; min-height: 170px; resize: vertical; padding: 16px; color: var(--text); border: 1px solid var(--border); border-radius: 15px; background: rgba(255,255,255,.025); outline: none; }
.todo { display: grid; gap: 9px; }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 12px; }
.todo-item input { accent-color: var(--accent); }
.todo-add { display: flex; gap: 8px; margin-top: 10px; }
.todo-add input { flex: 1; padding: 11px 12px; color: var(--text); border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.025); }

.empty { padding: 34px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 18px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; padding: 13px 16px; border-radius: 13px; background: #171b2d; color: #fff; box-shadow: var(--shadow); transform: translateY(20px); opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { transform: translateY(0); opacity: 1; }

.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid { display: grid; gap: 12px; }
.field label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .85rem; }
.field input, .field textarea, .field select { width: 100%; padding: 11px 12px; color: var(--text); border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.025); }
.admin-app { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--border); border-radius: 14px; }
.switch { position: relative; width: 46px; height: 26px; }
.switch input { display: none; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: rgba(255,255,255,.12); cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: linear-gradient(90deg,var(--accent),var(--accent-2)); }
.switch input:checked + span::after { transform: translateX(20px); }

footer { padding: 34px 0 10px; color: var(--muted); text-align: center; font-size: .82rem; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 92px 1fr; }
  .sidebar { padding: 22px 12px; }
  .brand-name, .nav-link span:not(.icon), .nav-label, .sidebar-footer { display: none; }
  .brand { justify-content: center; padding-inline: 0; }
  .nav-link { justify-content: center; }
  .app-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: fixed; left: -290px; width: 270px; transition: left .25s; }
  .sidebar.open { left: 0; }
  .brand-name, .nav-link span:not(.icon), .nav-label, .sidebar-footer { display: initial; }
  .nav-link { justify-content: flex-start; }
  .mobile-menu { display: inline-grid; place-items: center; }
  .content { width: min(100% - 28px, 1400px); padding-top: 24px; }
  .topbar { padding-inline: 14px; }
  .keycap { display: none; }
  .app-grid, .dashboard-grid, .admin-grid, .notes-wrap { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: clamp(2.4rem,13vw,4rem); }
}
@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr; }
  .hero-card { padding: 26px 20px; }
  .status-card { padding: 18px; }
  .section-head { align-items: flex-start; flex-direction: column; }
}
