/* ========================================
   BIFULL ENTERPRISE DASHBOARD V2
   Theme: Dark with Blue/Yellow Bifullcraft accents
   ======================================== */

:root {
    /* Colors */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-card: #1c2128;

    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;

    --accent-gold: #ffd700;
    --accent-blue: #00a8ff;
    --accent-gradient: linear-gradient(135deg, #ffd700, #00a8ff);

    --border-color: #30363d;
    --border-light: #21262d;

    --success: #3fb950;
    --warning: #d29922;
    --error: #f85149;
    --info: #58a6ff;

    /* 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 8px 24px rgba(0, 0, 0, 0.5);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;

    /* Spacing */
    --sidebar-width: 240px;
}

/* ========================================
   BASE STYLES
   ======================================== */

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

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
}

/* ========================================
   LOGIN PAGE
   ======================================== */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at top, rgba(255, 215, 0, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(0, 168, 255, 0.05) 0%, transparent 50%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header .logo {
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: var(--error);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

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

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent-gradient);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 168, 255, 0.4);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.login-footer {
    margin-top: 32px;
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========================================
   DASHBOARD LAYOUT
   ======================================== */

.dashboard-page {
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

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

.nav-item.active {
    background: rgba(0, 168, 255, 0.1);
    color: var(--accent-blue);
}

.nav-badge {
    position: absolute;
    right: 12px;
    background: var(--error);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #000;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

.logout-btn {
    padding: 8px;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: var(--bg-tertiary);
    color: var(--error);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    padding-bottom: 60px;
    background: var(--bg-primary);
    height: 100vh;
}

.view {
    display: none;
    min-height: min-content;
}

.view.active {
    display: block;
    padding-bottom: 40px;
}

.view-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.view-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 4px;
}

.view-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.header-time {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 16px;
    background: var(--bg-card);
    border-radius: 8px;
}

/* ========================================
   STATS CARDS
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stats-grid-6 {
    grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 1400px) {
    .stats-grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.completed {
    background: rgba(63, 185, 80, 0.15);
    color: var(--success);
}

.stat-icon.in-progress {
    background: rgba(0, 168, 255, 0.15);
    color: var(--accent-blue);
}

.stat-icon.pending {
    background: rgba(210, 153, 34, 0.15);
    color: var(--warning);
}

.stat-icon.total {
    background: rgba(88, 166, 255, 0.15);
    color: var(--info);
}

.stat-icon.server {
    background: rgba(0, 168, 255, 0.15);
    color: var(--accent-blue);
}

.stat-icon.players {
    background: rgba(88, 166, 255, 0.15);
    color: var(--info);
}

.stat-icon.revenue {
    background: rgba(255, 215, 0, 0.15);
    color: var(--accent-gold);
}

.stat-icon.budget {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.stat-icon.monthly {
    background: rgba(0, 168, 255, 0.15);
    color: var(--accent-blue);
}

.stat-icon.weekly {
    background: rgba(88, 166, 255, 0.15);
    color: var(--info);
}

.stat-icon.sales {
    background: rgba(244, 114, 182, 0.15);
    color: #f472b6;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ========================================
   CARDS
   ======================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.finance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.card-highlight {
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(0, 168, 255, 0.15);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.card-content {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-warning {
    background: rgba(210, 153, 34, 0.2);
    color: var(--warning);
}

.budget-remaining {
    font-size: 13px;
    color: var(--success);
    font-weight: 500;
}

/* ========================================
   ACTIVITY LIST
   ======================================== */

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-indicator.completed {
    background: var(--success);
}

.activity-indicator.in_progress {
    background: var(--accent-blue);
}

.activity-indicator.pending {
    background: var(--warning);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.activity-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ========================================
   CEO ACTIONS
   ======================================== */

.action-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 3px solid var(--warning);
}

.action-item.high {
    border-left-color: var(--error);
}

.action-content {
    flex: 1;
}

.action-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.action-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.actions-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--warning);
}

.action-card.high {
    border-left-color: var(--error);
}

.action-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.action-card-title {
    font-size: 16px;
    font-weight: 600;
}

