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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* サイドバー */
.sidebar {
    width: 250px !important;
    background-color: #1e293b;
    color: white;
    padding: 0;
    position: fixed !important;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #334155;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background-color: #3b82f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.logo span {
    font-size: 18px;
    font-weight: 600;
}

.nav-menu {
    padding: 20px 0;
    padding-bottom: 100px;
    /* ユーザー情報の分のスペースを確保 */
    overflow-y: auto;
    height: calc(100vh - 80px - 100px);
    /* ロゴとユーザー情報の高さを除く */
}

.nav-menu ul {
    list-style: none;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s;
    gap: 12px;
}

.nav-link:hover {
    background-color: #334155;
    color: white;
}

.nav-item.active .nav-link {
    background-color: #3b82f6;
    color: white;
}

.nav-link i {
    width: 20px;
    text-align: center;
}

/* サイドバーユーザー情報 */
.sidebar-user {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-top: 1px solid #334155;
    background-color: #1e293b;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-user-details {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-weight: 500;
    color: white;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-settings-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #94a3b8;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sidebar-settings-btn:hover {
    background-color: #334155;
    color: #cbd5e1;
}

/* メインコンテンツ */
.main-content {
    flex: 1;
    margin-left: 250px !important;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow: auto;
}

/* ダッシュボード */
.dashboard {
    padding: 32px;
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    margin-bottom: 24px;
}

.dashboard-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.subtitle {
    color: #64748b;
    font-size: 16px;
}

/* KPIカード */
.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kpi-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-text h3 {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.kpi-change {
    font-size: 12px;
    color: #64748b;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.kpi-icon.blue {
    background-color: #3b82f6;
}

/* ダッシュボードセクション */
.dashboard-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    flex: 1;
    min-height: 0;
}

.section {
    background: white;
    border-radius: 12px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.section h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
}

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

.view-all {
    color: #3b82f6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

/* アクティビティリスト */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 2px;
}

.activity-company {
    font-size: 14px;
    color: #64748b;
}

.activity-time {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
}

/* タスクリスト */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    overflow-y: auto;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.task-content {
    flex: 1;
}

.task-title {
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 2px;
}

/* レポートリンクスタイル */
.report-link {
    color: #3b82f6;
    text-decoration: none;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    font-weight: 600;
    margin-right: 8px;
    transition: color 0.2s;
}

.report-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* 承認済みレポートスタイル */
.task-item.approved {
    background-color: #f0f9ff;
    border-left: 3px solid #10b981;
}

.approved-mark {
    display: inline-flex;
    align-items: center;
}

.task-company {
    font-size: 14px;
    color: #64748b;
}

.task-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.task-date i {
    color: #94a3b8;
}

.task-priority {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    margin-left: 8px;
}

.task-priority.high {
    background-color: #fef2f2;
    color: #dc2626;
}

.task-priority.low {
    background-color: #f0f9ff;
    color: #0369a1;
}

/* フッター */
.footer {
    background-color: white;
    border-top: 1px solid #e2e8f0;
    padding: 16px 24px;
    margin-top: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 500;
    color: #1e293b;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: #64748b;
}

.settings-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #64748b;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.settings-btn:hover {
    background-color: #f1f5f9;
    color: #333;
}

/* レスポンシブデザイン */
@media (max-width: 1024px) {
    .dashboard-sections {
        grid-template-columns: 1fr;
    }

    .kpi-cards {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

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

    .kpi-cards {
        grid-template-columns: 1fr;
    }

    .search-bar {
        width: 200px;
    }

    .dashboard {
        padding: 16px;
    }

    .task-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}