          * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
        }

        :root {
            --primary: #3b78ef;
            --secondary: #2f63dd;
            --success: #4CAF50;
            --warning: #FF9800;
            --danger: #F44336;
            --light-bg: #f5f7fa;
            --card-bg: #ffffff;
            --text: #333;
            --text-light: #666;
            --border: #e1e8ed;
            --shadow: rgba(0, 0, 0, 0.08);
            --date-bg: #e3f0ff;
            --category-chinese: #3b78ef;
            --category-math: #5cb85c;
            --category-english: #f0ad4e;
            --category-sports: #d9534f;
            --category-skills: #5bc0de;
            --category-knowledge: #aa66cc;
            --today-bg: #e6f0ff;
            --selected-bg:#fff9e6;
            --gold: #FFD700;
            --gold-light: #FFF9C4;
            --gold-dark: #FFC107;
        }

        body {
            background: linear-gradient(135deg, var(--light-bg) 0%, #e4edf5 100%);
            color: var(--text);
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
        }

        header {
            text-align: left;
            padding: 0;

            background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
            color: white;
            border-radius: 15px;
            box-shadow: 0 8px 16px rgba(0,0,0,0.1);
            position: relative;
            overflow: hidden;
        }

        header::before {
            content: "";
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
            transform: rotate(30deg);
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: relative;
            z-index: 2;
            gap: 20px;
        }

        .header-left {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            flex: 1;
            padding: 15px 30px;
        }

        .title-container {
            display: flex;
            align-items: center;
            flex-wrap: nowrap;
            flex: 1;
            min-width: 0;
            gap: 8px;
            font-size: clamp(1.2rem, 4vw, 2.8rem);
            font-weight: 700;
            color: white;
        }

        
        .title-separator {
            color: rgba(255, 255, 255, 0.8);
            font-size: clamp(1.2rem, 4vw, 2rem);
            white-space: nowrap;
        }

        
        header h2 {
            font-size: clamp(1.8rem, 5vw, 2.8rem);
            margin: 0;
            display: inline-block;
            color: white;
            font-weight: 700;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1;
            min-width: 0;
        }

        header h3 {
            font-size: clamp(1rem, 3vw, 1.4rem);
            margin: 0;
            display: inline-block;
            color: rgba(255, 255, 255, 0.9);
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1;
            min-width: 0;
        }

        header h1 i {
            color: #FFD700;
            animation: pulse 2s infinite;
            font-size: 2.5rem;
        }

        
        .header-left {
            flex: 1;
            min-width: 0;
        }

        .header-right {
            display: flex;
            align-items: center;
            padding: 15px 30px;
        }

        .account-controls {
            position: relative;
        }

        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.1); }
            100% { transform: scale(1); }
        }

        
        .date-navigation {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            margin-bottom: 25px;
            padding: 15px;
            background: white;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.05);
            align-items: center;
            justify-content: space-between;
        }

        .today-btn {
            background: #4caf50;
            color: white;
            border: none;
            border-radius: 8px;
            padding: 4px 5px;
            cursor: pointer;
            font-weight: 500;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .today-btn:hover {
            background: #3f9443;
        }

        .date-controls {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .nav-btn {
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 50%;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s;
        }

        .nav-btn:hover {
            background: var(--secondary);
        }

        .current-date {
            font-weight: 600;
            min-width: 150px;
            text-align: center;
        }

        
        .week-days-container {
    background: var(--date-bg);
    border-radius: 12px;
    padding: 2px;
    margin-bottom: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    overflow-x: hidden; 
}

        .week-days {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    min-width: 0; 
}

      .day-btn {
    background: rgba(59, 120, 239, 0.1);
    border: 1px solid rgba(59, 120, 239, 0.2);
    border-radius: 8px;
    padding: 8px 2px;
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-width: 0;
    margin: 0;
    font-size: 0.85rem;
    align-items: center;     
}

        .day-btn:hover {
            background: rgba(59, 120, 239, 0.2);
        }

        .day-btn.active {
            background: var(--primary);
            color: white;
            font-weight: bold;
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }

        .day-btn.today {
            background: #4caf50;
            border: 1px solid #3f9443;
            font-weight: bold;
            color: #fff;
        }

        .day-name {
            font-size: 0.9rem;
            font-weight: bold;
            margin-bottom: 5px;
        }

        .day-date {
            font-size: 1.1rem;
            font-weight: 600;
        }

        
        .month-view-container {
            display: none;
            background: white;
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 8px 16px var(--shadow);
            margin-bottom: 20px;
        }

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

        .calendar-title {
            font-weight: 600;
            color: var(--primary);
            font-size: 1.2rem;
        }

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

        .calendar-day {
            text-align: center;
            padding: 10px 0;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.9rem;
            position: relative;
            min-height: 50px;
        }

        .calendar-day.header {
            font-weight: bold;
            color: var(--primary);
            cursor: default;
            font-size: 0.85rem;
            padding: 8px 0;
        }

        .calendar-day.inactive {
            color: #ccc;
            cursor: default;
        }

        .calendar-day.today {
            background: #4caf50;
            color: #fff;
            font-weight: bold;
        }

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

        .calendar-day:hover:not(.header):not(.inactive) {
            background: #f0f7ff;
        }

        .task-dot {
            position: absolute;
            bottom: 3px;
            left: 50%;
            transform: translateX(-50%);
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--success);
        }

        
        .today-stats {
            display: flex;
            justify-content: space-between;
            gap: 8px;
           margin: 5px 0;
            flex-wrap: wrap; 
            position: relative;
            z-index: 2;
            padding: 5px 0; 
            width: 100%; 
            box-sizing: border-box;
        }

        .stat-card {
            background: var(--card-bg);
            padding: 10px 5px; 
            border-radius: 12px;
            box-shadow: 0 4px 8px var(--shadow);
            text-align: center;
            min-width: 80px; 
            max-width: none; 
            flex: 1 1 0%; 
            transition: transform 0.3s;
            position: relative;
            overflow: hidden;
            cursor: pointer;
            word-wrap: break-word; 
            white-space: normal; 
        }

        .card-hidden {
            display: none;
        }

        
        @media (max-width: 768px) {
            .stat-card {
                flex: 0 0 calc(25% - 6px); 
                min-width: calc(25% - 6px);
                max-width: calc(25% - 6px);
            }
        }

        .stat-card::after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 4px;
            background: linear-gradient(90deg, var(--primary), var(--secondary));
        }

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

        .stat-card h3 {
            font-size: 1.8rem;
            color: var(--primary);
            margin-bottom: 5px;
        }

        .stat-card p {
            font-size: 0.85rem;
            color: var(--text-light);
            word-wrap: break-word;
            white-space: normal;
            line-height: 1.3;
        }

        .main-content {
            display: flex;
            gap: 25px;
            margin-bottom: 30px;
            flex-wrap: wrap;
        }

        
        .sidebar {
            width: 280px;
            min-width: 40px; 
            background: var(--card-bg);
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 8px 16px var(--shadow);
            height: fit-content;
            position: relative;
            transition: all 0.3s ease;
            overflow: hidden;
        }

        
        .sidebar.collapsed {
            width: 40px;
            padding: 15px 5px;
        }

        .sidebar.collapsed .sidebar-header {
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 10px;
            padding: 10px 0;
        }

        .sidebar.collapsed .sidebar-header h2 {
            writing-mode: vertical-rl;
            text-orientation: mixed;
            margin: 0;
            padding: 0;
            white-space: nowrap;
            display: flex;
            align-items: center;
            gap: 0;
        }

        .sidebar.collapsed .sidebar-header h2 i {
            transform: rotate(0);
            margin-bottom: 5px;
        }

        .sidebar.collapsed .add-category-btn {
            position: relative;
            top: 0;
            right: 0;
            margin: 10px auto;
        }

        .sidebar.collapsed .category-list,
        .sidebar.collapsed .add-category-btn {
            display: none;
        }

       
.sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}
.sidebar-header h2 {
    flex: 1 1 auto;          
    margin: 0;
    padding: 0 10px;       
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;         
    user-select: none;       
}
.add-category-btn {
    flex: 0 0 36px;          
    height: 36px;
    border-radius: 50%;
    margin-left: 8px;        
}
        .sidebar h2 {
            color: var(--primary);
            padding-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 10px;
            transition: all 0.3s;
        }

        .add-category-btn {
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 50%;
            width: 32px;
            height: 32px;
            font-size: 1.2rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s;
            position: absolute;
            top: 10px;
            right: 0;
        }

        .add-category-btn:hover {
            background: var(--secondary);
            transform: rotate(90deg);
        }

        .category-list {
            list-style: none;
        }

        .category-item {
            margin-bottom: 10px;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        }

        .category-header {
            padding: 12px 15px;
            background: #f0f7ff;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: relative;
        }

        .category-header:hover {
            background: #e3f0ff;
        }

        .category-header.active {
            background: #d4e5ff;
            font-weight: 600;
            color: var(--primary);
        }

        .category-title {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .category-title i {
            font-size: 1.2rem;
            width: 24px;
            text-align: center;
        }

        .category-actions {
            display: flex;
            gap: 8px;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .category-header:hover .category-actions {
            opacity: 1;
        }

        .category-action-btn {
            background: none;
            border: none;
            color: var(--text-light);
            cursor: pointer;
            font-size: 0.9rem;
            padding: 2px 5px;
            border-radius: 4px;
        }

        .category-action-btn:hover {
            color: var(--primary);
            background: rgba(0,0,0,0.05);
        }

        .task-list {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease-out;
            background: #fafcff;
        }

        .category-item.active .task-list {
            max-height: 1000px;
        }

        .sub-task {
            padding: 10px 15px 10px 45px;
            border-top: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .sub-task:hover {
            background: #f0f9ff;
        }

        .sub-task-actions {
            display: flex;
            gap: 8px;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .sub-task:hover .sub-task-actions {
            opacity: 1;
        }

        .add-task-btn {
            background: var(--success);
            color: white;
            border: none;
            border-radius: 5px;
            padding: 6px 12px;
            font-size: 0.85rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 5px;
            transition: all 0.3s;
        }

        .add-task-btn:hover {
            background: #3d8b40;
        }

        .tasks-container {
            flex: 1;
            min-width: 300px;
            background: var(--card-bg);
            border-radius: 15px;
            padding: 25px;
            box-shadow: 0 8px 16px var(--shadow);
            position: relative;
            transition: all 0.3s ease;
        }

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

        .date-display {
            font-size: 1.1rem;
            color: var(--text-light);
            background: #f0f7ff;
            padding: 8px 15px;
            border-radius: 20px;
            font-weight: 500;
        }

        .add-task-main-btn {
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 8px;
            padding: 8px 15px;
            cursor: pointer;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.3s;
        }

        .add-task-main-btn:hover {
            background: var(--secondary);
            transform: translateY(-2px);
        }

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

        .empty-add-plan-link {
            color: var(--primary);
            cursor: pointer;
            text-decoration: underline;
            text-decoration-color: currentColor;
            font-weight: 600;
            transition: color 0.2s ease;
        }

        .empty-add-plan-link:hover,
        .empty-add-plan-link:focus {
            color: var(--secondary);
            outline: none;
        }

                    .task-card {
            background: white;
            border-radius: 16px;
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
            display: flex;
            overflow: hidden;
            position: relative;
            transition: all 0.3s ease; 
            height: 120px; 
            cursor: grab; 
          }
         
.task-card .date-range-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

        .task-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
        }

                .category-bar {
            width: 40px; 
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 0.9rem;
            letter-spacing: 1px;
            padding: 5px 0;
        }

        .category-bar i {
            font-size: 1.2rem;
            margin-bottom: 5px;
        }

        .category-bar .category-text {
            writing-mode: vertical-lr;
            text-orientation: mixed;
            text-align: center;
            max-height: 100%;
            overflow: hidden;
        }

               .card-content {
            flex: 1;
            display: flex;
            height: 100%;
        }

        
        .data-display-area {
            width: 70%;
            padding: 8px 15px;
            display: flex;
            flex-direction: column;
        }

        .info-row {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 2px;
            flex-wrap: wrap;
        }

        .task-title {
            font-weight: 700;
            font-size: 1.25rem;
            color: #2c3e50;
        }

        .repeat-info {
            color: #1976d2;
            font-size: 0.85rem;
            background: #e3f2fd;
            padding: 2px 8px;
            border-radius: 12px;
        }

        .plan-time {
            color: #9b59b6;
            font-size: 0.95rem;
            font-weight: 600;
            white-space: nowrap;
        }

        .description-box {
            flex: 1;
            background: #f9fbfd;
            border: 1px solid #edf2f7;
            border-radius: 10px;
            padding: 4px 8px;
            font-size: 0.92rem;
            line-height: 1.3;
            overflow-y: auto;
            color: #555;
            max-height: 70px;
        }

        .task-title {
            font-weight: 700;
            font-size: 1.25rem;
            color: #2c3e50;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .task-title i {
            color: #3b78ef;
        }

        .time-row {
            display: flex;
            gap: 15px;
            margin-bottom: 3px; 
        }

        .time-group {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        
        .date-range-group {
            display: flex;
            flex-direction: column;
            gap: 2px;
            margin-bottom: 3px; 
        }

        .info-label {
            font-size: 0.8rem;
            color: #7f8c8d;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .info-value {
            font-size: 0.95rem;
            font-weight: 600;
            color: #2c3e50;
            padding-left: 0;
        }

        .planned-time .info-value {
            color: #3498db;
        }

        .actual-time .info-value {
            color: #27ae60;
        }

        .date-range .info-value {
            color: #9b59b6;
        }

        .recurring-info {
            background: #e3f2fd;
            color: #1976d2;
            padding: 5px 12px;
            border-radius: 15px;
            font-size: 0.85rem;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-top: 3px; 
        }

            .action-section {
            width: 30%; 
            display: flex;
            flex-direction: column;
            gap: 8px; 
            padding: 8px;
            border-left: 1px solid #f0f4f8;
            justify-content: center;
            align-items: center;
        }

        .action-buttons {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
        }

        .action-btn {
            background: #f0f7ff;
            border: none;
            color: #3b78ef;
            cursor: pointer;
            font-size: 1.1rem;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .action-btn:hover {
            background: #3b78ef;
            color: white;
            transform: scale(1.1);
        }

        .timer-section {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

               .timer-display {
            font-size: 1.8rem;  
            font-weight: 700;
            color: #e74c3c;
            font-family: 'Courier New', monospace;
            background: #fff5f5;
            padding: 12px 15px;  
            border-radius: 10px;
            text-align: center;
            box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
            cursor: pointer;
            transition: all 0.3s;
            margin-bottom: 1px;  
        }

        .timer-display:hover {
            background: #ffebee;
        }

.timer-controls {
    display: flex;
    gap: 10px;  
    align-items: center;
    justify-content: center;  
}

.timer-btn {
    border: none;
    border-radius: 6px;  
    width: 45px;  
    height: 35px;  
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 16px;  
}

.timer-btn i {
    font-size: 16px;  
    margin: 0;
}

        .timer-btn.start {
            background: linear-gradient(to bottom, #27ae60, #2ecc71);
            color: white;
        }

        .timer-btn.pause {
            background: linear-gradient(to bottom, #f39c12, #f1c40f);
            color: white;
        }

        .timer-btn.stop {
            background: linear-gradient(to bottom, #e74c3c, #c0392b);
            color: white;
        }

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

        .timer-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        .completed-task {
            background: #e2f8e7;
        }

        .completed-task .task-title {
            color: var(--success);
        }

        .completed-task .timer-display {
            color: var(--success);
        }

        .completed-task .timer-btn {
            display: none;
        }
.completed-task .description-box {
    background: #e2f8e7 !important;   
    border-color: rgba(76, 175, 80, .25); 
}
        
        .completed-label {
            display: flex;
            align-items: center;
            justify-content: center;
            background: #4CAF50;
            color: white;
            border-radius: 8px;
            padding: 8px;
            font-weight: bold;
            grid-column: span 3;
            gap: 8px;
        }

        
        .stats-page {
            display: none;
            background: var(--light-bg);
            border-radius: 15px;
            padding: 25px;
            box-shadow: 0 8px 16px var(--shadow);
            margin-top: 20px;
        }

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

        .back-btn {
            background: var(--primary);
            color: white;
            border: none;
            padding: 10px 15px;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
        }

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

        .stat-chart {
            background: var(--card-bg);
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 4px 10px rgba(0,0,0,0.05);
            height: 350px;
        }

        .stat-chart h3 {
            text-align: center;
            margin-bottom: 15px;
            color: var(--primary);
        }

        .chart-container {
            height: calc(100% - 40px);
            position: relative;
        }

        .controls {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin: 20px 0;
        }

        .print-btn {
            background: var(--primary);
            color: white;
            border: none;
            padding: 12px 25px;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: background 0.3s;
        }

        .print-btn:hover {
            background: var(--secondary);
        }

        .data-buttons {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin: 20px 0;
            flex-wrap: wrap;
        }

        .data-btn {
            background: #5bc0de;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: background 0.3s;
        }

        .data-btn:hover {
            background: #31b0d5;
        }

        .export-btn {
            background: var(--success);
        }

        .export-btn:hover {
            background: #3d8b40;
        }

        .import-btn {
            background: #aa66cc;
        }

        .import-btn:hover {
            background: #9933cc;
        }

        .clear-btn {
            background: var(--danger);
        }

        .clear-btn:hover {
            background: #d32f2f;
        }

        footer {
            text-align: center;
            margin-top: 40px;
            padding: 20px;
            color: var(--text-light);
            font-size: 0.9rem;
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
            overflow: auto;
        }

        .modal-content {
            background: white;
            border-radius: 15px;
            width: 90%;
            max-width: 500px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            overflow: hidden;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
        }

        .modal-header {
            background: var(--primary);
            color: white;
            padding: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .modal-header h3 {
            font-size: 1.3rem;
        }

        .close-modal {
            background: none;
            border: none;
            color: white;
            font-size: 1.5rem;
            cursor: pointer;
        }

        .modal-body {
            padding: 20px;
            overflow-y: auto;
        }

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

.form-group {
    position: relative;
}

#saveTemplateContainer {
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}
        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: var(--text);
        }

        .form-control {
            width: 100%;
            padding: 12px;
            border: 1px solid var(--border);
            border-radius: 8px;
            font-size: 1rem;
        }

        .time-inputs {
            display: flex;
            gap: 10px;
        }

        .time-inputs .form-control {
            flex: 1;
        }

        .form-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 20px;
            padding-top: 15px;
            border-top: 1px solid var(--border);
            position: sticky;
            bottom: 0;
            background: white;
            z-index: 10;
        }

        .btn {
            padding: 6px 10px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
        }

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

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

        .btn-danger {
            background: #e74c3c;
            color: white;
            border: none;
            border-radius: 8px;
            padding: 8px 15px;
            cursor: pointer;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.3s;
        }

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

        .btn-secondary {
            background: #e0e0e0;
            color: var(--text);
        }

        .btn-secondary:hover {
            background: #d0d0d0;
        }

        .single-delete-message {
            display: none;
            margin: 20px 0;
            padding: 10px;
            background: #fff0f0;
            border-radius: 8px;
            border-left: 3px solid var(--danger);
        }

      
#alertModal {
    z-index: 4000; 
}


#commonSummarySelect {
    max-width: calc(100% - 120px); 
    white-space: normal;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

#commonSummarySelect option {
    white-space: normal;
    word-wrap: break-word;
    max-width: 250px; 
    padding: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 250px;
}

.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2100; 
    display: none;
    justify-content: center;
    align-items: center;
}

        .confirmation-content {
            background: white;
            border-radius: 15px;
            width: 90%;
            max-width: 400px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            overflow: hidden;
        }

        .confirmation-body {
            padding: 30px;
            text-align: center;
        }

        .confirmation-actions {
            display: flex;
            justify-content: center;
            gap: 15px;
            padding: 20px;
            border-top: 1px solid var(--border);
        }

        
        .password-control-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid #eee;
        }

        .password-control-label {
            font-size: 0.95rem;
            color: var(--text);
        }

        
        .switch {
            position: relative;
            display: inline-block;
            width: 50px;
            height: 24px;
        }

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

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: .4s;
            border-radius: 24px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }

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

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

        .repeat-options {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .repeat-option {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .repeat-inputs {
            display: flex;
            gap: 10px;
            margin-left: 10px;
            align-items: center;
        }

        .repeat-inputs input {
            width: 60px;
            padding: 8px;
            border: 1px solid var(--border);
            border-radius: 5px;
        }

        .delete-options {
            display: flex;
            flex-direction: column;
            gap: 15px;
            margin: 20px 0;
        }

        .delete-option {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .single-delete-message {
            display: none;
            margin: 20px 0;
            padding: 10px;
            background: #fff0f0;
            border-radius: 8px;
            border-left: 4px solid var(--danger);
        }

        .required:after {
            content: " *";
            color: var(--danger);
        }

        
        .date-row {
            flex-direction: row;
            flex-wrap: nowrap;
        }

        .date-group {
            min-width: auto;
            flex: 1;
        }

        
        .tasks-header-container {
            display: flex;
            flex-direction: column;
            margin-bottom: 0; 
        }

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

        .date-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: #f0f7ff;
            padding: 12px 20px;
            border-radius: 12px;
            margin-bottom: 0; 
        }

        .date-info {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .current-date-display {
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--primary);
        }

        .date-controls {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .week-controls {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .week-toggle {
            background: #e3f0ff;
            border-radius: 6px;
            overflow: hidden;
            display: flex;
        }

        .week-btn {
            padding: 6px 12px;
            background: transparent;
            border: none;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.3s;
        }

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

        .calendar-toggle {
            background: var(--primary);
            color: white;
            border: none;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s;
        }

        .calendar-toggle:hover {
            background: var(--secondary);
        }

        .action-buttons-container {
            display: flex;
            gap: 10px;
        }

        .plan-tabs-row {
            display: flex;
            align-items: flex-end;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: -2px;
            min-width: 0;
        }

        .plan-tab-btn {
            border: 1px solid #d8deee;
            border-bottom: none;
            border-radius: 22px 22px 0 0;
            background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
            color: #2f62f1;
            font-weight: 700;
            line-height: 1.1;
            padding: 12px 20px 13px;
            cursor: pointer;
            transition: all 0.2s ease;
            white-space: nowrap;
            max-width: 100%;
        }

        .plan-tab-btn.active {
            color: #2f62f1;
            box-shadow: 0 10px 24px rgba(59, 120, 239, 0.1);
        }

        .plan-tab-btn.secondary {
            color: #e03154;
        }

        .plan-tab-btn:focus-visible {
            outline: 2px solid rgba(47, 98, 241, 0.35);
            outline-offset: 2px;
        }

        .plan-tab-btn.primary-label {
            font-size: clamp(1.15rem, 2.1vw, 1.75rem);
            padding-left: 18px;
            padding-right: 24px;
        }

        .plan-tab-btn.secondary-label {
            font-size: clamp(1rem, 1.5vw, 1.25rem);
        }

        .tasks-header-container {
            position: relative;
        }

        .tasks-header-actions {
            display: flex;
            justify-content: flex-end;
        }

        .other-reserved-page {
            display: none;
            margin-top: 8px;
            padding: 34px 28px;
            border-radius: 18px;
            background: linear-gradient(135deg, rgba(59, 120, 239, 0.08) 0%, rgba(86, 160, 255, 0.14) 100%);
            border: 1px dashed rgba(59, 120, 239, 0.28);
        }

        
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.8);
            z-index: 9999;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            transition: opacity 0.3s;
        }

        .loading-spinner {
            width: 50px;
            height: 50px;
            border: 5px solid #f3f3f3;
            border-top: 5px solid #3b78ef;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

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

        
        #focusModal {
            display: none;
            background: rgba(255, 255, 255, 0.95);
            z-index: 2000;
        }

        .focus-container {
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            padding: 20px;
        }

        .focus-task-card {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }

        .focus-task-content {
    width: 90%;
    max-width: 800px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    padding: 60px 40px 40px;
    position: relative; 
}

        
        .focus-top-left {
            position: absolute;
            top: 15px;
            left: 15px;
            z-index: 10;
            padding: 8px 16px;
            font-size: 0.9rem;
        }

        .focus-top-right {
            position: absolute;
            top: 15px;
            right: 15px;
            z-index: 10;
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .focus-action-btn {
            background: rgba(59, 120, 239, 0.1);
            border: 1px solid rgba(59, 120, 239, 0.2);
            color: var(--primary);
            border-radius: 6px;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 1rem;
        }

        .focus-action-btn:hover {
            background: rgba(59, 120, 239, 0.2);
        }

        
        .focus-task-title {
            margin-top: 20px;
            position: relative;
            z-index: 5;
        }

        
        @media (max-width: 768px) {
            .focus-container {
                padding: 10px;
            }

            .focus-task-card {
                padding: 10px;
            }

            .focus-task-content {
                width: 100%; 
                max-width: none; 
                padding: 60px 20px 20px;
                margin: 0 -10px; 
                border-radius: 0; 
            }
        }

        .focus-task-title {
            font-size: 2.5rem;
            text-align: center;
            margin-bottom: 30px;
            color: var(--primary);
        }

        .focus-timer-display {
            font-size: 5rem;
            font-weight: bold;
            text-align: center;
            font-family: 'Courier New', monospace;
            color: #e74c3c;
            margin: 30px 0;
        }

        .focus-controls {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-top: 30px;
        }

        .focus-btn {
            padding: 15px 30px;
            font-size: 1.2rem;
            border-radius: 10px;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 10px;
            transition: all 0.3s;
        }

        .focus-btn.start {
            background: linear-gradient(to bottom, #27ae60, #2ecc71);
            color: white;
        }

        .focus-btn.pause {
            background: linear-gradient(to bottom, #f39c12, #f1c40f);
            color: white;
        }

        .focus-btn.stop {
            background: linear-gradient(to bottom, #e74c3c, #c0392b);
            color: white;
        }

        .focus-btn:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        }

        .focus-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        .focus-details {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-top: 20px;
        }

        .focus-detail-item {
            padding: 15px;
            background: #f9fbfd;
            border-radius: 10px;
            border: 1px solid #edf2f7;
        }

        .focus-detail-item h4 {
            margin-bottom: 10px;
            color: #3b78ef;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .focus-detail-item p {
            margin: 0;
            line-height: 1.6;
        }

        
        .icon-fallback .fas {
            position: relative;
            visibility: hidden;
        }

        .icon-fallback .fas::before {
            content: attr(data-fallback);
            position: absolute;
            visibility: visible;
            left: 0;
            top: 0;
            font-size: 0.7em;
            background: #f0f0f0;
            padding: 2px;
            border-radius: 3px;
            font-family: Arial, sans-serif;
            font-weight: bold;
        }

        
        #congratsModal {
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 3000;
        }

        .congrats-content {
            position: relative;
            background: linear-gradient(135deg, #fff9db 0%, #fff3bf 100%);
            border-radius: 20px;
            padding: 40px 30px;
            text-align: center;
            max-width: 500px;
            width: 90%;
            box-shadow: 0 15px 50px rgba(0,0,0,0.3);
            border: 4px solid var(--gold);
            animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        @keyframes popIn {
            0% { transform: scale(0.8); opacity: 0; }
            100% { transform: scale(1); opacity: 1; }
        }

        .congrats-content h2 {
            color: #d97706;
            margin-bottom: 15px;
            font-size: 2rem;
        }

        .congrats-icon {
            font-size: 80px;
            color: var(--gold);
            margin: 20px 0;
            text-shadow: 0 2px 8px rgba(0,0,0,0.1);
            animation: bounce 1s infinite alternate;
        }

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

        .congrats-message {
            font-size: 1.2rem;
            color: #333;
            margin-bottom: 25px;
            line-height: 1.6;
        }

        .stats-details {
            background: rgba(255, 255, 255, 0.9);
            border-radius: 12px;
            padding: 15px;
            margin: 20px 0;
            text-align: center;
            border: 1px solid rgba(255, 215, 0, 0.3);
            box-shadow: 0 4px 10px rgba(0,0,0,0.05);
        }

        .stats-details p {
            margin: 10px 0;
            font-size: 1.1rem;
            color: #333;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .stats-details span {
            font-weight: bold;
            color: #d97706;
            margin-left: 8px;
        }

        .backup-tip {
            color: #d97706;
            font-weight: 500;
            margin: 25px 0 15px;
            font-size: 1.1rem;
        }

        .backup-btn {
            background: linear-gradient(to bottom, #3b78ef, #2f63dd);
            color: white;
            border: none;
            border-radius: 50px;
            padding: 14px 35px;
            font-size: 1.2rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            margin-top: 10px;
            box-shadow: 0 4px 15px rgba(59, 120, 239, 0.4);
            display: inline-flex;
            align-items: center;
            gap: 10px;
        }

        .backup-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 20px rgba(59, 120, 239, 0.6);
        }

        .backup-btn i {
            font-size: 1.2rem;
        }

        .close-congrats {
            position: absolute;
            top: 20px;
            right: 20px;
            background: none;
            border: none;
            font-size: 1.8rem;
            color: #999;
            cursor: pointer;
            transition: all 0.3s;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
        }

        .close-congrats:hover {
            color: #333;
            background: rgba(0,0,0,0.05);
        }

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

            .date-navigation {
                flex-direction: column;
                align-items: flex-start;
            }

            .date-controls {
                margin-left: 0;
                margin-top: 2px;
            }

            .week-days {
                flex-wrap: wrap;
            }

            .day-btn {
                min-width: calc(50% - 10px);
                margin-bottom: 10px;
            }

       
  .task-card {
    border-radius: 12px;
    margin-bottom: 12px;
  }

  .category-bar {
    width: 40px; 
    height: auto; 
    padding: 10px 0; 
    justify-content: center; 
    font-size: 0.9rem;
    border-radius: 12px 0 0 12px; 
  }

.data-display-area {
   padding: 10px 12px;
}


.info-row {
    flex-wrap: nowrap;
    margin-bottom: 6px;
}

.task-title {
    font-size: 1.1rem;
    margin-right: 8px;
}

.description-box {
    max-height: 60px;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}




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

            .stat-chart {
                height: 300px;
            }

            .header-row {
                flex-direction: column;
                gap: 15px;
                align-items: flex-start;
            }

            .action-buttons-container {
                width: 100%;
                justify-content: space-between;
            }

            .date-info {
                flex-direction: column;
                align-items: flex-start;
                gap: 8px;
            }

            .week-controls {
                width: 100%;
                justify-content: space-between;
            }

            
            .today-stats {
                gap: 8px;
            }

            .week-days {
                min-width: auto;
            }

            .day-btn {
                min-width: auto;
                flex: 1;
            }

            .sidebar {
                min-width: 100%;
            }

            .tasks-container {
                min-width: 100%;
            }

            .focus-task-content {
                padding: 60px 20px 20px;
            }

            .focus-details {
                grid-template-columns: 1fr;
            }

            .focus-task-title {
                font-size: 1.8rem;
            }

            .focus-timer-display {
                font-size: 3rem;
            }

            
            .congrats-content {
                padding: 30px 20px;
            }

            .congrats-icon {
                font-size: 60px;
            }

            .congrats-content h2 {
                font-size: 1.6rem;
            }

            .congrats-message {
                font-size: 1rem;
            }

            .stats-details p {
                font-size: 1rem;
            }

            .backup-btn {
                padding: 12px 25px;
                font-size: 1.1rem;
            }
        }
        
        .account-controls {
            position: absolute;
            top: 10px;
            right: 10px;
            z-index: 10;
        }

        .account-selector {
            display: flex;
            gap: 8px;
            align-items: center;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 25px;
            padding: 8px 5px;
            min-width: auto; 
        }

        .account-selector select {
            background: transparent;
            border: none;
            color: white;
            font-weight: 500;
            outline: none;
            cursor: pointer;
            min-width: 30px;
        }

        .account-selector button {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            border-radius: 50%;
            width: 30px;
            height: 30px;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background 0.3s;
        }

       .account-selector button:hover {
            background: rgba(255, 255, 255, 0.3);
        }

   @media (max-width: 480px) {
  .today-stats {
    gap: 4px;
  }

  .stat-card {
    min-width: 70px;
    padding: 8px 3px;
  }

  .stat-card h3 {
    font-size: 1.4rem;
  }

  .stat-card p {
    font-size: 0.75rem;
  }

  .stat-card::after {
    height: 3px;
  }

  
  .header-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .header-left {
    padding: 5px 15px 5px 5px;
    width: auto;
  }

  .header-right {
    padding: 5px 5px 5px 15px;
    width: auto;
    justify-content: flex-end;
  }

  
  header h2 {
    font-size: 2.2rem;
    margin-bottom: 0;
    display: inline-block;
  }

  header h3 {
    font-size: 1.1rem;
    margin-bottom: 0;
    display: inline-block;
  }

  
  .account-trigger {
    background: transparent;
    padding: 0;
  }
}

@media (max-width: 350px) {
    .stat-card h3 {
        font-size: 1.2rem;
    }
    .stat-card p {
        font-size: 0.7rem;
    }
}

        @media print {
            .timer-controls, .print-btn, .task-actions, .add-task-main-btn,
            .category-actions, .add-category-btn, .stats-btn, .data-buttons {
                display: none;
            }

            body {
                padding: 10px;
                background: white;
            }

            .task-card {
                page-break-inside: avoid;
            }

            .chart-container {
                page-break-before: always;
            }
        }

        
        .stats-message {
            text-align: center;
            padding: 50px;
            background: var(--card-bg);
            border-radius: 15px;
            box-shadow: 0 4px 10px rgba(0,0,0,0.05);
            margin: 20px 0;
        }

        .stats-message i {
            font-size: 48px;
            color: var(--primary);
            margin-bottom: 20px;
            display: block;
        }

        .stats-message h3 {
            font-size: 1.5rem;
            margin-bottom: 15px;
            color: var(--text);
        }

        .stats-message p {
            font-size: 1rem;
            color: var(--text-light);
            max-width: 600px;
            margin: 0 auto;
            line-height: 1.6;
        }
         
.repeat-info {
    margin-left: 12px;
    font-size: 0.9rem;
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 12px;
}

.focus-description-section {
    grid-column: span 2; 
    margin-top: 15px;
}

.focus-description-content {
    background: #f9fbfd;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    padding: 15px;
    max-height: 150px; 
    overflow-y: auto; 
    line-height: 1.6;
}

.focus-action-buttons {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.focus-action-btn {
    background: #f0f7ff;
    border: none;
    color: #3b78ef;
    cursor: pointer;
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.focus-action-btn:hover {
    background: #3b78ef;
    color: white;
    transform: scale(1.1);
}

@media (max-width: 768px) {

   
  .sidebar.collapsed .sidebar-header h2 {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    flex-direction: row;
    justify-content: center;
    gap: 6px;
    font-size: 1rem;
    white-space: nowrap;
  }
  .sidebar.collapsed .sidebar-header h2 i {
    transform: none;
    margin-bottom: 0;
  }

  
.week-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    min-width: 0;
}
.day-btn {
    flex: none;
    min-width: 0;
    padding: 4px 1px;
    font-size: 0.75rem;
    border-radius: 6px;
    margin: 0;
}
.day-name {
    font-size: 0.7rem;
    margin-bottom: 2px;
}
.day-date {
    font-size: 0.9rem;
    font-weight: bold;
}
.day-btn.today {
    background: #4caf50;
    color: white;
}
.day-btn.active {
    background: var(--primary);
    color: white;
}

  
  .main-content {
    width: 100%;
    max-width: 100%;
  }
  .tasks-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  
  .focus-controls .focus-btn {
    padding: 8px 16px;
    font-size: 1rem;
  }
  .focus-timer-display {
    font-size: 3rem;
  }
  .focus-task-content {
    width: 100vw;                
    max-width: 100vw;
    border-radius: 0;
    margin-left: -20px;
    margin-right: -20px;
    padding: 60px 15px 15px;     
  }
}

@media (max-width: 768px) {
  
  .card-content {
    width: 100%;
    
  }

  
  .data-display-area {
    width: 100% !important;   
    flex: 1 1 0%;
    box-sizing: border-box;
    padding: 8px 12px;        
  }

  
  .action-section {
    width: auto;              
    min-width: 110px;         
    flex-shrink: 0;           
  }

  
  .info-row {
    flex-wrap: wrap;
    word-break: break-word;
  }
}
@media (max-width: 768px) {
  header {
    position: relative;
    padding: 0;
    text-align: left;
  }

  .header-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
  }

  .header-left {
    align-items: flex-start;
    width: auto;
    padding: 15px 15px 15px 15px;
  }

  
  header h2 {
    margin: 0 5px 0 0;
    font-size: 2.2rem;
    color: white;
    font-weight: 700;
    display: inline-block;
  }

  header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    display: inline-block;
  }

  #subTitle {
    font-size: 0.9rem !important;
    margin: 5px 0 0 0 !important;
  }

  
  .header-right {
    width: auto;
    justify-content: flex-end;
    padding: 15px 15px 15px 15px;
  }

  .account-controls {
    position: static;
    margin-top: 0;
  }

  .account-trigger {
    background: transparent;
    padding: 0;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
  }

  
  .account-menu {
    top: 100%;
    right: 0;
    left: auto;
  }
}
@media (max-width: 768px) {
  .sidebar.collapsed {
    min-height: 0;          
    padding: 6px 4px;       
    height: 44px;           
  }

  .sidebar.collapsed .sidebar-header {
    line-height: 1;         
  }

  .sidebar.collapsed .sidebar-header h2 {
    font-size: 1.2rem;      
  }

  .sidebar.collapsed .sidebar-header h2 i {
    font-size: 1.2rem;        
  }
}

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

  .stat-chart {
    min-width: 0 !important;             
    width: 100%;                         
    overflow-x: hidden;                  
  }
}
@media (max-width: 768px) {
  
  .task-card {
    height: auto !important;
    min-height: 110px; 
    padding-bottom: 5px;
  }

  
  .action-section {
    padding-top: 0 !important;
    margin-top: -10px; 
    gap: 5px !important; 
  }

  
  .timer-display {
    font-size: 1.3rem !important;
    padding: 6px 8px !important;
    margin-bottom: 2px !important;
  }

  .timer-controls {
    gap: 4px !important; 
  }

  .timer-btn {
    width: 40px !important;
    height: 32px !important;
    font-size: 14px !important;
  }

  
  .data-display-area {
    padding-bottom: 2px !important;
  }

  .description-box {
    margin-bottom: 2px !important;
  }
}

@media (max-width: 768px) {
    .header-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        gap: 8px;   
        width: 100%;
    }

    
    .header-row h2 {
        flex: 1 1 auto;
        white-space: nowrap;
        margin: 0;
    }

    .add-task-main-btn {
        flex-shrink: 0;
        white-space: nowrap;
        margin-left: 0;   
    }
}


.import-options {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #3b78ef;
}

.import-option {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.import-option:last-child {
    margin-bottom: 0;
}

.import-option input {
    margin-right: 10px;
}

.import-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.import-option i {
    margin-right: 8px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.option-description {
    margin-left: 30px;
    font-size: 0.9rem;
    color: #6c757d;
}

.custom-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 0 0 8px 8px;
}

.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

.dropdown-item .category-icon {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.dropdown-item .task-name {
    flex: 1;
}

.dropdown-item .category-name {
    color: #999;
    font-size: 0.8rem;
    margin-left: 10px;
}

.task-card.dragging {
    opacity: 0.8;
    transform: scale(0.7); 
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    cursor: grabbing;
}

.task-card.drag-over {
    border: 3px dashed #3b78ef;
    background-color: #e3f0ff;
    margin: 8px 0;
    box-shadow: 0 4px 12px rgba(59, 120, 239, 0.3);
}

.task-card.drag-insert-above {
    border-top: 4px solid #3b78ef !important;
}

.task-card.drag-insert-below {
    border-bottom: 4px solid #3b78ef !important;
}


.task-card {
    cursor: grab;
}

.task-card:active {
    cursor: grabbing;
}
.task-list-main {
    min-height: 100px;
}

@media (max-width: 768px) {
    .task-list-main {
        gap: 10px !important;   
    }
    .task-card {
        margin: 0 !important;   
        width: 100% !important; 
        transform: none !important; 
    }
}
@media (max-width: 768px) {
    
    .week-days-container {
        padding: 2px 5px !important;   
        margin-bottom: 10px;           
    }

    
    .week-days {
        gap: 2px !important;           
        padding: 0 !important;         
        align-items: center;           
    }

    
    .day-btn {
        padding: 4px 2px !important;   
        font-size: 0.75rem;
        line-height: 1;                
    }
}
@media (max-width: 768px) {
    .add-task-main-btn {
        width: 50%; 
        padding: 2px; 
        margin: 0 2px; 
    }
	 }


.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.badge-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    position: relative;
    transition: transform 0.3s;
    min-height: 140px;
    max-height: 250px; 
    overflow-y: auto; 
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.badge-item {
  
  position: relative;
}

.badge-recurring-count {
  
  position: absolute;
  top: 5px;
  right: 5px;
  
  background-color: #e74c3c; 
  color: white; 
  border-radius: 50%;
  width: 24px;
  height: 24px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  font-size: 0.8rem;
  font-weight: bold;
  
  z-index: 3;
  
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  
  border: 2px solid white;
  
  pointer-events: none;
}


.badge-item.badge-unlocked:not(.has-recurring-count) .badge-recurring-count {
  
  
}

.badge-item.has-recurring-count::before {
  
  
  
  
}
@media (max-width: 768px) {
    .badge-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

    .badge-item {
        padding: 12px;
        min-height: 120px;
        max-height: 200px; 
    }

    .badge-icon {
        font-size: 40px !important;
    }

    
    .badge-item::before {
        width: 50%;
        height: 12px;
        top: -6px;
    }
}

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

.badge-item:hover {
    transform: translateY(-5px);
}


.badge-item::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 16px;
    background: linear-gradient(135deg, #ff6b6b, #c0392b);
    border-radius: 4px 4px 0 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1;
}


.badge-item {
    border: 3px solid transparent;
    background-clip: padding-box;
    position: relative;
    background-image: 
        linear-gradient(white, white), 
        repeating-linear-gradient(
            45deg,
            #FFD700 0px,
            #FFD700 2px,
            transparent 2px,
            transparent 4px
        );
    background-origin: border-box;
}

.badge-unlocked {
    background-image: 
        linear-gradient(white, white), 
        repeating-linear-gradient(
            45deg,
            #FFD700 0px,
            #FFD700 2px,
            transparent 2px,
            transparent 4px
        );
    border: 3px solid transparent;
}

.badge-locked {
    background-image: 
        linear-gradient(white, white), 
        repeating-linear-gradient(
            45deg,
            #ccc 0px,
            #ccc 2px,
            transparent 2px,
            transparent 4px
        );
    border: 3px solid transparent;
    opacity: 0.6;
}

.badge-icon {
    font-size: 50px;
    margin-bottom: 15px;
    color: var(--gold);
    position: relative;
    z-index: 2; 
}

.badge-info h4 {
    margin: 0 0 10px 0;
    color: var(--text);
    font-size: 1.1rem;
    position: relative;
    z-index: 2;
}

.badge-info p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    z-index: 2;
}

.badge-unlocked {
    border: 3px solid var(--gold);
}

.badge-locked {
    opacity: 0.6;
}

.badge-locked .badge-icon {
    color: #ccc !important;
}

.badge-lock-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ccc;
    font-size: 1.2rem;
}

.badge-controls,
.score-controls {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 20px;
    width: 100%;
    overflow-x: hidden;
    padding: 0 5px;
}

.congrats-badge-content {
    position: relative;
    background: linear-gradient(135deg, #fff9db 0%, #fff3bf 100%);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    border: 4px solid var(--gold);
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-image: 
        radial-gradient(circle at 50% 10%, rgba(255,255,255,0.5) 0%, transparent 20%),
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23FFD700' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
		background-color: #ffffff; 
}

.badge-ribbon {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 30px;
    background: linear-gradient(135deg, #ff6b6b, #c0392b);
    border-radius: 5px 5px 0 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
}

.badge-title {
    font-size: 2.2rem;
    color: #d97706;
    margin: 20px 0 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    font-family: 'Times New Roman', serif;
    position: relative;
}

.badge-title::after {
    content: "";
    display: block;
    width: 100px;
    height: 2px;
    background: linear-gradient(to right, transparent, #d97706, transparent);
    margin: 10px auto;
}

.badge-icon-container {
    position: relative;
    margin: 20px 0;
}

.badge-icon-wrapper {
    display: inline-block;
    position: relative;
}

.badge-icon {
    font-size: 60px;
    color: var(--gold);
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);

    position: relative;
    z-index: 2;
}

.badge-icon-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255,215,0,0.3) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
}

.badge-name {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    font-family: 'Times New Roman', serif;
}

.badge-description {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 25px;
    line-height: 1.5;
    font-style: italic;
}

.badge-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #d97706;
    color: #777;
    font-size: 0.9rem;
}


#unlockedBadgeModal .confirmation-content {
    background: transparent;
    box-shadow: none;
    max-width: 550px;
}

#unlockedBadgeModal .confirmation-body {
    padding: 0;
    background: transparent;
}

