/* 学務管理システム専用スタイル */

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ナビゲーションバー */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 600;
}

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

.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.kpi-card.primary {
    border-left: 5px solid #667eea;
}

.kpi-card.danger {
    border-left: 5px solid #f56565;
}

.kpi-card.warning {
    border-left: 5px solid #ed8936;
}

.kpi-card.info {
    border-left: 5px solid #4299e1;
}

.kpi-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    line-height: 1;
    margin-bottom: 5px;
}

.kpi-description {
    font-size: 0.85rem;
    color: #999;
}

.kpi-change {
    font-size: 0.85rem;
    margin-top: 5px;
}

.kpi-change.positive {
    color: #48bb78;
}

.kpi-change.negative {
    color: #f56565;
}

/* グラフコンテナ */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.chart-header h2 {
    font-size: 1.2rem;
    color: #333;
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 10px;
}

.form-control {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* アラートセクション */
.alert-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 30px 0;
}

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

.section-header h2 {
    font-size: 1.3rem;
    color: #333;
    margin: 0;
}

.alert-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid;
    transition: background 0.3s;
}

.alert-item:hover {
    background: #f9fafb;
}

.alert-item.danger {
    background: #fff5f5;
    border-color: #f56565;
}

.alert-item.warning {
    background: #fffaf0;
    border-color: #ed8936;
}

.alert-item.info {
    background: #ebf8ff;
    border-color: #4299e1;
}

.alert-icon {
    font-size: 1.5rem;
    margin-right: 15px;
}

.alert-content {
    flex: 1;
}

.alert-message {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.alert-meta {
    font-size: 0.85rem;
    color: #666;
}

.alert-actions {
    display: flex;
    gap: 10px;
}

/* クイックビューセクション */
.quick-view-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 30px 0;
}

/* データテーブル */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table thead {
    background: #f7fafc;
}

.data-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e2e8f0;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    color: #333;
}

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

.data-table .loading {
    text-align: center;
    padding: 30px;
    color: #999;
}

/* リスクレベルバッジ */
.risk-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.risk-badge.level-5 {
    background: #fed7d7;
    color: #c53030;
}

.risk-badge.level-4 {
    background: #feebc8;
    color: #c05621;
}

.risk-badge.level-3 {
    background: #fefcbf;
    color: #975a16;
}

.risk-badge.level-2 {
    background: #c6f6d5;
    color: #2f855a;
}

.risk-badge.level-1 {
    background: #bee3f8;
    color: #2c5282;
}

/* 出席率バッジ */
.attendance-rate {
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
}

.attendance-rate.excellent {
    background: #c6f6d5;
    color: #2f855a;
}

.attendance-rate.good {
    background: #bee3f8;
    color: #2c5282;
}

.attendance-rate.warning {
    background: #feebc8;
    color: #c05621;
}

.attendance-rate.danger {
    background: #fed7d7;
    color: #c53030;
}

/* ボタン */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* フィルターエリア */
.filter-area {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .charts-container {
        grid-template-columns: 1fr;
    }

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

    .nav-menu {
        flex-direction: column;
        gap: 10px;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
}

/* ローディング */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1rem;
}

/* サブタイトル */
.subtitle {
    color: #666;
    font-size: 1rem;
    margin-top: -10px;
    margin-bottom: 20px;
}

/* モーダル */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.modal-close {
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    color: white;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 15px 25px;
    background: #f7fafc;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 学生詳細 */
.student-detail {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.detail-section h3 {
    font-size: 1.1rem;
    color: #667eea;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

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

.detail-table th {
    text-align: left;
    padding: 10px;
    background: #f7fafc;
    font-weight: 600;
    width: 150px;
}

.detail-table td {
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
}

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

.history-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 4px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item.success {
    background: #f0fff4;
    border-color: #48bb78;
}

.history-item.warning {
    background: #fffaf0;
    border-color: #ed8936;
}

.history-item.danger {
    background: #fff5f5;
    border-color: #f56565;
}

.history-item.info {
    background: #ebf8ff;
    border-color: #4299e1;
}

.history-date {
    font-size: 0.85rem;
    color: #666;
}

.history-lecture {
    font-weight: 600;
    color: #333;
    flex: 1;
    margin-left: 15px;
}

.history-status {
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.7);
}

/* ページネーション */
.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.pagination-container {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-container span {
    padding: 8px;
    color: #999;
}

/* タブ */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
}

.tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.tab-button:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

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

/* インサイトカード */
.insight-card {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-left: 4px solid #667eea;
    border-radius: 8px;
    padding: 25px;
    margin: 30px 0;
}

.insight-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.insight-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.insight-list li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    color: #333;
    font-size: 0.95rem;
}

.insight-list li:last-child {
    border-bottom: none;
}

/* 相関情報ボックス */
.correlation-info {
    display: flex;
    gap: 20px;
    padding: 20px;
}

.info-box {
    flex: 1;
    text-align: center;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
}

.info-box h4 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.info-box .value {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.info-box p {
    font-size: 0.85rem;
    color: #999;
    margin: 0;
}

/* レポート生成フォーム */
.report-form {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 600px;
}

.report-form .form-group {
    margin-bottom: 20px;
}

.report-form label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.report-form .form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
}

.report-form .btn {
    width: 100%;
    margin-top: 10px;
}
