/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-teal: #32675C;
    --primary-dark-green: #196733;
    --primary-light-green: #98F674;
    --primary-orange: #e54934;
    --primary-blue: #32675C;
    --background: #F9FAFB;
    --card-bg: #FFFFFF;
    --border-color: #E5E7EB;
    --text-primary: #196733;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --yellow-bg: #FEF3C7;
    --yellow-text: #92400E;
    --accent-gradient: linear-gradient(135deg, #32675C, #196733);
    --orange-gradient: linear-gradient(135deg, #ee4c37, #ee4c37);
    --border-radius: 0.75rem;
    --spacing-unit: 1rem;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    padding-bottom: 1.25rem;
    line-height: 1.5;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Safe area for notch devices */
body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #F9FAFB;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-content {
    background: white;
    padding: 3rem 2.5rem;
    max-width: 600px;
    width: 90%;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.login-content h1 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    font-weight: 600;
}

@media (max-width: 768px) {
    .login-content {
        padding: 2rem 1.5rem;
    }
    
    .login-content h1 {
        margin-top: 0.5rem;
        margin-bottom: 1.5rem;
    }
}

.login-users {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 2rem;
    padding: 1.5rem 0;
    justify-items: center;
    place-items: center;
}

.login-user-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0.75rem;
    border-radius: 8px;
    position: relative;
}

.login-user-card:hover {
    transform: translateY(-2px);
}

.login-user-card:hover .user-avatar {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.login-user-card:active {
    transform: translateY(0);
}

.login-user-card .user-avatar {
    width: 70px;
    height: 70px;
    font-size: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.15s ease;
    position: relative;
}

.login-user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.3;
    max-width: 100px;
    word-wrap: break-word;
}

.user-role {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    line-height: 1;
}

.role-admin {
    background: #FEE2E2;
    color: #DC2626;
}

.role-member {
    background: #DBEAFE;
    color: #2563EB;
}

.role-readonly {
    background: #F3F4F6;
    color: #6B7280;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E5E7EB;
    border-top: 3px solid var(--primary-teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 2rem auto;
    grid-column: 1 / -1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Logout Button */
.logout-btn {
    padding: 0.5rem 1rem;
    background: #FEE2E2;
    color: #DC2626;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.logout-btn:hover {
    background: #FECACA;
}

.logout-btn:active {
    transform: scale(0.98);
}

/* Password Modal */
.password-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.password-modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-width: 380px;
    width: 90%;
    text-align: center;
}

.password-modal-content h2 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.password-modal-content p {
    color: #6B7280;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.password-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
    transition: all 0.15s ease;
    font-family: inherit;
}

.password-input:focus {
    outline: none;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(50, 103, 92, 0.1);
}

.password-error {
    display: none;
    color: #EF4444;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.password-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.password-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.password-cancel {
    background: #F3F4F6;
    color: #6B7280;
}

.password-cancel:hover {
    background: #E5E7EB;
}

.password-submit {
    background: var(--accent-gradient);
    color: white;
}

.password-submit:hover {
    opacity: 0.9;
}

.password-submit:active {
    opacity: 0.8;
}

/* Navigation Tabs */
.tabs {
    display: flex;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.tab.active {
    color: var(--primary-teal);
    border-bottom-color: var(--primary-teal);
}

.notification-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #EF4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.375rem;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.tab:hover {
    background-color: var(--background);
}

.tab:active {
    transform: scale(0.98);
}

/* Install App Button */
.install-app-btn {
    padding: 0.5rem 1rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.install-app-btn:hover {
    background: linear-gradient(135deg, #2563EB, #1d4ed8);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.install-app-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Views */
.view {
    display: none;
    padding: 1.25rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding-top: 1.5rem;
}

.view.active {
    display: block;
}

/* Quick Filters */
.quick-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.25rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 50;
}

.filter-btn {
    padding: 0.625rem 1rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(50, 103, 92, 0.2);
    -webkit-touch-callout: none;
    white-space: nowrap;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
}

.filter-btn:hover {
    background-color: var(--background);
    border-color: var(--primary-teal);
    color: var(--primary-teal);
}

.filter-btn.active {
    background: var(--accent-gradient);
    border-color: var(--primary-teal);
    color: white;
    font-weight: 600;
}

.filter-btn:active {
    transform: scale(0.95);
}

/* Calendar Header */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.nav-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-width: 2.75rem;
    min-height: 2.75rem;
}

.nav-btn:hover {
    background-color: var(--background);
    border-color: #D1D5DB;
}

.nav-btn:active {
    transform: scale(0.95);
}

#current-month {
    font-size: clamp(1.25rem, 5vw, 1.5rem);
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    flex: 1;
}

/* Unclaimed Badge */
.unclaimed-badge {
    background: var(--orange-gradient);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(229, 112, 52, 0.3);
}

.unclaimed-badge strong {
    font-weight: 700;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    background-color: var(--card-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
}

.day-name {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.5rem;
    font-size: 0.875rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    min-height: 3.75rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.calendar-day:hover {
    background-color: #F3F4F6;
}

.calendar-day:active {
    transform: scale(0.95);
}

.calendar-day.other-month {
    color: #D1D5DB;
}

.calendar-day.selected {
    background-color: var(--primary-blue);
    color: white;
}

.calendar-day.selected:hover {
    background-color: #2563EB;
}

.day-number {
    font-size: 0.875rem;
    font-weight: 500;
}

.event-dots {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.event-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
}

.event-dot.unclaimed {
    background-color: #00FF00;
    box-shadow: 0 0 4px rgba(0, 255, 0, 0.5);
}

.event-dot.claimed {
    background-color: #FF0000;
    box-shadow: 0 0 4px rgba(255, 0, 0, 0.5);
}

/* Add Event Button */
.add-event-btn {
    width: 100%;
    padding: 0.875rem;
    background-color: var(--primary-blue);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1.25rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 3rem;
}

.add-event-btn:hover {
    background-color: #2563EB;
}

.add-event-btn:active {
    transform: scale(0.98);
}

/* Selected Date Events */
.selected-date-events {
    margin-bottom: 1.25rem;
}

.selected-date-events h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

#selected-events-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Event Card */
.event-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    transition: box-shadow 0.2s ease;
}

.event-card:active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.event-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.event-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    word-break: break-word;
}

.event-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.event-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.event-badge.available {
    background-color: rgba(152, 246, 116, 0.2);
    color: var(--primary-dark-green);
    font-weight: 600;
    border: 1px solid rgba(152, 246, 116, 0.4);
}

.event-type-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
}