#batchBadgeModal table {
    table-layout: fixed;
}

#batchBadgeModal th:nth-child(1) { width: 15%; }
#batchBadgeModal th:nth-child(2) { width: 15%; }
#batchBadgeModal th:nth-child(3) { width: 12%; }
#batchBadgeModal th:nth-child(4) { width: 12%; }
#batchBadgeModal th:nth-child(5) { width: 20%; }
#batchBadgeModal th:nth-child(6) { width: 10%; }
#batchBadgeModal th:nth-child(7) { width: 14%; }
#batchBadgeModal th:nth-child(8) { width: 2%; }

#batchBadgeTableBody tr:hover {
    background-color: #f8f9fa;
}

#batchBadgeTableBody input,
#batchBadgeTableBody select,
#batchBadgeTableBody textarea {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
    color: #495057;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
    vertical-align: middle;
}

#batchBadgeTableBody input:focus,
#batchBadgeTableBody select:focus,
#batchBadgeTableBody textarea:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#batchBadgeTableBody .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    width: 100%;
}

#batchBadgeTableBody .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}


#batchBadgeTableBody td {
    vertical-align: middle !important;
}

#batchBadgeTableBody textarea {
    min-height: 36px;
    resize: vertical;
    font-family: inherit;
}

.account-controls{position:relative;top:auto;right:auto;z-index:10;flex:0 0 auto;}
.account-dropdown{position:relative;display:inline-block;}
.account-trigger{background:rgba(255,255,255,.2);border:none;border-radius:20px;
  color:#fff;padding:6px 14px;cursor:pointer;font-size:.9rem;display:flex;align-items:center;gap:6px;}
.account-trigger:hover{background:rgba(255,255,255,.3);}
.account-trigger i{font-size:.7rem;transition:transform .2s;}
.account-trigger.open i{transform:rotate(180deg);}
.account-menu{
  position: absolute;
  top: 70px;          
  right: 20px;        
  background: #fff;
  color: #333;
  list-style: none;
  padding: 4px 0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  min-width: 140px;
  z-index: 999;       
  display: none;
}
.account-menu li{padding:8px 12px;cursor:pointer;font-size:.9rem;display:flex;align-items:center;gap:8px;}
.account-menu li:hover{background:#f5f7fa;}
.account-menu li.danger{color:#e74c3c;}
.account-menu hr{margin:4px 0;border:none;border-top:1px solid #e1e8ed;}

header .header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  header .header-right {
    align-items: flex-end;
    gap: 6px;
  }

  .badge-controls {
    flex-wrap: wrap;          
    gap: 8px 1px;             
    justify-content: left;  
  }

  .badge-controls .add-task-main-btn {
    flex: 1 1 auto;           
    min-width: 0;             
    max-width: 110px;         
    padding: 6px 8px;         
    font-size: 0.85rem;       
    white-space: nowrap;      
    overflow: hidden;
    text-overflow: ellipsis;  
  }
  
.sort-container {
    position: relative;
    display: inline-block;
}

.sort-btn {
    background: #6c757d;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sort-btn:hover {
    background: #5a6268;
    transform: scale(1.05);
}

.sort-dropdown {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 150px;
    top: 100%;
    left: 0;
}

.sort-option {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.sort-option:hover {
    background: #f0f7ff;
}

.sort-option:last-child {
    border-bottom: none;
}
@media (max-width: 768px) {
    
    .sort-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    .sort-dropdown {
        min-width: 130px;
    }

    .sort-option {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    
}
}

.icon-selection-container {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}


.icon-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #555;
    background: white;
    transition: all 0.3s ease;
}

.icon-option:hover {
    border-color: #3b78ef;
    color: #3b78ef;
    transform: scale(1.1);
}

.icon-option.selected {
    border-color: #3b78ef;
    background-color: #e3f0ff;
    color: #3b78ef;
    transform: scale(1.05);
}


@media (max-width: 768px) {
    .icon-selection-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .icon-option {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}
@media (max-width: 768px) {
    
    .task-list-main {
        gap: 8px !important;
    }

    .task-card {
        margin-bottom: 6px !important;
        height: 100px !important; 
    }

    
    .data-display-area {
        padding: 6px 10px !important;
    }

    .info-row {
        margin-bottom: 4px !important;
    }

    .task-title {
        font-size: 1.1rem !important;
        margin-right: 6px !important;
    }

    .description-box {
        max-height: 50px !important;
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
        padding: 4px 6px !important;
    }

    
    .action-section {
        padding: 4px 6px !important;
        gap: 4px !important;
        min-width: 90px !important; 
    }

    .timer-display {
        font-size: 1.2rem !important;
        padding: 8px 10px !important;
        margin-bottom: 2px !important;
    }

    .timer-controls {
        gap: 4px !important;
    }

    .timer-btn {
        width: 36px !important;
        height: 28px !important;
        font-size: 12px !important;
    }

    .timer-btn i {
        font-size: 12px !important;
    }

    
    .category-bar {
        width: 35px !important;
        font-size: 0.9rem !important;
    }

    
    .today-stats {
        gap: 6px !important;
    }

    .stat-card {
        padding: 8px 4px !important;
    }

    .stat-card h3 {
        font-size: 1.2rem !important;
    }

    .stat-card p {
        font-size: 0.75rem !important;
    }

    
    .week-days-container {
        padding: 2px 3px !important;
        margin-bottom: 8px !important;
    }

    .week-days {
        gap: 2px !important;
    }

    .day-btn {
        padding: 3px 1px !important;
        font-size: 0.7rem !important;
    }

    .day-name {
        font-size: 0.65rem !important;
        margin-bottom: 1px !important;
    }

    .day-date {
        font-size: 0.85rem !important;
    }

    
    .header-row {
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    .date-row {
        padding: 2px 2px !important;
    }

    
    .action-buttons-container {
        gap: 6px !important;
    }

    .add-task-main-btn {
        padding: 6px 10px !important;
        font-size: 0.85rem !important;
        min-width: 0 !important;
    }

    
    .sidebar.collapsed {
        padding: 4px 2px !important;
        height: 40px !important;
    }

    .sidebar.collapsed .sidebar-header h2 {
        font-size: 1rem !important;
        gap: 4px !important;
    }

    
    .focus-controls {
        gap: 12px !important;
        margin-top: 20px !important;
    }

    .focus-btn {
        padding: 10px 18px !important;
        font-size: 0.95rem !important;
    }

    .focus-timer-display {
        font-size: 2.5rem !important;
        margin: 20px 0 !important;
    }
}


@media (max-width: 480px) {
    .task-card {
        height: 95px !important;
    }

    .action-section {
        min-width: 85px !important;
    }

    .timer-display {
        font-size: 1.1rem !important;
        padding: 6px 8px !important;
    }

    .timer-btn {
        width: 32px !important;
        height: 26px !important;
    }

    .today-stats {
        gap: 4px !important;
    }

    .stat-card h3 {
        font-size: 1.1rem !important;
    }

    .stat-card p {
        font-size: 0.7rem !important;
    }
}
@media (max-width: 768px) {
  
  .container {
    padding: 10px;
  }

  
  .task-card {
    margin: 2px 0;
  }

  
  .category-bar {
    font-size: 0.9rem;
  }

  
  .task-title {
    font-size: 1.1rem;
  }

  .description-box {
    font-size: 0.9rem;
    max-height: 50px;
  }

  
  .timer-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .timer-display {
    font-size: 1.2rem;
    padding: 8px 10px;
  }

  
  .today-stats {
    gap: 8px;
  }

  .stat-card {
    padding: 8px 5px;
  }

  .stat-card h3 {
    font-size: 1.3rem;
  }

  .stat-card p {
    font-size: 0.8rem;
  }

  
  .day-btn {
    padding: 6px 2px;
    font-size: 0.8rem;
  }

  .day-name {
    font-size: 0.75rem;
  }

  .day-date {
    font-size: 0.9rem;
  }
}


@media (max-width: 480px) {
  .timer-btn {
    width: 28px;
    height: 28px;
  }

  .timer-display {
    font-size: 1.1rem;
    padding: 6px 8px;
  }

  .stat-card h3 {
    font-size: 1.1rem;
  }
}
@media (max-width: 768px) {
  
  .data-buttons {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0 5px !important;
    margin: 15px 0 !important;
  }

  
  .data-btn {
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
    flex: 1 !important; 
    min-width: 0 !important; 
    max-width: 120px !important; 
    text-align: center !important;
  }

  
  .data-btn i {
    font-size: 0.8rem !important;
    margin-right: 4px !important;
  }

  
  @media (max-width: 480px) {
    .data-buttons {
      gap: 5px !important;
    }

    .data-btn {
      padding: 6px 8px !important;
      font-size: 0.75rem !important;
      max-width: 100px !important;
    }

    .data-btn i {
      font-size: 0.7rem !important;
      margin-right: 3px !important;
    }
  }

  
  @media (max-width: 360px) {
    .data-btn {
      padding: 5px 6px !important;
      font-size: 0.7rem !important;
      max-width: 90px !important;
    }

    
    .data-btn .btn-text {
      display: inline-block;
      max-width: 50px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}

@media (max-width: 768px) {
  .data-buttons {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 0 2px !important;
    margin: 12px 0 !important;
  }

  .data-btn {
    padding: 6px 8px !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .data-btn i {
    font-size: 0.75rem !important;
    margin-right: 4px !important;
  }
}
@media (max-width: 768px) {
  
  body {
    padding: 10px 5px !important; 
  }

  .container {
    max-width: 100% !important;
    margin: 0 auto !important;
  }

  
  .task-card {
    width: 100% !important;
    margin: 0 0 8px 0 !important;
  }

  .card-content {
    width: 100% !important;
    overflow: hidden !important; 
  }

  .data-display-area {
    width: 65% !important; 
    min-width: 0 !important; 
    flex-shrink: 1 !important;
  }

  .action-section {
    width: 35% !important; 
    min-width: 100px !important; 
    flex-shrink: 0 !important; 
  }

  
  .header-row {
    padding: 0 2px !important; 
    margin-bottom: 10px !important;
  }

  .action-buttons-container {
    gap: 5px !important;
    flex-wrap: nowrap !important;
  }

  .add-task-main-btn {
    padding: 6px 10px !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    min-width: 0 !important;
    flex-shrink: 1 !important; 
  }

  
  .week-days-container {
    margin: 0 -2px 10px -2px !important; 
    padding: 2px !important;
  }

  .week-days {
    gap: 1px !important;
  }

  .day-btn {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 4px 1px !important;
  }

  
  .data-buttons {
    margin: 15px -2px !important; 
    padding: 0 2px !important;
    gap: 5px !important;
  }

  .data-btn {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 8px 5px !important;
    font-size: 0.75rem !important;
  }

  
  .main-content {
    gap: 10px !important;
    margin: 0 -2px !important; 
  }

  .tasks-container {
    padding: 2px 5px !important; 
    margin: 0 !important;
  }

  
  .today-stats {
    margin: 10px -2px !important; 
    padding: 0 2px !important;
    gap: 4px !important;
  }

  .stat-card {
    padding: 8px 3px !important;
  }
}


@media (max-width: 480px) {
  body {
    padding: 8px 3px !important;
  }

  .data-display-area {
    width: 60% !important;
  }

  .action-section {
    width: 40% !important;
    min-width: 90px !important;
  }

  .add-task-main-btn {
    padding: 5px 5px !important;
    font-size: 0.75rem !important;
  }

  .data-btn {
    padding: 6px 4px !important;
    font-size: 0.7rem !important;
  }
}


@media (max-width: 360px) {
  body {
    padding: 5px 2px !important;
  }

  .data-display-area {
    width: 55% !important;
  }

  .action-section {
    width: 45% !important;
    min-width: 85px !important;
  }

  
  .add-task-main-btn span {
    display: none; 
  }

  .add-task-main-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    justify-content: center !important;
  }
}
@media (max-width: 768px) {
  
  #categoryModal .modal-content {
    max-width: 95% !important;
    margin: 0 auto !important;
  }

  
  .icon-selection-container {
    grid-template-columns: repeat(8, 1fr) !important;
    gap: 6px !important;
    padding: 10px !important;
  }

  .icon-option {
    width: 35px !important;
    height: 35px !important;
    font-size: 1rem !important;
  }

  
  #colorPicker {
    gap: 6px !important;
  }

  .color-option {
    width: 28px !important;
    height: 28px !important;
  }

  
  header #subTitle {
    font-size: 0.9rem !important;
    margin: 4px 0 0 0 !important;
  }

  
  @media (max-width: 480px) {
    .icon-selection-container {
      gap: 4px !important;
      padding: 8px !important;
    }

    .icon-option {
      width: 32px !important;
      height: 32px !important;
      font-size: 0.9rem !important;
    }

    header #subTitle {
      font-size: 0.8rem !important;
    }
  }

  
  @media (max-width: 360px) {
    .icon-selection-container {
      gap: 2px !important;
      padding: 6px !important;
    }

    .icon-option {
      width: 30px !important;
      height: 30px !important;
      font-size: 0.85rem !important;
    }

    .color-option {
      width: 26px !important;
      height: 26px !important;
    }
  }
}
@media (max-width: 768px) {
  
  .task-card {
    width: 100% !important;
    transform: none !important;
  }

  .task-card .repeat-info { display: none; }
  
  .focus-task-title .repeat-info { display: inline; }
  
  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px !important;
  }

  .plan-time {
    font-size: 0.8rem !important;
    color: #666;
    order: 2; 
    width: 100%;
    margin-top: 2px;
  }

  .task-title {
    order: 1; 
    width: 100%;
  }

  
  .data-display-area {
    padding: 8px 10px !important;
  }

  .description-box {
    margin-top: 4px;
    order: 3; 
  }
}
@media (max-width: 768px) {
  
  .task-card {
    height: 130px !important; 
    min-height: 130px !important;
  }

  
  .description-box {
    max-height: 60px !important; 
    min-height: 50px !important; 
    line-height: 1.4 !important;
    font-size: 0.9rem !important;
    overflow-y: auto; 
    padding: 6px 8px !important;
  }

  
  .data-display-area {
    padding: 8px 10px !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
  }

  
  .info-row {
    margin-bottom: 8px !important;
    flex: 0 0 auto; 
  }


  .timer-btn {
    width: 34px !important;
    height: 28px !important;
    font-size: 12px !important;
  }
}


@media (max-width: 480px) {
  .task-card {
    height: 150px !important; 
    min-height: 150px !important;
  }

  .description-box {
    max-height: 75px !important;
    min-height: 55px !important;
  }
}


@media (max-width: 360px) {
  .task-card {
    height: 160px !important; 
    min-height: 160px !important;
  }

  .description-box {
    max-height: 80px !important;
    min-height: 60px !important;
  }
}

.overdue-tag {
    background: #ffebee;
    color: #c62828;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 8px;
    border: 1px solid #ffcdd2;
}

.overdue-task {
    border-left: 4px solid #f44336;
    background: #fff5f5;
}

.overdue-task .category-bar {
    opacity: 0.8;
}

#manualTimeModal .time-inputs {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#manualTimeModal .time-inputs > div {
    display: flex;
    flex-direction: column;
}

#manualTimeModal .time-inputs label {
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: 500;
}
@media (max-width: 768px) {
  
  .plan-time {
    font-size: 0.75rem !important;
    color: #666;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    order: 3; 
    width: 100%;
  }

  
  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px !important;
  }

  .task-title {
    order: 1;
    width: 100%;
    margin-right: 0 !important;
  }

  .repeat-info {
    order: 2;
    margin-left: 0 !important;
    margin-top: 2px;
  }

  
  .plan-time::before {
    content: "⏰ ";
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  
  .plan-time {
    font-size: 0.7rem !important;
  }

  
  .repeat-info {
    display: none;
  }

}
@media (max-width: 768px) {
  
  .focus-details {
    grid-template-columns: 1fr 1fr !important; 
    gap: 12px !important;
  }

  
  .focus-detail-item {
    min-width: 0 !important; 
    min-height: 60px; 
    padding: 10px !important;
    word-break: break-word; 
  }

  
  .focus-detail-item:nth-child(1),
  .focus-detail-item:nth-child(2) {
    flex: 1;
    min-width: 45%; 
  }

  
  .focus-detail-item:nth-child(3),
  .focus-detail-item:nth-child(4) {
    flex: 1;
    min-width: 45%;
  }

  
  .focus-description-section {
    grid-column: 1 / span 2 !important; 
    margin-top: 10px !important;
  }

  .focus-description-content {
    max-height: 100px !important;
    padding: 10px !important;
    font-size: 0.9rem;
  }

  
  .focus-task-content {
    padding: 60px 15px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 -2px !important;
    border-radius: 0 !important;
  }

  
  .focus-timer-display {
    font-size: 2.8rem !important;
    margin: 20px 0 !important;
  }

  
  .focus-controls {
    gap: 8px !important;
    flex-wrap: wrap;
    justify-content: center;
  }

  .focus-btn {
    padding: 10px 15px !important;
    font-size: 0.9rem !important;
    min-width: 80px;
  }

  
  .focus-detail-item h4 {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }

  .focus-detail-item p {
    font-size: 0.85rem;
    line-height: 1.3;
  }
}

@media (max-width: 480px) {
  
  .focus-task-content {
    padding: 60px 5px 20px !important;
  }

  .focus-task-title {
    font-size: 1.4rem !important;
    margin-bottom: 15px !important;
  }

  .focus-timer-display {
    font-size: 2.2rem !important;
  }

  .focus-controls {
    gap: 5px !important;
  }

  .focus-btn {
    padding: 8px 12px !important;
    font-size: 0.8rem !important;
    min-width: 70px;
  }

  
  .focus-details {
    gap: 8px !important;
  }

  .focus-detail-item {
    padding: 8px !important;
    min-height: 55px;
  }

  .focus-detail-item h4 {
    font-size: 0.85rem;
  }

  .focus-detail-item p {
    font-size: 0.8rem;
  }

  
  .focus-task-title .repeat-info {
    display: none;
  }
}


@media (max-width: 360px) {
  .focus-details {
    grid-template-columns: 1fr !important; 
  }

  .focus-detail-item:nth-child(1),
  .focus-detail-item:nth-child(2),
  .focus-detail-item:nth-child(3),
  .focus-detail-item:nth-child(4) {
    grid-column: 1 !important;
    min-width: 100% !important;
  }

  .focus-description-section {
    grid-column: 1 !important;
  }
}


@media (max-width: 768px) {
  header h1 {
    font-size: 2.2rem !important;
  }

  .app-slogan {
    font-size: 1.1rem !important; 
    margin: 0 0 0 10px !important;
  }

  header #subTitle {
    font-size: 0.8rem !important;
    margin: 2px 0 0 0 !important;
  }

  .title-container {
    flex-direction: row;
  }
}

