/* =====================================================================
 *  style.css  -  Dark-Mode Dashboard mit Glassmorphism
 * ===================================================================== */

:root {
    --bg-0:        #0a0a0c;   /* Seitengrund, fast schwarz */
    --bg-1:        #141417;
    --glass-bg:    rgba(22, 22, 26, 0.85);   /* dunkelgraue Panels */
    --glass-brd:   rgba(255, 255, 255, 0.06);
    --glass-blur:  10px;
    --text:        #ececee;
    --text-muted:  #86868f;
    --primary:     #ec1e63;   /* Magenta-Akzent */
    --primary-2:   #ff4d86;
    --sidebar-w:   258px;
    --radius:      14px;
    --shadow:      0 8px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    color: var(--text);
    background:
        radial-gradient(900px 600px at 100% -8%, rgba(236,30,99,0.07) 0%, transparent 55%),
        var(--bg-0);
    background-attachment: fixed;
    min-height: 100vh;
}

a { color: var(--primary-2); }

/* ---------- Glass-Utility ---------- */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-brd);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* =====================================================================
 *  Layout
 * ===================================================================== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    padding: 22px 16px;
    background: rgba(14, 14, 17, 0.94);
    backdrop-filter: blur(var(--glass-blur));
    border-right: 1px solid var(--glass-brd);
    overflow-y: auto;
    z-index: 1040;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    font-size: 1.15rem; font-weight: 700;
    padding: 6px 10px 20px;
}
.sidebar-brand i { color: var(--primary-2); font-size: 1.4rem; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-section {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-muted); margin: 16px 10px 4px;
}
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 12px;
    color: var(--text-muted); text-decoration: none;
    font-size: 0.92rem; transition: all 0.15s ease;
}
.nav-link i { width: 20px; text-align: center; font-size: 1rem; }
.nav-link:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff; box-shadow: 0 6px 18px rgba(108,92,231,0.35);
}

.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex; flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 26px;
    position: sticky; top: 0; z-index: 1030;
    background: rgba(10, 10, 12, 0.72);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-brd);
}
.topbar-spacer { flex: 1; }

.btn-icon {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-brd);
    color: var(--text);
    width: 42px; height: 42px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative; text-decoration: none;
}
.btn-icon:hover { background: rgba(255,255,255,0.12); }
.badge-count {
    position: absolute; top: -6px; right: -6px;
    background: #e84393; color: #fff;
    font-size: 0.7rem; font-weight: 700;
    min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 9px; display: flex; align-items: center; justify-content: center;
}

.user-chip {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-brd);
    border-radius: 40px; padding: 5px 14px 5px 5px;
    color: var(--text); cursor: pointer;
}
.user-chip img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.user-chip-meta { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.user-chip-meta strong { font-size: 0.85rem; }
.user-chip-meta small { font-size: 0.7rem; color: var(--text-muted); }

.content { padding: 26px; flex: 1; }

/* =====================================================================
 *  Seitenkopf, Cards
 * ===================================================================== */
.page-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}
.page-head h1 { font-size: 1.6rem; margin: 0; font-weight: 700; }
.text-muted { color: var(--text-muted) !important; }

.card { padding: 20px; margin-bottom: 0; }
.card.glass { color: var(--text); }
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; gap: 10px;
}
.card-head h2 { font-size: 1.05rem; margin: 0; font-weight: 600; }
.card-head h2 i { color: var(--primary-2); margin-right: 6px; }

