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

        html, body {
            overflow-x: hidden;
            width: 100%;
            -webkit-text-size-adjust: 100%;
        }

        button {
            cursor: pointer;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
            touch-action: manipulation;
        }

        button:active {
            opacity: 0.8;
        }

        .emoji-btn, .theme-option, .badge-item, .week-task {
            cursor: pointer;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
            user-select: none;
            -webkit-user-select: none;
            touch-action: manipulation;
        }

        .emoji-btn:active, .theme-option:active {
            opacity: 0.7;
        }

        /* iOS Safe Area Support */
        @supports(padding: max(0px)) {
            body {
                padding-left: max(20px, env(safe-area-inset-left));
                padding-right: max(20px, env(safe-area-inset-right));
                padding-bottom: max(20px, env(safe-area-inset-bottom));
            }

            @media (max-width: 768px) {
                body {
                    padding-left: max(10px, env(safe-area-inset-left));
                    padding-right: max(10px, env(safe-area-inset-right));
                }
            }

            .floating-btn {
                bottom: calc(20px + env(safe-area-inset-bottom));
                right: calc(20px + env(safe-area-inset-right));
            }

            @media (max-width: 768px) {
                .floating-btn {
                    bottom: calc(20px + env(safe-area-inset-bottom));
                    right: calc(15px + env(safe-area-inset-right));
                }
            }
        }

        :root {
            /* Default theme - Classic Purple */
            --primary-color: #667eea;
            --primary-dark: #5568d3;
            --secondary-color: #764ba2;
            --gradient-start: #667eea;
            --gradient-end: #764ba2;
            --accent-color: #2ecc71;
            --background-gradient: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
        }

        /* Theme variations */
        body.theme-ocean-blue {
            --primary-color: #3498db;
            --primary-dark: #2980b9;
            --secondary-color: #2c3e50;
            --gradient-start: #3498db;
            --gradient-end: #2c3e50;
        }

        body.theme-sunset-pink {
            --primary-color: #ff6b9d;
            --primary-dark: #c44569;
            --secondary-color: #ff9a76;
            --gradient-start: #ff6b9d;
            --gradient-end: #ffa751;
        }

        body.theme-forest-green {
            --primary-color: #27ae60;
            --primary-dark: #229954;
            --secondary-color: #16a085;
            --gradient-start: #27ae60;
            --gradient-end: #16a085;
        }

        body.theme-midnight-dark {
            --primary-color: #34495e;
            --primary-dark: #2c3e50;
            --secondary-color: #1a1a2e;
            --gradient-start: #2c3e50;
            --gradient-end: #1a1a2e;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background: var(--background-gradient);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }

        @media (max-width: 768px) {
            body {
                padding: 10px;
                align-items: flex-start;
            }
        }

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

        @media (max-width: 768px) {
            .container {
                padding: 15px;
                border-radius: 0;
                min-height: 100vh;
            }
        }

        .main-layout {
            display: flex;
            gap: 30px;
            align-items: flex-start;
        }

        .calendar-section {
            flex: 0 0 350px;
            position: sticky;
            top: 20px;
        }

        .todo-section {
            flex: 1;
            min-width: 0;
        }

        h1 {
            color: #333;
            margin-bottom: 30px;
            text-align: center;
        }

        .notification-status {
            text-align: center;
            padding: 10px;
            margin-bottom: 20px;
            border-radius: 5px;
            font-size: 14px;
        }

        @media (max-width: 768px) {
            .notification-status {
                font-size: 12px;
                padding: 8px;
                margin-bottom: 15px;
            }

            .notification-status button {
                display: block;
                margin: 10px auto 0;
                width: 100%;
                max-width: 200px;
            }
        }

        .notification-status.enabled {
            background: #d4edda;
            color: #155724;
        }

        .notification-status.disabled {
            background: #fff3cd;
            color: #856404;
        }

        .notification-status button {
            margin-left: 10px;
            padding: 5px 15px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            background: var(--primary-color);
            color: white;
            font-size: 13px;
        }

        .notification-status button:hover {
            background: var(--primary-dark);
        }

        .input-container {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 20px;
        }

        .input-row {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

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

            .input-row input,
            .input-row select,
            .input-row button {
                width: 100% !important;
                min-width: unset !important;
            }
        }

        #todoInput {
            flex: 1;
            padding: 12px 15px;
            border: 2px solid #e0e0e0;
            border-radius: 5px;
            font-size: 16px;
            transition: border-color 0.3s;
            -webkit-appearance: none;
            appearance: none;
        }

        #todoInput:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        #deadlineInput, #assigneeInput {
            padding: 12px 15px;
            border: 2px solid #e0e0e0;
            border-radius: 5px;
            font-size: 16px;
            transition: border-color 0.3s;
            -webkit-appearance: none;
            appearance: none;
        }

        #deadlineInput:focus, #assigneeInput:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        #assigneeInput {
            flex: 1;
        }

        #deadlineInput {
            min-width: 200px;
            max-width: 100%;
        }

        @media (max-width: 768px) {
            #deadlineInput {
                min-width: unset;
                width: 100%;
            }
        }

        #addBtn {
            padding: 12px 25px;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
            transition: background 0.3s;
        }

        #addBtn:hover {
            background: var(--primary-dark);
        }

        .filters {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            justify-content: center;
        }

        .filter-btn {
            padding: 8px 16px;
            border: 2px solid #e0e0e0;
            background: white;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.3s;
        }

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

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

        #todoList {
            list-style: none;
        }

        .todo-item {
            display: flex;
            align-items: flex-start;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 5px;
            margin-bottom: 10px;
            transition: all 0.3s;
            flex-wrap: wrap;
        }

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

        .todo-item.completed {
            opacity: 0.6;
        }

        .todo-item.completed .todo-text {
            text-decoration: line-through;
        }

        .todo-item.overdue {
            border-left: 4px solid #ff4757;
        }

        .todo-checkbox {
            width: 20px;
            height: 20px;
            margin-right: 15px;
            margin-top: 2px;
            cursor: pointer;
            flex-shrink: 0;
        }

        .todo-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .todo-text {
            color: #333;
            font-size: 16px;
            font-weight: 500;
        }

        .todo-meta {
            display: flex;
            gap: 15px;
            font-size: 13px;
            color: #666;
        }

        .todo-meta-item {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .todo-meta-label {
            font-weight: 600;
        }

        .todo-deadline {
            color: var(--primary-color);
        }

        .todo-deadline.overdue {
            color: #ff4757;
            font-weight: 600;
        }

        .todo-assignee {
            color: #2ecc71;
        }

        .edit-btn {
            padding: 6px 12px;
            background: #3498db;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: background 0.3s;
            align-self: flex-start;
            margin-left: 10px;
            flex-shrink: 0;
        }

        .edit-btn:hover {
            background: #2980b9;
        }

        .delete-btn {
            padding: 6px 12px;
            background: #ff4757;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: background 0.3s;
            align-self: flex-start;
            margin-left: 10px;
            flex-shrink: 0;
        }

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

        .stats {
            margin-top: 20px;
            padding-top: 20px;
            border-top: 2px solid #e0e0e0;
            text-align: center;
            color: #666;
        }

        .empty-state {
            text-align: center;
            padding: 40px;
            color: #999;
        }

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

        @media (max-width: 768px) {
            .header-container {
                margin-bottom: 20px;
            }

            .header-container h1 {
                font-size: 24px;
                flex: 1 1 100%;
                text-align: center;
            }

            .header-buttons {
                flex: 1 1 100%;
                justify-content: center;
            }
        }

        .header-container h1 {
            margin: 0;
        }

        .header-buttons {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            position: relative;
            z-index: 10;
        }

        #settingsBtn, #customizeBtn, #syncBtn, #firebaseSetupBtn, #googleSignInBtn {
            padding: 8px 16px;
            background: white;
            border: 2px solid var(--primary-color);
            color: var(--primary-color);
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.3s;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            -webkit-appearance: none;
            appearance: none;
            touch-action: manipulation;
            position: relative;
            z-index: 10;
        }

        #settingsBtn:hover, #customizeBtn:hover, #syncBtn:hover, #firebaseSetupBtn:hover, #googleSignInBtn:hover {
            background: var(--primary-color);
            color: white;
        }

        #googleSignInBtn {
            background: #4285f4;
            border-color: #4285f4;
            color: white;
            font-weight: 600;
        }

        #googleSignInBtn:hover {
            background: #357ae8;
            border-color: #357ae8;
        }

        #userProfile {
            display: inline-flex;
            align-items: center;
            padding: 4px 12px 4px 4px;
            background: #f0f0f0;
            border-radius: 20px;
            font-size: 14px;
        }

        #userProfile #userName {
            font-weight: 600;
            color: #333;
            max-width: 150px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        #signOutBtn {
            padding: 4px 12px;
            background: #ff4757;
            color: white;
            border: none;
            border-radius: 12px;
            cursor: pointer;
            font-size: 12px;
            transition: background 0.3s;
        }

        #signOutBtn:hover {
            background: #ff3838;
        }

        @media (max-width: 768px) {
            #settingsBtn, #customizeBtn, #syncBtn, #firebaseSetupBtn, #googleSignInBtn {
                font-size: 13px;
                padding: 6px 12px;
            }

            #userProfile #userName {
                max-width: 100px;
                font-size: 13px;
            }

            #userAvatar {
                width: 28px !important;
                height: 28px !important;
            }

            #syncStatus {
                font-size: 11px !important;
                margin-top: 8px !important;
            }
        }

        #priorityInput {
            padding: 12px 15px;
            border: 2px solid #e0e0e0;
            border-radius: 5px;
            font-size: 16px;
            transition: border-color 0.3s;
            cursor: pointer;
            min-width: 160px;
        }

        #priorityInput:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        .todo-priority {
            display: inline-block;
            padding: 3px 10px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            color: white;
            letter-spacing: 0.5px;
        }

        .sort-controls {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            justify-content: center;
            align-items: center;
            font-size: 14px;
            color: #666;
        }

        .sort-btn {
            padding: 6px 12px;
            border: 2px solid #e0e0e0;
            background: white;
            border-radius: 5px;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.3s;
        }

        .sort-btn.active {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        .sort-btn:hover {
            border-color: var(--primary-color);
        }

        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 10000;
            -webkit-overflow-scrolling: touch;
        }

        .modal-content {
            background: white;
            padding: 30px;
            border-radius: 10px;
            max-width: 500px;
            width: 90%;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        }

        .modal-content h2 {
            margin-bottom: 20px;
            color: #333;
        }

        .color-settings {
            margin-bottom: 20px;
        }

        .color-setting-item {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 15px;
            padding: 10px;
            background: #f8f9fa;
            border-radius: 5px;
        }

        .color-setting-item label {
            flex: 1;
            font-weight: 600;
            color: #333;
        }

        .color-setting-item input[type="color"] {
            width: 60px;
            height: 40px;
            border: 2px solid #e0e0e0;
            border-radius: 5px;
            cursor: pointer;
        }

        .color-preview {
            padding: 8px 16px;
            border-radius: 12px;
            color: white;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            min-width: 80px;
            text-align: center;
        }

        .modal-actions {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }

        .modal-actions button {
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.3s;
        }

        .modal-actions #saveSettings {
            background: var(--primary-color);
            color: white;
        }

        .modal-actions #saveSettings:hover {
            background: var(--primary-dark);
        }

        .modal-actions #resetSettings {
            background: #f39c12;
            color: white;
        }

        .modal-actions #resetSettings:hover {
            background: #e67e22;
        }

        .modal-actions #closeSettings {
            background: #95a5a6;
            color: white;
        }

        .modal-actions #closeSettings:hover {
            background: #7f8c8d;
        }

        .calendar-container {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 20px;
        }

        .view-toggle {
            display: flex;
            gap: 5px;
            margin-bottom: 15px;
            background: white;
            padding: 5px;
            border-radius: 8px;
        }

        .view-toggle-btn {
            flex: 1;
            padding: 8px 16px;
            background: transparent;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            color: #666;
            transition: all 0.3s;
        }

        .view-toggle-btn.active {
            background: var(--primary-color);
            color: white;
        }

        .view-toggle-btn:hover:not(.active) {
            background: #f0f0f0;
        }

        .calendar-nav-secondary {
            text-align: center;
            margin-bottom: 15px;
        }

        .today-btn {
            padding: 6px 20px;
            background: white;
            border: 2px solid var(--primary-color);
            color: var(--primary-color);
            border-radius: 5px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 600;
            transition: all 0.3s;
        }

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

        /* Week View Styles */
        .week-view-container {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 10px;
        }

        .week-day-column {
            background: white;
            border-radius: 8px;
            padding: 10px;
            min-height: 300px;
        }

        .week-day-column.weekend {
            background: #f8f9fa;
        }

        .week-day-column.today-column {
            background: #e8f5e9;
            border: 2px solid #4caf50;
        }

        .week-day-header {
            text-align: center;
            font-weight: 700;
            font-size: 14px;
            color: #333;
            padding-bottom: 8px;
            border-bottom: 2px solid #e0e0e0;
            margin-bottom: 10px;
        }

        .week-day-date {
            font-size: 18px;
            display: block;
            color: var(--primary-color);
        }

        .week-task {
            background: white;
            border: 1px solid #e0e0e0;
            border-radius: 6px;
            padding: 8px;
            margin-bottom: 8px;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }

        .week-task:hover {
            transform: translateY(-2px);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

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

        .week-task-text {
            font-size: 13px;
            color: #333;
            margin-bottom: 4px;
            line-height: 1.3;
        }

        .week-task.completed .week-task-text {
            text-decoration: line-through;
        }

        .week-task-time {
            font-size: 11px;
            color: #666;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .week-task-priority {
            display: inline-block;
            padding: 2px 6px;
            border-radius: 8px;
            font-size: 9px;
            font-weight: 700;
            text-transform: uppercase;
            color: white;
            margin-right: 4px;
        }

        .week-no-tasks {
            text-align: center;
            color: #999;
            font-size: 12px;
            padding: 20px 10px;
        }

        @media (max-width: 768px) {
            .week-view-container {
                grid-template-columns: 1fr;
                gap: 15px;
            }

            .week-day-column {
                min-height: auto;
            }

            .week-task {
                padding: 10px;
            }

            .week-task-text {
                font-size: 14px;
            }
        }

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

        .calendar-header h3 {
            margin: 0;
            color: #333;
            cursor: pointer;
            transition: color 0.3s;
            touch-action: manipulation;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
            user-select: none;
            -webkit-user-select: none;
        }

        .calendar-header h3:hover {
            color: var(--primary-color);
        }

        .calendar-header h3:active {
            opacity: 0.7;
        }

        .calendar-nav {
            display: flex;
            gap: 10px;
        }

        .calendar-nav button {
            padding: 5px 15px;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            transition: background 0.3s;
            -webkit-appearance: none;
            appearance: none;
            touch-action: manipulation;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
            min-width: 40px;
            min-height: 40px;
        }

        .calendar-nav button:hover {
            background: var(--primary-dark);
        }

        .calendar-nav button:active {
            opacity: 0.7;
        }

        .calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 5px;
            width: 100%;
        }

        .calendar-day-header {
            text-align: center;
            font-weight: 600;
            color: #666;
            padding: 10px;
            font-size: 12px;
        }

        .calendar-day {
            aspect-ratio: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: white;
            border: 2px solid #e0e0e0;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.3s;
            position: relative;
            padding: 5px;
            min-height: 50px;
            touch-action: manipulation;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        }

        .calendar-day:active {
            opacity: 0.7;
        }

        .calendar-day:hover {
            border-color: var(--primary-color);
            transform: scale(1.05);
        }

        .calendar-day.other-month {
            opacity: 0.3;
        }

        .calendar-day.today {
            border-color: #2ecc71;
            background: #d4edda;
        }

        .calendar-day.selected {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        .calendar-day.has-tasks {
            font-weight: 700;
        }

        .calendar-day-number {
            font-size: 14px;
        }

        .calendar-task-count {
            font-size: 10px;
            color: #667eea;
            margin-top: 2px;
        }

        .calendar-day.selected .calendar-task-count {
            color: white;
        }

        .calendar-filter-info {
            text-align: center;
            padding: 10px;
            background: var(--primary-color);
            color: white;
            border-radius: 5px;
            margin-bottom: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .calendar-filter-info button {
            background: white;
            color: #667eea;
            border: none;
            padding: 5px 15px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 13px;
        }

        .calendar-filter-info button:hover {
            background: #f0f0f0;
        }

        /* === FLOATING BUTTON === */
        .floating-btn {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: var(--primary-color);
            color: white;
            border: none;
            font-size: 24px;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
            transition: all 0.3s;
            z-index: 1000;
            -webkit-tap-highlight-color: transparent;
            touch-action: manipulation;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .floating-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
        }

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

        /* === PIN ENTRY MODAL === */
        .pin-modal {
            text-align: center;
        }

        .pin-modal p {
            color: #666;
            margin-bottom: 20px;
        }

        .pin-input {
            width: 200px;
            padding: 15px;
            font-size: 24px;
            text-align: center;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            margin-bottom: 20px;
            letter-spacing: 10px;
            -webkit-appearance: none;
            appearance: none;
        }

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

        @media (max-width: 768px) {
            .pin-input {
                width: 180px;
                font-size: 20px;
                padding: 12px;
            }
        }

        .pin-error {
            color: #ff4757;
            font-size: 14px;
            margin-top: 10px;
        }

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

        .primary-btn:hover {
            background: var(--primary-dark);
        }

        /* === PARENT DASHBOARD === */
        .parent-dashboard-modal .modal-content {
            max-width: 900px;
            max-height: 90vh;
            overflow-y: auto;
        }

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

        .parent-dashboard-header h2 {
            margin: 0;
        }

        .close-btn {
            background: none;
            border: none;
            font-size: 28px;
            color: #999;
            cursor: pointer;
            padding: 0;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.3s;
        }

        .close-btn:hover {
            background: #f0f0f0;
            color: #333;
        }

        .dashboard-section {
            margin-bottom: 30px;
        }

        .dashboard-section h3 {
            color: var(--primary-color);
            margin-bottom: 15px;
            font-size: 18px;
        }

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

        .parent-stat-card {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 20px;
            text-align: center;
            border: 2px solid #e0e0e0;
        }

        .parent-stat-value {
            font-size: 36px;
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: 5px;
        }

        .parent-stat-label {
            font-size: 14px;
            color: #666;
        }

        .activity-list {
            max-height: 300px;
            overflow-y: auto;
        }

        .activity-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px;
            background: #f8f9fa;
            border-radius: 8px;
            margin-bottom: 8px;
        }

        .activity-text {
            flex: 1;
            font-size: 14px;
            color: #333;
        }

        .activity-time {
            font-size: 12px;
            color: #999;
        }

        .completion-bar {
            background: #e0e0e0;
            border-radius: 10px;
            height: 30px;
            overflow: hidden;
            margin-bottom: 10px;
        }

        .completion-fill {
            background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            padding-right: 10px;
            color: white;
            font-weight: 600;
            font-size: 14px;
            transition: width 0.5s ease;
        }

        .parent-settings {
            background: #f8f9fa;
            padding: 20px;
            border-radius: 10px;
        }

        .setting-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid #e0e0e0;
        }

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

        .setting-label {
            font-weight: 600;
            color: #333;
        }

        .setting-input {
            padding: 8px 12px;
            border: 2px solid #e0e0e0;
            border-radius: 5px;
            width: 100px;
            text-align: center;
        }

        .export-btn {
            padding: 10px 20px;
            background: #2ecc71;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            transition: background 0.3s;
        }

        .export-btn:hover {
            background: #27ae60;
        }

        /* === SYNC MODAL STYLES === */
        .sync-section {
            background: #f8f9fa;
            padding: 20px;
            border-radius: 10px;
        }

        .sync-section h3 {
            color: #333;
            font-size: 16px;
            margin-bottom: 10px;
        }

        #syncModal .modal-content {
            max-width: 600px;
        }

        @media (max-width: 768px) {
            #syncModal textarea {
                font-size: 11px !important;
                height: 100px !important;
            }

            .sync-section {
                padding: 15px;
            }
        }

        /* === THEME CUSTOMIZATION STYLES === */
        .theme-settings h3 {
            color: #333;
            margin-bottom: 15px;
            font-size: 16px;
        }

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

        .theme-option {
            cursor: pointer;
            text-align: center;
            transition: transform 0.3s;
        }

        .theme-option:hover {
            transform: scale(1.05);
        }

        .theme-option.selected .theme-preview {
            border: 3px solid var(--primary-color);
            box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
        }

        .theme-preview {
            width: 100%;
            height: 80px;
            border-radius: 10px;
            margin-bottom: 8px;
            border: 3px solid transparent;
            transition: all 0.3s;
        }

        .theme-name {
            font-size: 13px;
            color: #333;
            font-weight: 500;
        }

        .emoji-info {
            background: #f8f9fa;
            padding: 15px;
            border-radius: 8px;
        }

        .emoji-info p {
            margin-bottom: 12px;
            color: #666;
            font-size: 14px;
        }

        .emoji-suggestions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .emoji-btn {
            background: white;
            border: 2px solid #e0e0e0;
            padding: 8px 12px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.3s;
            display: inline-block;
        }

        .emoji-btn:hover {
            border-color: var(--primary-color);
            background: var(--primary-color);
            color: white;
        }

        /* === GAMIFICATION STYLES === */
        .gamification-dashboard {
            background: var(--background-gradient);
            border-radius: 10px;
            padding: 20px;
            margin-bottom: 20px;
            color: white;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }

        /* Panel theme variations */
        .gamification-dashboard.panel-blue {
            background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
        }

        .gamification-dashboard.panel-pink {
            background: linear-gradient(135deg, #ff6b9d 0%, #ffa751 100%);
        }

        .gamification-dashboard.panel-green {
            background: linear-gradient(135deg, #27ae60 0%, #16a085 100%);
        }

        .gamification-dashboard.panel-gold {
            background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
        }

        .gamification-dashboard.panel-rainbow {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
        }

        .gamification-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            user-select: none;
        }

        .gamification-header h3 {
            margin: 0;
            font-size: 20px;
        }

        .collapse-icon {
            font-size: 18px;
            transition: transform 0.3s;
        }

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

        .gamification-stats {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
            margin-bottom: 20px;
        }

        .stat-card {
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            border-radius: 10px;
            padding: 15px;
            text-align: center;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .stat-icon {
            font-size: 32px;
            margin-bottom: 5px;
        }

        .stat-value {
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .stat-label {
            font-size: 12px;
            opacity: 0.9;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .daily-progress {
            margin-bottom: 20px;
        }

        .progress-bar-container {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 20px;
            height: 24px;
            overflow: hidden;
            margin-bottom: 8px;
        }

        .progress-bar {
            background: linear-gradient(90deg, #2ecc71 0%, #27ae60 100%);
            height: 100%;
            border-radius: 20px;
            transition: width 0.5s ease;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            padding-right: 10px;
            color: white;
            font-weight: 600;
            font-size: 12px;
        }

        .progress-label {
            font-size: 13px;
            text-align: center;
            opacity: 0.9;
        }

        .badges-preview {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 15px;
        }

        .badges-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
            font-weight: 600;
        }

        .view-all-badges-btn {
            background: rgba(255, 255, 255, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: white;
            padding: 5px 12px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 12px;
            transition: all 0.3s;
        }

        .view-all-badges-btn:hover {
            background: rgba(255, 255, 255, 0.3);
        }

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

        .badge-item {
            display: flex;
            align-items: center;
            gap: 8px;
            background: rgba(255, 255, 255, 0.15);
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 13px;
        }

        .badge-emoji {
            font-size: 20px;
        }

        .badge-name {
            font-weight: 500;
        }

        .no-badges {
            text-align: center;
            opacity: 0.7;
            padding: 10px;
            font-size: 14px;
        }

        /* Points popup animation */
        .points-popup {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: var(--background-gradient);
            color: white;
            padding: 20px 30px;
            border-radius: 15px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
            z-index: 10000;
            animation: pointsPopup 2s ease-out forwards;
            text-align: center;
        }

        .points-amount {
            font-size: 48px;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .points-reason {
            font-size: 16px;
            opacity: 0.9;
        }

        @keyframes pointsPopup {
            0% {
                transform: translate(-50%, -50%) scale(0);
                opacity: 0;
            }
            10% {
                transform: translate(-50%, -50%) scale(1.2);
                opacity: 1;
            }
            20% {
                transform: translate(-50%, -50%) scale(1);
            }
            80% {
                transform: translate(-50%, -50%) scale(1);
                opacity: 1;
            }
            100% {
                transform: translate(-50%, -50%) scale(0.8);
                opacity: 0;
            }
        }

        /* Badge unlock modal styles */
        .badge-unlock-modal {
            z-index: 10001;
        }

        .badge-unlock-content {
            text-align: center;
            animation: badgeUnlock 0.5s ease-out;
        }

        .badge-unlock-emoji {
            font-size: 80px;
            margin-bottom: 15px;
            animation: badgeSpin 0.6s ease-out;
        }

        @keyframes badgeUnlock {
            0% {
                transform: scale(0) rotate(-180deg);
                opacity: 0;
            }
            100% {
                transform: scale(1) rotate(0);
                opacity: 1;
            }
        }

        @keyframes badgeSpin {
            0% {
                transform: rotate(0deg) scale(0);
            }
            50% {
                transform: rotate(180deg) scale(1.2);
            }
            100% {
                transform: rotate(360deg) scale(1);
            }
        }

        .modal-close-btn {
            padding: 12px 30px;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
            margin-top: 20px;
            transition: background 0.3s;
        }

        .modal-close-btn:hover {
            background: var(--primary-dark);
        }

        /* Confetti animation */
        .confetti {
            position: fixed;
            width: 10px;
            height: 10px;
            top: -10px;
            z-index: 9999;
            animation: confettiFall linear forwards;
        }

        @keyframes confettiFall {
            to {
                transform: translateY(100vh) rotate(360deg);
                opacity: 0;
            }
        }

        /* Badges modal */
        .badges-modal-content {
            max-width: 600px;
            max-height: 80vh;
            overflow-y: auto;
        }

        .badges-progress {
            text-align: center;
            color: #666;
            margin-bottom: 20px;
            font-size: 14px;
        }

        .badge-category {
            margin-bottom: 25px;
        }

        .badge-category h4 {
            color: var(--primary-color);
            margin-bottom: 15px;
            font-size: 16px;
            border-bottom: 2px solid #e0e0e0;
            padding-bottom: 8px;
        }

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

        .badge-card {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 15px;
            text-align: center;
            transition: all 0.3s;
        }

        .badge-card.earned {
            background: linear-gradient(135deg, color-mix(in srgb, var(--primary-color) 8%, transparent) 0%, color-mix(in srgb, var(--secondary-color) 8%, transparent) 100%);
            border: 2px solid var(--primary-color);
        }

        .badge-card.locked {
            opacity: 0.5;
        }

        .badge-card-emoji {
            font-size: 40px;
            margin-bottom: 8px;
        }

        .badge-card-name {
            font-weight: 600;
            color: #333;
            font-size: 13px;
            margin-bottom: 5px;
        }

        .badge-card-desc {
            font-size: 11px;
            color: #666;
            line-height: 1.3;
        }

        @media (max-width: 1024px) {
            .main-layout {
                flex-direction: column;
            }

            .calendar-section {
                flex: 1;
                width: 100%;
                position: static;
                margin-bottom: 30px;
            }

            .todo-section {
                width: 100%;
            }

            .gamification-stats {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .gamification-stats {
                grid-template-columns: repeat(3, 1fr);
                gap: 8px;
            }

            .stat-card {
                padding: 10px;
            }

            .stat-icon {
                font-size: 24px;
            }

            .stat-value {
                font-size: 20px;
            }

            .stat-label {
                font-size: 10px;
            }

            .filters {
                flex-wrap: wrap;
            }

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

            .sort-controls {
                flex-wrap: wrap;
            }

            .sort-btn {
                padding: 5px 10px;
                font-size: 12px;
            }

            .floating-btn {
                width: 56px;
                height: 56px;
                bottom: 20px;
                right: 20px;
                font-size: 22px;
                z-index: 9999;
            }

            .todo-item {
                flex-direction: column;
                align-items: stretch;
            }

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

            .delete-btn {
                margin-left: 0;
                margin-top: 10px;
                align-self: stretch;
            }

            .calendar-section {
                margin-bottom: 20px;
            }

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

            .calendar-day {
                padding: 2px;
            }

            .calendar-day-number {
                font-size: 12px;
            }

            .calendar-task-count {
                font-size: 8px;
            }

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

            .modal-content {
                width: 95%;
                max-height: 85vh;
                overflow-y: auto;
                padding: 20px;
            }

            .badges-modal-content {
                max-height: 80vh;
            }

            .parent-dashboard-content {
                max-height: 85vh;
            }

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

            .emoji-suggestions {
                gap: 6px;
            }

            .emoji-btn {
                padding: 6px 10px;
                font-size: 12px;
            }
        }

        @media (max-width: 480px) {
            .gamification-stats {
                grid-template-columns: 1fr;
            }

            .stat-grid {
                grid-template-columns: 1fr;
            }

            .theme-grid {
                grid-template-columns: 1fr;
            }
        }