.event-type-badge.cleaning {
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    color: #1E40AF;
    border: 1px solid #93C5FD;
}

.event-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.event-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    word-break: break-word;
    white-space: pre-wrap;
}

.event-creator {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.event-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 2.5rem;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3a7867, #145028);
}

.btn-success {
    background: var(--orange-gradient);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #f57d3f, #c44e1a);
}

/* Profile Section */
.profile-section {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.profile-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.current-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Team Members List */
.team-members {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.team-member:hover {
    background-color: var(--background);
}

.team-member:active {
    transform: scale(0.98);
}

.team-member.active {
    background-color: #EFF6FF;
    border-color: var(--primary-blue);
}

.team-member .user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.125rem;
}

/* Team Statistics */
#team-statistics {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: var(--background);
    border-radius: 0.5rem;
}

.stat-item .user-avatar {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1rem;
}

.stat-info {
    flex: 1;
}

.stat-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-numbers {
    display: flex;
    gap: 1rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.stat-number {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-number strong {
    color: var(--text-primary);
}

/* Unclaimed Section */
.unclaimed-section {
    background-color: var(--yellow-bg);
    padding: 1.25rem;
    margin-top: 1.25rem;
}

.unclaimed-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--yellow-text);
    margin-bottom: 1rem;
    text-align: center;
}

#unclaimed-events-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    align-items: flex-end;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 37.5rem;
    margin: 0 auto;
    border-radius: 1.25rem 1.25rem 0 0;
    padding: 1.5rem;
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    -webkit-appearance: none;
    appearance: none;
    background-color: white;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(50, 103, 92, 0.15);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 1.5rem;
}

.modal-actions-row {
    display: flex;
    gap: 0.75rem;
}

.modal-actions-row .btn {
    flex: 1;
    padding: 0.75rem;
    font-size: 1rem;
}

.btn-full-width {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
}

/* Notifications */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.no-notifications {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

.notification-item {
    position: relative;
    padding: 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-blue);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    touch-action: pan-y;
}

.notification-item.swiping {
    transition: none;
}

.notification-item.deleting {
    transform: translateX(-100%);
    opacity: 0;
}

.notification-content {
    display: block;
    width: 100%;
}

.notification-message {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1F2937;
    margin-bottom: 0.5rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.notification-time {
    font-size: 0.8125rem;
    color: #6B7280;
    display: block;
}

.btn-small {
    display: none;
}

.btn-small:hover {
    background: #FEE2E2;
    color: #DC2626;
}

/* Notification Form */
.notification-form {
    max-width: 600px;
}

.notification-form select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    background: white;
}

