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

:root {
    color-scheme: light;
    --bg-gradient-start: #1e3c72;
    --bg-gradient-end: #2a5298;
    --container-bg: white;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #6c757d;
    --card-bg: #f8f9fa;
    --border-color: #e9ecef;
    --input-bg: white;
    --input-border: #dee2e6;
}

/* Auto theme - respects browser preference */
@media (prefers-color-scheme: dark) {
    html.theme-auto {
        color-scheme: dark;
        --bg-gradient-start: #0a1628;
        --bg-gradient-end: #1a2f4f;
        --container-bg: #1a1f2e;
        --text-primary: #e9ecef;
        --text-secondary: rgba(255, 255, 255, 0.7);
        --text-muted: rgba(255, 255, 255, 0.6);
        --card-bg: rgba(255, 255, 255, 0.05);
        --border-color: rgba(255, 255, 255, 0.1);
        --input-bg: rgba(255, 255, 255, 0.05);
        --input-border: rgba(255, 255, 255, 0.2);
    }
}

/* Explicit dark theme */
html.theme-dark {
    color-scheme: dark;
    --bg-gradient-start: #0a1628;
    --bg-gradient-end: #1a2f4f;
    --container-bg: #1a1f2e;
    --text-primary: #e9ecef;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.6);
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.2);
}

/* Explicit light theme */
html.theme-light {
    color-scheme: light;
    --bg-gradient-start: #1e3c72;
    --bg-gradient-end: #2a5298;
    --container-bg: white;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #6c757d;
    --card-bg: #f8f9fa;
    --border-color: #e9ecef;
    --input-bg: white;
    --input-border: #dee2e6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    padding: 20px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Touch-friendly improvements */
button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
}

/* Prevent text selection on interactive elements */
button,
.nav-link,
.member-card button,
.award-card button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Improve touch target sizes for mobile */
@media (hover: none) and (pointer: coarse) {
    button,
    a,
    input[type="checkbox"],
    input[type="radio"],
    select {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--container-bg);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    .container {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header h2 {
    font-size: 1.3em;
    font-weight: 300;
    opacity: 0.95;
}

header .user-info {
    position: absolute;
    top: 20px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.username-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.username-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.username-btn::after {
    content: '▼';
    font-size: 0.7em;
    margin-left: 5px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--container-bg);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--card-bg);
    color: #667eea;
}

.dropdown-item:active {
    background: #e9ecef;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 5px 0;
}

.admin-only {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    font-weight: bold;
}

.admin-only:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    color: #764ba2;
}

/* Theme Options */
.theme-section {
    padding: 8px 0;
    margin: 5px 0;
}

.theme-section-label {
    padding: 8px 20px;
    font-size: 0.85em;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.theme-option {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    border-radius: 8px;
    margin: 2px 0;
    cursor: pointer;
    gap: 10px;
}

.theme-option:hover {
    background: var(--card-bg);
}

.theme-option.active {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    font-weight: 600;
}

@media (prefers-color-scheme: dark) {
    html.theme-auto .theme-option:hover,
    html.theme-dark .theme-option:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

#username-display {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--container-bg);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.nav-menu {
    display: flex;
    background: var(--card-bg);
    border-bottom: 2px solid var(--border-color);
    padding: 0;
}

.nav-link {
    flex: 1;
    padding: 15px 20px;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1em;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    background: var(--card-bg);
    color: #667eea;
}

.nav-link.active {
    background: var(--container-bg);
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Admin link special styling */
.nav-link.admin-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    font-weight: bold;
}

.nav-link.admin-link:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
    color: white !important;
}

.nav-link.admin-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border-bottom-color: white;
}

main {
    padding: 30px;
}

/* Action Bar */
.action-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.primary-action-btn,
.secondary-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.primary-action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.primary-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.secondary-action-btn {
    background: var(--container-bg);
    color: #667eea;
    border: 2px solid #667eea;
}

.secondary-action-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-icon {
    font-size: 1.2em;
}

.btn-text {
    font-weight: 600;
}

/* CSV Import Section */
.csv-import-section {
    margin-bottom: 30px;
    animation: slideDown 0.3s ease-out;
}

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

.csv-import-card {
    background: var(--container-bg);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.csv-import-card h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.csv-help {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.95em;
    line-height: 1.6;
}

.csv-help code {
    background: var(--card-bg);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #e83e8c;
    font-size: 0.9em;
}

.csv-upload {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.import-btn {
    background: #28a745;
    color: white;
}

.import-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

.permission-notice {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #2196f3;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.permission-notice p {
    color: #1565c0;
    font-size: 1em;
    font-weight: 500;
    margin: 0;
}

/* Modal Enhancements */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

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

.modal-member {
    animation: slideUp 0.3s ease-out;
}

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

.modal-member h3 {
    color: var(--text-primary);
    margin-bottom: 25px;
    font-size: 1.6em;
    padding-right: 30px;
}

.modal-buttons {
    margin-top: 25px;
    display: flex;
    gap: 12px;
}

.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 1;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.secondary-btn {
    background: #6c757d;
    color: white;
    flex: 1;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.form-section {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 2px solid var(--border-color);
}

.form-section h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.5em;
}

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

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

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

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.button-group {
    display: flex;
    gap: 10px;
}

button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

#submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 1;
}

#submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#cancel-btn {
    background: #6c757d;
    color: white;
}

#cancel-btn:hover {
    background: #5a6268;
}

.members-section h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.5em;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

#search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#search-input:focus {
    outline: none;
    border-color: #667eea;
}

.clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.3s;
}

.clear-search:hover {
    background: #5a6268;
}

.members-list {
    display: grid;
    gap: 15px;
}

