@charset "UTF-8";

/* ========================================
   基本設定
======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}
:root {
    --sidebar-width: 240px;
}

html,
body {
    min-height: 100%;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: #1f3f6b;
    background: linear-gradient(180deg, #e8f2ff 0%, #f5f9ff 100%);
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========================================
   ヘッダー・フッター
======================================== */
header,
footer {
    color: #ffffff;
    background: linear-gradient(90deg, #f1f1f1 0%, #3786eb 100%);
}

header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 96px;
    padding: 18px 24px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(15, 57, 103, 0.14);
}

footer {
    margin-top: auto;
    padding: 14px 24px;
    font-size: 0.95rem;
    text-align: center;
}

/* ヘッダー内の認証ボタン */
.header__auth button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 6px 16px;
    color: #2a5592;
    background-color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 50px;
    outline: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition:
        color 0.3s ease,
        background-color 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.15s ease;
}
/* ヘッダーロゴ */
.logoCls {
    display: flex;
    align-items: center;
    margin-right: auto;
    overflow: hidden;
}

/* ロゴ画像をヘッダー背景になじませる */
.logoCls #logoImg {
    display: block;
    width: auto;
    max-width: 300px;
    height: 65px;
    object-fit: contain;
    opacity: 0.96;

    -webkit-mask-image: linear-gradient(
        90deg,
        transparent 0%,
        #000000 7%,
        #000000 93%,
        transparent 100%
    );

    mask-image: linear-gradient(
        90deg,
        transparent 0%,
        #000000 7%,
        #000000 93%,
        transparent 100%
    );

    filter:
        saturate(0.9)
        contrast(0.96)
        drop-shadow(0 2px 5px rgba(7, 38, 82, 0.16));
}


.header__auth button.btn:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#logout-btn {
    color: #ffffff;
    background-color: #d9534f;
    border-color: #d9534f;
}

#logout-btn:hover {
    background-color: #c9302c;
    border-color: #c9302c;
    box-shadow: 0 0 10px rgba(217, 83, 79, 0.5);
}



/* ========================================
   メインコンテンツ
======================================== */
main {
    flex: 1;
    width: calc(100% - 288px);
    max-width: 1440px;
    margin: 24px 24px 24px 264px;
    padding: 28px;
    overflow-x: auto;
    background-color: #ffffff;
    border: 1px solid rgba(29, 79, 145, 0.15);
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(22, 75, 138, 0.08);
}

h2 {
    margin-top: 0;
    margin-bottom: 24px;
    color: #1c3d6b;
    font-size: 1.8rem;
}

/* ========================================
   フォーム部品
======================================== */
label {
    display: block;
    margin-bottom: 6px;
    color: #2b4f82;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    max-width: 100%;
    margin-bottom: 18px;
    padding: 12px 14px;
    color: #173a68;
    background-color: #f7faff;
    border: 1px solid #c9d8ee;
    border-radius: 10px;
    font: inherit;
    font-size: 1rem;
}

textarea {
    resize: vertical;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #6295ea;
    box-shadow: 0 0 0 3px rgba(98, 149, 234, 0.14);
}

/* ========================================
   汎用ボタン
======================================== */
button,
input[type="button"],
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease,
        filter 0.15s ease;
}

input[type="submit"] {
    margin-right: 12px;
    color: #ffffff;
    background: linear-gradient(90deg, #3b78e7 0%, #1e4eb8 100%);
}

input[type="button"],
button.js-back-page {
    color: #206ad2;
    background-color: #d9e8ff;
}

input[type="button"]:hover,
button.js-back-page:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(35, 87, 155, 0.16);
}

button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible {
    outline: 3px solid rgba(98, 149, 234, 0.32);
    outline-offset: 2px;
}

/* ========================================
   メッセージ・エラー表示
======================================== */
.request-message,
.error {
    margin-bottom: 22px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 0.98rem;
    line-height: 1.55;
}

.request-message {
    color: #1b3f72;
    background-color: #eef5ff;
    border: 1px solid rgba(59, 120, 231, 0.3);
}

/* メッセージが空の場合は非表示にする */
.request-message:empty {
    display: none;
}

/* メッセージが存在する場合に表示する */
.request-message.visible {
    display: block;
}

.error {
    display: none;
    margin-top: 4px;
    margin-bottom: 10px;
    color: #8b2434;
    background-color: #ffe9ed;
    border: 1px solid #f5b3bf;
    font-size: 14px;
}

.error.is-visible {
    display: block;
}

.input-error {
    background-color: #fff5f5;
    border: 1px solid #d93025;
}

