/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.5;
}

/* Login Page Styles */
.login-body {
    background: linear-gradient(135deg, #10b981 0%, #065f46 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-form h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-weight: 600;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #10b981;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #10b981 0%, #065f46 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-btn:hover {
    transform: translateY(-2px);
}

.error-message {
    color: #e74c3c;
    text-align: center;
    margin-top: 15px;
    display: none;
}

/* Header Styles */
.dashboard-header {
    background: white;
    border-bottom: 2px solid #e5e7eb;
    padding: 16px 0;
    margin-bottom: 32px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.system-logo {
    height: 40px;
    width: auto;
}

.system-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

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

.current-user {
    font-weight: 500;
    color: #6b7280;
}

.logout-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: #dc2626;
}

/* Dashboard Styles */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 24px;
}

/* Leaderboard Section */
.leaderboard-section {
    margin-bottom: 48px;
}

.leaderboard-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 18px;
    font-weight: 500;
    color: #1a1a1a;
}

.points-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.points-label {
    font-size: 16px;
    color: #6b7280;
}

.points-badge {
    background: #10b981;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
}

.trophy-icon {
    display: flex;
    align-items: center;
}

.trophy-image {
    width: 40px;
    height: 40px;
}

/* Performance Section */
.performance-section {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 20px 24px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.team-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 14px;
}

.date-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6b7280;
    font-size: 14px;
}

.styled-week-header {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.week-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}

.week-number {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.month-year {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.9;
    line-height: 1.2;
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
    position: relative;
}

.date-selector:hover {
    background-color: #f3f4f6;
}

.week-nav-btn {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #374151;
    transition: all 0.2s;
}

.week-nav-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.week-nav-btn:active {
    transform: scale(0.95);
}

.team-avatars {
    display: flex;
    align-items: center;
    gap: -8px;
}

.team-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    margin-left: -8px;
}

.team-avatar:first-child {
    margin-left: 0;
}

.additional-members {
    background: #f3f4f6;
    color: #6b7280;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

#week-picker {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    padding: 8px 12px;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.members-btn {
    background: white;
    border: 2px solid #10b981;
    color: #10b981;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.members-btn:hover {
    background: #10b981;
    color: white;
}

.members-icon {
    font-size: 16px;
}