@media (max-width: 600px) {
  header h1 {
    font-size: 2rem !important;
  }

  .app-slogan {
    font-size: 1rem !important; 
    margin: 0 0 0 8px !important;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.8rem !important;
  }

  .app-slogan {
    font-size: 0.9rem !important; 
    margin: 0 0 0 8px !important;
  }

  header #subTitle {
    font-size: 0.75rem !important;
    margin: 2px 0 0 0 !important;
  }

  .title-container {
    flex-direction: row;
    align-items: center !important;
    font-size: clamp(1rem, 3.5vw, 2rem);
  }
}

@media (max-width: 360px) {
  header h1 {
    font-size: 1.6rem !important;
  }

  .app-slogan {
    font-size: 0.8rem !important; 
  }

  header #subTitle {
    font-size: 0.7rem !important;
    margin: 1px 0 0 0 !important;
  }
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #3b78ef;
}

input:checked + .slider:before {
    transform: translateX(26px);
}
.week-day-btn{
  width: 32px; height: 32px; border: 1px solid #3b78ef;
  background: #fff; color: #3b78ef; border-radius: 4px;
  cursor: pointer; font-size: 14px; line-height: 1;
}
.week-day-btn.active{
  background: #3b78ef; color: #fff;
}

.score-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 160px;
    display: flex;
}