.action-priority {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.action-priority.high {
    background: rgba(248, 81, 73, 0.15);
    color: var(--error);
}

.action-priority.medium {
    background: rgba(210, 153, 34, 0.15);
    color: var(--warning);
}

.action-card-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.action-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-agent {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.action-agent-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #000;
}

.action-deadline {
    font-size: 12px;
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.btn-approve {
    background: var(--success);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.btn-reject {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

/* ========================================
   MONITORING
   ======================================== */

.monitoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.monitor-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.monitor-card.large {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .monitor-card.large {
        grid-column: span 1;
    }
}

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

.monitor-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.monitor-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.online {
    background: rgba(63, 185, 80, 0.15);
    color: var(--success);
}

.status-badge.offline {
    background: rgba(248, 81, 73, 0.15);
    color: var(--error);
}

.player-display {
    text-align: center;
    margin-bottom: 20px;
}

.player-count {
    font-size: 48px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.player-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.server-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.detail-item {
    text-align: center;
}

.detail-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.detail-value {
    font-size: 13px;
    font-weight: 500;
}

.gauge-container {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.gauge {
    width: 120px;
    height: 60px;
}

.gauge-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 8;
    stroke-linecap: round;
}

.gauge-fill {
    fill: none;
    stroke: var(--accent-blue);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 110;
    stroke-dashoffset: 110;
    transition: stroke-dashoffset 0.5s ease;
}

.monitor-details {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.monitor-content.centered {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
}

.uptime-display {
    font-size: 16px;
    font-weight: 500;
    color: var(--accent-blue);
}

/* ========================================
   BUDGET & FINANCES
   ======================================== */

.budget-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.budget-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.budget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.budget-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.budget-color {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.budget-amounts {
    font-size: 12px;
    color: var(--text-secondary);
}

.budget-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.budget-fill {
    height: 100%;
    border-radius: 3px;
    transition: width var(--transition-normal);
}

.projections-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.projection-item {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.projection-item.highlight {
    background: rgba(0, 168, 255, 0.1);
    border: 1px solid rgba(0, 168, 255, 0.3);
}

.projection-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.projection-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-gold);
}

/* ========================================
   ORGANIGRAMME
   ======================================== */

.org-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    padding-bottom: 60px;
    min-height: min-content;
    overflow: visible;
    width: 100%;
}

.org-level {
    display: flex;
    justify-content: center;
}

.org-level.org-agents {
    width: 100%;
}

.org-connector {
    width: 2px;
    height: 40px;
    background: var(--border-color);
    margin: 10px 0;
}

.org-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    width: 250px;
}

.org-card.ceo {
    border-color: var(--accent-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2), 0 0 40px rgba(0, 168, 255, 0.1);
}

.org-card-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #000;
    margin: 0 auto 12px;
}

.org-card-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.org-card-role {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.org-card-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.org-card-type.human {
    background: rgba(255, 215, 0, 0.15);
    color: var(--accent-gold);
}

.org-card-type.ai {
    background: rgba(0, 168, 255, 0.15);
    color: var(--accent-blue);
}

.org-agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 100%;
    padding: 0 20px;
}

.org-agent-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.org-agent-card:hover {
    transform: translateY(-2px);
}

.org-agent-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #000;
    margin: 0 auto 12px;
}

.org-agent-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.org-agent-role {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.org-agent-dept {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    background: var(--bg-tertiary);
}

.org-responsibilities {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    text-align: left;
}

.org-responsibilities ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.org-responsibilities li {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 2px 0;
    padding-left: 12px;
    position: relative;
}

.org-responsibilities li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
}

.org-agent-card.ai-subagent {
    border-style: dashed;
    opacity: 0.95;
}

.org-agent-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(0, 168, 255, 0.15);
    color: var(--accent-blue);
    margin-top: 6px;
}

.org-agent-command {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    background: var(--bg-tertiary);
    color: var(--accent-gold);
    margin-top: 8px;
    border: 1px solid var(--border-color);
}

/* ========================================
   TEAM PROGRESS
   ======================================== */

.team-progress-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.team-progress-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.team-color {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.team-stats {
    font-size: 12px;
    color: var(--text-secondary);
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

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

/* ========================================
   FILTERS
   ======================================== */

.filters-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-group select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    min-width: 140px;
}

/* ========================================
   TODOS LIST
   ======================================== */

.todos-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.todos-list {
    padding: 8px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    transition: background var(--transition-fast);
    cursor: pointer;
}

.todo-item:hover {
    background: var(--bg-tertiary);
}

.todo-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.todo-status-indicator.completed {
    background: var(--success);
}

.todo-status-indicator.in_progress {
    background: var(--accent-blue);
}

.todo-status-indicator.pending {
    background: var(--warning);
}

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

.todo-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.todo-item.completed .todo-title {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.todo-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.todo-team {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.todo-priority {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.todo-priority.high {
    background: rgba(248, 81, 73, 0.15);
    color: var(--error);
}

.todo-priority.medium {
    background: rgba(210, 153, 34, 0.15);
    color: var(--warning);
}

.todo-priority.low {
    background: rgba(88, 166, 255, 0.15);
    color: var(--info);
}

.todo-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.todo-item:hover .todo-actions {
    opacity: 1;
}

.todo-action-btn {
    padding: 6px;
    border-radius: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.todo-action-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.todo-action-btn.delete:hover {
    color: var(--error);
}

/* ========================================
   TEAMS VIEW
   ======================================== */

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.team-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.team-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-card-title h3 {
    font-size: 16px;
    font-weight: 600;
}

.team-card-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-tertiary);
}

.team-card-content {
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.team-todo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.team-todo-item:last-child {
    margin-bottom: 0;
}

.team-todo-item:hover {
    background: var(--bg-tertiary);
}

.team-todo-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.team-todo-title {
    flex: 1;
    font-size: 13px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* ========================================
   MODAL
   ======================================== */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

#todo-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

/* ========================================
   SCROLLBAR
   ======================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        z-index: 100;
        transition: left var(--transition-normal);
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   LEADERBOARD STYLES
   ======================================== */

.stat-icon.gemmes {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
}

.stat-icon.essences {
    background: linear-gradient(135deg, #00d4ff 0%, #0088ff 100%);
}

.stat-icon.money {
    background: linear-gradient(135deg, #00d4ff 0%, #0088ff 100%);
}

.stat-icon.time {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
}

.sort-controls select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

.player-name {
    font-weight: 500;
}

.rank-cell {
    font-weight: 600;
    text-align: center;
    font-size: 1.1rem;
}

.currency.gemmes {
    color: #ffd700;
    font-weight: 600;
}

.currency.essences {
    color: #00d4ff;
    font-weight: 600;
}

.money {
    color: #00d4ff;
    font-weight: 500;
}

.last-seen {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

tr.rank-1 {
    background: rgba(255, 215, 0, 0.1);
}

tr.rank-2 {
    background: rgba(192, 192, 192, 0.1);
}

tr.rank-3 {
    background: rgba(205, 127, 50, 0.1);
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

/* ========================================
   LOGO STYLES
   ======================================== */

.sidebar-header .logo img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
}

.login-header .logo img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: contain;
}

/* ========================================
   VIDEOS SECTION
   ======================================== */

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.video-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.video-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-gold);
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.2);
}

.video-preview {
    width: 100%;
    aspect-ratio: 9/16;
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-preview .play-icon {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(255, 215, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #000;
    pointer-events: none;
}

.video-info {
    padding: 15px;
}

.video-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.badge-fact { background: #4CAF50; color: #fff; }
.badge-dilemma { background: #FF9800; color: #fff; }
.badge-story { background: #2196F3; color: #fff; }
.badge-guide { background: #F44336; color: #fff; }
.badge-lore { background: #9C27B0; color: #fff; }

.video-title {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.4;
}

.video-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.video-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.video-actions .btn {
    padding: 8px 12px;
    font-size: 0.85rem;
    flex: 1;
}

.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-state .spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent-gold);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-videos {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-videos svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.stat-icon.videos {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.stat-icon.size {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

.stat-icon.today {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
}

.stat-icon.types {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
}