.member-card {
    background: var(--container-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.member-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.member-info {
    flex: 1;
}

.member-name {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.member-rank {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.member-power {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: help;
}

.rank-R5 {
    background: #ffd700;
    color: #856404;
}

.rank-R4 {
    background: #ff6b6b;
    color: white;
}

.rank-R3 {
    background: #4ecdc4;
    color: white;
}

.rank-R2 {
    background: #95e1d3;
    color: #155724;
}

.rank-R1 {
    background: #a8dadc;
    color: #004085;
}

.member-eligible {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 500;
    margin-left: 8px;
}

.member-eligible.eligible {
    background: #d4edda;
    color: #155724;
}

.member-eligible.not-eligible {
    background: #f8d7da;
    color: #721c24;
}

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

.edit-btn,
.delete-btn,
.create-user-btn,
.toggle-eligible-btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
}

.edit-btn {
    background: #28a745;
    color: white;
}

.edit-btn:hover {
    background: #218838;
}

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

.delete-btn:hover {
    background: #c82333;
}

.create-user-btn {
    background: #007bff;
    color: white;
}

.create-user-btn:hover {
    background: #0056b3;
}

.toggle-eligible-btn {
    font-size: 13px;
    padding: 6px 12px;
}

.toggle-eligible-btn.eligible {
    background: #28a745;
    color: white;
}

.toggle-eligible-btn.eligible:hover {
    background: #218838;
}

.toggle-eligible-btn.not-eligible {
    background: #6c757d;
    color: white;
}

.toggle-eligible-btn.not-eligible:hover {
    background: #5a6268;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.loading,
.empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 1.1em;
}

/* ===== MOBILE RESPONSIVE STYLES ===== */

/* Tablet and below */
@media (max-width: 1024px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 10px;
    }

    header {
        padding: 20px 15px;
    }

    header h1 {
        font-size: 2em;
    }

    header h2 {
        font-size: 1.1em;
    }

    main {
        padding: 20px;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    .container {
        border-radius: 8px;
    }

    /* Header adjustments */
    header {
        padding: 15px 10px 50px 10px;
    }

    header h1 {
        font-size: 1.5em;
        margin-bottom: 5px;
    }

    header h2 {
        font-size: 0.9em;
    }

    /* User info - move below header */
    header .user-info {
        position: static;
        width: 100%;
        justify-content: center;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.3);
    }

    .user-dropdown {
        width: 100%;
        max-width: 300px;
    }

    .username-btn {
        width: 100%;
        justify-content: center;
        font-size: 0.85em;
        padding: 10px 15px;
    }

    .dropdown-menu {
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(-10px);
        min-width: 250px;
    }

    .dropdown-menu.show {
        transform: translateX(-50%) translateY(0);
    }

    #username-display {
        font-size: 0.85em;
        padding: 6px 12px;
    }

    .logout-btn {
        font-size: 0.85em;
        padding: 6px 15px;
    }

    /* Navigation menu - make scrollable */
    .nav-menu {
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .nav-link {
        display: inline-block;
        padding: 12px 15px;
        font-size: 0.9em;
        min-width: fit-content;
    }

    /* Main content */
    main {
        padding: 15px 10px;
    }

    /* Form sections */
    .form-section {
        padding: 15px;
        margin-bottom: 20px;
    }

    .form-section h3 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }

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

    .form-group label {
        font-size: 0.95em;
    }

    .form-group input,
    .form-group select {
        padding: 10px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    /* Button adjustments */
    button {
        padding: 10px 20px;
        font-size: 15px;
    }

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

    #submit-btn,
    #cancel-btn {
        width: 100%;
    }

    /* Member cards */
    .member-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }

    .member-info {
        width: 100%;
        margin-bottom: 10px;
    }

    .member-name {
        font-size: 1.1em;
        margin-bottom: 8px;
    }

    .member-rank {
        font-size: 0.85em;
        padding: 4px 12px;
    }

    .member-eligible {
        display: block;
        margin-left: 0;
        margin-top: 8px;
        width: fit-content;
    }

    .member-actions {
        margin-top: 10px;
        width: 100%;
        gap: 8px;
    }

    .edit-btn,
    .delete-btn,
    .create-user-btn {
        flex: 1;
        min-width: 0;
        padding: 8px 12px;
        font-size: 13px;
    }

    .toggle-eligible-btn {
        width: 100%;
        margin-top: 5px;
    }

    /* Search box */
    .search-box {
        margin-bottom: 15px;
    }

    #search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    /* CSV Import section */
    .csv-upload {
        flex-direction: column;
        align-items: stretch;
    }

    #csv-file {
        width: 100%;
    }

    .import-btn {
        width: 100%;
        padding: 12px;
    }

    /* Summary stats */
    .summary-stats {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
        padding: 15px;
    }

    .stat-value {
        font-size: 1.5em;
    }

    /* Loading and empty states */
    .loading,
    .empty {
        padding: 30px 15px;
        font-size: 1em;
    }

    /* Permission notice */
    .permission-notice {
        padding: 15px;
        font-size: 0.95em;
    }

    .permission-notice p {
        font-size: 1em;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.3em;
    }

    header h2 {
        font-size: 0.85em;
    }

    .nav-link {
        padding: 10px 12px;
        font-size: 0.85em;
    }

    .form-section h3 {
        font-size: 1.1em;
    }

    .member-name {
        font-size: 1em;
    }

    .member-actions {
        flex-direction: column;
    }

    .edit-btn,
    .delete-btn,
    .create-user-btn {
        width: 100%;
    }
}

.permission-notice {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.permission-notice p {
    color: #856404;
    font-size: 1.1em;
    margin: 0;
    font-weight: 500;
}

.csv-import-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #dee2e6;
}

.csv-import-section h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.2em;
}

.csv-help {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: 15px;
}

.csv-help code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--text-secondary);
}

.csv-upload {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

#csv-file {
    flex: 1;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
}