/* ========================================
   サイドバー
======================================== */
.sidebar {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #ffffff;
    border-right: 1px solid #e5e7eb;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

/* サイドメニューのヘッダー */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
    padding: 8px 12px;
    border-bottom: 1px solid #e5e7eb;
}

/* サイドメニューのタイトル */
.sidebar-header .title {
    min-width: 0;
    margin: 0;
    padding: 10px 20px;
    color: #1f2937;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

/* サイドメニューのナビゲーション */
.sidebar-nav {
    padding: 10px 20px;
    border: none;
}

.sidebar-nav ul,
.sidebar-nav li {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* サイドメニューのボタン */
.sidebar-button {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 45px;
    padding: 12px 15px;
    color: #4b5563;
    background-color: transparent;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

.sidebar-nav button {
    gap: 18px;
    appearance: none;

    border: none;
    background-color: transparent;
    font: inherit;
}

/* マウスオーバー時 */
.sidebar-nav button:hover {
    color: #2563eb;
    background-color: #eff6ff;
    transform: translateX(3px);
}

/* クリック時 */
.sidebar-nav button:active {
    color: #1d4ed8;
    background-color: #dbeafe;
}

/* キーボード操作時 */
.sidebar-nav button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* 現在表示中のメニュー */
.sidebar-button.active {
    color: #ffffff;
    background-color: #2563eb;
    font-weight: 700;
}

/* サイドメニュー内のアイコン */
.sidebar-nav img {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.sidebar-header img {
    flex-shrink: 0;
    width: 45%;
    height: 45%;
    margin: 0 -45px 0 -10px;
    object-fit: contain;
    transform: translateX(-15px);
}

.sidebar .decoration #flowerLeft {
    max-width: 214px;
}

/* ========================================
   汎用テーブル
   class="table" を持つテーブルに適用
======================================== */
.table {
    width: 100%;
    max-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
    color: #173f72;
    background-color: #ffffff;
    border: 1px solid #d7e1ee;
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.5;
    overflow: hidden;
}

/* JSPの border 属性による既定罫線を上書きする */
.table th,
.table td {
    border: 0;
    border-right: 1px solid #dfe7f0;
    border-bottom: 1px solid #dfe7f0;
}

/* テーブルヘッダー */
.table thead th {
    min-width: 64px;
    padding: 13px 12px;
    color: #173f72;
    background: linear-gradient(180deg, #f7faff 0%, #edf3fb 100%);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    vertical-align: middle;
    word-break: keep-all;
    overflow-wrap: normal;
    white-space: normal;
}

/* テーブルのデータセル */
.table tbody td {
    padding: 12px;
    color: #174474;
    background-color: #ffffff;
    text-align: left;
    vertical-align: middle;
    word-break: normal;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
    transition:
        color 0.18s ease,
        background-color 0.18s ease;
}

/* 最終列の右罫線を非表示にする */
.table th:last-child,
.table td:last-child {
    border-right: 0;
}

/* 最終行の下罫線を非表示にする */
.table tbody tr:last-child td {
    border-bottom: 0;
}

/* 偶数行の背景色 */
.table tbody tr:nth-child(even) td {
    background-color: #f9fbfe;
}

/* マウスオーバー時の背景色 */
.table tbody tr:hover td {
    background-color: #eef5ff;
}

/* 空データ表示用のセル */
.table td[colspan] {
    padding: 32px 20px;
    color: #687c98;
    background-color: #f9fbfe;
    text-align: center;
}

/* テーブル内のリンク */
.table a {
    color: #1f63bd;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.table a:hover {
    color: #174b91;
    text-decoration: underline;
}

.table a:focus-visible {
    outline: 2px solid #6295ea;
    outline-offset: 2px;
    border-radius: 3px;
}

/* ========================================
   テーブル内のフォーム部品
======================================== */
.table form {
    margin: 0;
    padding: 0;
}

/* テーブル内の入力欄をコンパクトに表示する */
.table input[type="text"],
.table input[type="password"],
.table input[type="email"],
.table input[type="number"],
.table input[type="date"],
.table input[type="time"],
.table select,
.table textarea {
    width: 100%;
    min-width: 90px;
    margin: 0;
    padding: 8px 10px;
    color: #173a68;
    background-color: #ffffff;
    border: 1px solid #c9d8ee;
    border-radius: 7px;
    font-size: 14px;
    line-height: 1.4;
}

.table textarea {
    min-height: 70px;
    resize: vertical;
}

/* テーブル内のボタンをコンパクトに表示する */
.table button,
.table input[type="button"],
.table input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 88px;
    min-height: 36px;
    margin: 0;
    padding: 8px 14px;
    border: 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

/* テーブル内の送信ボタン */
.table input[type="submit"] {
    color: #ffffff;
    background: linear-gradient(135deg, #3979e7 0%, #2456bd 100%);
    box-shadow: 0 3px 9px rgba(35, 87, 155, 0.16);
}

.table input[type="submit"]:hover {
    filter: brightness(1.03);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(35, 87, 155, 0.22);
}

.table input[type="submit"]:active {
    transform: translateY(0);
}

/* ========================================
   テーブル内の進捗バー
======================================== */
.table progress {
    appearance: none;
    -webkit-appearance: none;
    display: inline-block;
    width: min(180px, calc(100% - 52px));
    min-width: 72px;
    height: 9px;
    margin: 0 7px 0 0;
    overflow: hidden;
    vertical-align: middle;
    background-color: transparent;
    border: 0;
    border-radius: 999px;
}

/* Chrome・Edgeの未完了部分 */
.table progress::-webkit-progress-bar {
    background-color: #e1e7ef;
    border-radius: 999px;
    box-shadow: inset 0 1px 2px rgba(15, 43, 92, 0.13);
}

/* Chrome・Edgeの完了部分 */
.table progress::-webkit-progress-value {
    background: linear-gradient(
        110deg,
        #1f56a6 0%,
        #2f6ed5 30%,
        #609af7 48%,
        #2f6ed5 66%,
        #1f56a6 100%
    );
    background-size: 240% 100%;
    border-radius: 999px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(8, 35, 86, 0.16),
        0 0 5px rgba(45, 105, 220, 0.18);
    animation: common-progress-flow 4s ease-in-out infinite;
}

/* Firefoxの完了部分 */
.table progress::-moz-progress-bar {
    background: linear-gradient(
        110deg,
        #1f56a6 0%,
        #2f6ed5 30%,
        #609af7 48%,
        #2f6ed5 66%,
        #1f56a6 100%
    );
    background-size: 240% 100%;
    border-radius: 999px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(8, 35, 86, 0.16),
        0 0 5px rgba(45, 105, 220, 0.18);
    animation: common-progress-flow 4s ease-in-out infinite;
}

@keyframes common-progress-flow {
    0% {
        background-position: 100% 50%;
    }

    50% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

/* OSの「視差効果を減らす」設定に対応する */
@media (prefers-reduced-motion: reduce) {
    .table progress::-webkit-progress-value,
    .table progress::-moz-progress-bar {
        animation: none;
    }
}

/* ========================================
   レスポンシブ対応
======================================== */
@media (max-width: 1100px) {
    /* 多列テーブルを無理に縮小せず横スクロールで表示する */
    .table {
        min-width: 880px;
    }
}

@media (max-width: 768px) {
    main {
        width: auto;
        max-width: none;
        margin: 16px;
        padding: 20px;
    }

    input[type="submit"],
    input[type="button"],
    button.js-back-page {
        width: 100%;
        margin: 0 0 14px;
    }

    .table {
        font-size: 14px;
    }

    .table thead th {
        padding: 11px 9px;
        font-size: 13px;
    }

    .table tbody td {
        padding: 10px 9px;
    }

    /* テーブル内のボタンは全幅にしない */
    .table button,
    .table input[type="button"],
    .table input[type="submit"] {
        width: auto;
        min-width: 84px;
        margin: 0;
        padding: 8px 12px;
    }

    .table progress {
        min-width: 70px;
    }
}

/* ========================================
   サイドバー表示時のヘッダー調整
======================================== */



/* サイドバーがある場合はヘッダー左側に余白を確保する */
body:has(.sidebar) header.header {
    padding-left: calc(var(--sidebar-width) + 24px);
}

/* サイドバーがない場合は通常の余白に戻す */
body:not(:has(.sidebar)) header.header {
    padding-left: 24px;
}

header.header .logoCls {
    margin-right: auto;
}

/* ========================================
   共通アニメーション設定
======================================== */

:root {
    --motion-fast: 160ms;
    --motion-normal: 280ms;
    --motion-slow: 520ms;
    --motion-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --motion-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ページ表示時にメインコンテンツを滑らかに表示する */
@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.995);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

main {
    animation: page-enter var(--motion-slow) var(--motion-ease-out) both;
}

/* ページ遷移直前の表示状態 */
body {
    transition:
        opacity 220ms ease,
        transform 220ms ease,
        filter 220ms ease;
}

body.is-page-leaving {
    opacity: 0;
    transform: translateY(-5px);
    filter: blur(1.5px);
    pointer-events: none;
}

/* ========================================
   テーブル行の表示アニメーション
======================================== */

@keyframes table-row-enter {
    from {
        opacity: 0;
        transform: translateY(7px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table tbody tr {
    opacity: 0;
    animation: table-row-enter 400ms var(--motion-ease-out) forwards;
}

/* マウスオーバー時に行の先頭へアクセントを表示する */
.table tbody td {
    transition:
        color var(--motion-fast) ease,
        background-color var(--motion-fast) ease,
        box-shadow var(--motion-fast) ease;
}

.table tbody tr:hover td {
    background-color: #eef5ff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(70, 120, 190, 0.06);
}

.table tbody tr:hover td:first-child {
    box-shadow:
        inset 3px 0 0 #3b78e7,
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(70, 120, 190, 0.06);
}

/* ========================================
   ボタンの操作アニメーション
======================================== */

button,
input[type="button"],
input[type="submit"] {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    will-change: transform;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
    filter: brightness(1.035);
}

button:active,
input[type="button"]:active,
input[type="submit"]:active {
    transform: translateY(1px) scale(0.98);
}

/* button要素の上を移動する光沢 */
button::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: -70%;
    left: -45%;
    width: 26%;
    height: 240%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    pointer-events: none;
    transform: rotate(18deg);
    transition: left 560ms ease;
}

button:hover::after {
    left: 125%;
}

/* JavaScriptでbutton要素に追加する波紋 */
.button-ripple {
    position: absolute;
    z-index: 2;
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.48);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    animation: button-ripple-effect 580ms ease-out forwards;
}

@keyframes button-ripple-effect {
    from {
        opacity: 0.72;
        transform: translate(-50%, -50%) scale(0);
    }

    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(24);
    }
}

/* inputボタンは疑似要素を利用できないため背景移動で光沢を表現する */
input[type="submit"] {
    background-image: linear-gradient(
        110deg,
        #2456bd 0%,
        #3979e7 35%,
        #70a5ff 50%,
        #3979e7 65%,
        #2456bd 100%
    );
    background-position: 100% 50%;
    background-size: 240% 100%;
    transition:
        background-position 650ms ease,
        transform var(--motion-fast) ease,
        box-shadow var(--motion-fast) ease,
        filter var(--motion-fast) ease;
}

input[type="submit"]:hover {
    background-position: 0% 50%;
}

/* ========================================
   サイドメニューのアニメーション
======================================== */

.sidebar-button {
    transition:
        color var(--motion-fast) ease,
        background-color var(--motion-fast) ease,
        box-shadow var(--motion-fast) ease,
        transform var(--motion-fast) ease;
}

.sidebar-button.active {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(
        110deg,
        #1d4ed8 0%,
        #2563eb 35%,
        #4b8df8 50%,
        #2563eb 65%,
        #1d4ed8 100%
    );
    background-size: 240% 100%;
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.2);
    animation: active-menu-flow 5s ease-in-out infinite;
}

@keyframes active-menu-flow {
    0%,
    100% {
        background-position: 100% 50%;
    }

    50% {
        background-position: 0% 50%;
    }
}

/* ========================================
   集計カードのアニメーション
======================================== */

.count {
    position: relative;
    overflow: hidden;
    transition:
        transform 250ms var(--motion-ease-out),
        border-color 250ms ease,
        box-shadow 250ms ease;
}

.count:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 120, 231, 0.3);
    box-shadow:
        0 16px 30px rgba(31, 86, 160, 0.14),
        0 0 0 1px rgba(75, 137, 232, 0.08);
}

/* カード内を移動する薄い光沢 */
.count::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: -70%;
    left: -50%;
    width: 35%;
    height: 240%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.62),
        transparent
    );
    pointer-events: none;
    transform: rotate(20deg);
    transition: left 700ms ease;
}

.count:hover::before {
    left: 125%;
}

/* 集計数値を順番に表示する */
@keyframes number-enter {
    0% {
        opacity: 0;
        transform: translateY(9px) scale(0.92);
    }

    72% {
        transform: translateY(-2px) scale(1.025);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.number {
    animation: number-enter 550ms var(--motion-ease-out) both;
}

.count:nth-child(1) .number {
    animation-delay: 80ms;
}

.count:nth-child(2) .number {
    animation-delay: 160ms;
}

.count:nth-child(3) .number {
    animation-delay: 240ms;
}

/* ========================================
   アニメーション軽減設定
======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 6. パスワード表示切り替えエリア */
.show-password-wrapper {
    margin-top: -15px;
    margin-bottom: 8px; 
    display: flex;
    align-items: center;
    gap: 6px;
}

.show-password-wrapper input[type="checkbox"] {
    cursor: pointer;
    margin: 0;
}

.show-password-label {
    font-size: 13px;
    color: #666666;
    cursor: pointer;
    user-select: none;
    margin-top: 4px;
}