.score-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
}


.score-category-bar {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    writing-mode: vertical-lr;
    text-orientation: mixed;
    letter-spacing: 2px;
}


.score-card-content {
    flex: 1;
    display: flex;
    height: 100%;
}


.score-data-display-area {
    width: 70%;
    padding: 15px;
    display: flex;
    flex-direction: column;
}


.score-header {
    margin-bottom: 10px;
}

.score-main-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-main-title i {
    color: #3b78ef;
}

.score-subtitle {
    display: flex;
    gap: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}


.score-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.score-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.score-info-label {
    font-size: 0.8rem;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    gap: 6px;
}

.score-info-value {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.score-info-value.target {
    color: #3498db;
}

.score-info-value.average {
    color: #9b59b6;
}

.score-info-value.max {
    color: #e74c3c;
}

.score-info-value.ranking {
    color: #27ae60;
}


.score-action-section {
    width: 30%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    border-left: 1px solid #f0f4f8;
    justify-content: center;
    align-items: center;
}

.score-circle-container {
    position: relative;
    width: 80px;
    height: 80px;
}

.score-circle-svg {
    width: 100%;
    height: 100%;
    transform: rotate(0deg);
}

.score-circle-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
}

.score-actual {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2c3e50;
    display: block;
    line-height: 1.2;
}