.import-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.import-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.import-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.import-result {
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.import-result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.import-result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.import-result.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.import-result ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.import-result li {
    margin: 5px 0;
}

/* CSV Preview Modal Styles */
.csv-summary {
    margin-bottom: 20px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
}

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

.stat-label {
    display: block;
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.stat-label.new {
    color: #28a745;
}

.stat-label.change {
    color: #ffc107;
}

.stat-value {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: var(--text-primary);
}

.stat-value.new {
    color: #28a745;
}

.stat-value.change {
    color: #ffc107;
}

.csv-members-preview {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.csv-members-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.csv-member-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: var(--container-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.csv-member-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.csv-member-item.new {
    border-left: 4px solid #28a745;
    background: linear-gradient(to right, rgba(40, 167, 69, 0.1) 0%, var(--container-bg) 100%);
}

.csv-member-item.changed {
    border-left: 4px solid #ffc107;
    background: linear-gradient(to right, rgba(255, 193, 7, 0.1) 0%, var(--container-bg) 100%);
}

.csv-member-item .member-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.csv-member-item .member-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.csv-member-item .member-name {
    font-weight: bold;
    flex: 1;
}

.csv-member-item .member-rank {
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.9em;
}

.csv-member-item .member-status {
    font-size: 0.85em;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 100px;
    text-align: right;
}

.similar-match-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-top: 8px;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
    font-size: 0.9em;
}

.similar-match-notice .warning-icon {
    font-size: 1.2em;
    flex-shrink: 0;
}

.rename-select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ffc107;
    border-radius: 4px;
    background: var(--container-bg);
    font-size: 0.9em;
    cursor: pointer;
}

.rename-select:focus {
    outline: none;
    border-color: #ff9800;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.2);
}

.stat-value.warning {
    color: #ff9800;
}

.stat-label.warning {
    color: #ff9800;
}

.remove-members-section {
    margin-top: 25px;
    padding: 20px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
}

.remove-members-section h4 {
    margin: 0 0 10px 0;
    color: #856404;
    font-size: 1.1em;
}

.remove-help {
    margin: 0 0 15px 0;
    color: #856404;
    font-size: 0.9em;
}

.members-to-remove-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 6px;
}

.remove-member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--container-bg);
    border: 1px solid #ffc107;
    border-radius: 6px;
    transition: all 0.2s;
}

.remove-member-item:hover {
    background: #fffaeb;
    border-color: #ff9800;
}

.remove-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

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

.remove-member-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95em;
}

.csv-sync-option {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.sync-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.sync-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
}

.sync-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sync-text strong {
    color: #856404;
    font-size: 1em;
}

.sync-help {
    font-size: 0.85em;
    color: #856404;
    font-style: italic;
}

/* Train Schedule Styles */
.schedule-controls {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.week-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.message-copy-section {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.weekly-message-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.weekly-message-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
}

.message-box {
    position: relative;
}

.message-box textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    background: var(--container-bg);
}

.copy-btn {
    margin-top: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Conductor Messages */
.conductor-messages-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.conductor-messages-section h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.conductor-messages-section .info-text {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

.conductor-messages-list {
    display: grid;
    gap: 15px;
}

.conductor-message-card {
    background: var(--container-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
}

.conductor-message-header {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 16px;
}

.conductor-message-content textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    resize: vertical;
    background: var(--container-bg);
    color: var(--text-primary);
    margin-bottom: 10px;
}

.week-nav-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.week-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#week-display {
    color: var(--text-primary);
    font-size: 1.3em;
    margin: 0;
}

.auto-schedule-controls {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.auto-schedule-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.auto-schedule-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(17, 153, 142, 0.4);
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.day-card {
    background: var(--container-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
}

.day-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.day-card.past {
    opacity: 0.7;
}

.day-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-header h4 {
    margin: 0;
    font-size: 1.1em;
}

.day-date {
    font-size: 0.9em;
    opacity: 0.9;
}

.schedule-info {
    padding: 15px;
}

.schedule-info.success {
    background: #d4edda;
}

.schedule-info.warning {
    background: #fff3cd;
}

.schedule-info .conductor,
.schedule-info .backup {
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 5px;
}

.schedule-info .notes {
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    font-size: 0.9em;
    font-style: italic;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    margin-left: 5px;
}

.status-badge.success {
    background: #28a745;
    color: white;
}

.status-badge.warning {
    background: #ffc107;
    color: #856404;
}

.status-badge.active {
    background: #17a2b8;
    color: white;
}

.score-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: 700;
    margin-left: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.no-schedule {
    padding: 40px 15px;
    text-align: center;
}

.no-schedule p {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.schedule-btn,
.edit-schedule-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.schedule-btn:hover,
.edit-schedule-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.edit-schedule-btn,
.clear-schedule-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.edit-schedule-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.clear-schedule-btn {
    background: #dc3545;
    color: white;
}

.clear-schedule-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* 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.6);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--container-bg);
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s;
}

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

.date-display {
    background: var(--card-bg);
    padding: 10px;
    border-radius: 5px;
    font-weight: 600;
    color: var(--text-primary);
}

.dropdown-search {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 8px;
    transition: border-color 0.3s;
}

.dropdown-search:focus {
    outline: none;
    border-color: #667eea;
}

#conductor-select,
#backup-select {
    width: 100%;
    padding: 8px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
}

#conductor-select option,
#backup-select option {
    padding: 8px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-label:hover {
    border-color: #667eea;
    background: var(--card-bg);
}

.radio-label input[type="radio"] {
    margin-right: 10px;
}

.submit-btn,
.cancel-btn {
    flex: 1;
}

.cancel-btn {
    background: #6c757d;
}

.cancel-btn:hover {
    background: #5a6268;
}

/* History Section */
.history-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #dee2e6;
}

