:root {
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --card-bg: rgba(255, 255, 255, 0.8);
    --primary-color: #6366f1;
    --secondary-color: #64748b;
    --accent-color: #10b981;
    --danger-color: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.5);
    --header-bg: rgba(255, 255, 255, 0.9);
    --select-bg: #ffffff;
    --select-text: #1e293b;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.dark-theme {
    --bg-color: #0f172a;
    --text-color: #f1f5f9;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary-color: #818cf8;
    --secondary-color: #94a3b8;
    --accent-color: #34d399;
    --danger-color: #f87171;
    --glass-border: rgba(255, 255, 255, 0.1);
    --header-bg: rgba(15, 23, 42, 0.85);
    --select-bg: #1e293b;
    --select-text: #f1f5f9;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

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

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(-45deg, var(--bg-color), #e0e7ff, #dbeafe, var(--bg-color));
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease;
    overflow-x: hidden;
    padding-bottom: 80px;
}

.dark-theme {
    background: linear-gradient(-45deg, #0f172a, #1e1b4b, #1e293b, #0f172a);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    animation: fadeInScale 0.5s ease-out;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

.glass-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    padding: 12px 16px;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    animation: slideInRight 0.6s ease-out;
}

.header-content {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    animation: fadeInScale 0.6s ease-out;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.brand-text h1 {
    font-size: 1.1rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    margin: 0;
}

.tagline {
    font-size: 0.65rem;
    color: var(--secondary-color);
    font-weight: 600;
}

.user-badge {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.xp-bar-container {
    width: 70px;
    height: 6px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.xp-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #10b981, #34d399);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

#userLevel {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--secondary-color);
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    gap: 4px;
}

main {
    padding: 80px 12px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.stats-container {
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.stats-card {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-4px);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: fadeInScale 0.5s ease-out;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

.stat-label {
    font-size: 0.65rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.05);
    padding: 8px;
    border-radius: 16px;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.tab-btn {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.4s ease-out;
}

.habit-list {
    display: grid;
    gap: 12px;
}

.habit-card {
    display: flex;
    align-items: center;
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.5s ease-out;
    cursor: pointer;
}

.habit-card:hover {
    transform: translateX(8px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.2);
}

.habit-card:active {
    transform: scale(0.98);
}

.habit-info {
    flex: 1;
}

.habit-name {
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.habit-meta {
    font-size: 0.8rem;
    color: var(--secondary-color);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.streak-badge {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.2), rgba(245, 158, 11, 0.2));
    color: #f59e0b;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.75rem;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.habit-check {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.habit-check:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.habit-check.checked {
    background: linear-gradient(135deg, var(--accent-color), #10b981);
    border-color: var(--accent-color);
    animation: bounce 0.6s ease-out;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.5);
}

.habit-check svg {
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.habit-check.checked svg {
    opacity: 1;
    transform: scale(1);
}

.fab {
    position: fixed;
    bottom: 28px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-color), #6366f1, var(--accent-color));
    background-size: 200% 200%;
    color: white;
    border: none;
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInScale 0.8s ease-out 0.4s both, pulse 3s ease-in-out infinite 2s;
}

.fab:hover {
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.7);
}

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

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeInScale 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 24px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-color);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    transform: rotate(90deg);
    color: var(--primary-color);
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.form-group {
    margin-bottom: 16px;
    animation: fadeInUp 0.4s ease-out;
}

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

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.custom-select {
    background-color: var(--select-bg) !important;
    color: var(--select-text) !important;
    cursor: pointer;
}

.settings-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-group h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

.settings-card-inner {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.2s ease;
}

.setting-row:hover {
    background: rgba(99, 102, 241, 0.05);
}

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

.setting-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.btn {
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

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

.btn-secondary:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #ef4444);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-outline {
    border: 2px solid var(--glass-border);
    background: transparent;
    color: var(--text-color);
}

.btn-outline:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.1);
}

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

.detailed-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.progress-circle-container {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    animation: fadeInScale 0.6s ease-out;
}

.circular-chart {
    width: 100%;
    height: 100%;
}

.circle-bg {
    fill: none;
    stroke: rgba(0,0,0,0.1);
    stroke-width: 3.5;
}

.circle {
    fill: none;
    stroke: var(--accent-color);
    stroke-width: 3.5;
    stroke-linecap: round;
    transition: stroke-dasharray 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.5));
}

.percentage {
    fill: var(--text-color);
    font-size: 0.5rem;
    text-anchor: middle;
    font-weight: 800;
}

.stats-grid-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mini-stat {
    background: rgba(0,0,0,0.03);
    padding: 14px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease-out;
}

.mini-stat:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.mini-stat span {
    display: block;
    font-size: 1.3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mini-stat label {
    font-size: 0.65rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.achievement-item {
    padding: 14px 8px;
    text-align: center;
    border-radius: 12px;
    background: rgba(0,0,0,0.03);
    opacity: 0.3;
    filter: grayscale(1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInScale 0.5s ease-out;
}

.achievement-item:hover {
    transform: scale(1.05);
}

.achievement-item.unlocked {
    opacity: 1;
    filter: grayscale(0);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(16, 185, 129, 0.15));
    animation: fadeInScale 0.6s ease-out, pulse 2s ease-in-out infinite 1s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.achievement-icon {
    font-size: 1.5rem;
    animation: bounce 1s ease-in-out infinite;
}

.achievement-name {
    font-size: 0.65rem;
    font-weight: 800;
    margin-top: 4px;
}

.reward-content {
    text-align: center;
    animation: fadeInScale 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.reward-icon {
    font-size: 4rem;
    margin-bottom: 12px;
    animation: bounce 1s ease-in-out infinite;
}

.reward-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

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

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

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0,0,0,0.03);
    border-radius: 12px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.4s ease-out;
}

.category-item:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-sm);
}

.category-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.category-count {
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
}

.calendar-view {
    padding: 20px 0;
}

.calendar-container {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 20px;
    animation: fadeInScale 0.5s ease-out;
}

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

.calendar-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    transform: scale(1.1);
}

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

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(0,0,0,0.03);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-day:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.calendar-day.completed {
    background: var(--accent-color);
    color: white;
}

.notes-view {
    padding: 20px 0;
}

.notes-container {
    animation: fadeInUp 0.5s ease-out;
}

.notes-list {
    display: grid;
    gap: 12px;
}

.note-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    animation: fadeInUp 0.5s ease-out;
    transition: all 0.3s ease;
}

.note-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.note-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 8px;
}

.note-content {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 12px;
    line-height: 1.5;
}

.note-date {
    font-size: 0.75rem;
    color: var(--secondary-color);
}

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

.toggle-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: 0.4s;
    border-radius: 24px;
}

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

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

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

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3000;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

@media (max-width: 480px) {
    .brand-text h1 {
        font-size: 1rem;
    }

    .stats-card {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    .habit-card {
        padding: 12px;
    }

    .habit-name {
        font-size: 0.95rem;
    }

    .habit-meta {
        font-size: 0.75rem;
    }

    .modal-content {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 85vh;
    }

    .fab {
        width: 52px;
        height: 52px;
        bottom: 20px;
        right: 12px;
    }

    .tabs-container {
        gap: 6px;
        padding: 6px;
    }

    .tab-btn {
        font-size: 0.75rem;
        padding: 8px 10px;
    }
}

@media (max-width: 360px) {
    main {
        padding: 80px 8px 20px;
    }

    .stat-value {
        font-size: 1rem;
    }

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