/* ============================================
   META INVEST — BRAIN DASHBOARD
   Quiet Luxury Dark Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap');

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

:root {
    /* Brand Colors */
    --bg-primary: #111111;
    --bg-secondary: #1A1A1A;
    --bg-card: #1E1E1E;
    --bg-card-hover: #252525;
    --bg-elevated: #2A2A2A;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --text-primary: #EDEDED;
    --text-secondary: #999999;
    --text-tertiary: #666666;

    --accent: #D16206;
    --accent-glow: rgba(209, 98, 6, 0.15);
    --accent-dim: rgba(209, 98, 6, 0.6);

    --green: #2DD4A8;
    --green-dim: rgba(45, 212, 168, 0.15);
    --red: #F87171;
    --red-dim: rgba(248, 113, 113, 0.15);
    --yellow: #FBBF24;
    --yellow-dim: rgba(251, 191, 36, 0.15);
    --blue: #60A5FA;
    --blue-dim: rgba(96, 165, 250, 0.15);

    /* Typography */
    --font-primary: 'Inter', 'Helvetica Neue', system-ui, sans-serif;
    --font-mono: 'Geist Mono', 'JetBrains Mono', 'SF Mono', monospace;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== HEADER ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.logo-mark svg {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.logo-text span {
    color: var(--accent);
}

.badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 100px;
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(209, 98, 6, 0.2);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s infinite;
}

.live-dot.offline {
    background: var(--red);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(45, 212, 168, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(45, 212, 168, 0); }
}

.clock {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

/* ===== MAIN GRID ===== */
.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto 1fr;
    gap: 16px;
    padding: 24px 32px;
    max-width: 1600px;
    margin: 0 auto;
}

/* ===== STATUS CARDS ROW ===== */
.status-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

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

.stat-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
}

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

.stat-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

.stat-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.stat-icon.green { background: var(--green-dim); }
.stat-icon.orange { background: var(--accent-glow); }
.stat-icon.blue { background: var(--blue-dim); }
.stat-icon.red { background: var(--red-dim); }
.stat-icon.yellow { background: var(--yellow-dim); }

/* ===== PANELS ===== */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color var(--transition-base);
}

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

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.01);
}

.panel-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title .icon {
    font-size: 15px;
}

.panel-count {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    background: var(--bg-elevated);
    padding: 2px 8px;
    border-radius: 100px;
}

.panel-body {
    padding: 0;
    flex: 1;
    overflow-y: auto;
    max-height: 420px;
}

.panel-body::-webkit-scrollbar {
    width: 4px;
}

.panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.panel-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* ===== LIST ITEMS ===== */
.list-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-fast);
    cursor: default;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.list-item a {
    color: inherit;
    text-decoration: none;
}

.item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.item-dot.green { background: var(--green); }
.item-dot.orange { background: var(--accent); }
.item-dot.red { background: var(--red); }
.item-dot.blue { background: var(--blue); }
.item-dot.yellow { background: var(--yellow); }
.item-dot.gray { background: var(--text-tertiary); }

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

.item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.item-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 100px;
    flex-shrink: 0;
    text-transform: uppercase;
}

.badge-published { background: var(--green-dim); color: var(--green); }
.badge-pending { background: var(--yellow-dim); color: var(--yellow); }
.badge-cancelled { background: var(--red-dim); color: var(--red); }
.badge-rewriting { background: var(--blue-dim); color: var(--blue); }
.badge-high { background: var(--red-dim); color: var(--red); }
.badge-medium { background: var(--yellow-dim); color: var(--yellow); }
.badge-low { background: var(--green-dim); color: var(--green); }
.badge-todo { background: var(--blue-dim); color: var(--blue); }
.badge-inprogress { background: var(--accent-glow); color: var(--accent); }

/* ===== ACTIVITY FEED ===== */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-fast);
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.activity-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
    min-width: 64px;
    padding-top: 1px;
}

.activity-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.activity-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.activity-text strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.empty-state .icon {
    font-size: 28px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width var(--transition-slow);
}

.progress-fill.green { background: var(--green); }
.progress-fill.orange { background: var(--accent); }
.progress-fill.red { background: var(--red); }

/* ===== LOADING ANIMATION ===== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, rgba(255,255,255,0.05) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
    height: 16px;
    margin: 4px 0;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .dashboard {
        grid-template-columns: 1fr 1fr;
        padding: 16px;
    }
    .status-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 16px;
        flex-wrap: wrap;
        gap: 12px;
    }
    .dashboard {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    .status-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .stat-value {
        font-size: 22px;
    }
}

/* ===== FADE-IN ANIMATION ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.panel { animation: fadeIn 0.5s ease forwards; }
.panel:nth-child(2) { animation-delay: 0.05s; }
.panel:nth-child(3) { animation-delay: 0.1s; }
.panel:nth-child(4) { animation-delay: 0.15s; }

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 24px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border);
    letter-spacing: 0.5px;
}

.footer a {
    color: var(--accent-dim);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer a:hover {
    color: var(--accent);
}