.history-section h3 {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.history-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: var(--container-bg);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.history-grid {
    display: grid;
    gap: 15px;
}

.history-card {
    background: var(--container-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s;
}

.history-card:hover {
    border-color: #667eea;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.history-card.success {
    border-left: 5px solid #28a745;
}

.history-card.warning {
    border-left: 5px solid #ffc107;
}

.history-date {
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.history-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-notes {
    margin-top: 8px;
    padding: 8px;
    background: var(--card-bg);
    border-radius: 5px;
    font-size: 0.9em;
    font-style: italic;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .week-selector {
        flex-direction: column;
    }
    
    .week-nav-btn {
        width: 100%;
    }
    
    .schedule-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        flex-direction: column;
    }
    
    .nav-link {
        border-bottom: 1px solid #dee2e6;
        border-left: 3px solid transparent;
    }
    
    .nav-link.active {
        border-bottom: 1px solid #dee2e6;
        border-left-color: #667eea;
    }
}

/* Awards Page Styles */
.awards-controls {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.week-info {
    text-align: center;
}

.week-info h3 {
    margin: 0;
    color: var(--text-primary);
}

.week-subtitle {
    margin: 5px 0 0 0;
    color: var(--text-muted);
    font-size: 0.9em;
}

.awards-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.save-btn,
.clear-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.save-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.clear-btn {
    background: #dc3545;
    color: white;
}

.clear-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.award-card {
    background: var(--container-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s;
    position: relative;
}

.award-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.award-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.award-title {
    margin: 0;
    color: #667eea;
    font-size: 1.1em;
}

.toggle-award-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

.toggle-award-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.inactive-awards-section {
    grid-column: 1 / -1;
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.inactive-title {
    color: var(--text-muted);
    font-size: 1.1em;
    margin: 0 0 15px 0;
    text-align: center;
}

.inactive-awards-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.inactive-award-chip {
    background: var(--container-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.inactive-award-chip:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.3);
}

.award-position {
    margin-bottom: 15px;
}

.award-position label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95em;
}

.member-search {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 5px;
    transition: border-color 0.3s;
}

.member-search:focus {
    outline: none;
    border-color: #667eea;
}

.member-select {
    width: 100%;
    padding: 8px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
}

.member-select option {
    padding: 8px;
}

.history-search,
.week-filter {
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.history-search {
    flex: 1;
}

.history-search:focus,
.week-filter:focus {
    outline: none;
    border-color: #667eea;
}

.week-filter {
    min-width: 200px;
}

.history-content {
    margin-top: 20px;
}

.week-history {
    margin-bottom: 40px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 10px;
}

.week-history-title {
    margin: 0 0 20px 0;
    color: var(--text-secondary);
    font-size: 1.3em;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

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

.history-award-card {
    background: var(--container-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
}

.history-award-title {
    margin: 0 0 10px 0;
    color: #667eea;
    font-size: 1em;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.history-award-item {
    padding: 8px;
    margin: 5px 0;
    border-radius: 5px;
    font-weight: 500;
}

.history-award-item.rank-1 {
    background: #ffd700;
    color: #856404;
}

.history-award-item.rank-2 {
    background: #c0c0c0;
    color: var(--text-primary);
}

.history-award-item.rank-3 {
    background: #cd7f32;
    color: white;
}

@media (max-width: 768px) {
    .awards-grid {
        grid-template-columns: 1fr;
    }
    
    .awards-history-grid {
        grid-template-columns: 1fr;
    }
    
    .history-filters {
        flex-direction: column;
    }
    
    .week-filter {
        width: 100%;
    }
}

/* Recommendations Page Styles */
.recommendation-form-section {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    margin: 30px;
}

.recommendation-form-section h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.recommendation-form {
    background: var(--container-bg);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

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

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

.notes-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.notes-input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    width: 100%;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.recommendations-list-section {
    padding: 30px;
}

.recommendations-list-section h3 {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.filter-section {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    background: var(--container-bg);
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.filter-chip:hover {
    border-color: #667eea;
    background: var(--card-bg);
}

.filter-chip.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

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

.view-toggle {
    display: flex;
    gap: 10px;
}

.toggle-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--container-bg);
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
    color: var(--text-primary);
}

.toggle-btn:hover {
    border-color: #667eea;
    background: var(--card-bg);
}

.toggle-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Statistics Dashboard */
.stats-dashboard {
    background: var(--container-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    transition: transform 0.3s;
}

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

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-icon {
    font-size: 2.5em;
    opacity: 0.9;
}

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

.stat-value {
    font-size: 2em;
    font-weight: bold;
    line-height: 1;
    color: white;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.stat-label {
    font-size: 0.85em;
    opacity: 0.9;
    margin-top: 5px;
    color: white;
}

/* Charts Section */
.charts-section {
    background: var(--container-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.chart-container {
    background: var(--section-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    min-height: 300px;
}

.chart-container.full-width {
    grid-column: 1 / -1;
}

.chart-container h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 1.1em;
    text-align: center;
}

.chart-container canvas {
    max-height: 300px;
}

/* Grouped View Styles */
.grouped-card {
    background: var(--container-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.grouped-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.grouped-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    flex-wrap: wrap;
    gap: 10px;
}

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

.member-name-large {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text-primary);
}

.grouped-badges {
    display: flex;
    gap: 10px;
}

.count-badge {
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
}

.active-count {
    background: #667eea;
    color: white;
}

.assigned-count {
    background: #28a745;
    color: white;
}

.grouped-recommendations {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recommendation-item {
    background: var(--card-bg);
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid #e9ecef;
    transition: all 0.3s;
}

.recommendation-item:hover {
    background: #e9ecef;
}

.recommendation-item.active-rec {
    border-left-color: #667eea;
}

.recommendation-item.expired-rec {
    border-left-color: #28a745;
    opacity: 0.8;
}

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

.rec-by {
    font-size: 0.9em;
    color: var(--text-secondary);
    font-weight: 500;
}

.rec-date {
    font-size: 0.85em;
    color: #adb5bd;
}

.delete-btn-small {
    padding: 4px 10px;
    border: none;
    border-radius: 5px;
    background: #dc3545;
    color: white;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s;
}

.delete-btn-small:hover {
    background: #c82333;
}

.rec-notes-small {
    font-size: 0.9em;
    color: var(--text-secondary);
    font-style: italic;
    padding: 8px;
    background: var(--card-bg);
    border-radius: 5px;
    margin-top: 5px;
}

.active-badge {
    padding: 4px 10px;
    background: #667eea;
    color: white;
    font-size: 0.75em;
    border-radius: 12px;
    font-weight: 600;
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recommendation-card {
    background: var(--container-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s;
}

.recommendation-card.expired {
    opacity: 0.7;
    background: var(--card-bg);
    border-color: #28a745;
}

.recommendation-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.recommendation-card.expired:hover {
    border-color: #28a745;
}

.recommendation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.recommendation-member {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.expired-badge {
    padding: 4px 10px;
    background: #28a745;
    color: white;
    font-size: 0.75em;
    border-radius: 12px;
    font-weight: 600;
}

.member-name {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-primary);
}

.member-rank {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    color: white;
}

.rank-R5 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.rank-R4 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.rank-R3 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.rank-R2 {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.rank-R1 {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.delete-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    background: #dc3545;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.delete-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.recommendation-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recommendation-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9em;
}

.recommended-by strong {
    color: var(--text-primary);
}

.recommendation-date {
    color: #adb5bd;
}

.recommendation-notes {
    background: var(--card-bg);
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 5px;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #adb5bd;
    font-size: 1.1em;
}

@media (max-width: 768px) {
    .recommendation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .recommendation-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .delete-btn {
        width: 100%;
    }
}

/* Settings page styles */
.settings-group {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.settings-group h4 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 1.1em;
}

.help-text {
    display: block;
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 5px;
    font-style: italic;
}

.info-text {
    color: var(--text-muted);
    margin-bottom: 20px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 5px;
    border-left: 4px solid #2196F3;
}

.info-section {
    background: var(--container-bg);
    padding: 30px;
    border-top: 2px solid var(--border-color);
}

.info-section h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.info-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.info-card ul {
    margin: 15px 0;
    padding-left: 20px;
}

.info-card li {
    margin: 10px 0;
    line-height: 1.6;
}

.info-card strong {
    color: #667eea;
}

.info-box {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #4a90e2;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.info-box p {
    margin: 5px 0;
    line-height: 1.6;
}

.info-box code {
    background: var(--container-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
}

.secondary-btn {
    background: #6c757d;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

.secondary-btn:hover {
    background: #5a6268;
}

/* Rankings page styles */
.charts-section {
    background: var(--container-bg);
    padding: 30px;
    margin-top: 20px;
}

.charts-section h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.chart-container {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    min-height: 350px;
}

.chart-container h4 {
    color: var(--text-secondary);
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.1em;
}

.chart-container canvas {
    max-height: 300px;
}

.chart-options {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 8px;
    flex-wrap: wrap;
}

.chart-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 15px;
    background: var(--container-bg);
    border-radius: 6px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.chart-options label:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.chart-options input[type="checkbox"],
.chart-options input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.member-search-box {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    max-width: 600px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 8px;
}

.member-search-box input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.member-search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.member-search-box .clear-search {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.member-search-box .clear-search:hover {
    background: #5a6268;
}

.member-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.member-timeline-chart {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.member-timeline-chart h5 {
    color: var(--text-secondary);
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.05em;
    font-weight: 600;
}

.member-timeline-chart canvas {
    max-height: 250px;
}

.rankings-section {
    background: var(--container-bg);
    padding: 30px;
    margin-top: 20px;
}

.rankings-section h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.rankings-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-group input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    min-width: 200px;
    transition: border-color 0.3s;
}

.filter-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1em;
    background: var(--container-bg);
    cursor: pointer;
    min-width: 150px;
    transition: border-color 0.3s;
}

.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.secondary-btn {
    background: var(--card-bg);
    color: var(--text-secondary);
    padding: 8px 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-btn:hover {
    background: #e9ecef;
    border-color: #bbb;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-badge {
    background: var(--card-bg);
    padding: 10px 20px;
    border-radius: 20px;
    border-left: 4px solid #2196F3;
    color: var(--text-primary);
}

.system-info-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.system-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.system-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--container-bg);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.info-value {
    font-weight: 700;
    color: #667eea;
}

.system-note {
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    line-height: 1.6;
}

.rankings-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ranking-card {
    background: var(--container-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s;
}

.ranking-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.rank-first {
    border-color: #FFD700;
    background: linear-gradient(to right, rgba(255, 215, 0, 0.1), var(--container-bg));
}

.rank-second {
    border-color: #C0C0C0;
    background: linear-gradient(to right, rgba(192, 192, 192, 0.1), var(--container-bg));
}

.rank-third {
    border-color: #CD7F32;
    background: linear-gradient(to right, rgba(205, 127, 50, 0.1), var(--container-bg));
}

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

.ranking-position {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.position-number {
    font-size: 1.2em;
    font-weight: 700;
    color: #667eea;
}

.ranking-position h4 {
    margin: 0;
    font-size: 1.5em;
    color: var(--text-primary);
}

.rank-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #667eea;
    color: white;
    border-radius: 15px;
    font-size: 0.7em;
    font-weight: 600;
    margin-left: 10px;
}

.total-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.score-value {
    font-size: 2.5em;
    font-weight: 700;
    line-height: 1;
}

.score-label {
    font-size: 0.9em;
    opacity: 0.9;
}

.ranking-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-section {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
}

.detail-section h5 {
    margin: 0 0 15px 0;
    color: #667eea;
    font-size: 1.1em;
}

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

.section-header-with-toggle h5 {
    margin: 0;
    color: #667eea;
    font-size: 1.1em;
}

.section-header-with-toggle .checkbox-label {
    margin: 0;
    white-space: nowrap;
}

.member-timeline-canvas {
    max-height: 300px;
    width: 100% !important;
    height: auto !important;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 5px;
    border-left: 3px solid var(--border-color);
}

.detail-item.positive {
    border-left-color: #28a745;
}

.detail-item.positive .detail-value {
    color: #28a745;
}

.detail-item.negative {
    border-left-color: #dc3545;
}

.detail-item.negative .detail-value {
    color: #dc3545;
}

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.detail-value {
    font-weight: 700;
}

.awards-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.award-chip {
    display: inline-block;
    padding: 6px 12px;
    background: var(--container-bg);
    border: 1px solid #667eea;
    border-radius: 20px;
    font-size: 0.9em;
    color: #667eea;
    font-weight: 600;
}

.awards-detailed-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.award-detail-item {
    display: grid;
    grid-template-columns: 40px 1fr 100px 80px;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.award-icon {
    font-size: 1.5em;
    text-align: center;
}

.award-type {
    font-weight: 600;
    color: var(--text-primary);
}

.award-rank {
    color: var(--text-muted);
    font-size: 0.9em;
}

.award-points {
    font-weight: 700;
    color: #28a745;
    text-align: right;
}

/* Compact awards list */
.awards-compact-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.award-compact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid #dee2e6;
    font-size: 0.9em;
    transition: all 0.2s;
}

.award-compact-item:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.award-compact-item.expired-award {
    opacity: 0.5;
    background: var(--card-bg);
    border-color: #ced4da;
    border-style: dashed;
}

.award-compact-item.expired-award:hover {
    opacity: 0.7;
    background: #e9ecef;
    border-color: #adb5bd;
}

.award-compact-item.expired-award .award-type-compact {
    color: var(--text-muted);
    text-decoration: line-through;
}

.award-compact-item.expired-award .award-points-compact {
    color: var(--text-muted);
    text-decoration: line-through;
}

.award-icon-compact {
    font-size: 1.2em;
}

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

.award-type-compact {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.award-week-compact {
    font-size: 0.85em;
    color: var(--text-muted);
    line-height: 1;
}

.award-points-compact {
    font-weight: 700;
    color: #28a745;
    margin-left: 5px;
}

.no-awards {
    color: #adb5bd;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

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

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: var(--container-bg);
    border-radius: 5px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.85em;
    color: var(--text-secondary) !important;
    font-weight: 600;
}

.stat-value {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-primary) !important;
}

.loading, .error, .empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

.error {
    color: #dc3545;
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        min-height: 300px;
    }
    
    .member-charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .chart-options label {
        width: 100%;
        justify-content: center;
    }
    
    .member-search-box {
        flex-direction: column;
        gap: 10px;
    }
    
    .member-search-box input,
    .member-search-box .clear-search {
        width: 100%;
    }
    
    .award-detail-item {
        grid-template-columns: 30px 1fr;
        gap: 5px;
    }
    
    .award-rank {
        grid-column: 2;
    }
    
    .award-points {
        grid-column: 2;
        text-align: left;
    }
    
    .award-compact-item {
        flex: 1 1 100%;
        justify-content: space-between;
    }
    
    .ranking-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .total-score {
        align-self: flex-end;
    }
    
    .rankings-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .info-badge {
        text-align: center;
    }
}

/* ========================================
   DESERT STORM STYLES
   ======================================== */

.storm-strategy {
    background: var(--card-bg);
}

.strategy-phases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.phase-card {
    background: var(--container-bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.phase-card h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 1.1em;
}

.phase-card ul {
    margin: 0;
    padding-left: 20px;
}

.phase-card li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.storm-buildings-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.storm-stage {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
}

.storm-stage-title {
    margin: 0 0 20px 0;
    color: var(--text-primary);
    font-size: 1.2em;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.storm-stage-buildings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.storm-building {
    background: var(--container-bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #6c757d;
    transition: transform 0.3s, box-shadow 0.3s;
}

.storm-building:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.storm-building.critical {
    border-left-color: #dc3545;
    background: linear-gradient(to right, rgba(220, 53, 69, 0.1) 0%, var(--container-bg) 100%);
}

.storm-building.high {
    border-left-color: #fd7e14;
    background: linear-gradient(to right, rgba(253, 126, 20, 0.1) 0%, var(--container-bg) 100%);
}

.storm-building.medium {
    border-left-color: #ffc107;
    background: linear-gradient(to right, rgba(255, 193, 7, 0.1) 0%, var(--container-bg) 100%);
}

.storm-building.low {
    border-left-color: #6c757d;
}

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

.building-header h5 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1em;
}

.priority-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
}

.priority-badge.critical {
    background: #dc3545;
    animation: pulse 2s infinite;
}

.priority-badge.high {
    background: #fd7e14;
}

.priority-badge.medium {
    background: #ffc107;
    color: var(--text-primary);
}

.priority-badge.low {
    background: #6c757d;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.building-info {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.building-info .points {
    color: #28a745;
    font-weight: bold;
    font-size: 0.9em;
}

.building-info .boost {
    color: #667eea;
    font-size: 0.85em;
    font-style: italic;
}

.member-slots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.slot-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
}

.slot-container label {
    font-size: 0.85em;
    color: var(--text-muted);
    font-weight: 600;
}

.searchable-select {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 8px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9em;
    background: var(--container-bg);
    cursor: text;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--container-bg);
    border: 2px solid #667eea;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: -2px;
}

.dropdown-item {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

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

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item.disabled {
    color: #999;
    cursor: default;
    font-style: italic;
}

.dropdown-item.disabled:hover {
    background-color: white;
}

.member-select-storm {
    width: 100%;
    padding: 8px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9em;
    transition: border-color 0.3s;
}

.member-select-storm:focus {
    outline: none;
    border-color: #667eea;
}

.member-select-storm option:first-child {
    color: var(--text-muted);
    font-style: italic;
}

.mail-content {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    font-size: 0.9em;
    line-height: 1.6;
    max-height: 600px;
    overflow-y: auto;
    border: 2px solid #dee2e6;
}

.mail-header {
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .strategy-phases {
        grid-template-columns: 1fr;
    }
    
    .storm-stage-buildings {
        grid-template-columns: 1fr;
    }
    
    .member-slots {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   UPLOAD PAGE STYLES
   ======================================== */

.upload-instructions {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.upload-instructions h4 {
    margin: 0 0 15px 0;
    color: var(--text-secondary);
}

.upload-instructions ol {
    margin: 0;
    padding-left: 25px;
}

.upload-instructions li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.preview-section {
    margin-top: 20px;
}

.file-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.file-preview {
    position: relative;
    background: var(--card-bg);
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.preview-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.file-info {
    font-size: 0.85em;
}

.file-size {
    color: var(--text-muted);
    font-size: 0.9em;
}

.remove-file-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.remove-file-btn:hover {
    background: #c82333;
}

.processing-status {
    text-align: center;
    padding: 40px 20px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
    width: 0%;
}

#processing-message {
    font-size: 1.1em;
    color: var(--text-secondary);
}

.results-summary {
    margin-bottom: 30px;
}

.summary-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 10px;
    color: white;
}

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

.summary-label {
    display: block;
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.summary-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
}

.summary-value.new {
    color: #90ee90;
}

.summary-value.change {
    color: #ffd700;
}

.detected-members h4 {
    margin: 0 0 20px 0;
    color: var(--text-secondary);
}

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

.detected-member-card {
    background: var(--container-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.detected-member-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.detected-member-card.new {
    border-color: #28a745;
    background: linear-gradient(to right, rgba(40, 167, 69, 0.1) 0%, var(--container-bg) 100%);
}

.detected-member-card.changed {
    border-color: #ffc107;
    background: linear-gradient(to right, #fff8e1 0%, white 100%);
}

.detected-member-card .member-name {
    font-weight: bold;
    flex: 1;
}

.detected-member-card .member-rank {
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: bold;
    margin: 0 10px;
}

.detected-member-card .member-status {
    font-size: 0.85em;
    color: var(--text-muted);
    font-weight: 600;
}

.success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-message h4 {
    color: #28a745;
    font-size: 1.5em;
    margin-bottom: 30px;
}

.update-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: var(--container-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-label {
    display: block;
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.stat-value {
    display: block;
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
}

/* ===== ADDITIONAL MOBILE STYLES FOR ALL PAGES ===== */
@media (max-width: 768px) {
    /* File upload and preview styles */
    .file-previews {
        grid-template-columns: 1fr;
    }
    
    .summary-card,
    .update-stats {
        grid-template-columns: 1fr;
    }
    
    .members-grid {
        grid-template-columns: 1fr;
    }

    /* Awards page mobile styles */
    .awards-controls {
        padding: 15px;
    }

    .awards-actions {
        flex-direction: column;
        gap: 8px;
    }

    .save-btn,
    .clear-btn {
        width: 100%;
        padding: 12px;
    }

    .awards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .award-card {
        padding: 15px;
    }

    .award-header {
        flex-wrap: wrap;
    }

    .inactive-awards-section {
        padding: 15px;
    }

    .inactive-awards-chips {
        gap: 8px;
    }

    .inactive-award-chip {
        font-size: 13px;
        padding: 6px 12px;
    }

    .awards-history-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .history-filters {
        flex-direction: column;
        gap: 10px;
    }

    .history-search,
    .week-filter {
        width: 100%;
        min-width: 0;
    }

    .week-history {
        padding: 15px;
    }

    /* Recommendations page mobile styles */
    .recommendation-form-section {
        padding: 15px;
        margin: 15px 10px;
    }

    .recommendation-form {
        padding: 15px;
    }

    .recommendation-card {
        padding: 15px;
    }

    .recommendation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .recommendation-member {
        width: 100%;
        justify-content: space-between;
    }

    .member-name {
        font-size: 1.1em;
    }

    .member-rank {
        font-size: 0.8em;
        padding: 4px 10px;
    }

    .recommendation-meta {
        flex-direction: column;
        gap: 5px;
    }

    .delete-btn {
        width: 100%;
        margin-top: 10px;
    }

    .delete-btn-small {
        width: 100%;
        padding: 8px;
    }

    .recommendations-list {
        gap: 12px;
    }

    /* Rankings page mobile styles */
    .rankings-section {
        padding: 15px;
    }

    .rankings-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .rankings-controls select,
    .rankings-controls button {
        width: 100%;
    }

    .info-badge {
        text-align: center;
        margin: 10px 0;
    }

    .charts-section {
        padding: 15px;
    }

    .charts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .rankings-list {
        gap: 12px;
    }

    .ranking-card {
        padding: 15px;
    }

    .ranking-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .ranking-position {
        font-size: 1.8em;
    }

    .ranking-info h4 {
        font-size: 1.1em;
    }

    .score-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .total-score {
        align-self: flex-start;
        font-size: 1.3em;
    }

    /* Desert Storm page mobile styles */
    .storm-strategy {
        padding: 15px;
    }

    .strategy-phases {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .phase-card {
        padding: 15px;
    }

    .storm-buildings-grid {
        gap: 20px;
    }

    .storm-stage {
        padding: 15px;
    }

    .storm-stage-buildings {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .storm-building {
        padding: 15px;
    }

    .building-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Settings page mobile styles */
    .settings-group {
        padding: 15px;
        margin-bottom: 20px;
    }

    .info-section {
        padding: 15px;
    }

    .info-card {
        padding: 15px;
    }

    .secondary-btn {
        width: 100%;
        padding: 12px;
    }

    /* Profile page mobile styles */
    .profile-section {
        padding: 15px;
    }

    .profile-info {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Train schedule mobile styles */
    .train-schedule-section {
        padding: 15px;
    }

    .train-controls {
        flex-direction: column;
        gap: 10px;
    }

    .train-controls input,
    .train-controls select,
    .train-controls button {
        width: 100%;
    }

    .train-list {
        gap: 12px;
    }

    .train-card {
        padding: 15px;
    }

    .train-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .train-actions {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .train-actions button {
        width: 100%;
    }

    /* Modal mobile styles */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 10px;
        padding: 20px 15px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header {
        padding: 15px;
        margin: -20px -15px 15px -15px;
    }

    .modal-body {
        padding: 10px 0;
    }

    .modal-footer {
        padding: 15px;
        margin: 15px -15px -20px -15px;
        flex-direction: column-reverse;
        gap: 8px;
    }

    .modal-footer button {
        width: 100%;
        margin: 0;
    }

    /* Member modal mobile styles */
    .modal-member h3 {
        font-size: 1.3em;
        margin-bottom: 20px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .modal-buttons button {
        width: 100%;
    }

    /* Action bar mobile */
    .action-bar {
        flex-direction: column;
        margin-bottom: 20px;
        gap: 10px;
    }

    .primary-action-btn,
    .secondary-action-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }

    .csv-import-card {
        padding: 15px;
    }

    .csv-import-card h4 {
        font-size: 1.1em;
    }

    .csv-upload {
        flex-direction: column;
        gap: 8px;
    }

    .csv-upload input,
    .csv-upload button {
        width: 100%;
    }

    /* Table mobile styles */
    table {
        font-size: 0.9em;
    }

    th,
    td {
        padding: 8px 6px;
    }

    /* Make tables scrollable on mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Compact display for long content */
    .compact-mobile {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 150px;
    }
}

/* Small mobile adjustments (smaller phones) */
@media (max-width: 480px) {
    /* Further reduce padding and font sizes */
    .award-title {
        font-size: 1em;
    }

    .ranking-position {
        font-size: 1.5em;
    }

    .total-score {
        font-size: 1.2em;
    }

    .phase-card {
        padding: 12px;
    }

    .storm-building {
        padding: 12px;
    }

    .stat-value {
        font-size: 2em;
    }

    /* Adjust chart containers for very small screens */
    .chart-container {
        min-height: 250px;
    }
}

/* ================================================ */
/* ADMIN PANEL STYLES */
/* ================================================ */

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

@media (prefers-color-scheme: dark) {
    .tabs {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
}

.tab-button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 15px 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-button:hover {
    color: var(--text-primary);
    background: var(--card-bg);
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

@media (prefers-color-scheme: dark) {
    .tab-button.active {
        color: #a0aef0;
    }
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Users List */
.users-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.user-card:hover {
    background: var(--card-bg);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

@media (prefers-color-scheme: dark) {
    .user-card {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .user-card:hover {
        background: rgba(255, 255, 255, 0.08);
    }
}

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

.user-card .user-info {
    position: static;
    flex: 1;
}

.user-info h3 {
    color: var(--text-primary);
    font-size: 1.3em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

@media (prefers-color-scheme: dark) {
    .user-info h3 {
        color: white;
    }
}

.admin-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.member-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9em;
}

.no-member {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-style: italic;
    opacity: 0.6;
}

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

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

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9em;
}

@media (prefers-color-scheme: dark) {
    .stat {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.05);
    }
    
    .stat-label {
        color: rgba(255, 255, 255, 0.7);
    }
}

.stat-value {
    color: var(--text-primary);
    font-weight: bold;
}

@media (prefers-color-scheme: dark) {
    .stat-value {
        color: white;
    }
}

/* Recent Logins */
.recent-logins {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.recent-logins strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 10px;
}

@media (prefers-color-scheme: dark) {
    .recent-logins {
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    
    .recent-logins strong {
        color: white;
    }
}

.login-entry {
    display: grid;
    grid-template-columns: 1fr 120px 150px;
    gap: 10px;
    padding: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.85em;
}

.login-location {
    color: var(--text-primary);
}

.login-ip {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.login-time {
    color: var(--text-secondary);
    font-size: 0.9em;
    opacity: 0.8;
}

@media (prefers-color-scheme: dark) {
    .login-entry {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.05);
    }
    
    .login-location {
        color: rgba(255, 255, 255, 0.9);
    }
    
    .login-ip {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .login-time {
        color: rgba(255, 255, 255, 0.6);
    }
}

/* Login History Table */
.login-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.login-table thead {
    background: var(--card-bg);
    border-bottom: 2px solid var(--border-color);
}

.login-table th {
    color: var(--text-primary);
    font-weight: 600;
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

.login-table td {
    padding: 12px 15px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.login-row:hover {
    background: var(--card-bg);
}

@media (prefers-color-scheme: dark) {
    .login-table {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .login-table thead {
        background: rgba(0, 0, 0, 0.3);
    }
    
    .login-table th {
        color: white;
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .login-table td {
        color: rgba(255, 255, 255, 0.9);
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }
    
    .login-row:hover {
        background: rgba(255, 255, 255, 0.05);
    }
}

.login-row.failed {
    background: rgba(229, 62, 62, 0.1);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 1.2em;
}

.status-badge.success {
    background: rgba(72, 187, 120, 0.2);
}

.status-badge.failed {
    background: rgba(229, 62, 62, 0.2);
}

.device-info {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-controls select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 14px;
}

/* Search Box */
.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 16px;
}

.search-box input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

@media (prefers-color-scheme: dark) {
    .search-box input {
        border-color: rgba(255, 255, 255, 0.2);
        background: rgba(0, 0, 0, 0.2);
        color: white;
    }
    
    .search-box input::placeholder {
        color: rgba(255, 255, 255, 0.5);
    }
}

/* Modal Overrides for Admin */
#reset-password-result {
    padding: 20px;
    background: rgba(72, 187, 120, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(72, 187, 120, 0.3);
}

#result-password {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 15px;
    border-radius: 8px;
    display: inline-block;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.checkbox-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: bold;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Empty States and Loading */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 1.1em;
    opacity: 0.8;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 1.1em;
}

@media (prefers-color-scheme: dark) {
    .empty-state {
        color: rgba(255, 255, 255, 0.6);
    }
    
    .loading {
        color: rgba(255, 255, 255, 0.7);
    }
}

/* Error and Info Messages */
.error-message {
    padding: 20px;
    margin: 20px 0;
    background: rgba(229, 62, 62, 0.1);
    border-left: 4px solid #e53e3e;
    border-radius: 8px;
    color: var(--text-primary);
}

.info-message {
    padding: 20px;
    margin: 20px 0;
    background: rgba(66, 153, 225, 0.1);
    border-left: 4px solid #4299e1;
    border-radius: 8px;
    color: var(--text-primary);
}

@media (prefers-color-scheme: dark) {
    .error-message {
        color: #fc8181;
    }
    
    .info-message {
        color: #90cdf4;
    }
}

/* Responsive Admin Styles */
@media (max-width: 768px) {
    .user-header {
        flex-direction: column;
    }
    
    .user-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .user-actions button {
        flex: 1;
        min-width: 0;
        font-size: 0.85em;
        padding: 8px 12px;
    }
    
    .login-entry {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .login-table {
        font-size: 0.85em;
    }
    
    .login-table th,
    .login-table td {
        padding: 8px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-button {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .login-table {
        display: block;
        overflow-x: auto;
    }
    
    .user-actions button {
        font-size: 0.75em;
        padding: 6px 8px;
    }
}

/* Admin Panel Cards */
.card {
    background: var(--container-bg);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 15px;
}

.card-header h2 {
    color: var(--text-primary);
    font-size: 1.5em;
    margin: 0;
}

@media (prefers-color-scheme: dark) {
    .card {
        background: rgba(255, 255, 255, 0.02);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: none;
    }
    
    .card-header {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .card-header h2 {
        color: white;
    }
}
