body {
    background: linear-gradient(135deg,
            #0f172a 0%,
            #1e293b 50%,
            #0f172a 100%);
    color: #e2e8f0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

html {
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.header {
    background: linear-gradient(90deg, #1e293b 0%, #334155 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding: 1rem 0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 50;
    flex-shrink: 0;
}

.navbar-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-back:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateX(-2px);
}

.btn-back svg {
    stroke: currentColor;
    flex-shrink: 0;
}

.navbar-title {
    margin: 0;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    white-space: nowrap;
}

.content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    padding: 1.5rem;
    height: calc(100vh - 80px);
}

.grid-container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    height: 95%;
    display: flex;
    flex-direction: column;
}

.grid-item {
    background: linear-gradient(135deg,
            rgba(30, 41, 59, 0.8) 0%,
            rgba(51, 65, 85, 0.8) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding-bottom: 1.5rem;
}

.grid-item:hover {
    box-shadow: 0 25px 50px rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.3);
}

.header-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(96, 165, 250, 0.3);
    flex-shrink: 0;
}

.header-section h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.75rem;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.subtitle {
    margin: 0;
    color: #94a3b8;
    font-size: 0.9rem;
}

.habits-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding-right: 0.5rem;
}

.habits-list::-webkit-scrollbar {
    width: 6px;
}

.habits-list::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.1);
    border-radius: 10px;
}

.habits-list::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.habits-list::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.5);
}

.habit-card {
    background: linear-gradient(135deg,
            rgba(71, 85, 105, 0.4) 0%,
            rgba(51, 65, 85, 0.4) 100%);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.habit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #60a5fa 0%, #a78bfa 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.habit-card:hover {
    background: linear-gradient(135deg,
            rgba(71, 85, 105, 0.6) 0%,
            rgba(51, 65, 85, 0.6) 100%);
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 8px 16px rgba(96, 165, 250, 0.15);
    transform: translateY(-2px);
}

.habit-card:hover::before {
    transform: scaleX(1);
}

.habit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

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

.habit-name {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
    color: #f1f5f9;
    font-weight: 700;
}

.habit-description {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.habit-date {
    padding: 0.5rem 1rem;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.3);
    color: #60a5fa;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.daily-average {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg,
            rgba(34, 197, 94, 0.1) 0%,
            rgba(59, 130, 246, 0.1) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
}

.daily-label {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 600;
}

.daily-value {
    font-size: 1.1rem;
    color: #22c55e;
    font-weight: 700;
}

.progression-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    background: linear-gradient(135deg,
            rgba(99, 102, 241, 0.1) 0%,
            rgba(168, 85, 247, 0.1) 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: linear-gradient(135deg,
            rgba(99, 102, 241, 0.15) 0%,
            rgba(168, 85, 247, 0.15) 100%);
    border-color: rgba(168, 85, 247, 0.5);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    color: #a78bfa;
    font-weight: 700;
}

.time-records {
    margin: 1.25rem 0;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.time-records-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.time-records-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.time-record-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    font-size: 0.85rem;
    position: relative;
    transition: all 0.2s ease;
}

.time-record-item:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
}

.record-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    border-radius: 50%;
    font-weight: 700;
    color: white;
    font-size: 0.9rem;
}

.record-label {
    color: #94a3b8;
    font-size: 0.8rem;
}

.record-date {
    color: #cbd5e1;
    font-size: 0.75rem;
    margin-left: auto;
}

.record-delete-btn {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    margin-left: auto;
}

.time-record-item:hover .record-delete-btn {
    display: flex;
}

.record-delete-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
    color: #fca5a5;
}

.habit-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-primary {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: white;
    border: 1px solid rgba(59, 130, 246, 0.5);
}

.btn-primary:hover {
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.btn-secondary:hover {
    background: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

.btn-secondary:active {
    background: rgba(96, 165, 250, 0.1);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:active {
    background: rgba(239, 68, 68, 0.1);
}

.btn-success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.btn-success:active {
    background: rgba(34, 197, 94, 0.1);
}

.btn-chart {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.btn-chart:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.chart-button-container {
    margin-top: 12px;
}

.btn svg {
    stroke: currentColor;
}

.btn-add-habit {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    padding: 0;
    margin-top: 0;
    flex-shrink: 0;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.btn-add-habit:hover {
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.4);
    transform: scale(1.1);
}

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

.btn-add-habit svg {
    width: 24px;
    height: 24px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: #94a3b8;
    flex: 1;
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.5;
    stroke: #94a3b8;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: #cbd5e1;
    font-weight: 700;
}

.empty-state p {
    margin: 0;
    color: #64748b;
}

@media (max-width: 768px) {
    .header {
        padding: 0.75rem 0;
    }

    .navbar-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0 1rem;
    }

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

    .content {
        padding: 1rem;
        height: calc(100vh - 70px);
    }

    .grid-item {
        padding: 1rem;
    }

    .header-section {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .header-section h1 {
        font-size: 1.4rem;
        margin: 0 0 0.15rem 0;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .time-records-list {
        grid-template-columns: 1fr;
    }

    .habit-actions {
        flex-direction: column;
    }

    .btn {
        flex: 1 1 auto;
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}