/* =========================================================
   PHOENIX GAMING - VIP LIFE PREMIUM DESIGN
   ========================================================= */

:root {
    --bg: #090a0f;               
    --panel: #11131a;            
    --panel-2: #181a24;          
    --line: rgba(255, 255, 255, 0.06); 
    --line-light: rgba(255, 255, 255, 0.12);
    
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    
    /* Phoenix Premium Colors */
    --brand-primary: #ff5e00;
    --brand-gradient: linear-gradient(135deg, #ff8c00, #e63900);
    --brand-glow: rgba(255, 94, 0, 0.25);
    
    /* Status Colors */
    --green: #10b981;
    --red: #ef4444;
    --yellow: #f59e0b;
    --blue: #3b82f6;
    --purple: #8b5cf6;
    
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background-color: var(--bg); }

body.theme-dark {
    background-color: var(--bg);
    background-image: 
        radial-gradient(800px circle at 15% -5%, rgba(255, 94, 0, 0.05), transparent 60%),
        radial-gradient(600px circle at 90% 80%, rgba(255, 140, 0, 0.04), transparent 50%);
    color: var(--text);
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: #ff8c00; }

/* --- Layout: 3 KOLONNER FASTLÅST --- */
.shell { 
    display: grid; 
    grid-template-columns: 280px 1fr 300px; 
    min-height: 100vh; 
}

.sidebar {
    border-right: 1px solid var(--line);
    background: rgba(13, 15, 20, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 10;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar { -ms-overflow-style: none; scrollbar-width: none; }

/* --- Brand --- */
.brand { display: flex; align-items: center; gap: 14px; padding: 4px; }
.brand-icon {
    width: 44px; height: 44px; border-radius: 14px;
    background: var(--brand-gradient);
    box-shadow: 0 4px 20px var(--brand-glow);
    display: grid; place-items: center; font-size: 22px;
    color: white;
}
.brand-title { font-weight: 800; font-size: 18px; letter-spacing: 0.5px; }
.brand-sub { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; margin-top: 2px; }

/* --- Navigation --- */
.nav { display: grid; gap: 6px; }
.nav-link {
    padding: 12px 16px; border-radius: var(--radius-sm);
    color: var(--text-muted); transition: var(--transition);
    font-weight: 500; font-size: 14px; display: flex; align-items: center;
}
.nav-link:hover { background: rgba(255,255,255,0.03); color: var(--text); padding-left: 20px; }
.nav-link.active {
    background: linear-gradient(90deg, var(--brand-glow), transparent);
    color: white; border-left: 3px solid var(--brand-primary);
    font-weight: 600;
}

/* --- Sidebar Footer & User --- */
.sidebar-footer { margin-top: auto; display: grid; gap: 16px; }
.lang-chip {
    padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    color: var(--text-muted); font-size: 12px; background: rgba(0,0,0,0.2);
}
.lang-chip strong { color: var(--text); }

.user-mini { 
    display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; 
    padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); 
    background: rgba(0,0,0,0.2); transition: var(--transition);
}
.user-mini:hover { border-color: var(--line-light); background: rgba(255,255,255,0.02); }
.user-name { font-weight: 600; font-size: 14px; }
.user-id { font-size: 12px; color: var(--text-muted); margin-top: 2px;}

/* --- Topbar --- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { 
    display: flex; justify-content: space-between; align-items: center; gap: 16px; 
    padding: 24px 40px; border-bottom: 1px solid var(--line); 
    background: rgba(9, 10, 15, 0.8); backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 5;
}
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.user-chip { 
    display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); 
    border-radius: 999px; padding: 6px 14px 6px 6px; background: rgba(0,0,0,0.3); font-size: 13px; font-weight: 500;
}
.page-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.page-subtitle { margin-top: 6px; color: var(--text-muted); font-size: 14px; }

/* --- Content & Cards --- */
.content { padding: 32px 40px 60px; min-width: 0; max-width: 1400px; margin: 0 auto; width: 100%; flex: 1; }
.card { 
    background: var(--panel); 
    border: 1px solid var(--line); 
    border-radius: var(--radius); 
    box-shadow: var(--shadow); 
    padding: 24px; 
    position: relative;
    overflow: hidden;
}
.card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.stat-card { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 32px 16px; transition: var(--transition); }
.stat-card:hover { transform: translateY(-4px); border-color: var(--line-light); }
.stat-card .muted { text-transform: uppercase; font-size: 12px; font-weight: 600; letter-spacing: 1px; }
.stat-card .stat-value { font-size: 40px; font-weight: 800; margin-top: 12px; background: var(--brand-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.grid-2, .grid-4 { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.layout-ticket { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; }
.sidepanel-stack { display: grid; gap: 24px; align-content: start; }

/* --- Tables & Toolbar --- */
.toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.toolbar h2 { margin: 0; }
.toolbar-wrap { flex-wrap: wrap; align-items: flex-end; }
.grow { flex: 1; min-width: 280px; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 16px; background: var(--panel-2); }
.table { width: 100%; border-collapse: collapse; min-width: 820px; }
.table th, .table td { padding: 16px 20px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 14px; }
.table th { color: var(--text-muted); font-weight: 600; background: rgba(0,0,0,0.2); text-transform: uppercase; font-size: 12px; letter-spacing: 0.5px; }
.table tr:last-child td { border-bottom: none; }
.table tr { transition: var(--transition); }
.table tbody tr:hover { background: rgba(255,255,255,0.02); }

/* --- Forms & Inputs --- */
.form { display: grid; gap: 12px; }
.label { font-size: 13px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.input, .textarea, .select {
    width: 100%; background: #0c0d12; color: var(--text);
    border: 1px solid var(--line); border-radius: var(--radius-sm); 
    padding: 14px 16px; outline: none; transition: var(--transition);
    font-family: inherit; font-size: 14px;
}
.input:hover, .textarea:hover, .select:hover { border-color: var(--line-light); }
.input:focus, .textarea:focus, .select:focus { 
    border-color: var(--brand-primary); 
    box-shadow: 0 0 0 4px var(--brand-glow); 
    background: #11131a;
}
.textarea { resize: vertical; min-height: 140px; line-height: 1.5; }

/* --- Buttons --- */
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.btn {
    border: 1px solid transparent; color: var(--text);
    padding: 12px 20px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: var(--transition); font-family: inherit; font-size: 14px;
}
.btn:active { transform: scale(0.98); }

.btn-primary { 
    background: var(--brand-gradient); 
    color: white; 
    box-shadow: 0 4px 15px var(--brand-glow); 
    border: none;
}
.btn-primary:hover { 
    box-shadow: 0 6px 20px rgba(255, 94, 0, 0.4); 
    transform: translateY(-2px); 
    filter: brightness(1.1);
}

.btn-secondary { 
    background: rgba(255,255,255,0.03); 
    border: 1px solid var(--line); 
}
.btn-secondary:hover { 
    background: rgba(255,255,255,0.08); 
    border-color: var(--line-light);
}

/* EKSTREM FORCE på rød knap - løser problem med hvid baggrund i nogle browsere/caches */
.btn-danger {
    background-color: #ef4444 !important; 
    background-image: none !important;
    border: 1px solid #dc2626 !important;
    color: #ffffff !important; 
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25) !important;
}
.btn-danger:hover {
    background-color: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4) !important;
}
.btn-danger:disabled,
.btn-danger[disabled] {
    background-color: rgba(239, 68, 68, 0.4) !important;
    border-color: transparent !important;
    color: rgba(255, 255, 255, 0.8) !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.btn:disabled,
.btn[disabled] {
    cursor: not-allowed;
    opacity: 0.6;
    filter: grayscale(0.1);
    transform: none !important;
}

.btn-full { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 16px 24px; font-size: 16px; font-weight: 700; }

/* --- Badges & Status --- */
.badge {
    display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
    padding: 6px 12px; font-size: 12px; font-weight: 600;
    border: 1px solid transparent; letter-spacing: 0.5px;
}
.badge-mini { padding: 2px 8px; font-size: 11px; }
.badge-outline { background: rgba(0,0,0,0.2); border-color: var(--line); color: var(--text-muted); }
.badge-green { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.2); color: var(--green); }

.status-open { background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.3); color: #93c5fd; }
.status-waiting_staff { background: rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.3); color: #fcd34d; }
.status-waiting_user { background: rgba(255, 255, 255, 0.05); border-color: var(--line-light); color: var(--text); }
.status-under_review { background: rgba(139, 92, 246, 0.15); border-color: rgba(139, 92, 246, 0.3); color: #c4b5fd; }
.status-approved { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.3); color: #6ee7b7; box-shadow: 0 0 10px rgba(16,185,129,0.2); }
.status-declined { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.status-closed { background: rgba(148, 163, 184, 0.1); border-color: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

/* --- Alerts --- */
.alert { margin: 24px 40px 0; border-radius: var(--radius-sm); padding: 16px 20px; border: 1px solid; font-weight: 500; display: flex; align-items: center; gap: 12px; }
.alert::before { content: "ℹ"; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: bold; flex-shrink: 0; }
.alert-success { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.2); color: #a7f3d0; }
.alert-success::before { content: "✓"; background: var(--green); color: #000; }
.alert-error { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); color: #fecaca; }
.alert-error::before { content: "✕"; background: var(--red); color: #fff; }
.alert-info { background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.2); color: #bfdbfe; }
.alert-info::before { background: var(--blue); color: #fff; }

/* WARNING BOKSEN OPPDATERET - SKARP GUL FARVE! */
.alert-warning { background: rgba(245, 158, 11, 0.1) !important; border: 1px solid rgba(245, 158, 11, 0.5) !important; color: #fde68a !important; }
.alert-warning::before { content: "!" !important; background: var(--yellow) !important; color: #000 !important; font-size: 15px !important; }

/* --- Tickets & Chat --- */
.ticket-header { 
    display: flex; justify-content: space-between; align-items: flex-start; 
    gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 24px; margin-bottom: 24px;
}
.ticket-header > div:first-child { flex: 1; min-width: 0; }
.ticket-header h2 { margin: 0 0 6px 0; word-wrap: break-word; overflow-wrap: break-word; }
.stack { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; min-width: fit-content; }

.chat-list { display: flex; flex-direction: column; gap: 24px; }
.chat-item { 
    display: flex; flex-direction: column; max-width: 85%; 
    animation: fadeIn 0.3s ease forwards;
}
.chat-item.user { align-self: flex-start; align-items: flex-start; }
.chat-item.staff { align-self: flex-end; align-items: flex-end; }

.chat-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; max-width: 100%; flex-wrap: wrap; }
.chat-item.staff .chat-meta { flex-direction: row-reverse; }

.chat-bubble { 
    padding: 14px 18px; border-radius: 16px; line-height: 1.6; font-size: 14px; 
    word-break: break-word; box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    width: fit-content; max-width: min(100%, 760px);
    display: flex; flex-direction: column; gap: 12px;
}
.chat-bubble > div { width: 100%; }

.chat-item.user .chat-bubble { 
    background: var(--panel-2); border: 1px solid var(--line); 
    border-bottom-left-radius: 4px; align-self: flex-start;
}
.chat-item.staff .chat-bubble { 
    background: linear-gradient(135deg, rgba(255, 94, 0, 0.12), rgba(230, 57, 0, 0.05));
    border: 1px solid rgba(255, 94, 0, 0.25); border-bottom-right-radius: 4px;
    align-self: flex-end; color: #fff;
}

.file-input { padding: 8px 12px; }
.file-input::file-selector-button {
    margin-right: 16px; border: none; background: var(--brand-gradient);
    color: white; border-radius: 6px; padding: 8px 16px; cursor: pointer;
    font-weight: 600; font-size: 13px; transition: var(--transition);
    box-shadow: 0 2px 10px var(--brand-glow);
}
.file-input::file-selector-button:hover {
    transform: translateY(-1px); box-shadow: 0 4px 15px rgba(255, 94, 0, 0.4);
}

.chat-attachment { display: flex; flex-direction: column; gap: 8px; width: fit-content; max-width: 100%; }
.chat-attachment-link { font-size: 13px; font-weight: 600; }
.chat-attachment-image {
    width: 100%; max-width: 320px; max-height: 250px; object-fit: cover;
    border-radius: 10px; border: 1px solid var(--line-light);
    background: rgba(0,0,0,0.3); display: block; cursor: zoom-in; transition: var(--transition);
}
.chat-attachment-image:hover { opacity: 0.9; transform: scale(1.02); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Sidepanel Lists --- */
.meta-list { display: grid; gap: 12px; }
.meta-list > div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.meta-list span { color: var(--text-muted); font-size: 13px; }
.meta-list strong { text-align: right; font-size: 13px; font-weight: 600; color: var(--text); }

/* --- AUDIT LOG CLEANUP (Farverne er nu pro og neutrale!) --- */
.notes-list, .audit-list { display: grid; gap: 12px; }
.note-item, .audit-item { 
    border: 1px solid var(--line); 
    border-left: 3px solid #3b82f6; /* Blå kant i stedet for orange hack-stil */
    border-radius: var(--radius-sm); 
    padding: 14px; 
    background: rgba(255,255,255,0.02); 
    font-size: 13px;
}
.audit-item strong { color: var(--text); }
.note-body { margin-top: 8px; line-height: 1.5; white-space: pre-wrap; font-size: 14px; color: var(--text-muted); }

.json-box { 
    margin: 12px 0 0; 
    background: rgba(0,0,0,0.4); 
    border: 1px solid var(--line); 
    border-radius: var(--radius-sm); 
    padding: 12px; 
    overflow: auto; 
    font-size: 12px; 
    font-family: 'Consolas', 'Courier New', monospace; 
    color: #93c5fd; /* Afdæmpet blå kode-farve */
    white-space: pre-wrap;
}

/* --- Misc Utilities --- */
.avatar, .avatar-sm { border-radius: 50%; object-fit: cover; display: inline-block; border: 2px solid var(--line); }
.avatar { width: 44px; height: 44px; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-fallback { display: grid; place-items: center; font-weight: 700; color: white; background: var(--brand-gradient); }

.center-wrap { min-height: calc(100vh - 180px); display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(480px, 100%); text-align: center; }
.auth-card h2 { font-size: 28px; margin-bottom: 12px; font-weight: 800; }
.auth-card p { font-size: 15px; }

.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line-light), transparent); margin: 24px 0; }
.info-box { 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; 
    align-items: center;
    margin-top: 16px; 
    padding: 16px; 
    background: rgba(0,0,0,0.2); 
    border-radius: var(--radius-sm); 
    border: 1px solid var(--line); 
}

.info-box .muted.small {
    display: inline-block;
    margin-top: 2px;
}
.list { margin: 0; padding-left: 0; display: grid; gap: 12px; list-style: none; }
.list li { position: relative; padding-left: 28px; color: var(--text-muted); font-size: 15px; }
.list li::before { 
    content: "✦"; position: absolute; left: 0; top: 0; 
    color: var(--brand-primary); font-size: 14px; 
}

.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }

/* =========================================================
   VIP RIGHT SIDEBAR
   ========================================================= */
.vip-sidebar {
    border-left: 1px solid var(--line);
    background: transparent;
    display: flex;
    flex-direction: column;
    z-index: 5;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.vip-marquee-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
}

.vip-marquee {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    will-change: transform;
    --vip-marquee-loop-px: -50%;
    --vip-marquee-duration: 40s;
    animation: scroll-vertical var(--vip-marquee-duration) linear infinite;
}

.vip-marquee-group {
    display: flex;
    flex-direction: column;
}

.vip-marquee:hover {
    animation-play-state: paused;
}

@keyframes scroll-vertical {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(0, var(--vip-marquee-loop-px), 0); }
}

/* Rettet margins så listen står skarpt uden mærkelige mellemrum */
.vip-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: transparent;
    transition: var(--transition);
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    margin: 0;
}

.vip-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

.vip-avatar {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
}

.vip-card .vip-info { display: flex; flex-direction: column; justify-content: center; }
.vip-card .vip-name { font-weight: 700; font-size: 15px; color: var(--text); }
.vip-card .vip-id { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* --- Safeguard Framework Content --- */
.safeguard-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-top: 16px;
}
.safeguard-content strong {
    color: var(--text);
    font-size: 15px;
    display: block;
    margin-bottom: 6px;
}
.safeguard-content p {
    margin: 0;
}
.safeguard-content ul {
    margin-top: 8px;
}
.safeguard-footer {
    border-top: 1px solid var(--line);
    padding-top: 16px;
    margin-top: 4px;
}

/* --- Responsive --- */
@media (max-width: 1450px) {
    .shell { grid-template-columns: 280px 1fr 280px; }
}
@media (max-width: 1200px) {
    .shell { grid-template-columns: 280px 1fr; }
    .vip-sidebar { display: none; }
}
@media (max-width: 980px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--line); display: none; }
    .vip-sidebar { display: none; }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .topbar { padding: 20px; }
    .content { padding: 20px; }
    .alert { margin: 16px 20px 0; }
}
@media (max-width: 560px) {
    .grid-4 { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; align-items: flex-start; gap: 16px; }
    .topbar-actions { width: 100%; justify-content: space-between; }
    .chat-item { max-width: 100%; }
}
/* --- Global Footer --- */
.site-footer {
    margin-top: auto;
    padding: 14px 40px 18px;
    border-top: 1px solid var(--line);
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    background: rgba(9, 10, 15, 0.45);
}

@media (max-width: 980px) {
    .site-footer { padding: 14px 20px 18px; }
}