/* ============================================
   DESIGN SYSTEM
   ============================================ */
:root {
    /* Backgrounds */
    --bg-base: #0b0b0f;
    --bg-elevated: #14141a;
    --bg-card: #1a1a22;
    --bg-card-hover: #20202a;
    --bg-input: #0f0f14;
    --bg-sidebar: #0e0e14;

    /* Borders */
    --border: #25252e;
    --border-strong: #2f2f3a;
    --border-glow: rgba(255, 136, 0, 0.3);

    /* Text */
    --text: #f1f1f5;
    --text-secondary: #a8a8b8;
    --text-muted: #62626f;

    /* Brand */
    --accent: #ff8800;
    --accent-light: #ffa033;
    --accent-glow: rgba(255, 136, 0, 0.18);
    --accent-soft: rgba(255, 136, 0, 0.08);

    /* States */
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.15);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 24px var(--accent-glow);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Transitions */
    --t-fast: 0.15s ease;
    --t-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-base);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.screen { height: 100vh; }
.hidden { display: none !important; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
    border: 2px solid var(--bg-base);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================
   LOGIN SCREEN
   ============================================ */
#loginScreen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at top, #1a0e00 0%, #0a0a0d 60%);
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px; height: 400px;
    background: var(--accent);
    top: -100px; right: -100px;
}

.orb-2 {
    width: 300px; height: 300px;
    background: #ff4500;
    bottom: -80px; left: -80px;
    animation-delay: -5s;
}

.orb-3 {
    width: 250px; height: 250px;
    background: #ffaa00;
    top: 50%; left: 30%;
    animation-delay: -10s;
    opacity: 0.25;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 30px) scale(0.95); }
}

.login-card {
    background: rgba(20, 20, 26, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.04) inset;
    position: relative;
    z-index: 2;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.login-logo-wrap {
    width: 96px; height: 96px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff4500);
    padding: 3px;
    box-shadow: 0 0 32px var(--accent-glow);
}

.login-logo-wrap img {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: var(--bg-base);
}

.login-brand {
    color: var(--accent);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 3px;
    margin-bottom: 8px;
}

.login-card h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-card .subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.input-wrap {
    position: relative;
    margin-bottom: 16px;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--t-fast);
}

.input-wrap input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-submit {
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: none;
    background: linear-gradient(135deg, var(--accent), #ff5500);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.login-submit:active { transform: translateY(0); }

.login-submit .arrow {
    transition: transform var(--t-fast);
}

.login-submit:hover .arrow { transform: translateX(4px); }

.error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 12px;
    min-height: 18px;
}

.login-footer {
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ============================================
   STATUS DOT
   ============================================ */
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.dot.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 8px var(--success); }
    50% { box-shadow: 0 0 16px var(--success), 0 0 24px var(--success-glow); }
}

/* ============================================
   PANEL LAYOUT
   ============================================ */
#panelScreen {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
}

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 50;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 18px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 30;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    position: relative;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 200px;
    background: radial-gradient(ellipse at top, var(--accent-soft), transparent 70%);
    pointer-events: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.sidebar-brand img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: 0 0 16px var(--accent-glow);
}

.brand-name {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.2px;
}

.brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 1px;
}

.sidebar-bot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.bot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--success);
}

.bot-info { flex: 1; min-width: 0; }
.bot-tag {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bot-status {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.nav-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 16px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md);
    margin-bottom: 2px;
    text-align: left;
    transition: all var(--t-fast);
    font-family: inherit;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text);
}

.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px var(--accent);
}

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.bot-uptime { flex: 1; }
.uptime-label {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.uptime-value {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    margin-top: 2px;
}

.logout-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--t-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-family: inherit;
}

.logout-btn:hover {
    background: var(--danger-glow);
    border-color: var(--danger);
    color: var(--danger);
}

/* ============================================
   CONTENT WRAPPER
   ============================================ */
.content-wrapper {
    overflow-y: auto;
    height: 100vh;
}

.content-header {
    padding: 24px 40px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-base);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(11, 11, 15, 0.85);
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 13px;
}

.header-actions { display: flex; gap: 8px; align-items: center; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--success-glow);
    border: 1px solid var(--success);
    border-radius: 20px;
    color: var(--success);
    font-size: 12px;
    font-weight: 600;
}

main {
    padding: 32px 40px 48px;
    max-width: 1300px;
}

/* ============================================
   TABS / SECTIONS
   ============================================ */
