* { box-sizing: border-box; }

:root {
    --bg-1: #ebf5ff;
    --bg-2: #d8e9ff;
    --text: #10335f;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(59, 145, 255, 0.28), transparent 24%),
        radial-gradient(circle at 10% 30%, rgba(0, 132, 255, 0.20), transparent 30%),
        radial-gradient(circle at bottom left, rgba(0, 106, 255, 0.18), transparent 28%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
    min-height: 100vh;
}

a { color: #0f4ea8; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 92px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #0b3c7a 0%, #1b7dff 60%, #59b2ff 100%);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(13, 61, 122, 0.28);
    overflow: hidden;
    text-align: center;
}
.topbar::before {
    content: "";
    position: absolute;
    inset: -40% auto auto -10%;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 68%);
    pointer-events: none;
}
.topbar::after {
    content: "";
    position: absolute;
    right: -90px;
    top: -70px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 66%);
    pointer-events: none;
}
.topbar-title { position: relative; z-index: 1; text-align: center; }
.topbar h1, .topbar .eyebrow, .topbar a { color: #ffffff; position: relative; z-index: 1; }

.eyebrow {
    font-size: 14px;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    opacity: 0.96;
    margin-bottom: 3px;
    font-weight: 700;
}
.ops-eyebrow { font-size: 15px; letter-spacing: 1.8px; }
.ops-title {
    margin: 0;
    font-size: 56px;
    letter-spacing: -0.8px;
    color: #ff4d4f;
    text-shadow: 0 0 18px rgba(255, 77, 79, 0.24), 0 0 30px rgba(255, 77, 79, 0.10);
}
.ops-subtitle {
    margin-top: 6px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.92);
}
h2 { margin: 0; font-size: 20px; }