/* Performance Table */
.performance-table {
    margin-bottom: 32px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-header {
    display: grid;
    grid-template-columns: 80px 1fr 140px 130px 130px 100px;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.table-row {
    display: grid;
    grid-template-columns: 80px 1fr 140px 130px 130px 100px;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
    align-items: center;
}

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

.row-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.col-position {
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.col-date, .col-positive, .col-negative, .col-total {
    font-weight: 500;
    text-align: center;
}

.col-date {
    font-size: 12px;
    color: #6b7280;
}

.col-total.positive {
    color: #10b981;
    font-weight: 600;
}

.col-total.negative {
    color: #ef4444;
    font-weight: 600;
}

.clickable-name {
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.clickable-name:hover {
    background-color: #f3f4f6;
    border-radius: 6px;
    padding: 4px;
    margin: -4px;
}

.clickable-name:hover::after {
    content: "Click to select user";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #374151;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0.9;
}

/* Only show tooltip for admin users - we'll control this via JavaScript */
body:not(.admin-user) .clickable-name:hover::after {
    display: none;
}

.table-row.current-user {
    background-color: #eff6ff;
    border-left: 4px solid #3b82f6;
}

.table-row.selected-user {
    background-color: #f0fdf4;
    border-left: 4px solid #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
    transform: translateX(2px);
    transition: all 0.3s ease;
}

.you-badge {
    background: #3b82f6;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
}

/* Admin Controls */
.admin-controls {
    margin-bottom: 24px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.user-selector, .week-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.week-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-week-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    min-width: 200px;
}

.admin-week-text {
    flex: 1;
    font-weight: 500;
    color: #374151;
}

.calendar-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.calendar-btn:hover {
    background-color: #e5e7eb;
}

#admin-week-picker {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    padding: 8px 12px;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-selector label, .week-selector label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.user-selector select, .week-selector select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.user-selector select:focus, .week-selector select:focus {
    outline: none;
    border-color: #3b82f6;
}

.admin-actions {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.reset-btn, .save-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-btn {
    background: #ef4444;
    color: white;
}

.reset-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.save-btn {
    background: #10b981;
    color: white;
}

.save-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.metric-card {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.metric-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.metric-card.highlighted {
    border-color: #3b82f6;
    background: #eff6ff;
}

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

.metric-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.metric-description {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

.metric-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s;
}

.metric-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.metric-btn.minus {
    color: #ef4444;
}

.metric-btn.plus {
    color: #10b981;
}

.metric-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: #1a1a1a;
    padding: 0 8px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    color: #1a1a1a;
    font-size: 20px;
    font-weight: 600;
}

.close {
    color: #9ca3af;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #374151;
}

.modal-body {
    padding: 24px;
}

.add-member-section, .member-list-section {
    margin-bottom: 32px;
}

.add-member-section h3, .member-list-section h3 {
    margin-bottom: 16px;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
}

.add-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 8px;
}

.add-btn:hover {
    background: #059669;
}

.cancel-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.cancel-btn:hover {
    background: #4b5563;
}

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

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

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

.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #6b7280;
}

.member-details {
    display: flex;
    flex-direction: column;
}

.member-name {
    font-weight: 500;
    color: #1a1a1a;
}

.member-username {
    font-size: 12px;
    color: #6b7280;
}

.member-role {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.member-role.admin {
    background: #fee2e2;
    color: #dc2626;
}

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

.edit-btn, .disable-btn, .delete-btn {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid;
}

.edit-btn {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #3b82f6;
}

.edit-btn:hover {
    background: #3b82f6;
    color: white;
}

.clickable-member {
    cursor: pointer;
    transition: all 0.2s;
}

.clickable-member:hover {
    background-color: #f8f9fa;
    border-radius: 6px;
}

.disable-btn {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #f59e0b;
}

.disable-btn:hover {
    background: #fbbf24;
    color: white;
}

.delete-btn {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #ef4444;
}

.delete-btn:hover {
    background: #ef4444;
    color: white;
}

.disabled {
    opacity: 0.6;
}

/* Avatar Upload Styles */
.avatar-preview {
    margin-top: 12px;
    text-align: center;
}

.avatar-preview img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

/* Performance Breakdown Styles (Member View) */
.performance-breakdown {
    max-width: 100%;
}

.performance-breakdown h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 24px;
}

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

.back-to-your-breakdown {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.back-to-your-breakdown:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.breakdown-category {
    margin-bottom: 32px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.breakdown-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid;
    transition: all 0.2s;
}

.breakdown-item.positive {
    background: #f0fdf4;
    border-left-color: #10b981;
}

.breakdown-item.negative {
    background: #fef2f2;
    border-left-color: #ef4444;
}

.breakdown-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.breakdown-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.breakdown-label {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
}

.breakdown-description {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

.breakdown-value {
    font-size: 16px;
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

.breakdown-item.positive .breakdown-value {
    color: #10b981;
}

.breakdown-item.negative .breakdown-value {
    color: #ef4444;
}

.no-activity {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 16px 0;
    border-top: 1px solid #e5e7eb;
}

.page-btn {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
}

.page-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.page-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.page-btn:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 20px 16px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 16px;
        padding: 0 16px;
    }
    
    .leaderboard-card {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .board-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .table-header, .table-row {
        grid-template-columns: 50px 1fr 80px 70px 70px 50px;
        font-size: 11px;
        gap: 8px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .metric-card {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .member-item {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .member-info {
        justify-content: center;
    }
    
    .breakdown-item {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .breakdown-value {
        text-align: center;
    }
    
    .metric-card {
        grid-column: 1 / -1;
    }
    
    .metric-info {
        text-align: center;
        margin-bottom: 12px;
    }
    
    .admin-controls {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .admin-actions {
        justify-content: center;
        margin-left: 0;
    }
    
    .breakdown-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .breakdown-header h3 {
        text-align: center;
        margin-bottom: 0;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .page-btn {
        min-width: 36px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Settings Button Styles */
.settings-btn {
    background: white;
    border: 2px solid #059669;
    color: #059669;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.settings-btn:hover {
    background: #059669;
    color: white;
}

.settings-icon {
    font-size: 16px;
}

/* Better spacing for board header buttons */
.board-header .members-btn,
.board-header .settings-btn {
    margin-left: 12px;
}

.board-header .settings-btn {
    margin-left: 8px;
}

/* Metrics Container Spacing */
#metrics-container {
    margin-top: 32px;
    padding: 24px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Tab Navigation Styles */
.tab-navigation {
    background: white;
    border-radius: 12px;
    padding: 8px;
    margin: 24px 0;
    display: flex;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
}

.tab-btn.active {
    background: #10b981;
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #f3f4f6;
    color: #374151;
}

.tab-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-content .leaderboard-section {
    padding: 0;
    margin-bottom: 24px;
}

.tab-content .performance-section {
    padding: 0;
    margin-top: 24px;
}

.tab-content .performance-section .section-title {
    background: #f8f9fa;
    margin: 0 -24px 24px -24px;
    padding: 20px 24px;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #e5e7eb;
}

.tab-content .rank-section {
    padding: 0;
}

.tab-content .rank-section .section-title {
    background: #f8f9fa;
    margin: 0 -24px 24px -24px;
    padding: 20px 24px;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #e5e7eb;
}

/* Discord Button Styles */
.discord-btn {
    background: #059669;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-left: 8px;
}

.discord-btn:hover {
    background: #047857;
}

/* Settings Modal Styles */
.settings-section {
    margin-bottom: 24px;
}

.settings-section h3 {
    margin-bottom: 16px;
    color: #374151;
    font-weight: 600;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
}

.image-preview {
    margin-top: 8px;
    text-align: center;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

/* Rank Management Styles */
.rank-section {
    margin-bottom: 24px;
}

.rank-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.date-range-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-range-selector label {
    font-weight: 500;
    color: #374151;
}

.date-range-selector select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.rank-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.rank-table .table-header {
    background: #f9fafb;
    display: grid;
    grid-template-columns: 80px 1fr 120px 120px 150px;
    gap: 16px;
    padding: 16px;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.rank-table .table-row {
    display: grid;
    grid-template-columns: 80px 1fr 120px 120px 150px;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    align-items: center;
    transition: background 0.2s;
}

.rank-table .table-row:hover {
    background: #f9fafb;
}

.rank-table .table-row:last-child {
    border-bottom: none;
}

.col-total-points {
    font-weight: 600;
    color: #10b981;
}

.col-title {
    font-weight: 500;
    color: #059669;
}

/* Rank Input Controls */
.rank-input {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.points-input {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

/* Show settings button only for admins */
body:not(.admin-user) .settings-btn {
    display: none;
}

/* Responsive adjustments for new elements */
@media (max-width: 768px) {
    .board-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .settings-btn,
    .members-btn {
        margin-left: 0;
        margin-top: 8px;
    }
    
    .tab-navigation {
        flex-direction: column;
        gap: 4px;
    }
    
    .rank-table .table-header,
    .rank-table .table-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .rank-controls {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
}