.tab-content { display: none; }
.tab-content.active {
    display: block;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

h2:not(:first-child) { margin-top: 36px; }

.hint {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 20px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 16px;
    transition: border-color var(--t-fast);
}

.card:hover {
    border-color: var(--border-strong);
}

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 700px) {
    .form-row { grid-template-columns: 1fr; }
}

input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--t-fast);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.5;
}

input[type="color"] {
    height: 44px;
    padding: 4px;
    cursor: pointer;
    background: var(--bg-input);
}

.duration-input { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    padding: 8px 0;
    text-transform: none;
    letter-spacing: 0;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.button-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================
   BUTTONS
   ============================================ */
button {
    padding: 11px 20px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all var(--t-fast);
    font-family: inherit;
    letter-spacing: 0.2px;
}

button:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #ff5500);
    color: #fff;
    box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: #fff;
    box-shadow: 0 2px 8px var(--success-glow);
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 4px 16px var(--success-glow); }

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: #fff;
}
.btn-warning:hover { transform: translateY(-1px); }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #fff;
    box-shadow: 0 2px 8px var(--danger-glow);
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 4px 16px var(--danger-glow); }

.btn-link {
    background: none;
    color: var(--accent);
    padding: 6px 0;
    text-decoration: none;
    font-size: 13px;
    border: none;
    transition: color var(--t-fast);
}

.btn-link:hover { color: var(--accent-light); text-decoration: underline; }

.poll-option { margin-bottom: 8px; }

/* ============================================
   DASHBOARD
   ============================================ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--t-base);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0;
    transition: opacity var(--t-base);
}

.stat-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::before { opacity: 1; }

.stat-label {
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -1px;
    line-height: 1;
}

/* ============================================
   LISTS
   ============================================ */
.list { display: flex; flex-direction: column; gap: 8px; }

.list-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: all var(--t-fast);
}

.list-item:hover {
    border-color: var(--border-strong);
    background: var(--bg-card-hover);
}

.list-item-info { flex: 1; min-width: 0; }
.list-item-title {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}
.list-item-meta {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
}

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

.list-empty {
    color: var(--text-muted);
    padding: 40px 20px;
    text-align: center;
    font-style: italic;
    background: var(--bg-card);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
}

.tag {
    display: inline-block;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-right: 4px;
}

.tag.ingame { color: var(--info); border-color: var(--info); background: rgba(59,130,246,0.1); }
.tag.ended { color: var(--text-muted); }
.tag.active { color: var(--success); border-color: var(--success); background: var(--success-glow); }

/* ============================================
   EMBED BUILDER
   ============================================ */
.embed-builder {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1100px) {
    .embed-builder { grid-template-columns: 1fr; }
}