.topnav {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    z-index: 2;
}
.topnav a, .btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #1b7dff 0%, #59b2ff 100%);
    box-shadow: 0 8px 16px rgba(16, 51, 95, 0.16);
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}
.topnav a:hover, .btn:hover, button:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(16, 51, 95, 0.20);
    opacity: 0.95;
}
.btn.primary, button { background: linear-gradient(135deg, #0f5fff 0%, #43a6ff 100%); }
.btn.small { padding: 5px 9px; border-radius: 9px; font-size: 11px; }
.admin-btn { background: linear-gradient(135deg, #27588f 0%, #3e7dd2 100%); }
.admin-btn:hover { background: linear-gradient(135deg, #0f4ea8 0%, #59b2ff 100%); }
.btn-ok { background: linear-gradient(135deg, #14a95d 0%, #39c97e 100%); }
.btn-warn { background: linear-gradient(135deg, #c97816 0%, #e59b3a 100%); }

.container { width: min(1320px, calc(100% - 20px)); margin: 16px auto 26px; }

.stats-panel {
    margin-bottom: 18px;
    padding: 12px 12px 10px;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(16, 51, 95, 0.08);
    border-radius: 20px;
    box-shadow: 0 14px 32px rgba(21, 72, 132, 0.10);
}
.stats-head { margin-bottom: 10px; }
.stats-panel.is-collapsed .stats-strip { display: none; }
.stats-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}
.stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 12px 12px 10px 12px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(16, 51, 95, 0.08);
    box-shadow: 0 14px 32px rgba(21, 72, 132, 0.12);
    min-height: 96px;
}
.stat-card::after {
    content: "";
    position: absolute;
    right: -22px;
    bottom: -22px;
    width: 84px;
    height: 84px;
    border-radius: 999px;
    opacity: 0.18;
}
.stat-blue::after { background: #1b7dff; }
.stat-gold::after { background: #ffb300; }
.stat-cyan::after { background: #00b8d9; }
.stat-green::after { background: #18c964; }
.stat-red::after { background: #e54b4b; }
.stat-dark::after { background: #35516f; }
.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 800;
    color: #567291;
    margin-bottom: 8px;
}
.stat-value { position: relative; z-index: 1; font-weight: 900; color: #0b315d; }
.stat-pulse { font-size: 30px; line-height: 1; animation: statPulse 1.6s infinite; }
.stat-blink { font-size: 30px; line-height: 1; animation: statBlink 1.1s infinite; }
.stat-time { font-size: 15px; line-height: 1.2; font-weight: 800; }
.stat-foot {
    position: relative;
    z-index: 1;
    margin-top: 7px;
    font-size: 11px;
    color: #6d84a0;
    font-weight: 700;
}
@keyframes statPulse {
    0% { transform: scale(1); text-shadow: 0 0 0 rgba(27,125,255,0); }
    50% { transform: scale(1.045); text-shadow: 0 0 16px rgba(27,125,255,0.24); }
    100% { transform: scale(1); text-shadow: 0 0 0 rgba(27,125,255,0); }
}
@keyframes statBlink {
    0%, 100% { opacity: 1; filter: brightness(1); }
    50% { opacity: 0.6; filter: brightness(1.18); }
}

.section-block { margin-bottom: 18px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.section-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-note { font-size: 12px; color: #537196; font-weight: 700; }

.badge-row { display: flex; gap: 4px; flex-wrap: wrap; }
.compact-badges { margin-top: 8px; }

.badge {
    font-size: 9px;
    padding: 3px 5px;
    border-radius: 999px;
    font-weight: 700;
    border: 1px solid transparent;
    line-height: 1.05;
}
.badge-chip.badge-online { background: #e3f9eb; color: #168348; border-color: #b8ebcb; }
.badge-chip.badge-test { background: #e6f3ff; color: #1264bf; border-color: #b8d9ff; }
.badge-chip.badge-intern { background: #eef0ff; color: #4b53c0; border-color: #d2d7ff; }
.badge-chip.badge-neu { background: #eaf8ff; color: #0082a6; border-color: #b9ebff; }
.badge-chip.badge-wichtig { background: #fff2d9; color: #a36500; border-color: #ffd999; }
.badge-chip.badge-default { background: #edf2f7; color: #48607b; border-color: #d8e0ea; }

.live-status {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    font-size: 10px;
    color: #3e5a7a;
}
.live-label { font-weight: 700; }
.live-time { color: #6f85a0; }
.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    flex: 0 0 auto;
}
.status-dot.is-online { background: #18c964; animation: ledOnline 0.9s infinite; }
.status-dot.is-offline { background: #e54b4b; animation: ledOffline 0.9s infinite; }
.status-dot.is-unknown { background: #8aa2bf; }
@keyframes ledOnline {
    0%, 100% { box-shadow: 0 0 0 rgba(24, 201, 100, 0); opacity: 1; }
    50% { box-shadow: 0 0 10px rgba(24, 201, 100, 0.72); opacity: 0.72; }
}
@keyframes ledOffline {
    0%, 100% { box-shadow: 0 0 0 rgba(229, 75, 75, 0); opacity: 1; }
    50% { box-shadow: 0 0 10px rgba(229, 75, 75, 0.72); opacity: 0.72; }
}

.inline-form { margin: 0; }
.star-toggle {
    width: 24px;
    height: 24px;
    min-width: 24px;
    padding: 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    color: #9aa8ba;
    box-shadow: inset 0 0 0 1px rgba(16, 51, 95, 0.08);
}
.star-toggle:hover { background: #fff8d9; color: #d9a400; }
.star-toggle.is-favorite { background: #fff3bf; color: #c58a00; }

.app-bar-list, .admin-app-bar-list { display: flex; flex-direction: column; gap: 10px; }

.app-bar, .admin-app-bar {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(16, 51, 95, 0.08);
    box-shadow: 0 12px 28px rgba(21, 72, 132, 0.10);
    border-radius: 18px;
    min-height: 88px;
    padding: 12px 14px 12px 18px;
    overflow: hidden;
}
.app-bar-accent, .admin-app-bar-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--app-color, #1b7dff);
}
.app-bar-main, .admin-app-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.app-bar-icon, .admin-app-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.90);
    color: var(--app-color, #1b7dff);
    box-shadow: inset 0 0 0 1px rgba(16, 51, 95, 0.08);
}
.app-bar-icon svg, .admin-app-icon svg { width: 20px; height: 20px; }
.app-bar-info, .admin-app-info { min-width: 0; }

.app-bar-title-row, .admin-app-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.app-bar-title, .admin-app-title {
    margin: 0;
    font-size: 20px;
    line-height: 1.15;
    font-weight: 800;
    color: #0c366b;
}
.inline-favorite {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 999px;
    background: #fff3bf;
    color: #a16b00;
    border: 1px solid #f3d678;
}
.inline-inactive {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 999px;
    background: #f4e4e4;
    color: #a33d3d;
    border: 1px solid #ebc0c0;
}
.app-bar-desc, .admin-app-desc {
    margin-top: 4px;
    font-size: 12px;
    color: #587290;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-bar-meta, .admin-app-status { min-width: 0; }
.admin-app-status {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.admin-app-meta-line {
    font-size: 11px;
    color: #5f7795;
    font-weight: 700;
}
.admin-app-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 11px;
    font-weight: 700;
}
.app-bar-actions, .admin-app-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.form-panel, .login-box {
    background: rgba(255,255,255,0.90);
    border: 1px solid rgba(16, 51, 95, 0.08);
    box-shadow: 0 14px 32px rgba(21, 72, 132, 0.12);
    border-radius: 20px;
}
.form-panel {
    padding: 18px;
}
.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-shell {
    width: 100%;
    display: grid;
    place-items: center;
    min-height: calc(100vh - 48px);
}
.login-box {
    width: min(430px, 100%);
    padding: 26px 24px 22px;
    position: relative;
    overflow: hidden;
}
.login-glow {
    position: absolute;
    width: 180px;
    height: 180px;
    right: -40px;
    top: -40px;
    background: radial-gradient(circle, rgba(89,178,255,0.28), transparent 70%);
    pointer-events: none;
}
.login-title {
    color: #0c366b;
    font-size: 42px;
    margin: 0 0 6px 0;
}
.login-subtitle {
    color: #315e8d;
    font-size: 20px;
    margin: 0 0 16px 0;
}
.edit-form, .login-form { display: grid; gap: 10px; }
label {
    font-weight: 700;
    color: #28517e;
    font-size: 13px;
}
input, select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(16, 51, 95, 0.14);
    background: rgba(255,255,255,0.92);
    color: #10335f;
    font-size: 14px;
}
.badge-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.badge-check {
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(16, 51, 95, 0.12);
    background: rgba(255,255,255,0.8);
}
.check-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.check-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13px;
}
.check-item input { width: auto; margin: 0; }

.alert {
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 10px;
}
.alert.error { background: #ffe7ea; color: #9d1730; }
.alert.success { background: #e6f8ec; color: #166e3d; }

.sortable-row { cursor: grab; }
.sortable-row.dragging { opacity: 0.6; cursor: grabbing; }
.save-order-btn.is-saved { background: linear-gradient(135deg, #0ea85c 0%, #38c57a 100%); }

@media (max-width: 1280px) {
    .stats-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
    .topbar {
        justify-content: flex-start;
        min-height: auto;
        padding-top: 16px;
        padding-bottom: 16px;
    }
    .topbar-title {
        text-align: left;
        padding-right: 220px;
    }
    .ops-title { font-size: 42px; }
    .topnav { right: 14px; }
    .app-bar, .admin-app-bar {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .app-bar-actions, .admin-app-actions {
        justify-content: flex-start;
    }
}
@media (max-width: 860px) {
    .topbar {
        align-items: flex-start;
        justify-content: flex-start;
        flex-direction: column;
        text-align: left;
    }
    .topbar-title {
        text-align: left;
        padding-right: 0;
    }
    .topnav {
        position: static;
        transform: none;
        margin-top: 8px;
    }
    .ops-title { font-size: 30px; }
    .ops-subtitle { font-size: 14px; letter-spacing: 2px; }
    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-bar, .admin-app-bar {
        padding: 11px 12px 11px 14px;
        min-height: 0;
    }
    .app-bar-title, .admin-app-title { font-size: 18px; }
    .app-bar-desc, .admin-app-desc { white-space: normal; }
    .app-bar-main, .admin-app-main { align-items: flex-start; }
    .login-title { font-size: 36px; }
}
@media (max-width: 560px) {
    .stats-strip { grid-template-columns: 1fr; }
    .login-box { padding: 22px 18px 18px; }
}
