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

html, body {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

body {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: transparent;
    padding: 0;
    margin: 0;
    color: #333;
    min-height: 100%;
}

:root {
    --primary: #D84A15;
    --primary-light: #FB5B21;
    --success: #28a745;
    --info: #4facfe;
    --warning: #ffc107;
    --danger: #dc3545;
    --dark: #111;
    --card-bg: #ffffff;
    --border: rgba(0,0,0,0.06);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --gradient-primary: linear-gradient(135deg, #D84A15, #FB5B21);
    --gradient-success: linear-gradient(135deg, #43e97b, #38f9d7);
    --gradient-info: linear-gradient(135deg, #4facfe, #00f2fe);
    --gradient-warning: linear-gradient(135deg, #f093fb, #f5576c);
}

.dashboard-container {
    padding: 0;
    animation: fadeIn 0.4s ease;
    min-height: 100%;
    overflow-x: hidden;
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(216,74,21,0.05) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.stat-content {
    position: relative;
    z-index: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.stat-label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-trend {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend.positive { color: var(--success); }
.stat-trend.negative { color: var(--danger); }

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to right, rgba(216,74,21,0.02), transparent);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.card-title i {
    color: var(--primary);
    font-size: 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }

@media (max-width: 991px) {
    .col-8, .col-4, .col-6 { grid-column: span 12; }
}

/* Tournament Selector */
.tournament-selector {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(216,74,21,0.3) transparent;
}

.tournament-selector::-webkit-scrollbar {
    height: 6px;
}

.tournament-selector::-webkit-scrollbar-track {
    background: transparent;
}

.tournament-selector::-webkit-scrollbar-thumb {
    background: rgba(216,74,21,0.3);
    border-radius: 10px;
}

.tournament-chip {
    flex-shrink: 0;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tournament-chip:hover {
    border-color: rgba(216,74,21,0.3);
    background: rgba(216,74,21,0.04);
}

.tournament-chip.active {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(216,74,21,0.3);
}

.tournament-chip .badge {
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tournament-chip.active .badge {
    background: rgba(255,255,255,0.25);
}

.tournament-chip:not(.active) .badge.completed {
    background: rgba(40,167,69,0.1);
    color: var(--success);
}

.tournament-chip:not(.active) .badge.upcoming {
    background: rgba(216,74,21,0.1);
    color: var(--primary);
}

.tournament-chip:not(.active) .badge.draft {
    background: rgba(108,117,125,0.1);
    color: #6c757d;
}

/* Activity List */
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

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

.activity-item:hover {
    background: rgba(216,74,21,0.02);
    margin: 0 -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
    color: #fff;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.activity-meta {
    font-size: 0.8rem;
    color: #888;
}

.activity-time {
    font-size: 0.75rem;
    color: #999;
    flex-shrink: 0;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.quick-action-btn {
    padding: 1.25rem 1rem;
    border-radius: 14px;
    border: 2px solid var(--border);
    background: var(--card-bg);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    background: rgba(216,74,21,0.04);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(216,74,21,0.15);
}

.quick-action-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.quick-action-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #999;
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.2;
    display: block;
}

.empty-state h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #666;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Chart Container */
.chart-container {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(216,74,21,0.02), rgba(251,91,33,0.02));
    border-radius: 12px;
    color: #999;
    font-style: italic;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success { background: rgba(40,167,69,0.1); color: var(--success); }
.badge-info { background: rgba(79,172,254,0.1); color: var(--info); }
.badge-warning { background: rgba(255,193,7,0.1); color: var(--warning); }
.badge-danger { background: rgba(220,53,69,0.1); color: var(--danger); }
.badge-primary { background: rgba(216,74,21,0.1); color: var(--primary); }

/* Button */
.btn {
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(216,74,21,0.25);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(216,74,21,0.35);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: #666;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(216,74,21,0.04);
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

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

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-card {
    height: 120px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Hide any modal/dialog elements that might leak from parent */
.modal, .modal-backdrop, .modal-dialog, .modal-content, .modal-header, .modal-body, .modal-footer,
[role="dialog"], [aria-modal="true"], [class*="modal"], [id*="modal"], [id*="Modal"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body > *:not(.dashboard-container) {
    display: none !important;
}

body > p, body > div:not(.dashboard-container), body > span {
    display: none !important;
}