.char-counter {
    float: right;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.preview-wrapper {
    position: sticky;
    top: 100px;
}

.preview-wrapper h3 {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.preview-content {
    color: var(--text);
    font-size: 14px;
    margin-bottom: 6px;
    white-space: pre-wrap;
    word-break: break-word;
}

.preview-discord {
    background: #313338;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.discord-embed {
    background: #2b2d31;
    border-left: 4px solid #ff8800;
    border-radius: 4px;
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    max-width: 520px;
    color: #dbdee1;
    font-size: 14px;
    line-height: 1.4;
}

.discord-embed-content { min-width: 0; }

.discord-embed-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.discord-embed-author-icon {
    width: 24px; height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.discord-embed-title {
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    text-decoration: none;
    display: block;
    word-break: break-word;
}

.discord-embed-title.linked { color: #00a8fc; }
.discord-embed-title.linked:hover { text-decoration: underline; }

.discord-embed-description {
    white-space: pre-wrap;
    word-break: break-word;
    color: #dbdee1;
}

.discord-embed-description code {
    background: #1e1f22;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.discord-embed-description code.md-block {
    display: block;
    padding: 8px;
    margin: 4px 0;
    white-space: pre-wrap;
}

.discord-embed-description a {
    color: #00a8fc;
    text-decoration: none;
}

.discord-embed-description a:hover { text-decoration: underline; }

.discord-embed-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    margin-top: 12px;
    object-fit: contain;
}

.discord-embed-thumbnail {
    width: 80px; height: 80px;
    border-radius: 4px;
    object-fit: cover;
}

.discord-embed-footer {
    margin-top: 12px;
    font-size: 12px;
    color: #949ba4;
    word-break: break-word;
}

/* ============================================
   FIVEM
   ============================================ */
.fivem-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.fivem-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

.fivem-count {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.player-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: all var(--t-fast);
}

.player-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.player-id {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.player-ping {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Consolas', monospace;
}

.player-name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--text);
}

.player-ic {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.player-job {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.player-grade {
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    margin-left: 4px;
}

.player-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--success);
    margin-bottom: 8px;
    font-weight: 600;
}

.player-discord {
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 8px;
}

.player-discord code {
    color: var(--info);
    font-size: 11px;
}

/* ============================================
   CHARTS
   ============================================ */
.chart-title {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.chart-container {
    position: relative;
    height: 220px;
    width: 100%;
}

/* ============================================
   TOP MEMBERS
   ============================================ */
.top-member-item {
    align-items: center;
}

.rank {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
    width: 44px;
    text-align: center;
    background: var(--accent-soft);
    padding: 6px 0;
    border-radius: 8px;
    flex-shrink: 0;
}

.top-member-item:nth-child(1) .rank { color: #ffd700; background: rgba(255,215,0,0.1); }
.top-member-item:nth-child(2) .rank { color: #c0c0c0; background: rgba(192,192,192,0.1); }
.top-member-item:nth-child(3) .rank { color: #cd7f32; background: rgba(205,127,50,0.1); }

/* ============================================
   HISTORY
   ============================================ */
.history-item { gap: 14px; }

.history-icon {
    font-size: 22px;
    width: 44px;
    height: 44px;
    background: var(--bg-input);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.history-success { border-left: 3px solid var(--success); }
.history-danger { border-left: 3px solid var(--danger); }
.history-warning { border-left: 3px solid var(--warning); }

/* ============================================
   BOT CONFIG (avatar + thumbnail preview)
   ============================================ */
.current-value-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 11px 14px;
    color: var(--text);
    font-weight: 600;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
}

.avatar-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.avatar-preview-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--accent), 0 0 16px var(--accent-glow);
    background: var(--bg-card);
    flex-shrink: 0;
}

.avatar-preview-img[src=""] {
    background: var(--bg-card-hover);
}

.avatar-row-info { flex: 1; }

.avatar-row-label {
    font-size: 10px;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}


.thumbnail-preview-box {
    margin: 18px 0;
}

.thumbnail-preview-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.thumbnail-preview-embed {
    background: #2b2d31;
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: start;
    max-width: 520px;
    color: #dbdee1;
}

.thumb-preview-author {
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
}

.thumb-preview-title {
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 6px;
}

.thumb-preview-desc {
    color: #dbdee1;
    font-size: 13px;
    line-height: 1.4;
}

.thumb-preview-img {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    object-fit: cover;
    background: var(--bg-input);
}

.thumb-preview-img[src=""] { display: none; }

/* ============================================
   COUNTER PREVIEW
   ============================================ */
.counter-preview-box {
    background: linear-gradient(135deg, var(--bg-input), var(--bg-card));
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 16px;
}

.counter-preview-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.counter-preview-content {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}

.list-item code {
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--accent);
    font-family: 'Consolas', monospace;
}

/* ============================================
   DISCORD VIEWER
   ============================================ */
.discord-tab {
    margin: -32px -40px -48px;
    height: calc(100vh - 81px);
}

@media (max-width: 900px) {
    .discord-tab { margin: -20px; height: calc(100vh - 100px); }
}

.discord-viewer {
    display: grid;
    grid-template-columns: 240px 1fr;
    height: 100%;
    background: var(--bg-base);
    border-top: 1px solid var(--border);
    overflow: hidden;
}

@media (max-width: 700px) {
    .discord-viewer { grid-template-columns: 1fr; }
}

.discord-channels-panel {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.discord-channels-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.discord-channels-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 6px;
}

.dc-guild-header {
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 14px 8px 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.dc-category-header {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    padding: 12px 8px 4px;
    text-transform: uppercase;
}

.dc-channel-item {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin-bottom: 1px;
    text-align: left;
    transition: all var(--t-fast);
    font-family: inherit;
}

.dc-channel-item:hover { background: var(--bg-card); color: var(--text); }

.dc-channel-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.dc-channel-icon {
    font-size: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.dc-channel-item.active .dc-channel-icon { color: var(--accent); }

.dc-channel-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* Messages area */
.discord-messages-wrap {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-base);
}

.discord-channel-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: var(--bg-elevated);
}

.discord-channel-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.discord-refresh-info {
    font-size: 11px;
    color: var(--text-muted);
}

.discord-messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.dc-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 12px;
    text-align: center;
}

.dc-message {
    display: flex;
    gap: 14px;
    padding: 6px 10px;
    margin: 0 -10px 4px;
    border-radius: var(--radius-sm);
    transition: background var(--t-fast);
    position: relative;
}

.dc-message:hover { background: var(--bg-card-hover); }
.dc-message:hover .dc-message-actions { opacity: 1; }

.dc-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.dc-message-content { flex: 1; min-width: 0; }

.dc-message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}

.dc-message-author {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.dc-message-author.bot::after {
    content: 'BOT';
    background: var(--accent);
    color: #fff;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 6px;
    font-weight: 800;
    letter-spacing: 0.5px;
    vertical-align: 2px;
}

.dc-message-timestamp {
    color: var(--text-muted);
    font-size: 11px;
}

.dc-message-edited {
    color: var(--text-muted);
    font-size: 10px;
}

.dc-message-body {
    color: var(--text);
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-wrap;
    font-size: 14px;
}

.dc-message-body code {
    background: #1e1f22;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
}

.dc-message-body code.md-block {
    display: block;
    padding: 8px;
    margin: 4px 0;
    white-space: pre-wrap;
}

.dc-message-body a { color: var(--info); text-decoration: none; }
.dc-message-body a:hover { text-decoration: underline; }

.dc-message-actions {
    position: absolute;
    top: -10px;
    right: 16px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity var(--t-fast);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 2px;
    box-shadow: var(--shadow-md);
}

.dc-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--t-fast);
    padding: 0;
    font-size: 13px;
    font-family: inherit;
}

