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

body {
    font-family: 'Hiragino Sans', 'Meiryo', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

header {
    background-color: #2c3e50;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
}

header nav a {
    color: white;
    text-decoration: none;
}

header nav a + a {
    margin-left: 20px;
}

header nav a:hover {
    text-decoration: underline;
}

.global-menu {
    background-color: #34495e;
    border-top: 1px solid #455a7d;
}

.global-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.global-menu li {
}

.global-menu a {
    display: block;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s;
}

.global-menu a:hover {
    background-color: #2c3e50;
}

.main-container {
    display: flex;
    max-width: 1200px;
    margin: 20px auto;
    gap: 20px;
}

aside {
    width: 250px;
}

aside h3 {
    margin-bottom: 15px;
    font-size: 1.0rem;
    color: #2c3e50;
}

aside ul {
    list-style: none;
}

aside li {
    margin-bottom: 10px;
}

aside a {
    color: #3498db;
    text-decoration: none;
}

aside a:hover {
    text-decoration: underline;
}

main {
    flex: 1;
    background-color: white;
    padding: 30px;
}

h1, h2, h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-primary {
    background-color: #3498db;
}

.btn-success {
    background-color: #2ecc71;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-secondary {
    background-color: #95a5a6;
}

/* ダッシュボードスタイル */
.dashboard-container {
    display: flex;
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-container h3 {
    background-color: #f0f0f0;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.main-content-dashboard {
    flex: 1;
    min-width: 0;
    background-color: #fff;
    border-radius: 5px;
}

.dashboard-sidebar {
    width: 350px;
    flex-shrink: 0;
}

.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    background-color: #eee;
    padding: 2px;
    border-radius: 5px;
}

.tab-button {
    flex: 1;
    padding: 10px 15px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.tab-button:hover {
    background-color: #e0e0e0;
}

.tab-button.active {
    background-color: white;
    color: #2c3e50;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-content {
    display: none;
    border-radius: 5px;
}

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

/* フォームスタイル */
.task-form {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.attendance-info, .communication-log, .monthly-stats {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
}

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

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.submit-button {
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.submit-button:hover {
    background-color: #2980b9;
}

/* タスクテーブル */
.task-table {
    width: 100%;
    border-collapse: collapse;
}

.task-table th {
    background-color: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
}

.task-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.status.in-progress {
    background-color: #fff3cd;
    color: #856404;
}

.status.pending {
    background-color: #d1ecf1;
    color: #0c5460;
}

.action-button {
    padding: 4px 12px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.action-button:hover {
    background-color: #218838;
}

/* スタッフタスクグリッド */
.staff-task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.staff-task-card {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    transition: transform 0.2s;
}

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

.staff-task-card h4 {
    margin-bottom: 5px;
    color: #333;
}

.task-count {
    font-size: 24px;
    font-weight: bold;
    color: #3498db;
}

/* 月次統計 */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item {
    flex: 1;
}

.stat-item h4 {
    margin-bottom: 10px;
    color: #666;
    font-size: 12px;
    background-color: #6c757d;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.stat-change {
    font-size: 12px;
    margin-top: 5px;
}

.stat-change.positive {
    color: #28a745;
}

.stat-change.negative {
    color: #dc3545;
}

/* コミュニケーションログ */
#comm-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#comm-form select,
#comm-form input,
#comm-form textarea {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#comm-form button {
    align-self: flex-end;
}

/* スタッフリスト */
.staff-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.staff-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 5px;
    transition: background-color 0.2s;
    font-size: 13px;
}

.staff-item:hover {
    background-color: #e9ecef;
}

.staff-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.staff-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #808080;
    opacity: 0.5;
}

.staff-icon.completed {
    border-color: #eba37f;
    opacity: 1;
}

.staff-icon.working {
    border-color: #9bdfe6;
    opacity: 1;
}

.staff-icon-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #ddd;
    border: 5px solid #808080;
    opacity: 0.5;
}

.staff-icon-placeholder.completed {
    border-color: #eba37f;
    opacity: 1;
}

.staff-icon-placeholder.working {
    border-color: #9bdfe6;
    opacity: 1;
}

.staff-details {
    display: flex;
    flex-direction: column;
}

.staff-name {
    font-weight: 500;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
}

.extension {
    font-size: 11px;
    color: #666;
}

.leave-type {
    font-size: 11px;
    color: #666;
    background-color: #fff3cd;
    padding: 2px 6px;
    border-radius: 3px;
}

/* ログインフォーム */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 5px;
}