/* ---------- Stat-Cards ---------- */
.stat-card { padding: 18px; text-align: left; height: 100%; }
.stat-icon {
    width: 46px; height: 46px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; color: #fff; margin-bottom: 12px;
}
.stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.stat-label { color: var(--text-muted); font-size: 0.82rem; margin-top: 4px; }
.bg-indigo { background: linear-gradient(135deg,#6c5ce7,#a29bfe); }
.bg-green  { background: linear-gradient(135deg,#00b894,#55efc4); }
.bg-blue   { background: linear-gradient(135deg,#0984e3,#74b9ff); }
.bg-orange { background: linear-gradient(135deg,#e17055,#fab1a0); }
.bg-purple { background: linear-gradient(135deg,#a55eea,#d6a2ff); }
.bg-teal   { background: linear-gradient(135deg,#00cec9,#81ecec); }

/* ---------- Profil ---------- */
.profile-top { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.profile-avatar { width: 76px; height: 76px; border-radius: 18px; object-fit: cover; border: 2px solid var(--glass-brd); }
.profile-card h3 { margin: 0 0 6px; }
.profile-meta { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.profile-meta li { color: var(--text-muted); }
.profile-meta i { color: var(--primary-2); width: 20px; }
.profile-meta strong { color: var(--text); }

/* ---------- Rollen-Badges ---------- */
.role-badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 600;
    background: rgba(255,255,255,0.1); color: var(--text);
}
.role-chief, .role-Chief.of.State { background: linear-gradient(135deg,#e84393,#fd79a8); color:#fff; }
.role-deputy_chief { background: linear-gradient(135deg,#e17055,#fab1a0); color:#fff; }
.role-state_kurator { background: linear-gradient(135deg,#0984e3,#74b9ff); color:#fff; }
.role-user { background: rgba(255,255,255,0.12); }

/* =====================================================================
 *  Tabellen
 * ===================================================================== */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; margin: 0; color: var(--text); border-collapse: collapse; }
.data-table thead th {
    text-align: left; font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-muted);
    padding: 10px 12px; border-bottom: 1px solid var(--glass-brd);
}
.data-table tbody td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: middle; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.data-table code { color: #ff77a3; background: rgba(236,30,99,0.12); padding: 2px 6px; border-radius: 6px; }
.detail-table th { color: var(--text-muted); font-weight: 500; width: 180px; }

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }

.thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; }
.thumb-empty { display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* ---------- Status-Badges ---------- */
.badge-status { padding: 4px 10px; border-radius: 20px; font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
.badge-open       { background: rgba(253,203,110,0.18); color: #fdcb6e; }
.badge-processing { background: rgba(9,132,227,0.18);  color: #74b9ff; }
.badge-done       { background: rgba(0,184,148,0.18);  color: #55efc4; }
.badge-rejected   { background: rgba(232,67,147,0.18); color: #fd79a8; }

/* =====================================================================
 *  Buttons / Formulare (Bootstrap-Overrides)
 * ===================================================================== */
.btn-primary { background: linear-gradient(135deg,var(--primary),var(--primary-2)); border: none; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-outline-light { border-color: var(--glass-brd); color: var(--text); }
.btn-outline-light:hover { background: rgba(255,255,255,0.1); color:#fff; }

.form-control, .form-select {
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-brd); color: var(--text);
}
.form-control:focus, .form-select:focus {
    background: rgba(255,255,255,0.08); color: var(--text);
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,92,231,0.2);
}
.form-control::placeholder { color: var(--text-muted); }
.form-select option { background: #161619; }

/* Filterleiste */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; padding: 14px; }
.filter-search { position: relative; flex: 1; min-width: 200px; }
.filter-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.filter-search input { width: 100%; padding-left: 40px; background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-brd); color: var(--text); border-radius: 10px; height: 42px; }
.filter-bar .form-select { max-width: 220px; height: 42px; }

.points-pill {
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, rgba(108,92,231,0.25), rgba(139,123,240,0.25));
    border: 1px solid rgba(139,123,240,0.4);
    padding: 8px 16px; border-radius: 30px; font-weight: 700;
}
.points-pill i { color: #fdcb6e; }
.points-pill.sm { padding: 4px 12px; font-size: 0.85rem; }

/* =====================================================================
 *  Shop / Produktraster
 * ===================================================================== */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 18px; margin-bottom: 20px; }
.product-card { overflow: hidden; display: flex; flex-direction: column; padding: 0; }
.product-img { position: relative; height: 160px; background: rgba(255,255,255,0.04); }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; color: var(--text-muted); }
.product-cat { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.55); padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; }
.product-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-body h3 { font-size: 1.02rem; margin: 0; }
.product-desc { color: var(--text-muted); font-size: 0.84rem; margin: 0; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-foot { display: flex; align-items: center; justify-content: space-between; }
.product-price { font-weight: 700; color: #fdcb6e; }
.product-price i { margin-right: 4px; }
.product-stock { font-size: 0.78rem; color: var(--text-muted); }
.product-stock.out { color: #fd79a8; }
/* Mengen-Stepper */
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.qty-label { font-size: 0.82rem; color: var(--text-muted); }
.qty-control { display: inline-flex; align-items: center; border: 1px solid var(--glass-brd);
    border-radius: 10px; overflow: hidden; background: rgba(255,255,255,0.05); }
.qty-btn {
    width: 34px; height: 34px; border: none; cursor: pointer;
    background: transparent; color: var(--text); font-size: 1.1rem; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background: rgba(255,255,255,0.12); }
.qty-input {
    width: 46px; height: 34px; text-align: center;
    border: none; border-left: 1px solid var(--glass-brd); border-right: 1px solid var(--glass-brd);
    background: transparent; color: var(--text); font-weight: 600;
    -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn-buy { background: linear-gradient(135deg,var(--primary),var(--primary-2)); border: none; color:#fff; margin-top: 4px; }
.btn-buy:hover:not(:disabled) { filter: brightness(1.1); color:#fff; }
.btn-buy:disabled { opacity: 0.5; }

/* Fraktions-/Punktekarten */
.faction-card { height: 100%; }
.faction-head { display: flex; align-items: center; justify-content: space-between; }
.faction-head h3 { font-size: 1.05rem; margin: 0; }
.faction-head h3 i { color: var(--primary-2); margin-right: 6px; }

/* =====================================================================
 *  Benachrichtigungen
 * ===================================================================== */
.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.notif-item { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,0.03); }
.notif-item.unread { background: rgba(108,92,231,0.12); }
.notif-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.notif-item.unread .notif-dot { background: var(--primary-2); box-shadow: 0 0 8px var(--primary-2); }
.notif-body { flex: 1; }
.notif-body p { margin: 4px 0; color: var(--text-muted); font-size: 0.88rem; }
.notif-body small { color: var(--text-muted); font-size: 0.76rem; }

/* Quick-Links */
.quick-links { display: flex; flex-wrap: wrap; gap: 12px; }
.quick-links a {
    display: flex; align-items: center; gap: 8px; text-decoration: none;
    padding: 12px 18px; border-radius: 12px; color: var(--text);
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-brd);
}
.quick-links a:hover { background: rgba(108,92,231,0.2); }
.quick-links i { color: var(--primary-2); }

/* =====================================================================
 *  Empty-State, Pagination
 * ===================================================================== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state i { font-size: 2.6rem; margin-bottom: 12px; display: block; opacity: 0.6; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.page-btn {
    min-width: 38px; height: 38px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; text-decoration: none; color: var(--text);
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-brd);
}
.page-btn:hover { background: rgba(255,255,255,0.12); }
.page-btn.active { background: linear-gradient(135deg,var(--primary),var(--primary-2)); color:#fff; border: none; }
.page-btn.disabled { opacity: 0.4; pointer-events: none; }
.page-ellipsis { align-self: center; color: var(--text-muted); padding: 0 4px; }

/* =====================================================================
 *  Toasts
 * ===================================================================== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-radius: 12px; color: #fff;
    background: rgba(24,24,28,0.96); border: 1px solid var(--glass-brd);
    backdrop-filter: blur(10px); box-shadow: var(--shadow);
    animation: toastIn 0.3s ease; transition: opacity 0.3s, transform 0.3s;
}
.toast-item.hide { opacity: 0; transform: translateX(30px); }
.toast-item i { font-size: 1.2rem; }
.toast-success i { color: #55efc4; }
.toast-error i   { color: #fd79a8; }
.toast-info i    { color: #74b9ff; }
.toast-warning i { color: #fdcb6e; }
.toast-item span { flex: 1; font-size: 0.9rem; }
.toast-close { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; line-height: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* =====================================================================
 *  Modals (Bootstrap-Override)
 * ===================================================================== */
.modal-content.glass { background: rgba(20,20,24,0.96) !important; color: var(--text); }
.modal-header, .modal-footer { border-color: var(--glass-brd); }
.btn-close { filter: invert(1) grayscale(1) brightness(1.6); }

/* =====================================================================
 *  Login / Landing
 * ===================================================================== */
.guest-body { display: flex; }
.guest-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; min-height: 100vh; }
.login-hero { width: 100%; max-width: 440px; }
.login-card { padding: 40px 32px; text-align: center; }
.login-logo {
    width: 72px; height: 72px; margin: 0 auto 18px;
    border-radius: 20px; display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color:#fff;
    background: linear-gradient(135deg,var(--primary),var(--primary-2));
    box-shadow: 0 10px 30px rgba(108,92,231,0.5);
}
.login-card h1 { font-size: 1.6rem; margin: 0 0 8px; }
.login-sub { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 26px; }
.btn-discord {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    width: 100%; padding: 14px; border-radius: 12px; text-decoration: none;
    background: #5865F2; color: #fff; font-weight: 600; font-size: 1rem;
    transition: filter 0.15s ease;
}
.btn-discord:hover { filter: brightness(1.1); color:#fff; }
.btn-discord i { font-size: 1.3rem; }
.login-features { list-style: none; padding: 0; margin: 24px 0 0; text-align: left; display: grid; gap: 10px; }
.login-features li { color: var(--text-muted); font-size: 0.9rem; }
.login-features i { color: #55efc4; margin-right: 8px; }

/* =====================================================================
 *  Fehlerseiten
 * ===================================================================== */
.error-page { text-align: center; padding: 60px 20px; }
.error-code { font-size: 5rem; font-weight: 800;
    background: linear-gradient(135deg,var(--primary),var(--primary-2));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.error-page h1 { margin: 8px 0; }
.error-page p { color: var(--text-muted); margin-bottom: 20px; }

/* =====================================================================
 *  Responsive
 * ===================================================================== */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
}
@media (max-width: 576px) {
    .content { padding: 16px; }
    .user-chip-meta { display: none; }
    .page-head h1 { font-size: 1.35rem; }
}
