:root {
    --bg: #0d1117;
    --panel: #161b22;
    --panel-2: #1c2128;
    --border: #30363d;
    --text: #e6eef3;
    --muted: #8b949e;
    --accent: #1f6feb;
    --accent-hover: #388bfd;
    --success: #3fb950;
    --error: #f85149;
    --warning: #d29922;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top, rgba(77, 208, 255, 0.15), transparent 55%),
        radial-gradient(circle at 20% 20%, rgba(255, 126, 219, 0.2), transparent 45%),
        var(--bg);
    min-height: 100vh;
    zoom: 0.9; /* Webseite um 10% verkleinert */
}

h1, h2, .brand-title, th {
    font-family: "Audiowide", sans-serif;
    font-weight: 400;
    letter-spacing: 0.5px;
}

h1 {
    margin: 0;
    font-size: 1.3rem;
}

h2 {
    margin: 0 0 16px 0;
    font-size: 1.05rem;
}

p {
    margin: 0;
}

.muted {
    color: var(--muted);
}

.app-container {
    display: flex;
    min-height: 100vh;
    padding-top: 91px;
}

.sidebar {
    width: 250px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-group {
    display: grid;
    gap: 8px;
}

.nav-group summary {
    list-style: none;
    cursor: pointer;
}

.nav-group summary::-webkit-details-marker {
    display: none;
}

.nav-sublist {
    list-style: none;
    padding: 0 0 0 12px;
    margin: 0;
    display: grid;
    gap: 8px;
}

.nav-item {
    text-decoration: none;
    color: var(--text);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    display: block;
    background: transparent;
    transition: all 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
    background: var(--panel-2);
    border-color: var(--border);
}

.sidebar__footer {
    margin-top: auto;
    font-size: 0.85rem;
    display: grid;
    gap: 16px;
}

.user-block {
    display: grid;
    gap: 10px;
}

.btn--full {
    width: 100%;
    justify-content: center;
    display: inline-flex;
}

.datetime {
    display: grid;
    gap: 4px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    height: 91px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    padding: 0 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

.topbar__left,
.topbar__right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar__right {
    justify-content: flex-end;
}

.topbar__left {
    justify-content: flex-start;
}

.brand-logo {
    height: 26px;
    width: auto;
    display: block;
}

.brand-logo--topbar-left {
    height: 48px;
}

.brand-logo--topbar-right {
    height: 62px;
}

.topbar__center {
    text-align: center;
}

.user-chip {
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    font-size: 0.85rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(63, 185, 80, 0.6);
    display: inline-block;
}

.content-wrapper {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.tile {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.tile__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.tile__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.stat {
    font-size: 1.6rem;
    margin-top: 8px;
}

.status-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    border: 1px solid transparent;
}

.status.success {
    background: rgba(63, 185, 80, 0.15);
    color: var(--success);
    border-color: rgba(63, 185, 80, 0.35);
}

.status.warning {
    background: rgba(210, 153, 34, 0.15);
    color: var(--warning);
    border-color: rgba(210, 153, 34, 0.35);
}

.status.error {
    background: rgba(248, 81, 73, 0.15);
    color: var(--error);
    border-color: rgba(248, 81, 73, 0.35);
}

.actions {
    display: flex;
    gap: 10px;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    background: var(--panel-2);
    padding: 12px 14px;
}

td {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
}

tbody tr:hover {
    background: var(--panel-2);
}

.row-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
}

.icon-btn.danger {
    color: var(--error);
    border-color: rgba(248, 81, 73, 0.5);
}

.btn {
    border-radius: 6px;
    padding: 8px 14px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn--primary {
    background: var(--accent);
    color: #ffffff;
}

.btn--primary:hover {
    background: var(--accent-hover);
}

.btn--ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn--danger {
    background: transparent;
    color: var(--error);
    border-color: var(--error);
}

.form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 8px;
    font-size: 0.85rem;
}

input,
select {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.9rem;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
}

.form__actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.tile--split {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
}

.log-list {
    display: grid;
    gap: 12px;
}

.log-item {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    font-size: 0.9rem;
}

@media (max-width: 1100px) {
    .topbar {
        grid-template-columns: 1fr 1fr;
        height: auto;
        gap: 8px;
        padding: 16px 20px;
    }

    .topbar__center {
        order: 3;
        text-align: left;
        grid-column: 1 / -1;
    }

    .tile--split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        height: 100vh;
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        padding: 16px;
    }
}

/* Footer DateTime & Version */
.datetime-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    color: var(--text-muted);
}

.datetime-row {
    display: flex;
    gap: 12px; /* Space between Date and Time */
    font-size: 0.85rem;
}

.version-row {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 2px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--panel);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: left;
}
.modal h2 { margin-top: 0; margin-bottom: 20px; }
.modal-success-msg { color: var(--success); margin-bottom: 10px; font-size: 0.9em; }
.modal-error-msg { color: var(--error); margin-bottom: 10px; font-size: 0.9em; }