.score-total {
    font-size: 0.9rem;
    color: var(--text-light);
    display: block;
    line-height: 1.2;
}

.score-performance {
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    padding: 4px 8px;
    border-radius: 12px;
    background: #f8f9fa;
}

.score-performance.excellent {
    color: #4CAF50;
    background: #e8f5e8;
}

.score-performance.good {
    color: #2196F3;
    background: #e3f2fd;
}

.score-performance.average {
    color: #FF9800;
    background: #fff3e0;
}

.score-performance.poor {
    color: #F44336;
    background: #ffebee;
}


@media (max-width: 768px) {
    .score-card {
        height: auto;
        flex-direction: column;
    }

    .score-category-bar {
        width: 100%;
        height: 40px;
        writing-mode: horizontal-tb;
        text-orientation: mixed;
    }

    .score-card-content {
        flex-direction: column;
    }

    .score-data-display-area {
        width: 100%;
        padding: 12px;
    }

    .score-action-section {
        width: 100%;
        padding: 12px;
        border-left: none;
        border-top: 1px solid #f0f4f8;
    }

    .score-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .score-main-title {
        font-size: 1.2rem;
    }
}

.ranking-item {
    font-size: 0.85rem;
    margin-bottom: 4px;
    line-height: 1.3;
}

.ranking-item:last-child {
    margin-bottom: 0;
}

