/* ==================== Variables ==================== */
:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --primary-bg: #EEF2FF;
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --tab-height: 64px;
    --header-height: 56px;
    /* iOS Safe Areas */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

/* ==================== Reset ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-tap-highlight-color: transparent;
    /* Prevent iOS bounce scroll */
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    /* iOS PWA: prevent overscroll */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    /* Prevent pull-to-refresh in PWA */
    overscroll-behavior-y: contain;
}

/* iOS PWA Standalone Mode Detection */
@media all and (display-mode: standalone) {
    body {
        /* Extra padding when in PWA mode */
        padding-top: 0;
    }

    .header {
        /* Ensure header covers status bar area */
        background: linear-gradient(to bottom, var(--primary) 0%, var(--primary) var(--safe-area-top), white var(--safe-area-top), white 100%);
    }
}

/* iOS Safari specific - when NOT in standalone mode, add extra bottom padding */
@supports (-webkit-touch-callout: none) {
    body:not(.standalone) {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

/* ==================== Utilities ==================== */
.hidden { display: none !important; }

/* ==================== Connection Status ==================== */
.connection-status {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--danger) 0%, #DC2626 100%);
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.connection-status:not(.hidden) {
    transform: translateY(0);
}

.connection-status.online {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

/* ==================== Header ==================== */
.header {
    background: white;
    color: var(--gray-900);
    padding: 0 1rem;
    padding-top: var(--safe-area-top);
    height: calc(var(--header-height) + var(--safe-area-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
}

.logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--gray-600);
    transition: all 0.2s;
}

.header-icon-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.user-menu {
    position: relative;
}

.user-btn {
    background: var(--primary-bg);
    border: none;
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
}

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

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    min-width: 220px;
    padding: 0.5rem 0;
    color: var(--gray-900);
    border: 1px solid var(--gray-200);
}

.user-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease;
}

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

.user-dropdown .user-info {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.user-dropdown .user-info strong {
    display: block;
    font-size: 1rem;
}

.user-dropdown .user-info small {
    display: block;
    color: var(--gray-500);
    font-size: 0.75rem;
}

.user-dropdown hr {
    display: none;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.user-dropdown a:hover {
    background: var(--gray-50);
}

.user-dropdown .logout-link {
    color: var(--danger);
    border-top: 1px solid var(--gray-200);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

.role-badge.admin {
    background: var(--primary-bg);
    color: var(--primary);
}

.role-badge.champion {
    background: var(--success-light);
    color: var(--success);
}

/* ==================== Tab Bar (Mobile Navigation) ==================== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--tab-height) + max(var(--safe-area-bottom), 12px));
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 0.5rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 100;
    padding-bottom: max(var(--safe-area-bottom), 12px);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--gray-400);
    font-size: 0.625rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
    position: relative;
}

.tab-item.active {
    color: var(--primary);
}

.tab-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

.tab-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    transition: transform 0.2s;
}

.tab-item.active .tab-icon {
    transform: scale(1.1);
}

/* ==================== Floating Action Button ==================== */
.fab {
    position: fixed;
    bottom: calc(var(--tab-height) + 16px + env(safe-area-inset-bottom));
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 90;
}

.fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

/* ==================== Main Content ==================== */
.main-content {
    padding: calc(var(--header-height) + var(--safe-area-top) + 16px) 16px calc(var(--tab-height) + max(var(--safe-area-bottom), 12px) + 16px);
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

.main-content.no-padding {
    padding: calc(var(--header-height) + var(--safe-area-top)) 0 calc(var(--tab-height) + max(var(--safe-area-bottom), 12px));
}

.main-content.no-tabs {
    padding-bottom: 16px;
}

/* ==================== Flash Messages ==================== */
.flash-messages {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-area-top) + 8px);
    left: 16px;
    right: 16px;
    z-index: 200;
}

.flash-message {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.flash-message.success {
    background: var(--success-light);
    color: #065F46;
    border-left: 4px solid var(--success);
}

.flash-message.error {
    background: var(--danger-light);
    color: #991B1B;
    border-left: 4px solid var(--danger);
}

.flash-message.info {
    background: var(--primary-bg);
    color: var(--primary-dark);
    border-left: 4px solid var(--primary);
}

.flash-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.5;
    padding: 0.25rem;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-outline {
    background: white;
    border: 2px solid var(--gray-200);
    color: var(--gray-700);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #DC2626 100%);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--gray-200);
}

.btn-icon.danger {
    color: var(--danger);
}

/* ==================== Forms ==================== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    background: white;
    transition: all 0.2s;
    color: var(--gray-900);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

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

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.form-actions.sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 50;
}

/* ==================== Auth Pages ==================== */
.auth-page {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.auth-logo-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    margin: 0 auto 1rem;
    display: block;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.auth-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}

.auth-header p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Invitation Required Page */
.invite-required-message {
    text-align: center;
    padding: 2rem 1rem;
}

.invite-required-message .invite-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.invite-required-message h2 {
    font-size: 1.25rem;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
}

.invite-required-message p {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.invite-required-message .invite-hint {
    color: var(--gray-500);
    font-size: 0.75rem;
    font-style: italic;
}

/* Invitation Info on Register Page */
.invitation-info {
    background: var(--primary-bg);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.invitation-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.invitation-badge.admin {
    background: linear-gradient(135deg, var(--gray-700) 0%, var(--gray-800) 100%);
    color: white;
}

.invitation-badge.champion {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.invitation-team {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.input-readonly {
    background: var(--gray-100) !important;
    color: var(--gray-500) !important;
    cursor: not-allowed;
}

/* ==================== Cards ==================== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* ==================== Task Cards (SCH Dashboard) ==================== */
.task-card-modern {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
    border-left: 4px solid var(--primary);
}

.task-card-modern.completed {
    border-left-color: var(--success);
    opacity: 0.7;
}

.task-card-modern.self_created {
    border-left-color: var(--warning);
}

.task-card-modern .task-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.task-card-modern.completed .task-icon {
    background: var(--success-light);
    color: var(--success);
}

.task-card-modern .task-content {
    flex: 1;
    min-width: 0;
}

.task-card-modern .task-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-card-modern .task-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.task-card-modern .task-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.task-card-modern .task-action {
    flex-shrink: 0;
}

.task-card-modern .task-action .btn {
    padding: 0.5rem 1rem;
}

/* ==================== Section Headers ==================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
}

.section-subtitle {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.125rem;
}

/* ==================== Dashboard Welcome ==================== */
.welcome-section {
    margin-bottom: 1.5rem;
}

.welcome-greeting {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.welcome-date {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* ==================== Stats Cards ==================== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

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

.stat-label {
    font-size: 0.625rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state.small {
    padding: 1.5rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.empty-state p {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* ==================== Team Chips ==================== */
.team-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.team-chip {
    background: var(--primary-bg);
    color: var(--primary);
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

/* ==================== Modal ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-content.modal-center {
    border-radius: var(--radius-lg);
    margin: 1rem;
    max-height: calc(100vh - 2rem);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
}

.modal-close {
    background: var(--gray-100);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content form {
    padding: 1.5rem;
}

/* ==================== Switch Toggle ==================== */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch.small {
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    transition: 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: var(--shadow);
}

.switch.small .slider:before {
    height: 18px;
    width: 18px;
}

input:checked + .slider {
    background: var(--success);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.switch.small input:checked + .slider:before {
    transform: translateX(20px);
}

/* ==================== Sync Toggle (Fixed) ==================== */
.sync-toggle {
    position: fixed;
    bottom: calc(var(--tab-height) + 80px + env(safe-area-inset-bottom));
    left: 16px;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 50;
    border: 1px solid var(--gray-200);
}

.sync-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
}

.sync-status {
    font-size: 0.625rem;
    color: var(--success);
    font-weight: 600;
    text-transform: uppercase;
}

.sync-status.inactive {
    color: var(--gray-400);
}

/* ==================== Days Selector ==================== */
.days-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.days-selector label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--gray-100);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.days-selector label:has(input:checked) {
    background: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
}

.days-selector input[type="checkbox"] {
    display: none;
}

/* ==================== Info Box ==================== */
.info-box {
    background: var(--primary-bg);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--primary-dark);
    border-left: 4px solid var(--primary);
}

/* ==================== Join Team Page ==================== */
.join-team-page {
    display: flex;
    justify-content: center;
    padding-top: 2rem;
}

.form-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow);
}

.form-card.centered {
    margin: 0 auto;
}

.card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.card-header h2 {
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.card-header p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* ==================== Code Input ==================== */
.code-input {
    text-transform: uppercase;
    text-align: center;
    font-size: 1.75rem !important;
    letter-spacing: 0.5rem;
    font-weight: 700;
    font-family: monospace;
}

/* ==================== Visit Form ==================== */
.visit-form-page {
    background: white;
    min-height: 100vh;
}

.task-info-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.25rem;
}

.task-info-banner h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.task-info-banner p {
    opacity: 0.9;
    font-size: 0.875rem;
}

.form-section {
    padding: 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.form-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.photo-container {
    cursor: pointer;
}

.photo-preview {
    width: 100%;
    height: 200px;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px dashed var(--gray-300);
    transition: all 0.2s;
}

.photo-preview:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview .placeholder {
    color: var(--gray-400);
    font-size: 0.875rem;
}

#photoInput {
    display: none;
}

.location-display {
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}

.location-display .success {
    color: var(--success);
    font-weight: 600;
}

.location-display .error {
    color: var(--danger);
}

.location-display small {
    display: block;
    color: var(--gray-500);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.mini-map {
    height: 150px;
    border-radius: var(--radius);
    overflow: hidden;
}

/* ==================== Admin Specific ==================== */
.teams-grid {
    display: grid;
    gap: 1rem;
}

.team-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.team-card .team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.team-card h3 {
    font-size: 1.125rem;
    color: var(--gray-900);
}

.team-code {
    font-family: monospace;
    background: var(--primary-bg);
    color: var(--primary);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
}

.team-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.team-stats .stat {
    text-align: center;
}

.team-stats .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.team-stats .stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.team-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ==================== Settings Page ==================== */
.settings-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.settings-section h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--gray-900);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.setting-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-item:first-child {
    padding-top: 0;
}

.setting-info strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.setting-info p {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin: 0;
}

/* ==================== Reports ==================== */
.filters-form {
    background: white;
    padding: 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.filter-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 120px;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--gray-600);
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.625rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

/* ==================== Responsive ==================== */
@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }

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

    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .header-buttons {
        display: flex;
        gap: 0.5rem;
    }

    .header-buttons .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* ==================== Admin pages ==================== */
body.admin-page .main-content {
    padding-bottom: calc(var(--tab-height) + max(var(--safe-area-bottom), 12px) + 16px);
}

body.admin-page .sync-toggle {
    display: none;
}

/* Hide champion tab bar on admin pages (only hide non-admin tab bars) */
body.admin-page .tab-bar:not(.admin) {
    display: none;
}

/* Show admin tab bar */
body.admin-page .tab-bar.admin {
    display: flex;
}

/* ==================== Page Header ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h2 {
    font-size: 1.25rem;
    color: var(--gray-900);
}

/* ==================== Template Cards ==================== */
.template-card {
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--success);
}

.template-card.inactive {
    opacity: 0.5;
    border-left-color: var(--gray-300);
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.template-header h4 {
    font-size: 0.9375rem;
}

.template-client {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.template-schedule {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ==================== Nav Cards (Admin) ==================== */
.team-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.nav-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    text-decoration: none;
    color: var(--gray-700);
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.nav-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--primary);
}

.nav-card.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.nav-card.highlight:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
}

.nav-icon {
    font-size: 1.75rem;
    display: block;
    margin-bottom: 0.5rem;
}

.nav-label {
    font-size: 0.875rem;
    font-weight: 600;
}

/* ==================== Team Detail ==================== */
.team-info-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.code-display .label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.code-display .code {
    font-size: 2rem;
    font-family: monospace;
    letter-spacing: 0.25rem;
    color: var(--primary);
    font-weight: 700;
}

.code-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.75rem;
}

/* Members list */
.members-list {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

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

.member-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.member-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.member-name {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
}

.member-email {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.member-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.member-date {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* ==================== Task list (Admin) ==================== */
.tasks-list .task-card {
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
}

.task-card.completed {
    opacity: 0.6;
}

.task-card.cancelled {
    opacity: 0.4;
}

.task-card .task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.task-card .task-header h4 {
    font-size: 0.9375rem;
}

.task-status {
    font-size: 0.625rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    font-weight: 600;
    text-transform: uppercase;
}

.task-status.pending {
    background: var(--warning-light);
    color: #92400E;
}

.task-status.completed {
    background: var(--success-light);
    color: #065F46;
}

.task-status.cancelled {
    background: var(--gray-200);
    color: var(--gray-600);
}

.task-client, .task-time, .task-assigned {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

/* Date nav */
.date-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-nav input {
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

/* ==================== Visit Card (Reports) ==================== */
.visit-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.visit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.visit-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.visit-user .avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.visit-user .name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.visit-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.visit-task {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.visit-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.badge {
    font-size: 0.6875rem;
    padding: 0.375rem 0.625rem;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    font-weight: 500;
    color: var(--gray-700);
}

.visit-notes {
    font-size: 0.8125rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    color: var(--gray-700);
    line-height: 1.5;
}

.visit-footer {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

/* ==================== Modern Champion Dashboard ==================== */
.champion-dashboard {
    padding-bottom: 2rem;
}

.welcome-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.welcome-text h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.today-date {
    font-size: 0.875rem;
    color: var(--gray-500);
    text-transform: capitalize;
}

.teams-indicator {
    background: var(--primary-bg);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
}

.teams-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}

/* Stats Cards Row */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stats-cards .stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
}

.stats-cards .stat-card.completed {
    background: linear-gradient(135deg, var(--success-light) 0%, #ECFDF5 100%);
    border-color: var(--success);
}

.stats-cards .stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
    line-height: 1;
}

.stats-cards .stat-card.completed .stat-number {
    color: var(--success);
}

.stats-cards .stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
    display: block;
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.section-header .badge {
    background: var(--primary);
    color: white;
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

/* Modern Task List */
.tasks-modern-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-card-modern {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    border-left: 4px solid var(--primary);
}

.task-card-modern.completed {
    border-left-color: var(--success);
    opacity: 0.6;
}

.task-card-left {
    flex-shrink: 0;
}

.task-time-badge {
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.5rem;
    border-radius: var(--radius);
    min-width: 48px;
    text-align: center;
}

.task-time-badge.flexible {
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 0.625rem;
}

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

.task-card-content h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-client-name {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin: 0 0 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.task-client-name .icon {
    font-size: 0.875rem;
}

.task-team-tag {
    display: inline-block;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.625rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-weight: 500;
}

/* Upcoming Tasks Styles */
.tasks-modern-list.upcoming {
    gap: 0.5rem;
}

.date-separator {
    padding: 0.5rem 0 0.25rem;
    margin-top: 0.5rem;
}

.date-separator:first-child {
    margin-top: 0;
}

.date-separator span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: capitalize;
}

.task-card-modern.upcoming {
    border-left-color: var(--gray-300);
    background: var(--gray-50);
    padding: 0.75rem;
}

.task-date-badge.small {
    background: var(--gray-200);
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius);
    text-align: center;
    min-width: 40px;
}

.task-date-badge.small .day {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gray-700);
    line-height: 1;
}

.task-date-badge.small .month {
    display: block;
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--gray-500);
    text-transform: uppercase;
}

.task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.25rem;
}

.task-time-tag {
    display: inline-block;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.task-card-action {
    flex-shrink: 0;
}

.btn-action {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
    transition: all 0.2s;
}

.btn-action:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
}

.status-icon.completed {
    width: 44px;
    height: 44px;
    background: var(--success-light);
    color: var(--success);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 700;
}

/* Empty State Modern */
.empty-state-modern {
    text-align: center;
    padding: 3rem 1rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.empty-illustration {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state-modern h3 {
    font-size: 1.125rem;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.empty-state-modern p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Teams Chips Modern */
.teams-chips-modern {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.team-chip-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow);
}

.team-initial {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.team-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
}

.team-chip-add {
    width: 44px;
    height: 44px;
    background: var(--gray-100);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--gray-400);
    text-decoration: none;
    transition: all 0.2s;
}

.team-chip-add:hover {
    background: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
}

/* Info Modal */
.info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 400;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.info-modal.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.info-modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 360px;
    padding: 2rem;
    text-align: center;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.info-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.info-logo-img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-lg);
    margin: 0 auto 1rem;
    display: block;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.info-modal-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}

.info-version {
    display: inline-block;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    margin-bottom: 1.5rem;
}

.info-list {
    text-align: left;
    margin-bottom: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.info-item .icon {
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.info-item .text {
    font-size: 0.8125rem;
    color: var(--gray-700);
}

.info-item .text strong {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-900);
    margin-bottom: 0.125rem;
}

.info-close-btn {
    width: 100%;
}


/* ==================== Update Notification ==================== */
.update-notification {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.update-notification span {
    font-size: 0.875rem;
    font-weight: 500;
}

.update-notification button {
    background: white;
    color: var(--primary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.update-notification button:hover {
    transform: scale(1.05);
}

/* ==================== Tasks Page Filters ==================== */
.filters-section {
    margin-bottom: 1rem;
}

.date-picker-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: white;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 0.75rem;
}

.date-nav-btn {
    width: 36px;
    height: 36px;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.2s;
}

.date-nav-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.date-input-modern {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.625rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    text-align: center;
}

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

.filter-chips {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    background: white;
    border: 2px solid var(--gray-200);
    color: var(--gray-600);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.day-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
}

.summary-date {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: capitalize;
}

.summary-count {
    font-size: 0.75rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}

/* Task type tags */
.task-tags {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.task-type-tag {
    font-size: 0.5625rem;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-type-tag.single {
    background: var(--primary-bg);
    color: var(--primary);
}

.task-type-tag.recurring_generated {
    background: var(--success-light);
    color: #065F46;
}

.task-type-tag.self_created {
    background: var(--warning-light);
    color: #92400E;
}

/* Task card left border colors by type */
.task-card-modern.recurring_generated {
    border-left-color: var(--success);
}

.task-card-modern.self_created {
    border-left-color: var(--warning);
}

/* ==================== My Tasks Page ==================== */
.my-tasks-page {
    padding-bottom: 2rem;
}

.team-selector-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.selector-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
}

.team-select {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
    background: white;
}

.team-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Action buttons row */
.action-buttons-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.action-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
}

.action-card.secondary {
    background: white;
    color: var(--gray-800);
    border: 2px solid var(--gray-200);
    box-shadow: var(--shadow);
}

.action-card.secondary:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.action-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.action-text {
    font-size: 0.9375rem;
    font-weight: 700;
    display: block;
}

.action-desc {
    font-size: 0.75rem;
    opacity: 0.8;
    display: block;
    margin-top: 0.25rem;
}

.action-card.secondary .action-desc {
    color: var(--gray-500);
}

/* Task date badge */
.task-date-badge {
    background: var(--warning-light);
    color: #92400E;
    padding: 0.5rem;
    border-radius: var(--radius);
    text-align: center;
    min-width: 48px;
}

.task-date-badge .day {
    font-size: 1.125rem;
    font-weight: 700;
    display: block;
    line-height: 1;
}

.task-date-badge .month {
    font-size: 0.625rem;
    text-transform: uppercase;
    font-weight: 600;
}

/* Task type tags status */
.task-type-tag.pending {
    background: var(--warning-light);
    color: #92400E;
}

.task-type-tag.completed {
    background: var(--success-light);
    color: #065F46;
}

/* Template cards modern */
.templates-modern-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.template-card-modern {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--success);
    transition: all 0.2s;
}

.template-card-modern.inactive {
    opacity: 0.5;
    border-left-color: var(--gray-300);
}

.template-card-modern.assigned {
    border-left-color: var(--primary);
    background: var(--primary-bg);
}

.assigned-badge {
    font-size: 0.625rem;
    padding: 0.25rem 0.5rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.template-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.template-title-row h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.template-client {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin: 0 0 0.5rem;
}

.template-schedule-info {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.schedule-days {
    font-size: 0.75rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
}

.schedule-time {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
}

.template-dates-info {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
}

.template-dates {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin: 0.375rem 0;
}

.template-stats {
    margin-top: 0.5rem;
}

.template-stats .stat {
    font-size: 0.6875rem;
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
}

/* Empty state small variant */
.empty-state-modern.small {
    padding: 2rem 1rem;
}

.empty-state-modern.small .empty-illustration {
    font-size: 2.5rem;
}

.empty-state-modern.small p {
    margin: 0;
}

/* ==================== Settings Page Modern ==================== */
.settings-page {
    padding-bottom: 2rem;
}

/* Sync Hero Card */
.sync-hero-card {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}

.sync-hero-card.disabled {
    background: linear-gradient(135deg, var(--gray-400) 0%, var(--gray-500) 100%);
    box-shadow: var(--shadow-md);
}

.sync-hero-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.sync-hero-info h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.sync-hero-info p {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0;
}

.sync-hero-toggle {
    margin-top: 1.25rem;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.sync-hero-toggle:hover {
    background: rgba(255,255,255,0.3);
}

.sync-hero-card.disabled .sync-hero-toggle {
    background: var(--success);
    border-color: var(--success);
}

/* Sync Pending Card */
.sync-pending-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.sync-pending-card.has-pending {
    background: var(--warning-light);
    border: 2px solid var(--warning);
}

.pending-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pending-icon {
    font-size: 1.5rem;
}

.pending-text strong {
    display: block;
    font-size: 0.9375rem;
    color: var(--gray-900);
}

.pending-text span {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Teams list in settings */
.teams-list-settings {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.team-item-modern {
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    box-shadow: var(--shadow);
}

.team-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
}

.team-details {
    flex: 1;
}

.team-details strong {
    display: block;
    font-size: 0.9375rem;
    color: var(--gray-900);
}

.team-code-display {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-family: monospace;
}

/* Account card */
.account-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.account-avatar {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
}

.account-details {
    flex: 1;
}

.account-details strong {
    display: block;
    font-size: 1.0625rem;
    color: var(--gray-900);
    margin-bottom: 0.125rem;
}

.account-details span {
    display: block;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.account-details .role-badge {
    display: inline-block;
    margin-top: 0.5rem;
}

/* About card */
.about-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.about-logo-img {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.about-info {
    flex: 1;
}

.about-info strong {
    display: block;
    font-size: 1rem;
    color: var(--gray-900);
}

.version-tag {
    display: inline-block;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    margin: 0.25rem 0 0.5rem;
}

.about-info p {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin: 0;
}

/* ==================== Visit Form Page Modern ==================== */
.visit-form-page {
    background: var(--gray-100);
    min-height: 100vh;
    padding-bottom: calc(var(--tab-height) + 80px + env(safe-area-inset-bottom));
}

.visit-section {
    padding: 1rem;
    background: white;
    border-bottom: 1px solid var(--gray-100);
}

.section-label {
    display: block;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
}

/* Team selector in visit form */
.team-selector-visit select {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    background: white;
}

/* Photo capture */
.photo-capture-card {
    cursor: pointer;
}

.photo-preview-large {
    width: 100%;
    height: 200px;
    background: var(--gray-50);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.2s;
}

.photo-preview-large:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.photo-preview-large.has-photo {
    border-style: solid;
    border-color: var(--success);
}

.photo-preview-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    text-align: center;
    color: var(--gray-400);
}

.placeholder-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.placeholder-text {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Location card */
.location-card {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
}

.location-card.success {
    background: var(--success-light);
}

.location-card.error {
    background: var(--danger-light);
}

.location-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.location-icon {
    font-size: 1.5rem;
}

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

.location-text {
    font-weight: 600;
    color: var(--gray-700);
}

.location-card.success .location-text {
    color: #065F46;
}

.location-coords {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-family: monospace;
}

.mini-map-large {
    height: 150px;
    border-radius: var(--radius);
    margin-top: 0.75rem;
    display: none;
    overflow: hidden;
}

/* Notes card */
.notes-card textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s;
}

.notes-card textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
}

.notes-card textarea::placeholder {
    color: var(--gray-400);
}

/* Option chips for dropdowns */
.option-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.option-chip {
    flex: 1 1 calc(50% - 0.3125rem);
    min-width: 140px;
}

.option-chip input {
    display: none;
}

.chip-content {
    display: block;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s;
}

.chip-content:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.option-chip input:checked + .chip-content {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

/* Visit actions */
.visit-actions {
    position: fixed;
    bottom: calc(var(--tab-height) + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    background: white;
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 50;
}

.visit-actions .btn {
    flex: 1;
}

.btn-large {
    padding: 1rem 1.5rem;
    font-size: 1rem;
}

/* Hide old sync toggle and related styles */
.sync-toggle {
    display: none !important;
}

/* ==================== Champion Detail Page (Admin) ==================== */
.champion-detail-page {
    padding-bottom: 2rem;
}

.champion-header-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.champion-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.champion-avatar-large {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
}

.champion-details h2 {
    font-size: 1.125rem;
    margin: 0 0 0.25rem;
    color: var(--gray-900);
}

.champion-email {
    font-size: 0.8125rem;
    color: var(--gray-500);
    display: block;
}

.team-badge {
    display: inline-block;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    margin-top: 0.375rem;
}

/* Date selector card */
.date-selector-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 0.875rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.date-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: capitalize;
    margin-left: auto;
}

/* Stats row admin */
.stats-row-admin {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card-admin {
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card-admin .stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    display: block;
    color: var(--gray-800);
}

.stat-card-admin .stat-label {
    font-size: 0.625rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-admin.pending .stat-number {
    color: var(--warning);
}

.stat-card-admin.completed .stat-number {
    color: var(--success);
}

.stat-card-admin.visits .stat-number {
    color: var(--primary);
}

/* Tasks list admin */
.tasks-list-admin {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-item-admin {
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    box-shadow: var(--shadow);
}

.task-status-indicator {
    width: 4px;
    height: 40px;
    border-radius: 2px;
    background: var(--warning);
    flex-shrink: 0;
}

.task-status-indicator.completed {
    background: var(--success);
}

.task-item-admin .task-info {
    flex: 1;
    min-width: 0;
}

.task-item-admin h4 {
    font-size: 0.9375rem;
    margin: 0 0 0.25rem;
    color: var(--gray-900);
}

.task-item-admin .task-client,
.task-item-admin .task-time {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-right: 0.75rem;
}

.task-status-badge {
    font-size: 0.6875rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    flex-shrink: 0;
}

.task-status-badge.pending {
    background: var(--warning-light);
    color: #92400E;
}

.task-status-badge.completed {
    background: var(--success-light);
    color: #065F46;
}

/* Visits list admin */
.visits-list-admin {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.visit-item-admin {
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.visit-time {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
    width: 50px;
}

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

.visit-content h4 {
    font-size: 0.9375rem;
    margin: 0 0 0.375rem;
    color: var(--gray-900);
}

.visit-notes {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin: 0 0 0.5rem;
    line-height: 1.4;
}

.visit-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.visit-tag {
    font-size: 0.625rem;
    padding: 0.25rem 0.5rem;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: var(--radius-full);
}

.visit-photo-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.visit-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Member item clickable */
.member-item.clickable {
    cursor: pointer;
    transition: all 0.2s;
}

.member-item.clickable:hover {
    background: var(--gray-50);
    transform: translateX(4px);
}

.member-arrow {
    font-size: 1.25rem;
    color: var(--gray-400);
    margin-left: 0.5rem;
}

@media (max-width: 480px) {
    .stats-row-admin {
        grid-template-columns: repeat(2, 1fr);
    }

    .champion-header-card {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .champion-info {
        flex-direction: column;
    }

    .date-label {
        width: 100%;
        text-align: center;
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* ==================== Admin Today Page ==================== */
.admin-today-page {
    padding-bottom: calc(var(--tab-height) + 1rem);
}

.today-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.today-header h2 {
    font-size: 1.25rem;
    color: var(--gray-800);
    margin: 0;
    text-transform: capitalize;
}

.today-header .subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0.25rem 0 0;
}

.stat-card.total {
    background: var(--gray-100);
    color: var(--gray-600);
}

.stat-card.total .stat-number {
    color: var(--gray-700);
}

/* Team Summary Cards */
.team-summary-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.team-summary-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.team-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.team-summary-header .team-name {
    font-weight: 600;
    color: var(--gray-800);
}

.team-summary-header .team-progress {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

.progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, #059669 100%);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.team-summary-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
}

.team-summary-stats .pending {
    color: var(--warning);
}

.team-summary-stats .completed {
    color: var(--success);
}

/* Task Tags */
.task-assignee-tag {
    display: inline-block;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 0.625rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-weight: 500;
}

.status-icon.pending {
    color: var(--warning);
    font-size: 1.25rem;
}

/* ==================== Admin Tab Bar ==================== */
.tab-bar.admin {
    background: linear-gradient(135deg, #1F2937 0%, #374151 100%);
}

.tab-bar.admin .tab-item {
    color: rgba(255, 255, 255, 0.6);
}

.tab-bar.admin .tab-item.active {
    color: white;
}

.tab-bar.admin .tab-item.active::before {
    background: var(--primary-light);
}

/* ==================== Consolidated Reports Page ==================== */
.consolidated-reports-page {
    padding-bottom: calc(var(--tab-height) + 1rem);
}

.filters-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.filters-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-row {
    display: flex;
    gap: 0.75rem;
}

.filter-group {
    flex: 1;
}

.filter-group.full {
    flex: 1 1 100%;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.625rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.report-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-stat {
    flex: 1;
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.summary-stat .number {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.summary-stat .label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Team Report Section */
.team-report-section {
    background: white;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.team-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.team-report-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--gray-800);
}

.team-report-header .visit-count {
    font-size: 0.75rem;
    background: var(--primary-bg);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.visits-list {
    padding: 0.5rem;
}

.visit-card {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.visit-card:last-child {
    border-bottom: none;
}

.visit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.visit-user {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
}

.visit-time {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.visit-content h4 {
    margin: 0 0 0.25rem;
    font-size: 0.9375rem;
    color: var(--gray-800);
}

.visit-client {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin: 0 0 0.5rem;
}

.visit-notes {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.visit-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.visit-tags .tag {
    font-size: 0.625rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--gray-600);
}

.visit-tags .tag.interest {
    background: var(--primary-bg);
    color: var(--primary);
}

.visit-tags .tag.status {
    background: var(--success-light);
    color: var(--success);
}

.visit-tags .tag.size {
    background: var(--warning-light);
    color: var(--warning);
}

.visit-photo {
    margin-top: 0.75rem;
}

.visit-photo img {
    width: 100%;
    max-width: 200px;
    border-radius: var(--radius);
}

/* ==================== Admin Settings Page ==================== */
.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section h3 {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.profile-avatar {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
}

.profile-info h4 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--gray-800);
}

.profile-info p {
    margin: 0.25rem 0 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.settings-list {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

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

.item-info .item-name {
    display: block;
    font-weight: 500;
    color: var(--gray-800);
}

.item-info .item-detail {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.item-count,
.item-value {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.btn-danger {
    background: white;
    color: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* ==================== Admin Teams Page ==================== */
.admin-teams-page {
    padding-bottom: calc(var(--tab-height) + 1rem);
}

.page-header-simple {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.teams-list-modern {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.team-card-modern {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.team-card-modern:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.team-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.team-card-icon span {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
}

.team-card-info {
    flex: 1;
    min-width: 0;
}

.team-card-info h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    color: var(--gray-800);
}

.team-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.meta-item {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.team-card-arrow {
    color: var(--gray-400);
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Admin page wrapper padding for tab bar */
.admin-page .main-content {
    padding-bottom: calc(var(--tab-height) + 16px);
}

/* ==================== Invitation System ==================== */
.invite-page {
    max-width: 500px;
    margin: 0 auto;
    padding-bottom: calc(var(--tab-height) + 2rem);
}

.invite-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.invite-card.success {
    border-top: 4px solid var(--success);
}

.invite-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.invite-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.invite-icon.admin {
    background: var(--gray-100);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
}

.invite-icon.success {
    color: var(--success);
}

.invite-header h2 {
    font-size: 1.25rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.invite-header p {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.invite-form {
    margin-bottom: 1rem;
}

.invite-info {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1.5rem;
    font-size: 0.8125rem;
}

.invite-info p {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.invite-info ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--gray-600);
}

.invite-info li {
    margin-bottom: 0.25rem;
}

.invite-link-section {
    margin: 1.5rem 0;
}

.invite-link-section label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.invite-link-box {
    display: flex;
    gap: 0.5rem;
}

.invite-url-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.75rem;
    background: var(--gray-50);
    color: var(--gray-700);
}

.copy-btn {
    flex-shrink: 0;
}

.copy-btn.copied {
    background: var(--success);
    border-color: var(--success);
}

.invite-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.invite-instructions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.invite-instructions h4 {
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.invite-instructions ol {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.invite-instructions li {
    margin-bottom: 0.5rem;
}

.invite-team-info,
.invite-role-info {
    margin-top: 0.5rem;
}

/* Invitation lists */
.invitations-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.invitations-list.compact {
    margin-bottom: 1rem;
}

.invitation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--warning-light);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}

.invitation-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.invitation-email {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--gray-800);
}

.invitation-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.invitation-actions {
    display: flex;
    gap: 0.5rem;
}

/* Team header actions */
.team-header-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

/* Section header with action */
.section-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header-with-action h3 {
    margin: 0;
}

/* Pending invites section */
.pending-invites-section {
    margin-bottom: 1rem;
}

.pending-invites-section h4 {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

/* Small button */
.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Muted card */
.team-info-card.muted {
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
}

.team-info-card.muted .code {
    color: var(--gray-500);
}

/* Item badge */
.item-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius);
}

.item-badge.muted {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* Settings item clickable */
.settings-item.clickable {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.settings-item.clickable:hover {
    background: var(--gray-50);
}

/* Button success */
.btn-success {
    background: var(--success);
    color: white;
    border: none;
}

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

/* ==================== No Team Page ==================== */
.no-team-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--header-height) - var(--safe-area-top) - 100px);
    padding: 1rem;
}

.no-team-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.no-team-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.no-team-card h2 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.no-team-card p {
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.no-team-card .hint {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
}

.no-team-info {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1.5rem 0;
    text-align: left;
}

.no-team-info h4 {
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.no-team-info ol {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.no-team-info li {
    margin-bottom: 0.5rem;
}

.no-team-actions {
    margin-top: 1.5rem;
}