.dc-action-btn:hover { background: var(--bg-input); color: var(--text); }
.dc-action-btn.delete:hover { background: var(--danger-glow); color: var(--danger); }

.dc-attachment {
    display: inline-block;
    margin-top: 6px;
    max-width: 400px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.dc-attachment img { width: 100%; display: block; cursor: zoom-in; }

.dc-attachment-file {
    display: inline-block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--info);
    text-decoration: none;
    font-size: 13px;
    margin-top: 4px;
}

.dc-attachment-file:hover { background: var(--bg-card-hover); }

/* Embeds inside messages */
.dc-embed {
    background: #2b2d31;
    border-left: 4px solid #5865f2;
    border-radius: 4px;
    padding: 12px 14px;
    margin-top: 6px;
    max-width: 520px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.dc-embed > * { grid-column: 1; }
.dc-embed .dc-embed-thumbnail { grid-column: 2; grid-row: 1 / 5; }

.dc-embed-author {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.dc-embed-author img { width: 20px; height: 20px; border-radius: 50%; }

.dc-embed-title {
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.dc-embed-description {
    color: #dbdee1;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.dc-embed-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.dc-embed-field { grid-column: 1 / -1; }
.dc-embed-field.inline { grid-column: span 1; }

.dc-embed-field-name { font-weight: 600; font-size: 12px; color: #fff; margin-bottom: 2px; }
.dc-embed-field-value { font-size: 12px; color: #dbdee1; }

.dc-embed-image {
    grid-column: 1 / -1;
    max-width: 100%;
    border-radius: 4px;
    margin-top: 8px;
}

.dc-embed-thumbnail { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; }

.dc-embed-footer {
    grid-column: 1 / -1;
    color: #949ba4;
    font-size: 11px;
    margin-top: 8px;
}

/* Input area */
.discord-input-area {
    border-top: 1px solid var(--border);
    padding: 14px 20px;
    flex-shrink: 0;
    background: var(--bg-elevated);
}

.discord-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#discordInputBox {
    flex: 1;
    min-height: 42px;
    max-height: 200px;
    resize: none;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
}

#discordInputBox:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#discordInputBox:disabled { opacity: 0.5; cursor: not-allowed; }

#discordSendBtn { height: 42px; padding: 0 20px; }

.discord-input-hint {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 11px;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--accent);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 380px;
    z-index: 100;
    font-size: 13px;
    font-weight: 500;
}

.toast.show { transform: translateX(0); }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    #panelScreen { grid-template-columns: 1fr; }

    .mobile-menu-btn { display: block; }

    .sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        width: 260px;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }

    .content-header { padding: 16px 20px 16px 64px; }
    main { padding: 20px; }

    .preview-wrapper { position: static; }
}