.preview-disabled {
    background-color: #f7f7f7 !important; 
    border: 1px solid #ddd !important;    
    pointer-events: none !important;      
    color: #555 !important;               
    opacity: 0.9;                        
}

.stats-page {
    display: none; 
    background: var(--light-bg);
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 8px 16px var(--shadow);
    margin-top: 20px;

    
    position: relative; 
    z-index: 1000;       
    

}

.score-header {
    
    
    
    
    
    margin-bottom: 10px; 
}


.score-main-title {
    
    
    
    
    
    
    
    
    display: flex; 
    align-items: center; 
    gap: 8px; 
    margin-bottom: 5px; 
}

.score-main-title i {
    
    
}


.exam-name-text {
    font-size: inherit; 
    font-weight: inherit; 
    color: inherit; 
    flex: 1; 
    
    white-space: nowrap; 
}


.score-grade-semester-inline {
    display: flex;
    gap: 6px; 
     
    align-self: center; 
}


.grade-label {
    background-color: #e0e7ff; 
    color: #4f46e5; 
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem; 
    font-weight: 500;
    white-space: nowrap; 
}


.semester-label {
    background-color: #f0fdf4; 
    color: #16a34a; 
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem; 
    font-weight: 500;
    white-space: nowrap; 
}


.score-subtitle {
    
    
    
    
    
    display: flex;
    gap: 15px;
    color: var(--text-light);
    font-size: 0.85rem;
     
}


.score-data-display-area {
    
    
    
    
    
    width: 100%; 
    padding: 15px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box; 
}

.score-filters {
    background-color: var(--card-bg, #f8f9fa) !important; 
    border-radius: 8px !important; 
    padding: 10px !important; 
    
}


.score-filters label {
    font-size: 0.9rem; 
    color: var(--text-light, #6c757d); 
    margin: 0; 
    white-space: nowrap; 
}


.score-filters select {
    padding: 6px 8px !important; 
    border: 1px solid var(--border-color, #ced4da) !important; 
    border-radius: 4px !important; 
    font-size: 0.9rem; 
    background-color: var(--input-bg, #fff); 
    color: var(--input-text, #212529); 
    min-width: 0; 
    flex: 1; 
    
}


#resetScoreFilters {
    padding: 6px 12px !important; 
    margin-left: 5px !important; 
    background-color: var(--secondary, #6c757d) !important; 
    color: white !important; 
    border: none !important; 
    border-radius: 4px !important; 
    cursor: pointer !important; 
    font-size: 0.85rem; 
    transition: background-color 0.2s; 
}

#resetScoreFilters:hover {
    background-color: #5a6268 !important; 
}

@media (max-width: 768px) {
  
  .score-filters {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  
  .score-filters > div {
    display: flex !important;
    flex: 1 1 48% !important;          
    flex-direction: column !important;
    gap: 6px !important;
  }

  
  .score-filters {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    row-gap: 12px;
    column-gap: 4%;
  }
  
  #resetScoreFilters {
    grid-column: 1 / -1;               
    justify-self: end;
    width: 80px;
    font-size: 0.9rem;
    padding: 6px 0;
    margin: 0 !important;
  }

  
  .score-filters label   { font-size: 0.8rem; }
  .score-filters select,
  .score-filters input[type="date"] {
    width: 100% !important;
    font-size: 0.9rem;
    padding: 6px 8px;
  }
}

@media (max-width: 768px) {
  
  .score-analysis-filters {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  
  .score-analysis-filters > div {
    display: flex !important;
    flex: 1 1 48% !important;   
    flex-direction: column !important;
    gap: 6px !important;
  }

  
  .score-analysis-filters {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    row-gap: 12px;
    column-gap: 4%;
  }

  
  .score-analysis-filters::after {
    content: "";
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
  }
  #applyAnalysisDateFilter,
  #resetAnalysisDateFilter {
    width: 80px;
    font-size: 0.9rem;
    padding: 6px 0;
    margin: 0 !important;
  }

  
  .score-analysis-filters label {
    font-size: 0.8rem;
  }
  .score-analysis-filters input[type="date"] {
    width: 100% !important;
    font-size: 0.9rem;
    padding: 6px 8px;
  }
}

    
    .points-exchange-content {
        padding: 0px;
        width: 100%; 
        margin: 0; 
        box-sizing: border-box; 
    }

    .tabs {
        display: flex;
        margin-bottom: 20px;
    }

    .tab-btn {
        padding: 10px 20px;
        background: #f0f0f0;
        border: none;
        cursor: pointer;
        border-radius: 5px 5px 0 0;
        margin-right: 5px;
    }

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

    .tab-content {
        display: none;
    }

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

    .points-records-table {
        width: 100%;
        border-collapse: collapse;
    }

    .points-records-table th,
    .points-records-table td {
        border: 1px solid #ddd;
        padding: 8px;
        text-align: left;
    }

    .points-records-table th {
        background-color: #f2f2f2;
    }

    .rewards-header {
        margin-bottom: 20px;
    }

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

    .reward-item {
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 15px;
        background: white;
        text-align: center;
    }

    .reward-item .icon {
        font-size: 2em;
        margin-bottom: 10px;
    }

    .reward-item h4 {
        margin: 10px 0 5px 0;
    }

    .reward-item p {
        color: #666;
        font-size: 0.9em;
        margin: 5px 0;
    }

    .reward-item .cost {
        font-weight: bold;
        color: var(--primary);
    }
    

.reward-item {
    position: relative; 
}

.exchange-count-badge {
    position: absolute;
    top: -8px; 
    right: -8px; 
    background-color: #3498db; 
    color: white; 
    border-radius: 50%; 
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 2; 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); 
    border: 1px solid white; 
    pointer-events: none; 
}


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


.reward-item {
    background: linear-gradient(135deg, #f9f7fe 0%, #e6f4ff 100%); 
    border: 2px solid #d0e7ff; 
    border-radius: 16px; 
    padding: 15px; 
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1); 
    transition: all 0.3s ease; 
    cursor: pointer; 
    display: flex;
    flex-direction: column; 
    height: 100%; 
    position: relative; 
    overflow: hidden; 
}


.reward-item:hover {
    transform: translateY(-5px) scale(1.02); 
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); 
    border-color: #a3cfff; 
}


.icon {
    position: relative; 
    text-align: center; 
    margin-bottom: 10px; 
}

.icon i {
    font-size: 3rem; 
    color: #3b78ef; 
    transition: transform 0.2s ease; 
}

.reward-item:hover .icon i {
    transform: scale(1.1); 
}


.exchange-count-badge {
    position: absolute;
    top: -6px; 
    right: -6px; 
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%); 
    color: white; 
    border-radius: 50%; 
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 3; 
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), 0 0 0 2px white; 
    pointer-events: none; 
    animation: pulse 2s infinite; 
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}


.reward-item h4 {
    font-size: 1.2rem; 
    font-weight: bold;
    color: #2c3e50; 
    margin: 5px 0; 
    text-align: center; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
    overflow: hidden; 
}


.reward-item p {
    font-size: 0.9rem; 
    color: #555; 
    margin: 5px 0; 
    text-align: center; 
    flex-grow: 1; 
    display: flex;
    justify-content: center; 
    align-items: center; 
    line-height: 1.4; 
}


.reward-item .cost {
    font-size: 1rem; 
    font-weight: bold;
    color: #e74c3c; 
    text-align: center; 
    margin: 10px 0 5px 0; 
}


.reward-item .btn {
    margin-top: auto; 
    padding: 8px 12px; 
    font-size: 1rem; 
    font-weight: bold; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    width: 100%; 
    box-sizing: border-box; 
}


.reward-item .btn.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    color: white;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.reward-item .btn.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%); 
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.6);
    transform: translateY(-2px); 
}


.reward-item .btn.btn-secondary {
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%); 
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}


.reward-item .btn:disabled {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%); 
    color: white;
    cursor: not-allowed;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    opacity: 0.8; 
}


.reward-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px; 
    background: linear-gradient(90deg, #ff9a9e, #fad0c4, #a1c4fd, #c2e9fb); 
    border-radius: 16px 16px 0 0; 
}



@media (max-width: 768px) {
    .rewards-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
        gap: 15px; 
        padding: 15px; 
    }

    .reward-item {
        padding: 12px; 
    }

    .icon i {
        font-size: 2.5rem; 
    }

    .reward-item h4 {
        font-size: 1.1rem; 
    }

    .reward-item p {
        font-size: 0.85rem; 
    }

    .reward-item .cost {
        font-size: 0.95rem; 
    }

    .reward-item .btn {
        padding: 6px 10px; 
        font-size: 0.95rem; 
    }
}

@media (max-width: 480px) {
    .rewards-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
        gap: 12px; 
        padding: 10px; 
    }

    .icon i {
        font-size: 2rem; 
    }

    .reward-item h4 {
        font-size: 1rem; 
    }

    .reward-item .cost {
        font-size: 0.9rem; 
    }
}

#cardVisibilityModal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); 
}

