/* ==========================================================================
   全体設計 & リセット
   ========================================================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
    background-color: #f1f5f9;
    color: #1e293b;
    margin: 0;
    padding: 40px 16px;
    line-height: 1.6;
}

/* フォーム・画面を包むメインコンテナ */
.container {
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 8px -1px rgba(15, 23, 42, 0.04);
    box-sizing: border-box;
}

/* タイトルスタイル */
h1 {
    color: #0f172a;
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 28px;
    letter-spacing: -0.025em;
}

h2 {
    color: #1e293b;
    font-size: 20px;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 16px;
    border-left: 4px solid #4f46e5;
    padding-left: 12px;
}

h3 {
    color: #334155;
    font-size: 16px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 16px;
}

/* フォーム基本構造 */
form {
    display: flex;
    flex-direction: column;
}

/* フォームラベル */
label {
    margin-top: 16px;
    font-weight: 600;
    font-size: 14px;
    color: #475569;
}

/* 入力・選択欄共通 */
input, select, textarea {
    padding: 10px 14px;
    margin-top: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    width: 100%;
    box-sizing: border-box;
    background-color: #ffffff;
    color: #0f172a;
    transition: all 0.2s ease;
}

/* フォーカス時のアニメーション */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

::placeholder {
    color: #94a3b8;
}

/* ==========================================================================
   ボタン類（モダンなフラットデザイン）
   ========================================================================== */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    padding: 12px 20px;
    background-color: #4f46e5;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

button:hover { background-color: #4338ca; }
button:active { transform: translateY(1px); }

/* バリエーションボタン */
.btn-update { background-color: #0284c7; }
.btn-update:hover { background-color: #0369a1; }

.btn-download { background-color: #059669; }
.btn-download:hover { background-color: #047857; }

.btn-danger { background-color: #dc2626; }
.btn-danger:hover { background-color: #b91c1c; }

.btn-row-delete {
    background-color: #ef4444;
    color: white;
    padding: 6px 12px;
    font-size: 13px;
    margin: 0;
}
.btn-row-delete:hover { background-color: #dc2626; }

/* ==========================================================================
   コンポーネント (通知・テーブル等)
   ========================================================================== */
/* アラートバッジ */
.alert {
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 24px;
}
.alert-success {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.alert-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

/* ツールバー枠 */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    align-items: center;
    justify-content: space-between;
}
.toolbar div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.toolbar button { margin: 0; }

/* レスポンシブ用スクロールラッパー推奨 */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

/* テーブルスタイル */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    word-wrap: break-word;
    font-size: 14px;
}

th, td {
    padding: 14px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

tr:last-child td { border-bottom: none; }

th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid #e2e8f0;
}

/* テーブル内ステータスSelect */
.status-select {
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 6px;
    margin: 0;
    border: 1px solid rgba(0,0,0,0.08);
    cursor: pointer;
}

/* テーブル内専用の極小入力ボックス */
.belong-inline-container {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
}
.input-table-mini {
    width: 46px !important;
    max-width: 46px !important;
    padding: 6px 4px !important;
    text-align: center !important;
    font-weight: 700 !important;
    box-sizing: border-box !important;
    display: inline-block !important;
    margin: 0 !important;
}

/* 備考・生徒補足バッジ */
.student-note {
    display: inline-block;
    font-size: 12px;
    color: #475569;
    background-color: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 500;
}

/* リンク */
a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
a:hover { color: #3730a3; text-decoration: underline; }

/* ポップなステータスバッジ（ログ用） */
.badge-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    text-align: center;
}