.remember-me input {
    width: auto;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* メインラッパー */
.main-wrapper {
    display: flex;
    min-height: calc(100vh - 200px);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.side-menu {
    width: 280px;
    background-color: #f8f9fa;
    padding: 25px;
    flex-shrink: 0;
}

.content-area {
    flex: 1;
    background-color: white;
    padding: 30px;
    overflow-x: hidden;
    min-width: 0; /* flexアイテムの収縮を許可 */
    width: calc(100% - 280px); /* サイドメニューの幅を引いた残り */
}


/* フッター */
footer {
    padding: 25px;
    text-align: center;
    color: #666;
    border-top: 1px solid #aaa;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    aside {
        width: 100%;
    }
    
    .dashboard-container {
        flex-direction: column;
    }
    
    .dashboard-sidebar {
        width: 100%;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .main-wrapper {
        flex-direction: column;
    }
    
    .side-menu {
        width: 100%;
    }
    
    .content-area {
        margin-left: 0;
        margin-top: 20px;
    }
}

/* サイドバーのスタイル */
.sidebar {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
}

.sidebar h3 {
    margin-bottom: 1rem;
    color: #333;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: #666;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.sidebar-menu a:hover {
    background-color: #e9ecef;
    color: #333;
}

.sidebar-menu a.active {
    background-color: #007bff;
    color: white;
}

/* テーブルのスタイル */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* 検索フォームのスタイル */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-form input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 3px;
}

.search-form button {
    padding: 0.5rem 1rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.search-form button:hover {
    background-color: #0056b3;
}

/* プロジェクト一覧のサイドバー */
.recent-projects {
    padding: 15px 0;
    margin-bottom: 20px;
}

.recent-projects h3 {
    margin-bottom: 15px;
    font-size: 1rem;
    color: #333;
}

.recent-projects ul {
    list-style: none;
}

.recent-projects li {
    margin-bottom: 2px;
}

.recent-projects a {
    display: block;
    padding: 12px 15px;
    color: #666;
    text-decoration: none;
    background-color: white;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.recent-projects a:hover {
    background-color: #f0f0f0;
    color: #333;
}

.recent-projects a.active {
    background-color: #3498db;
    color: white;
}

/* プログレスバーのスタイル */
.progress-mini {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #e0e0e0;
}

.recent-projects a.active .progress-mini {
    background-color: #555;
}

.progress-mini .progress-bar {
    height: 100%;
    background-color: #2ecc71;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 11px;
    color: #666;
    opacity: 0.8;
}

.recent-projects a.active .progress-text {
    color: #bbb;
}

/* プロジェクト一覧のプログレスバー */
.progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    height: 8px;
}

.progress-bar-fill {
    height: 100%;
    background-color: #3498db;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* プロジェクト詳細のプログレスバー */
.project-progress {
    background-color: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    height: 12px;
}

.project-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    border-radius: 8px;
    transition: width 0.5s ease;
}

/* サーバー収益スタイル */
.server-revenue {
    margin-bottom: 30px;
}

.revenue-table, .revenue-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.revenue-table th, .revenue-table td,
.revenue-history-table th, .revenue-history-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ddd;
}

.revenue-table th,
.revenue-history-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.revenue-table td:nth-child(2),
.revenue-table td:nth-child(3),
.revenue-history-table td:not(:first-child) {
    text-align: right;
}

.revenue-table tr.subtotal {
    background-color: #f0f0f0;
    font-weight: 500;
}

.revenue-table tr.total {
    background-color: #e0e0e0;
    font-weight: bold;
}

.revenue-history-table tr.current-month {
    background-color: #fff3cd;
}

.revenue-history-table tr.year-total {
    background-color: #e0e0e0;
    font-weight: bold;
}

.yoy {
    font-size: 12px;
    margin-left: 5px;
}

.yoy.positive {
    color: #0066cc;
}

.yoy.negative {
    color: #dc3545;
}

.server-revenue-history {
    margin-top: 30px;
}

.revenue-summary {
    margin-top: 30px;
    overflow-x: auto;
}

/* 反響・連絡表のスタイル */
.communication-form {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.communication-logs {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.communication-logs h3 {
    margin-bottom: 20px;
}

.client-search {
    display: flex;
    gap: 10px;
}

.client-search select {
    flex: 1;
}

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

.communication-table th {
    background-color: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.communication-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.communication-table .text-center {
    text-align: center;
    vertical-align: middle;
}

.log-summary {
    white-space: nowrap;
}

.log-summary .label,
.communication-table .label {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-right: 8px;
}

.space-05 {
    height: 5px;
}

.client-link {
    display: inline-block;
    padding: 2px 8px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 8px;
}

.client-link:hover {
    background-color: #2980b9;
}

.filter-row {
    margin-bottom: 15px;
}

.filter-row select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}