#cardVisibilityModal .modal-content {
    background-color: var(--card-bg, white); 
    margin: 15% auto; 
    padding: 20px;
    border: 1px solid var(--border, #ccc);
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#cardVisibilityModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border, #ccc);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

#cardVisibilityModal .modal-header h2 {
    margin: 0;
    color: var(--text, #333);
}

#cardVisibilityModal .close {
    color: var(--text-light, #aaa);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

#cardVisibilityModal .close:hover,
#cardVisibilityModal .close:focus {
    color: var(--text, black);
}

#cardVisibilityModal .modal-body {
    max-height: 60vh; 
    overflow-y: auto;
    padding-right: 5px; 
}

#cardVisibilityModal .visibility-options {
    display: flex;
    flex-direction: column;
    gap: 10px; 
}

#cardVisibilityModal .visibility-option {
    display: flex;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--border, #ddd);
    border-radius: 4px;
    background-color: var(--light-bg, #f9f9f9); 
}

#cardVisibilityModal .visibility-option label {
    margin-left: 10px; 
    cursor: pointer;
    flex-grow: 1; 
    color: var(--text, #333);
}

#cardVisibilityModal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    border-top: 1px solid var(--border, #ccc);
    padding-top: 15px;
}

#cardVisibilityModal .btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

#cardVisibilityModal .btn-primary {
    background-color: var(--primary, #007bff);
    color: white;
}

#cardVisibilityModal .btn-secondary {
    background-color: var(--secondary, #6c757d);
    color: white;
}

#cardVisibilityModal .btn:hover {
    opacity: 0.9;
}






.star-rating {
    display: inline-flex;
    gap: 5px;
}

.star-rating .star {
    cursor: pointer;
    font-size: 20px;
    color: #ddd; 
    transition: color 0.2s ease;
}

.star-rating .star:hover, 
.star-rating .star.selected {
    color: #FFD700; 
}

.star-rating .star:hover ~ .star {
    color: #ddd; 
}


.rating-item {
    display: flex;
    align-items: center;
}




.points-exchange-content .tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0; 
    
    
     
}


.points-exchange-content .tab-btn {
    
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
    color: #4a6572; 
    border: none; 
    border-bottom: 3px solid transparent; 
    cursor: pointer;
    padding: 12px 24px; 
    margin: 0; 
    font-size: 1rem; 
    font-weight: 500; 
    text-align: center; 
    transition: all 0.3s ease; 
    border-radius: 8px 8px 0 0; 
    position: relative; 
    z-index: 1; 
    
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}


.points-exchange-content .tab-btn:hover:not(.active) {
    background: linear-gradient(135deg, #e2eaf2 0%, #c5d5e4 100%); 
    color: #2b3e4d; 
    transform: translateY(-1px); 
}


.points-exchange-content .tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    color: white; 
    border-bottom-color: #764ba2; 
    
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}


@media (max-width: 768px) {
    .points-exchange-content .tab-btn {
        padding: 10px 18px; 
        font-size: 0.95rem; 
        border-radius: 6px 6px 0 0; 
    }
}

@media (max-width: 768px) {
    
    .back-btn,
    .add-task-main-btn,
    .btn.btn-danger,
    .data-btn {
        
        padding: 8px 12px;
        height: auto;
        min-height: 36px;

        
        font-size: 0.85rem;

        
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;

        
        border: none;
        border-radius: 8px;

        
        transition: all 0.3s ease;

        
        width: auto;
        min-width: fit-content;
        max-width: none;

        
        white-space: nowrap;

        
        margin: 0 2px;
    }

    
    .badge-controls,
    .score-controls,
    .rewards-header,
    .data-buttons {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        align-items: center;
        justify-content: flex-start;

        
        overflow-x: hidden;

        
        padding: 0 5px;
        width: 100%;
    }

    
    .badge-controls {
        margin-bottom: 15px;
    }

    .score-controls {
        margin-bottom: 15px;
    }

    .rewards-header {
        margin-bottom: 15px;
    }

    .data-buttons {
        justify-content: center;
        margin: 15px 0;
    }

    
    .badge-controls > button,
    .score-controls > button,
    .rewards-header > button,
    .data-buttons > button {
        flex: 1 1 auto;
        min-width: 80px;
        max-width: calc(33.333% - 5px);
    }

    
    .stats-header .back-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
        min-width: auto;
        max-width: auto;
        flex: none;
    }

    
    #addBatchBadgeBtn,
    #addBatchTaskBtn,
    #addScoreBtn,
    #scoreAnalysisBtn {
        background-color: inherit;
        background: var(--primary);
    }

    
    #addBatchBadgeBtn,
    #addBatchTaskBtn,
    #scoreAnalysisBtn {
        background: #5bc0de !important;
    }

    
    .btn.btn-danger {
        background: #e74c3c !important;
    }
}


.points-records-table {
    width: 100%; 
    table-layout: fixed; 
    border-collapse: collapse; 
    word-wrap: break-word; 
    overflow-wrap: break-word;
}


#recordsTab {
    overflow-x: hidden;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}


.points-exchange-content {
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}


.points-records-table th:nth-child(1),
.points-records-table td:nth-child(1) {
    width: 15%; 
    text-align: center;
}
.points-records-table th:nth-child(2),
.points-records-table td:nth-child(2) {
    width: 20%; 
    text-align: center;
}
.points-records-table th:nth-child(3),
.points-records-table td:nth-child(3) {
    width: 20%; 
    text-align: left;
    
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}
.points-records-table th:nth-child(4),
.points-records-table td:nth-child(4) {
    width: 15%; 
    text-align: center;
    white-space: normal;
}
.points-records-table th:nth-child(5),
.points-records-table td:nth-child(5) {
    width: 15%; 
    text-align: center;
    font-weight: bold;
    white-space: normal;
}
.points-records-table th:nth-child(6),
.points-records-table td:nth-child(6) {
    width: 15%; 
    text-align: center;
    font-weight: bold;
    white-space: normal;
}


.points-records-table th,
.points-records-table td {
    font-size: 0.9rem; 
    padding: 8px 10px;    
    border: 1px solid #e0e0e0; 
    vertical-align: top; 
    white-space: normal; 
    word-break: break-word; 
}


.points-records-table th {
    background-color: #f8f9fa;
    text-align: center;
    font-weight: bold;
    padding: 10px;
    white-space: normal; 
    word-break: break-word; 
}


@media (max-width: 768px) {
    .points-records-table th,
    .points-records-table td {
        font-size: 0.8rem; 
        padding: 6px 8px; 
    }

    
    .points-records-table th:nth-child(1),
    .points-records-table td:nth-child(1) {
        width: 15%; 
    }
    .points-records-table th:nth-child(2),
    .points-records-table td:nth-child(2) {
        width: 20%; 
    }
    .points-records-table th:nth-child(3),
    .points-records-table td:nth-child(3) {
        width: 20%; 
    }
    .points-records-table th:nth-child(4),
    .points-records-table td:nth-child(4) {
        width: 15%; 
    }
    .points-records-table th:nth-child(5),
    .points-records-table td:nth-child(5) {
        width: 15%; 
    }
    .points-records-table th:nth-child(6),
    .points-records-table td:nth-child(6) {
        width: 15%; 
    }
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px; 
}

.pagination-btn {
    padding: 8px 12px;
    margin: 0 2px; 
    border: 1px solid #ddd; 
    background-color: #f8f9fa; 
    color: #007bff; 
    cursor: pointer;
    border-radius: 4px; 
    font-size: 0.9rem; 
    transition: background-color 0.2s, color 0.2s; 
}

.pagination-btn:hover:not(:disabled) {
    background-color: #e9ecef; 
    color: #0056b3; 
}

.pagination-btn:disabled {
    color: #6c757d; 
    cursor: not-allowed; 
    opacity: 0.6; 
}

.pagination-btn.page-number.active {
    background-color: #007bff; 
    color: white; 
    border-color: #007bff; 
}

.pagination-btn.page-number.active:hover {
    background-color: #0056b3; 
}

.points-change-badge {
    font-size: 0.8em; 
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 4px; 
    margin-left: 5px; 
    vertical-align: middle; 
    display: inline-block; 
    min-width: 20px; 
    text-align: center; 
    box-sizing: border-box; 
    white-space: nowrap; 
}

.points-gained {
    color: #27ae60; 
    background-color: #d5f5e3; 
    border: 1px solid #a8e6a1; 
}

.points-lost {
    color: #e74c3c; 
    background-color: #fadbd8; 
    border: 1px solid #e2a7a3; 
}

@media (max-width: 768px) {
    .plan-tabs-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 2px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .plan-tabs-row::-webkit-scrollbar {
        display: none;
    }

    .plan-tab-btn {
        flex: 0 0 auto;
        max-width: none;
    }

    .plan-tab-btn.primary-label {
        font-size: 1.2rem;
        padding: 10px 16px 11px;
    }

    .plan-tab-btn.secondary-label {
        font-size: 1rem;
        padding: 10px 14px 11px;
    }

    .tasks-header-actions {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 10px;
    }

    .tasks-header-actions .add-task-main-btn {
        min-width: 0;
        padding: 10px 14px;
        font-size: 0.9rem;
        justify-content: center;
    }

    .date-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
        gap: 8px;
    }

    .date-info {
        display: flex;
        flex-direction: row !important;
        align-items: center;
        gap: 0;
        min-width: 0;
    }

    .current-date-display {
        display: block !important;
        min-width: 0;
        max-width: 100%;
        font-size: 1rem;
        line-height: 1.35;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .week-controls {
        display: none;
    }

    .overdue-toggle {
        margin-right: 0 !important;
        white-space: nowrap;
    }

    .overdue-toggle label {
        margin-left: 4px !important;
        font-size: 0.82rem !important;
    }

    .date-controls {
        gap: 6px;
        flex: 0 0 auto;
    }

    .nav-btn,
    .calendar-toggle {
        width: 30px;
        height: 30px;
    }

    .today-btn {
        white-space: nowrap;
        font-size: 0.82rem;
        padding: 4px 8px;
    }

    .other-reserved-page {
        padding: 22px 18px;
    }
}

@media (max-width: 480px) {
    .plan-tabs-row {
        gap: 8px;
    }

    .plan-tab-btn.primary-label {
        font-size: 1.05rem;
        padding: 9px 14px 10px;
    }

    .plan-tab-btn.secondary-label {
        font-size: 0.92rem;
        padding: 9px 12px 10px;
    }

    .current-date-display {
        font-size: 0.9rem;
    }

    .date-row {
        gap: 6px;
    }

    .nav-btn,
    .calendar-toggle {
        width: 28px;
        height: 28px;
    }

    .today-btn {
        font-size: 0.78rem;
        padding: 4px 7px;
    }

    .tasks-header-actions {
        display: flex;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
    }

    .tasks-header-actions .add-task-main-btn {
        width: auto;
        min-width: auto;
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 10px !important;
        font-size: 0.82rem !important;
        gap: 5px;
    }
}

@media (max-width: 360px) {
    .tasks-header-actions {
        gap: 6px;
    }

    .tasks-header-actions .add-task-main-btn {
        padding: 7px 8px !important;
        font-size: 0.76rem !important;
        gap: 4px;
    }
}
