/* ==================== RESET & VARIABLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2ecc71;
    --secondary-color: #27ae60;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --purple-color: #9b59b6;
    --blue-color: #3498db;
    --text-color: #333;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: var(--text-color);
}

.page { display: none; }
.page.active { display: block; }

/* ==================== LOGIN ==================== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease;
}

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

.logo { text-align: center; margin-bottom: 30px; }

.logo-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 15px;
    border-radius: 50%;
    background: white;
    padding: 5px;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.logo h1 {
    color: var(--dark-color);
    font-size: 32px;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.logo p { color: #7f8c8d; font-size: 14px; }

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
}

.input-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.login-info {
    text-align: center;
    margin-top: 20px;
    color: #7f8c8d;
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--dark-color);
}

.nav-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 50%;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 22px;
    color: var(--dark-color);
    cursor: pointer;
    padding: 5px 10px;
}

.nav-menu {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 8px 14px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-btn:hover { background: var(--light-color); }
.nav-btn.active { background: var(--primary-color); color: white; }

/* ==================== CONTAINER ==================== */
.container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.tab-content { display: none; animation: fadeIn 0.3s; }
.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.header-section h2 { color: white; font-size: 24px; }

/* ==================== BUTTONS ==================== */
.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary { background: #95a5a6; color: white; }
.btn-secondary:hover { background: #7f8c8d; }

.btn-sm { padding: 10px 16px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }

.btn-link {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s;
}

.btn-link:hover { background: var(--light-color); }

/* ==================== DASHBOARD - STAT CARDS (DRAG & DROP + CLICKABLE) ==================== */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    cursor: grab;
    position: relative;
    user-select: none;
    border: 2px solid transparent;
}

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

.stat-card:active {
    cursor: grabbing;
}

/* Drag handle indicator */
.stat-card::before {
    content: '\f58e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 11px;
    color: #cbd5e0;
    opacity: 0;
    transition: opacity 0.2s;
}

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

.stat-card.dragging {
    opacity: 0.4;
    transform: scale(0.95);
    cursor: grabbing;
}

.stat-card.drag-over {
    border: 2px dashed var(--warning-color) !important;
    background: #fff8e1 !important;
    transform: scale(1.03);
}

@keyframes dropPulse {
    0% { background: white; }
    50% { background: #e8f5e9; }
    100% { background: white; }
}

.stat-card.drop-success {
    animation: dropPulse 0.5s ease;
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-content { flex: 1; }

.stat-number {
    font-size: 26px;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-text {
    font-size: 12px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ==================== DASHBOARD SECTIONS ==================== */
.dashboard-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h3 {
    color: var(--dark-color);
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header h3 i { color: var(--primary-color); }

.upcoming-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.upcoming-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    padding: 15px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s;
    cursor: pointer;
}

.upcoming-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.upcoming-card.type-coaching { border-left-color: var(--purple-color); }
.upcoming-card.type-mabar { border-left-color: var(--primary-color); }

.upcoming-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
    gap: 8px;
}

.upcoming-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.upcoming-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 10px;
    line-height: 1.3;
}

.upcoming-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    color: #555;
}

.upcoming-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.upcoming-info i {
    color: var(--primary-color);
    width: 14px;
    font-size: 11px;
}

.upcoming-countdown {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ccc;
    font-size: 11px;
    font-weight: 700;
    color: var(--warning-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

.recent-activities {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--light-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.activity-item:hover { background: #e0e5e8; }

.activity-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.activity-icon.type-mabar { background: var(--primary-color); }
.activity-icon.type-coaching { background: var(--purple-color); }
.activity-icon.type-play { background: var(--blue-color); }

.activity-content { flex: 1; }

.activity-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 2px;
}

.activity-meta { font-size: 11px; color: #7f8c8d; }

.activity-time {
    font-size: 11px;
    color: #95a5a6;
    white-space: nowrap;
}

/* ==================== SEARCH ==================== */
.search-bar {
    position: relative;
    margin-bottom: 20px;
    max-width: 500px;
}

.search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
}

.search-bar input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

/* ==================== MEMBERS GRID ==================== */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.member-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    animation: slideUp 0.3s ease;
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

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

.member-avatar {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 700;
}

.member-level {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.level-beginner { background: #e8f5e9; color: #2e7d32; }
.level-intermediate { background: #fff3e0; color: #ef6c00; }
.level-advanced { background: #fce4ec; color: #c2185b; }

.member-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.member-info p {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 3px;
}

.member-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--light-color);
}

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

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 11px;
    color: #7f8c8d;
    text-transform: uppercase;
    margin-top: 2px;
}

.member-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-action {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.btn-edit { background: var(--blue-color); color: white; }
.btn-edit:hover { background: #2980b9; }
.btn-delete { background: var(--danger-color); color: white; }
.btn-delete:hover { background: #c0392b; }

/* ==================== SCHEDULE ==================== */
.schedule-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.schedule-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    animation: slideUp 0.3s ease;
    border-left: 5px solid var(--primary-color);
    position: relative;
}

.schedule-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.schedule-card.type-coaching { border-left-color: var(--purple-color); }
.schedule-card.type-mabar { border-left-color: var(--primary-color); }
.schedule-card.status-completed { opacity: 0.75; }
.schedule-card.status-ongoing {
    box-shadow: 0 0 0 2px var(--warning-color), var(--shadow);
}

.schedule-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.badge-mabar { background: #e8f5e9; color: #2e7d32; }
.badge-coaching { background: #f3e5f5; color: #7b1fa2; }

.sub-type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    background: #fff3e0;
    color: #e65100;
    margin-left: 6px;
    text-transform: uppercase;
}

.schedule-id {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 11px;
    font-weight: 700;
    color: #95a5a6;
    background: var(--light-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.schedule-card h3 {
    font-size: 18px;
    color: var(--dark-color);
    margin-bottom: 12px;
    padding-right: 80px;
}

.schedule-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.schedule-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
}

.schedule-info-item i {
    color: var(--primary-color);
    width: 16px;
}

.schedule-participants {
    border-top: 1px solid var(--light-color);
    padding-top: 12px;
    margin-top: 12px;
}

.participants-label {
    font-size: 12px;
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.participant-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.participant-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--light-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: var(--dark-color);
    font-weight: 500;
}

.participant-chip .chip-id {
    font-size: 9px;
    color: #95a5a6;
    font-family: 'Courier New', monospace;
}

.schedule-status {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--light-color);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.status-upcoming { background: #e3f2fd; color: #1976d2; }
.status-ongoing { background: #fff8e1; color: #f57c00; }
.status-completed { background: #e8f5e9; color: #388e3c; }

.schedule-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* ==================== TRACKING ==================== */
.tracking-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.tracking-form, .recent-plays {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.tracking-form h3, .recent-plays h3 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

.tracking-form form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tracking-form select,
.tracking-form input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.tracking-form select:focus,
.tracking-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.points-preview {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 8px;
    padding: 12px 16px;
    color: #2e7d32;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 4px solid var(--primary-color);
}

.points-preview i { color: #f39c12; }
.points-preview strong { font-size: 18px; }

.play-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-bottom: 1px solid var(--light-color);
    transition: all 0.3s;
}

.play-item:hover { background: var(--light-color); }
.play-item:last-child { border-bottom: none; }

.play-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.play-details { flex: 1; }

.play-details h4 {
    font-size: 14px;
    margin-bottom: 3px;
    color: var(--dark-color);
}

.play-details p {
    font-size: 12px;
    color: #7f8c8d;
}

.play-points {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ==================== LEADERBOARD ==================== */
.leaderboard-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid var(--light-color);
    transition: all 0.3s;
}

.leaderboard-item:hover { background: var(--light-color); }
.leaderboard-item:last-child { border-bottom: none; }

.rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.rank-1 { background: linear-gradient(135deg, #ffd700, #ffed4e); color: #b8860b; }
.rank-2 { background: linear-gradient(135deg, #c0c0c0, #e8e8e8); color: #696969; }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #e8a87c); color: #8b4513; }
.rank-other { background: var(--light-color); color: var(--text-color); }

.leaderboard-info { flex: 1; }

.leaderboard-info h4 {
    font-size: 16px;
    margin-bottom: 3px;
    color: var(--dark-color);
}

.leaderboard-info p {
    font-size: 12px;
    color: #7f8c8d;
}

.leaderboard-points {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ==================== SETTINGS ==================== */
.settings-info {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left: 4px solid var(--blue-color);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1565c0;
    font-weight: 500;
}

.settings-info i { font-size: 20px; }

.settings-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    animation: slideUp 0.3s ease;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--light-color);
}

.settings-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    flex-shrink: 0;
}

.icon-mabar { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.icon-coaching { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.icon-tracking { background: linear-gradient(135deg, #3498db, #2980b9); }

.settings-card-header h3 {
    color: var(--dark-color);
    font-size: 18px;
    margin-bottom: 4px;
}

.settings-card-header p {
    color: #7f8c8d;
    font-size: 13px;
}

.settings-subsection {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 15px;
    border-left: 3px solid var(--primary-color);
}

.settings-subsection:last-child { margin-bottom: 0; }

.subsection-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subsection-title i { color: var(--primary-color); }

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.setting-item label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-unit input {
    width: 100%;
    padding: 12px 60px 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--dark-color);
    transition: all 0.3s;
    background: white;
}

.input-with-unit input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #f0fdf4;
}

.input-with-unit .unit {
    position: absolute;
    right: 14px;
    color: #7f8c8d;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    background: var(--light-color);
    padding: 3px 8px;
    border-radius: 6px;
}

.settings-actions {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.points-info-box {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border-left: 4px solid var(--warning-color);
    border-radius: 8px;
    padding: 12px 16px;
    color: #e65100;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    margin-top: 10px;
}

.points-info-box i { color: #f39c12; }

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    animation: slideUp 0.3s;
    margin: auto;
}

.modal-large { max-width: 700px; }

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

.modal-header h3 { color: var(--dark-color); }

.close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover { color: var(--danger-color); }

.modal form { padding: 20px; }

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
    resize: vertical;
}

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

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

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ==================== PARTICIPANTS ==================== */
.participant-input {
    display: flex;
    gap: 8px;
    position: relative;
}

.participant-input input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.participant-input input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.help-text {
    display: block;
    margin-top: 6px;
    color: #7f8c8d;
    font-size: 12px;
}

.help-text i { color: var(--primary-color); }

.suggestions { position: relative; z-index: 10; }

.suggestion-item {
    background: white;
    border: 1px solid var(--light-color);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 5px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-item:hover {
    background: var(--light-color);
    border-color: var(--primary-color);
}

.suggestion-item .suggestion-name {
    font-weight: 500;
    color: var(--dark-color);
}

.suggestion-item .suggestion-id {
    font-size: 11px;
    color: #95a5a6;
    font-family: 'Courier New', monospace;
}

.suggestion-item.new-member {
    border-style: dashed;
    border-color: var(--warning-color);
}

.suggestion-item.new-member .suggestion-name { color: var(--warning-color); }

.participants-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.participant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--light-color);
    border-radius: 8px;
    animation: slideUp 0.2s ease;
}

.participant-item.is-new {
    background: #fff3e0;
    border-left: 3px solid var(--warning-color);
}

.participant-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.participant-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark-color);
}

.participant-id {
    font-size: 11px;
    color: #7f8c8d;
    font-family: 'Courier New', monospace;
}

.participant-id .new-badge {
    display: inline-block;
    background: var(--warning-color);
    color: white;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    margin-left: 5px;
    text-transform: uppercase;
}

.btn-remove {
    background: var(--danger-color);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 12px;
    flex-shrink: 0;
}

.btn-remove:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* ==================== MEMBER DETAIL ==================== */
.member-detail-header {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light-color);
}

.member-detail-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 700;
    flex-shrink: 0;
}

.member-detail-info { flex: 1; }

.member-detail-info h2 {
    color: var(--dark-color);
    font-size: 22px;
    margin-bottom: 5px;
}

.member-detail-code {
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
}

.member-detail-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #555;
}

.member-detail-contact span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.member-detail-contact i { color: var(--primary-color); }

.member-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.member-stat-box {
    background: var(--light-color);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.member-stat-box .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 5px;
}

.member-stat-box .stat-label {
    font-size: 11px;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
}

.history-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    background: var(--light-color);
    padding: 4px;
    border-radius: 8px;
    flex-wrap: wrap;
}

.history-tab {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #7f8c8d;
    transition: all 0.2s;
}

.history-tab:hover { color: var(--dark-color); }

.history-tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: white;
    border: 1px solid var(--light-color);
    border-radius: 10px;
    padding: 12px 15px;
    transition: all 0.2s;
    border-left: 3px solid var(--primary-color);
}

.history-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.history-item.type-coaching { border-left-color: var(--purple-color); }
.history-item.type-mabar { border-left-color: var(--primary-color); }
.history-item.type-play { border-left-color: var(--blue-color); }

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
    gap: 10px;
}

.history-item-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1.3;
}

.history-item-id {
    font-size: 10px;
    font-family: 'Courier New', monospace;
    color: #95a5a6;
    background: var(--light-color);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.history-item-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #7f8c8d;
}

.history-item-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-item-details i {
    color: var(--primary-color);
    font-size: 11px;
}

.history-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
}

.history-empty i {
    font-size: 40px;
    margin-bottom: 10px;
    opacity: 0.3;
}

/* ==================== DETAIL VIEW ==================== */
.detail-section { margin-bottom: 20px; }

.detail-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    color: #7f8c8d;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.detail-section p {
    font-size: 15px;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.detail-participants {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-participant {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--light-color);
    border-radius: 8px;
}

.detail-points-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    color: #e65100;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
    .tracking-section { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .navbar { flex-direction: row; flex-wrap: wrap; }

    .nav-toggle { display: block; }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 5px;
        margin-top: 10px;
    }

    .nav-menu.active { display: flex; }

    .nav-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 15px;
    }

    .header-section { flex-direction: column; align-items: stretch; }
    .header-section h2 { font-size: 20px; }

    .members-grid,
    .schedule-grid,
    .upcoming-grid { grid-template-columns: 1fr; }

    .login-card { padding: 30px 20px; }
    .logo-img { width: 80px; height: 80px; }
    .logo h1 { font-size: 26px; }

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

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

    .member-detail-header { flex-direction: column; text-align: center; }
    .member-detail-contact { justify-content: center; }
    .member-detail-stats { grid-template-columns: repeat(3, 1fr); }

    .leaderboard-points { font-size: 20px; }

    .schedule-card h3 { padding-right: 0; }
    .schedule-id { position: static; display: inline-block; margin-bottom: 10px; }

    .settings-grid { grid-template-columns: 1fr; }
    .settings-card { padding: 20px 15px; }
    .settings-card-header { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .nav-brand span { font-size: 16px; }
    .nav-logo { width: 32px; height: 32px; }
    .stats-overview { grid-template-columns: 1fr; }
    .member-detail-stats { grid-template-columns: 1fr; }
    .modal { padding: 10px; }
    .modal-content { border-radius: 10px; }
    .participant-input { flex-direction: column; }
    .history-tabs { flex-direction: column; }
    .history-tab { width: 100%; }
}

/* ==================== NOTIFICATION ==================== */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ==================== NAV USER ==================== */
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--light-color);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-color);
    margin-right: 5px;
}

.nav-user i {
    font-size: 18px;
    color: var(--primary-color);
}

.nav-btn.hidden,
.tab-content.hidden {
    display: none !important;
}

/* ==================== ROLE ACCESS ==================== */
.role-access-info {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left: 4px solid var(--blue-color);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1565c0;
    font-weight: 500;
    font-size: 14px;
}

.role-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.role-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.role-checkbox:hover {
    border-color: var(--primary-color);
    background: #f0fdf4;
}

.role-checkbox.checked {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}

.role-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.role-checkbox-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 15px;
    flex-shrink: 0;
}

.role-checkbox-text {
    flex: 1;
}

.role-checkbox-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark-color);
    display: block;
}

.role-checkbox-status {
    font-size: 11px;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 2px;
}

.role-checkbox.checked .role-checkbox-status {
    color: #2e7d32;
}

@media (max-width: 768px) {
    .role-access-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-user {
        display: none;
    }
}