/* EVD Aktuell Admin Panel - V2 */

:root {
    --red: #8B0000;
    --red-light: #a00000;
    --red-dim: rgba(139,0,0,0.15);
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface2: #22263a;
    --border: rgba(255,255,255,0.08);
    --text: #e8eaf0;
    --text-muted: #8a8ea8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --sidebar-w: 240px;
    --radius: 10px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* LOGIN */
#login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 60% 40%, rgba(139,0,0,0.18) 0%, transparent 60%), var(--bg);
}
.login-box {
    width: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { width: 64px; height: 64px; border-radius: 50%; }
.login-logo h1 { font-size: 20px; font-weight: 700; color: var(--text); margin-top: 12px; }
.login-logo p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.login-box .form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.login-box .form-input {
    width: 100%; background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; padding: 10px 14px; color: var(--text); font-size: 14px;
    outline: none; transition: border-color .2s; margin-bottom: 16px;
}
.login-box .form-input:focus { border-color: var(--red); }
.btn-login {
    width: 100%; background: var(--red); color: #fff; border: none;
    border-radius: 8px; padding: 11px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: background .2s;
}
.btn-login:hover { background: var(--red-light); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; }
.login-error { margin-top: 12px; color: var(--danger); font-size: 13px; text-align: center; display: none; }

/* APP SHELL */
#app-shell { display: none; }
#app-shell.visible { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 100; overflow-y: auto;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand img { width: 34px; height: 34px; border-radius: 50%; }
.sidebar-brand span { font-size: 15px; font-weight: 700; }
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--red);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }
.sidebar-nav { flex: 1; padding: 8px 0; }
.nav-section {
    padding: 16px 18px 4px;
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: var(--text-muted);
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 18px; color: var(--text-muted); cursor: pointer;
    transition: all .15s; border: none; background: none;
    width: 100%; text-align: left; font-size: 14px; position: relative;
}
.nav-item:hover { color: var(--text); background: var(--red-dim); }
.nav-item.active { color: #fff; background: var(--red-dim); font-weight: 600; }
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: var(--red); border-radius: 0 2px 2px 0;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.btn-logout {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border);
    background: none; color: var(--text-muted); font-size: 13px;
    cursor: pointer; transition: all .15s;
}
.btn-logout:hover { color: var(--danger); border-color: var(--danger); }

/* MAIN */
.main-content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 18px; font-weight: 700; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.page-content { padding: 28px; flex: 1; }

/* CARDS */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card-title {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px;
    display: flex; align-items: center; justify-content: space-between;
}

/* KPI GRID */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 16px; margin-bottom: 28px; }
.kpi-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 20px; position: relative; overflow: hidden;
}
.kpi-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 2px; background: var(--accent-color, var(--red));
}
.kpi-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; }
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1; }
.kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* LAYOUT GRIDS */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* BUTTONS */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 7px; border: 1px solid var(--border);
    font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s;
    color: var(--text); background: var(--surface2); text-decoration: none;
}
.btn:hover { border-color: rgba(255,255,255,.2); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-light); border-color: var(--red-light); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn svg { width: 14px; height: 14px; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
    text-align: left; padding: 10px 12px; color: var(--text-muted);
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; border-bottom: 1px solid var(--border);
}
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,.02); }

/* BADGES */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-green { background: rgba(34,197,94,.15); color: var(--success); }
.badge-red { background: rgba(239,68,68,.15); color: var(--danger); }
.badge-yellow { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-blue { background: rgba(59,130,246,.15); color: var(--info); }
.badge-gray { background: rgba(255,255,255,.08); color: var(--text-muted); }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea,
input[type=text].form-input, input[type=email].form-input, input[type=url].form-input,
input[type=number].form-input, input[type=date].form-input, select.form-input, textarea.form-input {
    width: 100%; background: var(--bg); border: 1px solid var(--border);
    border-radius: 7px; padding: 9px 12px; color: var(--text); font-size: 14px;
    outline: none; transition: border-color .15s; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--red); }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Toggle */
.toggle-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.toggle { position: relative; width: 42px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--surface2); border-radius: 11px; cursor: pointer; transition: .2s; border: 1px solid var(--border); }
.toggle-slider::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; background: var(--text-muted); border-radius: 50%; transition: .2s; }
.toggle input:checked + .toggle-slider { background: var(--red); border-color: var(--red); }
.toggle input:checked + .toggle-slider::after { transform: translateX(20px); background: #fff; }

/* QUILL EDITOR */
.editor-container { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ql-toolbar { border: none !important; border-bottom: 1px solid var(--border) !important; background: var(--surface2) !important; }
.ql-toolbar .ql-stroke { stroke: var(--text-muted) !important; }
.ql-toolbar .ql-fill { fill: var(--text-muted) !important; }
.ql-toolbar button:hover .ql-stroke, .ql-toolbar .ql-active .ql-stroke { stroke: var(--text) !important; }
.ql-toolbar button:hover .ql-fill, .ql-toolbar .ql-active .ql-fill { fill: var(--text) !important; }
.ql-toolbar .ql-picker-label { color: var(--text-muted) !important; }
.ql-toolbar .ql-picker-options { background: var(--surface2) !important; border-color: var(--border) !important; color: var(--text) !important; }
.ql-container { border: none !important; font-size: 15px !important; font-family: inherit !important; }
.ql-editor { min-height: 320px; color: var(--text); }
.ql-editor.ql-blank::before { color: var(--text-muted) !important; font-style: normal !important; }
.ql-editor blockquote { border-left: 3px solid var(--red); padding-left: 12px; color: var(--text-muted); }
.ql-editor pre { background: var(--surface2) !important; color: var(--text) !important; border-radius: 6px; }
.ql-editor a { color: #c0392b; }

/* CHART */
.chart-wrap { position: relative; height: 220px; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; opacity: .4; margin-bottom: 16px; }
.empty-state p { font-size: 15px; margin-bottom: 4px; color: var(--text); }

/* SPINNER */
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--red); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { display: flex; align-items: center; justify-content: center; padding: 40px; gap: 12px; color: var(--text-muted); }

/* MODAL */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal.wide { max-width: 860px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.modal-header h2 { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 22px; padding: 4px; line-height: 1; border-radius: 4px; transition: color .15s; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 0 24px 20px; display: flex; gap: 8px; justify-content: flex-end; }

/* TOASTS */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 500; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; max-width: 320px; box-shadow: var(--shadow); animation: slideIn .2s ease; display: flex; align-items: center; gap: 8px; }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast-success { background: #166534; color: #fff; }
.toast-error { background: #7f1d1d; color: #fff; }
.toast-info { background: #1e3a5f; color: #fff; }

/* STATS LIST */
.stats-list { list-style: none; }
.stats-list li { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.stats-list li:last-child { border-bottom: none; }
.stats-bar { flex: 1; margin: 0 12px; height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.stats-bar-fill { height: 100%; background: var(--red); border-radius: 2px; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

/* UTILS */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.justify-between { justify-content: space-between; }
.font-bold { font-weight: 700; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.search-input { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: 8px 12px; color: var(--text); font-size: 13px; outline: none; transition: border-color .15s; }
.search-input:focus { border-color: var(--red); }
