/* 메인 페이지 전용 스타일 */

/* 앱 컨테이너 */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 사이드바 */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
    z-index: 100;
}

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

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

.logo-icon {
    font-size: 1.75rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.version {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    background: var(--primary-light);
    color: white;
    border-radius: 4px;
    margin-left: auto;
}

/* 사이드바 네비게이션 */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--gray-600);
    transition: var(--transition-fast);
    position: relative;
}

.nav-item:hover {
    background: var(--gray-50);
    color: var(--primary);
}

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

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: white;
}

.nav-icon {
    font-size: 1.25rem;
}

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

.nav-badge {
    margin-left: auto;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    background: var(--danger);
    color: white;
    border-radius: 4px;
}

/* 사이드바 푸터 */
.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--gray-200);
}

.storage-info {
    margin-bottom: 1rem;
}

.storage-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.storage-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.storage-used {
    height: 100%;
    width: 35%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    transition: width 0.3s ease;
}

.storage-text {
    font-size: 0.75rem;
    color: var(--gray-600);
}

.btn-sync {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

/* 메인 콘텐츠 영역 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
}

/* 헤더 */
.main-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 2rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-700);
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--gray-100);
}

.header-title {
    flex: 1;
}

.header-title h1 {
    font-size: 1.5rem;
    margin-bottom: 0.125rem;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-btn {
    position: relative;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.header-btn:hover {
    background: var(--gray-100);
}

.notification-icon {
    font-size: 1.25rem;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.25rem;
    border-radius: 9999px;
    min-width: 16px;
    text-align: center;
}

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

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-200);
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

/* 콘텐츠 영역 */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* 빠른 통계 */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 1rem;
    transition: var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.customers { background: rgba(79, 70, 229, 0.1); }
.stat-icon.quotes { background: rgba(6, 182, 212, 0.1); }
.stat-icon.revenue { background: rgba(16, 185, 129, 0.1); }
.stat-icon.tasks { background: rgba(245, 158, 11, 0.1); }

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

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

.stat-change {
    font-size: 0.75rem;
    font-weight: 500;
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }
.stat-change.neutral { color: var(--gray-500); }

/* 빠른 액션 */
.quick-actions {
    margin-bottom: 2rem;
}

.quick-actions h2 {
    margin-bottom: 1rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.action-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

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

.action-label {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    color: var(--gray-700);
}

/* 홈 그리드 */
.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* 최근 활동 */
.recent-activities,
.upcoming-tasks {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.recent-activities h2,
.upcoming-tasks h2 {
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

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

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.activity-icon.new { background: rgba(79, 70, 229, 0.1); }
.activity-icon.quote { background: rgba(6, 182, 212, 0.1); }
.activity-icon.payment { background: rgba(16, 185, 129, 0.1); }

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.activity-desc {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

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

/* 오늘의 일정 */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
}

.task-item:hover {
    background: var(--gray-100);
}

.task-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.task-content {
    flex: 1;
    cursor: pointer;
}

.task-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-900);
}

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

.task-checkbox:checked ~ .task-content .task-title {
    text-decoration: line-through;
    color: var(--gray-500);
}

.btn-add-task {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

/* 알림 드롭다운 */
.notification-dropdown {
    position: fixed;
    top: calc(var(--header-height) + 10px);
    right: 20px;
    width: 360px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-fast);
    z-index: 200;
}

.notification-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

.notification-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.notification-clear {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.875rem;
    cursor: pointer;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    position: relative;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition-fast);
}

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

.notification-item.unread {
    background: rgba(79, 70, 229, 0.05);
}

.notification-dot {
    position: absolute;
    left: 0.75rem;
    top: 1.5rem;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

.notification-item.unread .notification-content {
    padding-left: 1rem;
}

.notification-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.notification-desc {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

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

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .main-header {
        padding: 0 1rem;
    }

    .content-area {
        padding: 1.5rem 1rem;
    }

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

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

    .user-name {
        display: none;
    }
}

/* 체크박스 커스텀 스타일 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}