:root {
    --bg-darker: #040508;
    --bg-dark: #080a0f;
    --bg-lighter: #11141d;
    --bg-accent: #1a1e2b;

    --accent: #ff3e3e;
    /* Toronto Red */
    --accent-glow: rgba(255, 62, 62, 0.3);
    --accent-dim: rgba(255, 62, 62, 0.1);

    --success: #00ffa3;
    --warning: #ffcc00;
    --danger: #ff4d4d;
    --danger-glow: rgba(255, 77, 77, 0.2);

    --text-main: #ffffff;
    --text-dim: #94a3b8;
    --text-muted: #64748b;

    --border: rgba(255, 255, 255, 0.05);
    --border-bright: rgba(255, 255, 255, 0.1);

    --glass: rgba(8, 10, 15, 0.8);
    --glass-bright: rgba(30, 41, 59, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-darker);
    background-image:
        radial-gradient(circle at 50% 0%, rgba(255, 62, 62, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(255, 62, 62, 0.02) 0%, transparent 40%);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    font-size: 14px;
}

.command-center {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* --- Top Bar --- */
.top-bar {
    height: 64px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-bright);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.logo-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 1px;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 255, 163, 0.05);
    padding: 6px 12px;
    border-radius: 100px;
    border: 1px solid rgba(0, 255, 163, 0.1);
    margin-left: 20px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s infinite;
}

.status-text {
    font-size: 10px;
    font-weight: 700;
    color: var(--success);
    letter-spacing: 1px;
}

.top-bar-right {
    display: flex;
    gap: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-lighter);
    border: 1px solid var(--border-bright);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 18px;
}

.btn-icon:hover {
    background: var(--bg-accent);
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 62, 62, 0.1);
}

/* --- Main Layout --- */
.main-grid {
    display: grid;
    grid-template-columns: 240px 1fr 300px;
    flex: 1;
    overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
    background: var(--bg-dark);
    border-right: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    overflow-y: auto;
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.stat-mini {
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stat-label {
    color: var(--text-dim);
    font-size: 12px;
}

.stat-value {
    color: var(--text-main);
    font-weight: 700;
    font-size: 16px;
}

.alert-stat {
    border-color: rgba(255, 77, 77, 0.2);
    background: rgba(255, 77, 77, 0.05);
}

.alert-stat .stat-value {
    color: var(--danger);
}

.accounts-list-mini {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-item-mini {
    padding: 10px 14px;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.account-item-mini:hover,
.account-item-mini.active {
    background: var(--bg-accent);
    border-color: var(--accent);
    transform: translateX(4px);
}

.account-name-mini {
    font-weight: 600;
    font-size: 13px;
}

.account-platform-mini {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* --- Main Content --- */
.main-content {
    background: var(--bg-darker);
    display: flex;
    flex-direction: column;
    position: relative;
}

.command-bar {
    padding: 16px 32px;
    background: rgba(10, 13, 20, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.command-tabs {
    display: flex;
    background: var(--bg-lighter);
    padding: 4px;
    border-radius: 100px;
    border: 1px solid var(--border);
}

.tab-btn {
    padding: 8px 20px;
    border-radius: 100px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.tab-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

.command-search {
    display: flex;
    gap: 12px;
    flex: 1;
    max-width: 400px;
}

.search-input {
    flex: 1;
    background: var(--bg-dark);
    border: 1px solid var(--border-bright);
    border-radius: 100px;
    padding: 8px 20px;
    color: var(--text-main);
    font-size: 13px;
    transition: all 0.2s;
}

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

.filter-select-mini {
    background: var(--bg-dark);
    border: 1px solid var(--border-bright);
    border-radius: 100px;
    padding: 0 16px;
    color: var(--text-dim);
    font-size: 12px;
    cursor: pointer;
}

.tab-content {
    display: none;
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.tab-content.active {
    display: block;
}

/* --- Feed Items --- */
.feed-container {
    display: grid;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.feed-item {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.feed-item:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    background: var(--bg-lighter);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.feed-item.flagged {
    border-left: 4px solid var(--danger);
    background: linear-gradient(to right, var(--danger-glow), transparent);
}

.feed-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.feed-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feed-account {
    font-weight: 700;
    color: var(--accent);
    font-size: 15px;
}

.feed-platform {
    font-size: 10px;
    font-weight: 800;
    background: var(--bg-accent);
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.feed-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 24px;
}

.feed-metrics {
    display: flex;
    gap: 24px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-item span:first-child {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.flag-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    padding: 6px 12px;
    background: var(--danger);
    color: white;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

/* --- Activity Sidebar --- */
.activity-sidebar {
    background: var(--bg-dark);
    border-left: 1px solid var(--border);
    padding: 24px;
    overflow-y: auto;
}

.activity-item {
    padding: 16px;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    position: relative;
}

.activity-item.new {
    border-left: 2px solid var(--accent);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- Modals & Glass --- */
.modal {
    background: rgba(5, 7, 10, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--accent);
    box-shadow: 0 0 50px rgba(255, 62, 62, 0.1);
    border-radius: 24px;
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 24px;
}

.modal-form {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group select {
    background: var(--bg-lighter);
    border-radius: 12px;
    border: 1px solid var(--border-bright);
    color: white;
    padding: 12px;
    width: 100%;
}

.btn-primary {
    background: var(--accent);
    border-radius: 12px;
    height: 48px;
    font-size: 14px;
    width: 100%;
    color: white;
    font-weight: 700;
    cursor: pointer;
    border: none;
    box-shadow: 0 10px 20px rgba(255, 62, 62, 0.15);
}

/* --- Responsive & Utilities --- */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(0, 255, 163, 0.4);
    }

    70% {
        transform: scale(1.1);
        opacity: 0.8;
        box-shadow: 0 0 0 10px rgba(0, 255, 163, 0);
    }

    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(0, 255, 163, 0);
    }
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-bright);
    border-radius: 10px;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: var(--text-dim);
    font-style: italic;
}

/* Config Tab Overhaul */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.config-item {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}

.config-item:hover {
    border-color: var(--accent);
}

.config-item label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.config-input {
    width: 100%;
    background: var(--bg-lighter);
    border: 1px solid var(--border-bright);
    border-radius: 10px;
    padding: 10px;
    color: white;
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 200px 1fr;
    }

    .activity-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }
}