.notification-form select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* User Performance */
.user-performance {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ============================================
   TEAM MEMBERS MANAGEMENT (ADMIN)
   ============================================ */

.members-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--background);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
}

.member-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: var(--primary-blue);
}

.member-card:active {
    transform: translateY(0);
}

.member-info {
    flex: 1;
}

.member-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.member-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.member-actions {
    display: flex;
    gap: 0.5rem;
}

/* Small button variant for member actions */
.btn-small {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    min-width: auto;
    min-height: auto;
}

.btn-danger {
    background: #EF4444;
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-danger:disabled {
    background: #FCA5A5;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-secondary {
    background-color: #3B82F6;
    color: white;
}

.btn-secondary:hover {
    background-color: #2563EB;
}

/* Member Modal Specific Styles */
#member-modal .form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

#member-modal input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary-teal);
    border: 2px solid #D1D5DB;
    border-radius: 4px;
    appearance: auto;
    -webkit-appearance: checkbox;
}

#member-modal input[type="checkbox"]:checked {
    background-color: var(--primary-teal);
    border-color: var(--primary-teal);
}

#member-modal input[type="checkbox"]:hover {
    border-color: var(--primary-teal);
}

#member-modal .form-group:has(input[type="checkbox"]) label {
    cursor: pointer;
    user-select: none;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

#member-modal .form-group:has(input[type="checkbox"]) label:hover {
    background-color: #F3F4F6;
}

#member-modal input[type="color"] {
    width: 100%;
    height: 50px;
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
}

#member-modal input[type="color"]:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}


.performance-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--background);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    position: relative;
    transition: all 0.2s ease;
}

.performance-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.rank-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    font-size: 1.25rem;
    z-index: 1;
}

.performance-info {
    flex: 1;
}

.performance-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.performance-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.percent-badge {
    padding: 0.25rem 0.625rem;
    background: var(--accent-gradient);
    color: white;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.performance-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.stat-badge {
    padding: 0.25rem 0.625rem;
    background: rgba(50, 103, 92, 0.1);
    color: var(--primary-teal);
    border-radius: 0.5rem;
    font-size: 0.75rem;
}

.stat-badge strong {
    font-weight: 700;
}

.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: #E5E7EB;
    border-radius: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 1rem;
    transition: width 0.5s ease;
    background: var(--primary-blue);
}

/* Responsive Design */
@media (max-width: 768px) {
    .view {
        padding: 0.75rem;
    }

    #current-month {
        font-size: clamp(1.125rem, 4.5vw, 1.25rem);
    }

    .calendar-grid {
        gap: 0.25rem;
        padding: 0.75rem;
    }

    .calendar-day {
        min-height: 3.125rem;
        padding: 0.25rem;
    }

    .day-number {
        font-size: 0.75rem;
    }

    .event-dot {
        width: 0.25rem;
        height: 0.25rem;
    }

    .event-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .event-badge {
        margin-top: 0.5rem;
    }

    .stat-numbers {
        flex-direction: column;
        gap: 0.25rem;
    }

    .unclaimed-section {
        padding: 0.75rem;
    }

    .modal-content {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .tab {
        font-size: 0.875rem;
        padding: 0.75rem;
    }

    .install-app-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

    .logout-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

    .login-content {
        padding: 1.5rem;
    }

    .login-content h1 {
        font-size: 1.5rem;
    }

    .login-users {
        grid-template-columns: repeat(2, 1fr);
    }

    .login-user-card .user-avatar {
        width: 3rem;
        height: 3rem;
        font-size: 1.5rem;
    }

    #current-month {
        font-size: 1.125rem;
    }

    .calendar-day {
        min-height: 2.5rem;
    }

    .day-name {
        font-size: 0.75rem;
        padding: 0.25rem;
    }

    .event-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .nav-btn {
        min-width: 2.5rem;
        min-height: 2.5rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Install PWA Banner */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--primary-blue);
    color: white;
    z-index: 999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    animation: slideUpBanner 0.3s ease;
}

@keyframes slideUpBanner {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.install-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.install-content span {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
}

.install-content .btn-primary {
    background-color: white;
    color: var(--primary-blue);
    font-weight: 600;
    flex-shrink: 0;
}

.install-content .btn-primary:hover {
    background-color: #F3F4F6;
}

.btn-icon {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Prevent pull-to-refresh on iOS */
body {
    overscroll-behavior-y: contain;
}

/* Better touch targets */
button, a, .calendar-day, .team-member {
    min-height: 2.75rem;
    min-width: 2.75rem;
}

/* Improve text readability */
@media (prefers-color-scheme: dark) {
    /* Add dark mode support if needed */
}
