*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f4f6f8;
    line-height: 1.6;
}

a {
    color: #3b82f6;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========== サイドメニュー ========== */
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    transition: grid-template-columns .22s ease;
}

/* サイドバーは fixed でグリッドの流れから外れるため、メインは常に2カラム目に置く
   （1カラム目=260px はサイドバー用の予約スペース） */
.app-main {
    grid-column: 2;
}

/* サイドバー折りたたみ状態（アイコンのみのレール表示）はデスクトップ幅のみ。
   スマホ幅では下部メディアクエリのドロワー（スライドイン）設計を使う */
@media (min-width: 961px) {
html.sidebar-collapsed .app-shell {
    grid-template-columns: 64px minmax(0, 1fr);
}

html.sidebar-collapsed .sidebar {
    width: 64px;
    /* フライアウトを固定フッターバー等より前面に出す */
    z-index: 45;
}

html.sidebar-collapsed .sidebar-inner {
    width: 64px;
    /* アクティブ項目のハイライトがレール端に密着しないよう左右に余白を作る */
    padding-left: 8px;
    padding-right: 8px;
    /* hover時のラベルフライアウトをレール外へ出すため可視にする */
    overflow: visible;
}

/* レール表示ではラベル類を隠してアイコンだけ見せる。
   ・通常メニューのラベル span は hover時のフライアウトに流用するので隠さない
   ・アコーディオンの親ラベルはフライアウトパネルの見出しを使うので隠す
   ・サブメニューは hover時のフライアウトパネルとして表示する（display:none にしない） */
html.sidebar-collapsed .sidebar-brand,
html.sidebar-collapsed .sidebar-brand-text,
html.sidebar-collapsed .sidebar-trigger-label > span,
html.sidebar-collapsed .sidebar-accordion-icon,
html.sidebar-collapsed .sidebar-user-text,
html.sidebar-collapsed .sidebar-logout {
    display: none;
}

/* アイコンを中央寄せ */
html.sidebar-collapsed .sidebar-header,
html.sidebar-collapsed .sidebar-link,
html.sidebar-collapsed .sidebar-accordion-trigger,
html.sidebar-collapsed .sidebar-trigger-label,
html.sidebar-collapsed .sidebar-user-meta {
    justify-content: center;
}

html.sidebar-collapsed .sidebar-link,
html.sidebar-collapsed .sidebar-accordion-trigger {
    gap: 0;
    padding-left: 0;
    padding-right: 0;
    position: relative;
}

html.sidebar-collapsed .sidebar-user-meta {
    margin-bottom: 0;
}

/* 折りたたみ時: 勤怠管理テキストは隠れ、ボタンだけを中央寄せ＋「展開」向きに反転 */
html.sidebar-collapsed .sidebar-header-bar {
    justify-content: center;
}

html.sidebar-collapsed .sidebar-collapse-btn {
    transform: rotate(180deg);
}

/* 未読バッジはアイコン右上の小さなドットにする */
html.sidebar-collapsed .sidebar-badge {
    position: absolute;
    top: 6px;
    right: 12px;
    min-width: 9px;
    width: 9px;
    height: 9px;
    padding: 0;
    font-size: 0;
    line-height: 0;
    border: 1.5px solid #047857;
}

/* レール表示: 通常リンクのラベルをアイコン右側のフライアウト（吹き出し）にする。既定は非表示 */
html.sidebar-collapsed .sidebar-link > span:not(.sidebar-badge) {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-8px);
    margin: 0;
    padding: 7px 12px;
    white-space: nowrap;
    background: #04372a;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(2, 8, 20, 0.38);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 50;
    transition: opacity .16s ease, transform .18s cubic-bezier(.2, .7, .3, 1), visibility .18s;
}

/* フライアウト左側の三角（吹き出しのしっぽ） */
html.sidebar-collapsed .sidebar-link > span:not(.sidebar-badge)::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -4px;
    width: 9px;
    height: 9px;
    background: inherit;
    transform: translateY(-50%) rotate(45deg);
    border-radius: 2px;
}

/* hoverでフライアウトを右へスライドしながらフェードイン */
html.sidebar-collapsed .sidebar-link:hover > span:not(.sidebar-badge) {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* hoverでアイコンを少し拡大して反応を出す */
html.sidebar-collapsed .sidebar-link:hover .sidebar-icon,
html.sidebar-collapsed .sidebar-accordion-trigger:hover .sidebar-icon {
    transform: scale(1.14);
}

/* ===== レール表示: アコーディオンの子メニューを hover でフライアウト（プルダウン）表示 ===== */
html.sidebar-collapsed .sidebar-accordion {
    position: relative;
}

/* レール時は全アコーディオンを強制 open にして中身を描画するため、
   open時のハイライト背景が常時付かないように打ち消す（hover時のみ色を付ける） */
html.sidebar-collapsed .sidebar-accordion[open] .sidebar-accordion-trigger {
    background-color: transparent;
    border-color: transparent;
}

html.sidebar-collapsed .sidebar-accordion-trigger:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(203, 213, 225, 0.3);
}

/* サブメニューを右側に浮かぶパネルにする。既定は非表示。
   縦位置は JS が --fly-top にビューポート内へ収めた値をセットする（はみ出し防止）。
   背景はレール右端(64px)から表示し、左の透明ボーダー(12px)を
   トリガー右端(x=56)まで延ばして当たり判定を繋ぐ（hoverが切れない）。 */
html.sidebar-collapsed .sidebar-accordion .sidebar-submenu {
    display: grid;
    gap: 2px;
    position: fixed;
    left: 52px;
    border-left: 12px solid transparent;
    background-clip: padding-box;
    top: var(--fly-top, 8px);
    bottom: auto;
    min-width: 220px;
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    margin: 0;
    padding: 8px;
    background: #04372a;
    border-radius: 0 12px 12px 0;
    box-shadow: 6px 0 34px rgba(2, 8, 20, 0.4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-8px);
    transition: opacity .16s ease, transform .18s cubic-bezier(.2, .7, .3, 1), visibility .18s;
    z-index: 60;
}

/* hoverでパネルを表示 */
html.sidebar-collapsed .sidebar-accordion:hover .sidebar-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

/* パネル見出し（親メニュー名） */
html.sidebar-collapsed .sidebar-submenu-title {
    display: block;
    margin: 2px 6px 6px;
    color: #a9d4bf;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* パネル内の子リンクはツリーの縦線をやめて押しやすいボタン状にする */
html.sidebar-collapsed .sidebar-accordion .sidebar-submenu .sidebar-sublink {
    border-left: none;
    border-radius: 6px;
    padding: 8px 10px;
    white-space: nowrap;
}

html.sidebar-collapsed .sidebar-accordion .sidebar-submenu .sidebar-sublink:hover {
    background: rgba(255, 255, 255, 0.10);
}

html.sidebar-collapsed .sidebar-accordion .sidebar-submenu .sidebar-sublink.is-active {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 6px;
}
} /* end @media (min-width: 961px) レール表示 */

.sidebar {
    background: #047857;
    border-right: 1px solid #065f46;
    color: #fff;
    /* スクロール位置に関わらず常にビューポート全高を覆う
       （本文がドロップダウン等で伸びても下端に隙間が出ないよう sticky ではなく fixed） */
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    z-index: 20;
    transition: transform .22s ease, width .22s ease;
    /* overflow は内側ラッパーに持たせる */
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px 18px;
    height: 100%;
    width: 260px;
    box-sizing: border-box;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 30px;
}

.sidebar-brand {
    display: block;
    color: #fff;
    text-decoration: none;
}

.sidebar-brand:hover {
    text-decoration: none;
}

/* ロゴ画像エリア: ロゴは白いサブ文字付き（暗背景用）なので、白カードではなく
   少し沈めた暗パネルに載せる。白文字・緑KOHSEI・青リングがすべて映える。 */
.sidebar-brand.has-logo {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(4, 12, 26, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 6px 16px rgba(2, 8, 20, 0.25);
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.sidebar-brand.has-logo:hover {
    transform: translateY(-1px);
    background: rgba(4, 12, 26, 0.36);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 10px 22px rgba(2, 8, 20, 0.32);
}

.sidebar-logo {
    display: block;
    width: 100%;
    height: auto;
}

/* ロゴの下: 勤怠管理テキスト ＋ 開閉ボタンを横並びにする行 */
.sidebar-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    row-gap: 3px;
    white-space: nowrap;
    font-family: "Yu Mincho", "Hiragino Mincho ProN", "Times New Roman", serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.18em;
    text-indent: 0.18em;
    color: #fff;
    text-decoration: none;
}

.sidebar-brand-text:hover {
    color: #fff;
    text-decoration: none;
}

.sidebar-brand-text::after {
    content: "INVOICE & ESTIMATE";
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: #bce3cf;
}

/* サイドバー開閉ボタン（ロゴの下、勤怠管理テキストの横） */
.sidebar-collapse-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #cdebdd;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}

.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.sidebar-collapse-btn svg {
    width: 18px;
    height: 18px;
}

/* スマホ用トップバー・ドロワー部品（デスクトップでは非表示） */
.mobile-topbar { display: none; }
.nav-backdrop { display: none; }
.sidebar-close-btn { display: none; }

/* ドロワー表示中は背面のスクロールを固定 */
body.nav-locked { overflow: hidden; }

/* デスクトップではレール自体が見えているため左端タブは出さない。
   表示はモバイル折りたたみ時のみ（下部のメディアクエリで制御） */

.sidebar-menu {
    display: grid;
    gap: 8px;
}

.sidebar-accordion {
    margin: 0;
}

.sidebar-accordion[open] .sidebar-accordion-trigger {
    background-color: rgba(255,255,255,0.08);
    border-color: rgba(203,213,225,0.22);
}

.sidebar-accordion-trigger {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 12px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.sidebar-accordion-trigger::-webkit-details-marker {
    display: none;
}

.sidebar-accordion-trigger:hover {
    background-color: rgba(255,255,255,0.12);
    border-color: rgba(203,213,225,0.3);
    color: #fff;
}

.sidebar-accordion-icon {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    flex-shrink: 0;
    margin-top: -2px;
}

.sidebar-accordion[open] .sidebar-accordion-icon {
    transform: rotate(225deg);
    margin-top: 2px;
}

.sidebar-submenu {
    margin-top: 8px;
    padding-left: 12px;
    display: grid;
    gap: 6px;
}

/* 親メニュー名の見出し。通常表示では不要（レール表示のフライアウト時のみ使う） */
.sidebar-submenu-title {
    display: none;
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    gap: 9px;
    border-left: 2px solid rgba(203,213,225,0.22);
    padding: 7px 10px 7px 12px;
    color: #cbd5e1;
    font-size: 13px;
    text-decoration: none;
}

.sidebar-sublink:hover {
    border-left-color: rgba(248,250,252,0.55);
    color: #fff;
    text-decoration: none;
}

.sidebar-sublink.is-active {
    border-left-color: #d6f0e1;
    color: #fff;
    background-color: rgba(255,255,255,0.08);
    border-radius: 0 8px 8px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 12px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

/* メニューアイコン共通 */
.sidebar-icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    display: block;
    transition: transform .16s ease;
}

.sidebar-sublink .sidebar-icon {
    width: 16px;
    height: 16px;
    opacity: 0.9;
}

.sidebar-trigger-label {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.sidebar-link:hover {
    background-color: rgba(255,255,255,0.12);
    border-color: rgba(203,213,225,0.3);
    color: #fff;
    text-decoration: none;
}

.sidebar-link.is-active {
    background-color: rgba(255,255,255,0.2);
    border-color: rgba(248,250,252,0.45);
    color: #fff;
}

.sidebar-user {
    margin-top: auto;
}

.sidebar-user-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #4f9e80;
}

.sidebar-user-name {
    margin: 0;
    color: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.sidebar-user-email {
    margin: 2px 0 0;
    color: #cbd5e1;
    font-size: 11px;
    line-height: 1.35;
    word-break: break-all;
}

.sidebar-user form {
    margin: 0;
}

.sidebar-logout.btn-outline {
    width: 100%;
    border-color: rgba(203,213,225,0.4);
    color: #e2e8f0;
    background-color: rgba(15, 23, 42, 0.16);
}

.sidebar-logout.btn-outline:hover {
    background-color: rgba(255,255,255,0.12);
    border-color: rgba(248,250,252,0.55);
    color: #fff;
}

.app-main {
    min-width: 0;
    transition: padding .22s ease;
}

@media (max-width: 960px) {
    /* ===== スマホ: 上部バー + 左からスライドインするドロワー ===== */
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 8px;
        position: sticky;
        top: 0;
        z-index: 30;
        height: 56px;
        padding: 0 8px;
        background: linear-gradient(160deg, #053d2e 0%, #047857 60%, #059669 100%);
        border-bottom: 1px solid #065f46;
    }

    .mobile-nav-toggle {
        position: relative;
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: none;
        border-radius: 10px;
        background: transparent;
        color: #fff;
        cursor: pointer;
    }

    .mobile-nav-toggle:active {
        background: rgba(255, 255, 255, 0.14);
    }

    .mobile-nav-toggle svg {
        width: 24px;
        height: 24px;
    }

    /* 未読のお知らせがあるときのドット表示 */
    .mobile-nav-dot {
        position: absolute;
        top: 9px;
        right: 9px;
        width: 9px;
        height: 9px;
        border-radius: 50%;
        background: #f87171;
        border: 1.5px solid #047857;
    }

    .mobile-topbar-title {
        color: #fff;
        font-family: "Yu Mincho", "Hiragino Mincho ProN", "Times New Roman", serif;
        font-size: 18px;
        font-weight: 700;
        letter-spacing: 0.14em;
        text-decoration: none;
    }

    .mobile-topbar-title:hover {
        text-decoration: none;
    }

    /* 本体は1カラム。上部バーの分だけ通常フローで下げる */
    .app-shell {
        display: block;
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .app-main {
        grid-column: auto;
    }

    /* サイドバーを左からのドロワーにする */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(82vw, 300px);
        height: auto;
        transform: translateX(-100%);
        transition: transform .26s ease;
        border-right: 1px solid #065f46;
        border-bottom: none;
        box-shadow: 6px 0 28px rgba(15, 23, 42, 0.32);
        z-index: 60;
    }

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

    .sidebar-inner {
        width: auto;
        height: 100%;
        padding: 18px 16px;
        gap: 18px;
        overflow-y: auto;
    }

    /* 背景オーバーレイ（タップで閉じる） */
    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 50;
        background: rgba(15, 23, 42, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity .26s ease, visibility .26s ease;
    }

    html.nav-open .nav-backdrop {
        opacity: 1;
        visibility: visible;
    }

    /* ドロワーヘッダー: デスクトップ用の折りたたみ矢印は隠し、閉じる(×)ボタンを表示 */
    .sidebar-collapse-btn {
        display: none;
    }

    .sidebar-close-btn {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.08);
        color: #cdebdd;
        cursor: pointer;
    }

    .sidebar-close-btn:active {
        background: rgba(255, 255, 255, 0.2);
    }

    .sidebar-close-btn svg {
        width: 22px;
        height: 22px;
    }

    /* メニューは縦並び。タップしやすいよう余白を広めに */
    .sidebar-menu {
        display: grid;
        gap: 4px;
    }

    .sidebar-link,
    .sidebar-accordion-trigger {
        font-size: 15px;
        padding: 12px;
    }

    .sidebar-sublink {
        padding-top: 11px;
        padding-bottom: 11px;
        font-size: 14px;
    }

    .sidebar-accordion {
        width: auto;
    }

    .sidebar-submenu {
        padding-left: 12px;
    }

    .sidebar-user {
        margin-top: auto;
    }
}

/* ========== メインコンテンツ ========== */
.container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 24px clamp(16px, 2.8vw, 32px);
}

.container-sm {
    max-width: 420px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ========== カード ========== */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    padding: 32px;
}

/* ========== ボタン ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s, opacity 0.15s;
}

.btn:hover {
    text-decoration: none;
    opacity: 0.9;
}

.btn-primary {
    background-color: #1e3a5f;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background-color: #162d4a;
    color: #fff;
}

.btn-outline {
    background-color: transparent;
    color: #64748b;
    border: 1px solid #cbd5e1;
    padding: 6px 14px;
    font-size: 13px;
}

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

.btn-secondary {
    background-color: #fff;
    color: #1e3a5f;
    border: 1px solid #1e3a5f;
}

.btn-secondary:hover {
    background-color: #eef2f7;
    color: #1e3a5f;
}

.btn-danger-outline {
    background-color: transparent;
    color: #ef4444;
    border: 1px solid #fca5a5;
    padding: 6px 14px;
    font-size: 13px;
}

.btn-danger-outline:hover {
    background-color: #fef2f2;
}

/* ========== アラート ========== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* ========== ダッシュボード ========== */
.page-title {
    font-size: 20px;
    font-weight: bold;
    color: #1e293b;
    margin: 0 0 24px;
}

.staff-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #dbe4ee;
}

.staff-page-heading {
    min-width: 0;
}

.staff-page-eyebrow {
    margin: 0 0 8px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.staff-page-title {
    margin: 0;
    font-size: 30px;
    line-height: 1.15;
    color: #0f172a;
}

.staff-create-btn {
    width: auto;
    min-width: 168px;
    padding: 12px 18px;
    border: 1px solid #1e3a5f;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .staff-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .staff-page-title {
        font-size: 26px;
    }

    .staff-create-btn {
        width: 100%;
        min-width: 0;
    }
}

.welcome-card {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a9e 100%);
    color: #fff;
    border-radius: 8px;
    padding: 28px 32px;
    margin-bottom: 24px;
}

.welcome-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.4);
    margin-bottom: 12px;
    display: block;
}

.welcome-card h2 {
    font-size: 18px;
    font-weight: normal;
    margin: 0 0 4px;
    opacity: 0.85;
}

.welcome-card .user-name {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.welcome-card .user-email {
    font-size: 13px;
    opacity: 0.7;
    margin: 8px 0 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.info-item {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-align: center;
}

.info-item .label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.info-item .value {
    font-size: 18px;
    font-weight: bold;
    color: #1e293b;
}

/* ========== フォーム共通 ========== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* フォームのセクションカードを2カラムに並べる（PC） */
.staff-form-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
    margin-bottom: 1.25rem;
}

/* 半幅カード内ではフィールドを1カラムに（窮屈さ回避） */
.staff-form-columns .form-grid {
    grid-template-columns: 1fr;
}

@media (max-width: 900px) {
    .staff-form-columns {
        grid-template-columns: 1fr;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: .35rem;
}

.form-label.required::after {
    content: ' *';
    color: #dc2626;
}

.field-lock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    padding: 2px 7px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background-color: #eff6ff;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    vertical-align: middle;
}

/* 作業員名簿で使用する項目を示すバッジ（SSOバッジと色味を変えて区別） */
.field-roster-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    padding: 2px 7px;
    border: 1px solid #fcd34d;
    border-radius: 999px;
    background-color: #fffbeb;
    color: #b45309;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    vertical-align: middle;
}

/* 名簿バッジの凡例 */
.roster-legend {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
    padding: .55rem .9rem;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    background-color: #fffbeb;
    color: #92400e;
    font-size: .82rem;
    line-height: 1.6;
}

.form-control {
    width: 100%;
    padding: .5rem .75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .9rem;
    background: #fff;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #2f6dba;
    box-shadow: 0 0 0 3px rgba(40, 84, 127, 0.14);
}

/* 入力要素の高さを検索付きセレクト(42px)に統一。
   ただしテーブル内の小型入力(.form-control-sm)は密度優先で対象外。 */
input.form-control:not(.form-control-sm),
select.form-control:not(.form-control-sm) {
    min-height: 42px;
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .65rem center;
    background-size: 18px;
    padding-right: 2.2rem;
}

.form-control-locked,
.form-control[readonly] {
    background-color: #f8fafc;
    border-color: #dbe4ee;
    color: #64748b;
    cursor: not-allowed;
}

.form-control-locked:focus,
.form-control[readonly]:focus {
    border-color: #dbe4ee;
    box-shadow: none;
}

.form-hint {
    font-size: .78rem;
    color: #9ca3af;
    margin: .3rem 0 0;
}

/* セクション見出し直下の説明文（補足のインフォボックス） */
.form-section-note {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid #dbe7f3;
    border-radius: 8px;
    background: #f5f9fd;
    color: #44566b;
    font-size: .8rem;
    line-height: 1.7;
}

/* ラベル横の補足アイコン（ホバー/フォーカスで説明を表示） */
/* ラベルは全幅のブロックにして、後続の input を必ず下に配置する
   （inline-flex だと幅の狭い input がラベル横に並んでしまう） */
.form-label:has(.info-tip) {
    display: flex;
    align-items: center;
}

/* 必須の * をアイコンより前に表示する */
.form-label:has(.info-tip)::after {
    order: 1;
}

.info-tip {
    order: 2;
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    color: #9aa7b8;
    cursor: help;
}

.info-tip:hover,
.info-tip:focus-visible {
    color: #2f6dba;
    outline: none;
}

.info-tip-icon {
    width: 15px;
    height: 15px;
    display: block;
}

.info-tip-bubble {
    position: absolute;
    bottom: calc(100% + 9px);
    left: -8px;
    z-index: 50;
    width: max-content;
    max-width: 260px;
    padding: 8px 11px;
    background: #1f2937;
    color: #f1f5f9;
    font-size: .75rem;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
    text-align: left;
    white-space: normal;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(3px);
    transition: opacity .12s ease, transform .12s ease;
    pointer-events: none;
}

.info-tip-bubble::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 13px;
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.info-tip:hover .info-tip-bubble,
.info-tip:focus-visible .info-tip-bubble {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ========== フォームページ（登録・編集） リデザイン ========== */
.form-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 28px;
    margin-bottom: 22px;
    border-radius: 14px;
    color: #fff;
    background:
        radial-gradient(circle at 14% 18%, rgba(255,255,255,0.12) 0, rgba(255,255,255,0.12) 12%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(125,211,252,0.20) 0, rgba(125,211,252,0.20) 12%, transparent 46%),
        linear-gradient(135deg, #17314f 0%, #1f4168 50%, #28547f 100%);
    box-shadow: 0 10px 28px rgba(15, 49, 79, 0.20);
}

.form-hero-main {
    min-width: 0;
    flex: 1;
}

.form-hero-eyebrow {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(199, 222, 248, 0.85);
}

.form-hero-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.form-hero-desc {
    margin: 6px 0 0;
    font-size: .82rem;
    line-height: 1.6;
    color: rgba(226, 238, 252, 0.82);
}

/* セクションカード */
.form-section {
    background: #fff;
    border: 1px solid #e7edf4;
    border-radius: 12px;
    padding: 4px 24px 22px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* 多項目フォーム: セクションカードを横幅いっぱいに均等配置 */
/* 横幅に応じて列数が自動で決まり、カードが余白なく全幅に広がる */
.staff-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 18px;
    align-items: start;
}

.staff-form-grid .form-section {
    margin: 0;
}

@media (max-width: 420px) {
    .staff-form-grid {
        grid-template-columns: 1fr;
    }
}

/* 必須・基本ブロック（常時表示で強調） */
.form-section--primary {
    border-color: #bcd3ec;
    background: #fbfdff;
    box-shadow: 0 4px 16px rgba(31, 65, 104, 0.08);
}

/* タブ */
.form-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 18px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
    /* スクロールしてもタブが常に見えるよう上部に固定（中身はバーの下に潜る） */
    position: sticky;
    top: 0;
    z-index: 15;
}

.form-tab-btn {
    appearance: none;
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    font-size: .88rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    border-radius: 8px;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.form-tab-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.form-tab-btn:hover {
    color: #1f4168;
    background: #eef2f7;
}

.form-tab-btn.is-active {
    color: #fff;
    background: linear-gradient(135deg, #1f4168 0%, #28547f 100%);
    box-shadow: 0 2px 8px rgba(31, 65, 104, 0.30);
}

.form-tab-btn.is-active:hover {
    color: #fff;
}

.form-tab-btn .form-tab-badge {
    display: inline-block;
    margin-left: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc2626;
    vertical-align: middle;
}

.form-tab-btn.is-active .form-tab-badge {
    background: #fecaca;
}

.form-tab-panel {
    display: none;
}

.form-tab-panel.is-active {
    display: block;
}

/* 有給カード: 有給休暇の有無が「無」のとき半透明オーバーレイで設定不可を示す */
.paid-lock-wrap {
    position: relative;
}

.paid-lock-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.55);
}

.paid-lock-overlay[hidden] {
    display: none;
}

.paid-lock-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 360px;
    color: #fff;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.7;
    text-align: center;
}

.paid-lock-icon {
    width: 30px;
    height: 30px;
    opacity: .9;
}

/* 入力エラー強調 */
.form-control.is-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* トグル項目群: 整列したグリッド（ラベル左／ボタン右で各列が揃う） */
.toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 2px 28px;
}

.toggle-grid .form-group {
    margin-bottom: 0;
}

/* ブロックトグル（ラベル上・有無下）を横並びで配置するグリッド
   最小幅は最長ラベル＋バッジ（例: 中小企業退職金共済制度の有無＋名簿）が
   1行に収まる幅に設定。これ未満になると auto-fit で列数が減るため、
   ラベル／バッジが折り返して各列の高さがバラつくのを防ぐ。 */
.toggle-block-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    align-items: start;
}

.toggle-block-grid .form-group {
    margin-bottom: 0;
}

.toggle-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid #f1f5f9;
}

.toggle-field .form-label {
    margin: 0;
    white-space: nowrap;
}

.toggle-field-hint {
    flex-basis: 100%;
    margin: 0;
}

/* 有/無 セグメントトグル */
.toggle-group {
    display: inline-flex;
    min-height: 42px;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

/* ブロック表示: 他のフォーム入力（ラベル上・全幅）に揃える */
.toggle-group-block {
    display: flex;
    width: 100%;
    border-radius: 6px;
}

.toggle-group-block .toggle-option {
    flex: 1;
}

.toggle-group-block .toggle-option span {
    min-width: 0;
    width: 100%;
    padding: 0 12px;
}

.toggle-option {
    position: relative;
    display: flex;
    margin: 0;
    cursor: pointer;
}

.toggle-option input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.toggle-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 0 18px;
    text-align: center;
    font-size: .9rem;
    color: #475569;
    user-select: none;
    transition: background .12s ease, color .12s ease;
}

.toggle-option + .toggle-option span {
    border-left: 1px solid #e5e7eb;
}

.toggle-option:hover span {
    background: #f1f6fb;
}

.toggle-option input:checked + span {
    background: #1f4168;
    color: #fff;
    font-weight: 600;
}

.toggle-option input:checked:hover + span {
    background: #1b3a5c;
}

.toggle-option input:focus-visible + span {
    box-shadow: inset 0 0 0 2px rgba(40, 84, 127, 0.45);
}

/* 検索付き単一セレクト */
.search-select {
    position: relative;
}

.search-select-control {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 42px;
    padding: .5rem .75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: .9rem;
    color: #1e293b;
    text-align: left;
    cursor: pointer;
}

.search-select.is-open .search-select-control,
.search-select-control:focus {
    outline: none;
    border-color: #2f6dba;
    box-shadow: 0 0 0 3px rgba(40, 84, 127, 0.14);
}

.search-select.is-invalid-wrap .search-select-control {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* 無効状態（選択肢が無いとき等） */
.search-select.is-disabled .search-select-control {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}
.search-select.is-disabled .search-select-caret {
    opacity: .4;
}

.search-select-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-select-value.is-placeholder {
    color: #9ca3af;
}

.search-select-clear {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #94a3b8;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.search-select-clear[hidden] {
    display: none;
}

.search-select-clear:hover {
    background: #eef2f7;
    color: #475569;
}

.search-select-caret {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-right: 1.6px solid #64748b;
    border-bottom: 1.6px solid #64748b;
    transform: rotate(45deg);
    margin-top: -3px;
}

.search-select-dropdown {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.search-select-search {
    width: 100%;
    border: none;
    border-bottom: 1px solid #eef2f7;
    padding: 10px 12px;
    font-size: .9rem;
    outline: none;
}

.search-select-options {
    max-height: 240px;
    overflow-y: auto;
}

.search-select-option {
    padding: 9px 12px;
    font-size: .9rem;
    color: #1e293b;
    cursor: pointer;
}

.search-select-option:hover,
.search-select-option.is-active {
    background: #f1f6fb;
}

.search-select-empty {
    padding: 10px 12px;
    font-size: .85rem;
    color: #9ca3af;
}

/* 検索付きマルチセレクト */
.multiselect {
    position: relative;
}

.multiselect-control {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 6px 8px 6px 34px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: #fff;
    /* 左に検索アイコン（カードと区別しやすく） */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 9px center;
    background-size: 16px;
    cursor: text;
}

.multiselect-control:focus-within {
    border-color: #2f6dba;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(40, 84, 127, 0.14);
}

.multiselect.is-invalid-wrap .multiselect-control {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.multiselect-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.multiselect-tags:empty {
    display: none;
}

.multiselect-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px 3px 10px;
    background: #eaf2fb;
    color: #1f4168;
    border: 1px solid #cfe0f3;
    border-radius: 999px;
    font-size: .82rem;
    line-height: 1.4;
}

.multiselect-tag button {
    appearance: none;
    border: none;
    background: transparent;
    color: #1f4168;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
    border-radius: 50%;
}

.multiselect-tag button:hover {
    background: rgba(31, 65, 104, 0.14);
}

.multiselect-search {
    flex: 1;
    min-width: 140px;
    border: none;
    outline: none;
    padding: 4px;
    font-size: .9rem;
    background: transparent;
}

.multiselect-dropdown {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.15);
}

.multiselect-option {
    padding: 11px 14px;
    font-size: .9rem;
    color: #1e293b;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.12s ease;
}

.multiselect-option:last-child {
    border-bottom: none;
}

.multiselect-option:hover {
    background: #e7eef7;
}

.multiselect-option.is-active {
    background: #dbeafe;
    font-weight: 500;
}

.multiselect-empty {
    padding: 14px 14px;
    font-size: .85rem;
    color: #9ca3af;
    text-align: center;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 20px;
    padding: 16px 0 14px;
    font-size: .92rem;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 1px solid #eef2f7;
}

.form-section-title::before {
    content: "";
    width: 4px;
    height: 16px;
    border-radius: 99px;
    background: linear-gradient(180deg, #1f4168, #28547f);
}

/* フィールドを2カラムで配置（レスポンシブ） */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 20px;
}

.form-row.is-single {
    grid-template-columns: 1fr;
}

/* form-rowで片方を指定したpxで表示するclass */
/* --short-col でカラム幅を上書き可能（例: style="--short-col: 120px;"） */
.form-row-short {
    --short-col: 100px;
    grid-template-columns: 1fr var(--short-col);
}
@media (max-width: 1200px) {
    .form-row-short {
        grid-template-columns: 1fr;
    }
}

.form-row .form-group {
    margin-bottom: 1rem;
}

.mb-0 {
    margin-bottom: 0 !important;
}

/* 調整給グループ（旧家族手当＋営業手当＋給与調整＝調整給 を1まとまりで示す） */
.adjustment-box {
    border: 1px solid #d8e0ea;
    border-radius: 10px;
    padding: 12px 14px 14px;
    margin-bottom: 1rem;
    background: #f7fafc;
}
.adjustment-box-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    font-size: .85rem;
    font-weight: 700;
    color: #1f4168;
}
.adjustment-box-note {
    font-size: .72rem;
    font-weight: 400;
    color: #94a3b8;
}

/* 画像アップロード（ドラッグ＆ドロップ / クリック選択） */
.image-upload {
    width: 100%;
}

.image-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 160px;
    padding: 20px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    text-align: center;
    color: #64748b;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.image-upload-zone:hover,
.image-upload-zone:focus-visible {
    border-color: #2f6dba;
    background: #f1f6fb;
    outline: none;
}

.image-upload-zone.is-dragover {
    border-color: #2f6dba;
    background: #e6f0fb;
}

.image-upload-icon {
    width: 34px;
    height: 34px;
    color: #94a3b8;
}

.image-upload-zone p {
    margin: 0;
    font-size: .85rem;
    line-height: 1.6;
}

.image-upload-link {
    color: #2f6dba;
    font-weight: 600;
    text-decoration: underline;
}

.image-upload-formats {
    font-size: .75rem !important;
    color: #9ca3af;
}

.image-upload-preview {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* hidden 属性を display:flex より優先させる */
.image-upload-preview[hidden] {
    display: none;
}

.image-upload-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    object-fit: contain;
}

.image-upload-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.image-upload-clear {
    background: none;
    border: none;
    padding: 0;
    color: #2f6dba;
    font-size: .8rem;
    text-decoration: underline;
    cursor: pointer;
}

.image-upload-remove {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: #475569;
    cursor: pointer;
}

/* チェックボックスチップ（特記事項など、固定リストの複数選択） */
.check-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.check-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: .85rem;
    color: #334155;
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease;
}

.check-chip:hover {
    border-color: #94a3b8;
}

.check-chip input {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    accent-color: #1f4168;
    cursor: pointer;
}

.check-chip:has(input:checked) {
    border-color: #2f6dba;
    background: #f1f6fb;
    color: #1f4168;
    font-weight: 600;
}

.check-chip.is-disabled {
    opacity: .5;
    cursor: not-allowed;
}

.check-chip.is-disabled input {
    cursor: not-allowed;
}

/* 指定部署カード（権限が「指定部署」系のとき表示・必須）
   基本情報ブロック（背景 #fbfdff）の上に置くため、白背景で浮き立たせる */
.auth-dept-card {
    border: 1px solid #cbdcee;
    border-radius: 10px;
    padding: 14px 16px 16px;
    margin-bottom: 1rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(31, 65, 104, 0.05);
}

.auth-dept-card.is-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* 扶養情報ブロック（扶養人数に応じて生成） */
.dependent-block {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px 16px;
    margin-top: 12px;
    background: #fbfdff;
}

.dependent-block-title {
    display: inline-flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 3px 12px;
    border-radius: 99px;
    background: #1f4168;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
}

/* 日付など、分割入力のインライン行 */
.field-inline {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.field-inline .field-unit {
    color: #6b7280;
    font-size: .85rem;
}

/* 分割番号入力（記号-番号 / 4桁-6桁-1桁 など）。
   狭い幅でも潰れすぎないよう最小幅を確保し、桁数が少ない欄でも数字を表示できるよう
   左右パディングを抑えて中央寄せにする。入りきらない場合は field-inline で折り返す。 */
.field-inline .join-part {
    min-width: 2.6em;
    padding-left: .4rem;
    padding-right: .4rem;
    text-align: center;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-hero {
        padding: 18px 20px;
    }
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.form-actions .btn {
    white-space: nowrap;
}

.form-actions-cancel {
    flex: 0 0 auto;
}

.form-actions-submit {
    width: auto;
    min-width: 160px;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex: 0 0 auto;
}

@media (max-width: 720px) {
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions-cancel,
    .form-actions-submit {
        width: 100%;
        justify-content: center;
    }
}

/* ========== フォーム固定フッターバー（従業員登録・編集） ========== */
.form-footer-bar {
    position: fixed;
    left: 260px;
    right: 0;
    bottom: 0;
    z-index: 30;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.08);
    padding: 14px clamp(16px, 2.8vw, 32px);
    transition: left .22s ease, padding .22s ease;
}

/* サイドバー非表示時: 左端まで広げ、本文の左右余白に揃える */
html.sidebar-collapsed .form-footer-bar {
    left: 0;
    padding-left: calc(28px + clamp(16px, 2.8vw, 32px));
    padding-right: calc(28px + clamp(16px, 2.8vw, 32px));
}

.form-footer-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* 固定フッターに隠れないよう、フォームページの下部に余白を確保 */
.has-form-footer {
    padding-bottom: 96px;
}

@media (max-width: 960px) {
    .form-footer-bar {
        left: 0;
    }
}

@media (max-width: 720px) {
    .form-footer-bar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .form-footer-bar-inner .form-actions-cancel,
    .form-footer-bar-inner .form-actions-submit {
        width: 100%;
        justify-content: center;
    }

    .has-form-footer {
        padding-bottom: 140px;
    }
}

/* ========== バッジ ========== */
.badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-green {
    background: #d1fae5;
    color: #065f46;
}

.badge-gray {
    background: #f3f4f6;
    color: #6b7280;
}

.badge-red {
    background: #fee2e2;
    color: #991b1b;
}

.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

/* ========== フィルター ========== */
.filter-label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: .3rem;
}

.filter-input {
    padding: .45rem .75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .875rem;
    width: 100%;
}

.filter-select {
    padding: .45rem .75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .875rem;
    background: #fff;
    max-width: 100%;
    text-overflow: ellipsis;
}

/* ========== 従業員テーブル ========== */
.staff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.staff-table th {
    padding: .6rem 1rem;
    text-align: left;
    font-size: .78rem;
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.staff-table td {
    padding: .7rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

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

/* 選択可能行 */
.staff-table tr.selectable {
    cursor: pointer;
}

.staff-table tr.row-selected td {
    background: #eff6ff;
}

.staff-table tr.selectable:hover td {
    background: #f0f9ff;
}

/* カスタムチェックボックス */
.row-check,
#check-all {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    position: relative;
    flex-shrink: 0;
    transition: border-color .15s, background .15s;
}

.row-check:hover,
#check-all:hover {
    border-color: #6366f1;
}

.row-check:checked,
#check-all:checked {
    background: #6366f1;
    border-color: #6366f1;
}

.row-check:indeterminate,
#check-all:indeterminate {
    background: #a5b4fc;
    border-color: #6366f1;
}

.row-check:checked::after,
#check-all:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

#check-all:indeterminate::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 6px;
    width: 8px;
    height: 2px;
    background: #fff;
}

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

.row-retired td {
    color: #9ca3af;
}

.staff-name-link {
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
}

.staff-name-link:hover {
    color: #3b82f6;
    text-decoration: underline;
}

/* ========== 従業員一覧（リデザイン） ========== */
/* ヒーロー右側のアクションボタン（白ベース） */
.hero-action {
    flex: 0 0 auto;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 18px;
    border-radius: 999px;
    background: #fff;
    color: #1f4168;
    border: 1px solid #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .02em;
    white-space: nowrap;
    text-decoration: none;
}

.hero-action:hover {
    background: #eaf2fb;
    color: #17314f;
    text-decoration: none;
}

/* 副次アクション（白パネル上では枠線ボタン） */
.hero-action--ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
}
.hero-action--ghost:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

/* 白パネル（フィルター・テーブルの土台） */
.list-panel {
    background: #fff;
    border: 1px solid #e7edf4;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.list-panel + .list-panel {
    margin-top: 16px;
}

.list-toolbar {
    padding: 16px 18px;
}

.list-count {
    padding: .72rem 1.1rem;
    border-bottom: 1px solid #eef2f7;
    font-size: .82rem;
    color: #64748b;
}

/* フィルター入力のフォーカス／セレクト矢印 */
.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #2f6dba;
    box-shadow: 0 0 0 3px rgba(40, 84, 127, 0.14);
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .55rem center;
    background-size: 16px;
    padding-right: 2rem;
}

/* 人物セル（アバター＋氏名＋フリガナ） */
.list-person {
    display: flex;
    align-items: center;
    gap: 11px;
}

.list-avatar {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #1f4168;
    background: #e7eef7;
    border: 1px solid #d7e3f0;
    overflow: hidden;
}

.list-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-person-name {
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
}

.list-person-name:hover {
    color: #2f6dba;
    text-decoration: underline;
}

.list-person-kana {
    margin-top: 1px;
    font-size: .74rem;
    color: #94a3b8;
}

.row-retired .list-avatar {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
}

/* 権限バッジ配色 */
.badge-auth-1 { background: #f1f5f9; color: #475569; }
.badge-auth-2 { background: #dbeafe; color: #1e40af; }
.badge-auth-4 { background: #e0e7ff; color: #3730a3; }
.badge-auth-3 { background: #ccfbf1; color: #115e59; }
.badge-auth-5 { background: #ffedd5; color: #9a3412; }
.badge-auth-99 { background: #fef3c7; color: #92400e; }

/* ========== 詳細画面 ========== */
.section-title {
    font-size: .9rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 1rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid #e5e7eb;
}

.info-dl {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: .5rem .75rem;
    margin: 0;
    font-size: .875rem;
}

.info-dl dt {
    color: #6b7280;
    font-weight: 500;
    padding-top: .1rem;
}

.info-dl dd {
    margin: 0;
    color: #1e293b;
    word-break: break-all;
}

/* ========== 従業員詳細（リデザイン） ========== */
.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    color: #64748b;
    margin-bottom: 16px;
}

.detail-back:hover {
    color: #1f4168;
}

/* ヒーロー */
.detail-hero {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 26px 30px;
    border-radius: 14px;
    color: #fff;
    background:
        radial-gradient(circle at 14% 18%, rgba(255,255,255,0.12) 0, rgba(255,255,255,0.12) 12%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(125,211,252,0.20) 0, rgba(125,211,252,0.20) 12%, transparent 46%),
        linear-gradient(135deg, #17314f 0%, #1f4168 50%, #28547f 100%);
    box-shadow: 0 10px 28px rgba(15, 49, 79, 0.22);
}

.detail-avatar {
    flex: 0 0 auto;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .02em;
    background: rgba(255,255,255,0.16);
    border: 2px solid rgba(255,255,255,0.30);
}

.detail-hero-main {
    min-width: 0;
    flex: 1;
}

.detail-hero-kana {
    margin: 0 0 4px;
    font-size: .8rem;
    letter-spacing: .04em;
    color: rgba(226, 238, 252, 0.85);
}

.detail-hero-name {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}

.detail-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-hero .badge {
    background: rgba(255,255,255,0.16);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.28);
}

.detail-hero .badge.badge-on-green { background: rgba(52, 211, 153, 0.30); border-color: rgba(110, 231, 183, 0.55); }
.detail-hero .badge.badge-on-red   { background: rgba(248, 113, 113, 0.30); border-color: rgba(252, 165, 165, 0.55); }

/* クイックステータス */
.detail-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 18px 0 22px;
}

.detail-stat {
    background: #fff;
    border: 1px solid #e7edf4;
    border-radius: 10px;
    padding: 14px 16px;
}

.detail-stat-label {
    margin: 0 0 6px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: #94a3b8;
    text-transform: uppercase;
}

.detail-stat-value {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    word-break: break-all;
}

.detail-stat-value.is-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .04em;
}

/* 情報カードグリッド */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

/* 任意適用モディファイア（detail-statsを置かない詳細画面向け）
   --spaced: ヒーロー下に余白を付ける / --equal: 同じ行のカード高さを揃える */
.detail-hero--spaced { margin-bottom: 20px; }
.detail-grid.detail-grid--equal { align-items: stretch; }

.detail-card {
    background: #fff;
    border: 1px solid #e7edf4;
    border-radius: 12px;
    padding: 0 22px 6px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.detail-card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 16px 0 14px;
    font-size: .9rem;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 1px solid #eef2f7;
}

.detail-card-title::before {
    content: "";
    width: 4px;
    height: 16px;
    border-radius: 99px;
    background: linear-gradient(180deg, #1f4168, #28547f);
}

.detail-card.is-warn .detail-card-title::before {
    background: linear-gradient(180deg, #b91c1c, #ef4444);
}

/* 項目はラベル上・値下のタイルを複数列で配置（固定ラベル幅をやめ、長い日本語でも折り返さない） */
.detail-dl {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 2px 20px;
    margin: 0;
    padding: 12px 0 16px;
}

.detail-dl > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 2px;
    min-width: 0;
    border-bottom: 1px solid #f1f5f9;
}

/* タグ・備考など内容が広い項目は全幅で表示 */
.detail-dl > div:has(.detail-tags),
.detail-dl > div:has(dd[style*="pre-wrap"]) {
    grid-column: 1 / -1;
}

.detail-dl dt {
    margin: 0;
    color: #94a3b8;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .03em;
}

.detail-dl dd {
    margin: 0;
    color: #1e293b;
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.45;
    word-break: break-all;
}

/* 詳細: タグ・テーブル・小見出し */
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eef2f7;
    color: #334155;
    font-size: .8rem;
    white-space: nowrap;
}
.detail-subtitle {
    margin: 14px 0 8px;
    font-size: .82rem;
    font-weight: 700;
    color: #475569;
}
.detail-table-wrap { overflow-x: auto; }
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.detail-table th,
.detail-table td {
    padding: 7px 10px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}
.detail-table th {
    color: #748196;
    font-weight: 600;
    font-size: .78rem;
    background: #f9fafb;
}
.detail-table td { color: #1e293b; }
.detail-empty { margin: 0; color: #9ca3af; font-size: .85rem; }

@media (max-width: 900px) {
    .detail-stats { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .detail-hero { flex-direction: column; text-align: center; }
    .detail-hero-badges { justify-content: center; }
    .detail-stats { grid-template-columns: 1fr; }
    .detail-dl > div { grid-template-columns: 1fr; gap: 2px; }
}

/* ========== ページネーション ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #475569;
    background: #fff;
    text-decoration: none;
    transition: background-color .15s, border-color .15s, color .15s;
}

.pagination-link:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    text-decoration: none;
}

.pagination-link.is-active {
    background: #1e3a5f;
    border-color: #1e3a5f;
    color: #fff;
    font-weight: 600;
}

.pagination-link.is-disabled {
    color: #cbd5e1;
    background: #f8fafc;
    cursor: default;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: #94a3b8;
    font-size: 13px;
}

/* ========== 休日設定カレンダー ========== */
.holiday-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem;
}

.holiday-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.palette-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    font-size: .85rem;
    color: #334155;
    cursor: pointer;
    user-select: none;
    transition: border-color .12s, box-shadow .12s, background .12s;
}

.palette-chip:hover {
    background: #f8fafc;
}

.palette-chip .swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex: 0 0 auto;
}

.palette-chip.is-active {
    border-color: #1f4168;
    box-shadow: 0 0 0 3px rgba(31, 65, 104, 0.12);
    font-weight: 600;
}

.palette-chip.palette-erase .swatch {
    background: repeating-linear-gradient(45deg, #e5e7eb, #e5e7eb 3px, #fff 3px, #fff 6px);
}

/* カレンダー全体（PCは大きめに表示） */
.holiday-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.cal-month {
    border: 1px solid #e7edf4;
    border-radius: 12px;
    padding: 14px 16px 16px;
    background: #fff;
}

.cal-month-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-wd {
    text-align: center;
    font-size: .76rem;
    font-weight: 600;
    color: #94a3b8;
    padding-bottom: 3px;
}

.cal-wd.is-sun { color: #dc2626; }
.cal-wd.is-sat { color: #2563eb; }

.cal-cell {
    position: relative;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1px;
    padding-top: 4px;
    border-radius: 7px;
    border: 1px solid transparent;
    cursor: pointer;
    background: #f8fafc;
    transition: background .1s, border-color .1s;
}

.cal-cell.is-empty {
    background: transparent;
    cursor: default;
}

.cal-cell:not(.is-empty):hover {
    border-color: #1f4168;
}

.cal-day {
    font-size: .9rem;
    line-height: 1.1;
    color: #475569;
}

.cal-day.is-sun { color: #dc2626; }
.cal-day.is-sat { color: #2563eb; }

.cal-mark {
    font-size: .68rem;
    line-height: 1.1;
    font-weight: 700;
    color: #fff;
    padding: 1px 4px;
    border-radius: 3px;
}

/* 祝日マーカー（区分設定の有無に関わらず表示） */
.cal-cell.is-holiday::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #dc2626;
}

.cal-cell.is-holiday.has-kind::after {
    background: #fff;
}

.cal-cell.is-holiday:not(.has-kind) .cal-day {
    color: #dc2626;
    font-weight: 700;
}

.cal-holiday {
    font-size: .6rem;
    line-height: 1.05;
    color: #dc2626;
    text-align: center;
    padding: 0 2px;
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 区分が設定されたセル: data-kind に応じて JS が色を付与 */
.cal-cell.has-kind {
    color: #fff;
}

.cal-cell.has-kind .cal-day {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
}

/* 区分設定時は祝日名テキストを隠す（色付き背景で読めないため。赤丸は維持） */
.cal-cell.has-kind .cal-holiday {
    display: none;
}

/* ========== マスタ エクスポート/インポート ========== */
.master-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.master-io-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}

.master-io-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    text-decoration: none;
}


/* ===== 役職履歴・職務経歴テーブル ===== */
.history-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.history-section-header .form-section-title {
    margin-bottom: 0;
}

.history-table-wrap {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.history-table th,
.history-table td {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    vertical-align: middle;
    white-space: nowrap;
}

.history-table thead th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
}

.history-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.history-table tbody tr:hover {
    background: #f1f5f9;
}

.history-table td:first-child {
    min-width: 160px;
    white-space: normal;
}

.history-table td:last-child {
    width: 56px;
    text-align: center;
}

.field-inline--compact {
    gap: 4px;
}

.field-inline--compact .field-unit {
    font-size: 13px;
}

/* ===== 給与マスタ 一括グリッド ===== */
.salary-grid {
    min-width: 600px;
}

.salary-grid th,
.salary-grid td {
    padding: .35rem .5rem;
}

.salary-grid th .req {
    color: #dc2626;
    margin-left: 2px;
}

.salary-grid .col-no {
    width: 44px;
    text-align: center;
    color: #94a3b8;
    font-size: .8rem;
    white-space: nowrap;
}

.salary-grid .col-kbn { width: 240px; }
.salary-grid .col-grade,
.salary-grid .col-issue { width: 80px; }
.salary-grid .col-money { width: 130px; text-align: right; }
.salary-grid .col-op { width: 156px; text-align: center; white-space: nowrap; }
.salary-grid .col-op .cell-del-btn + .cell-del-btn { margin-left: 6px; }

/* 閲覧行のセル（読み取り専用表示） */
.salary-grid .view-cell {
    padding: 10px 10px;
    color: #1f2937;
    font-size: .9rem;
    white-space: nowrap;
}
.salary-grid .view-cell.cell-center { text-align: center; }
.salary-grid .view-cell.cell-money-text { text-align: right; font-variant-numeric: tabular-nums; }
.salary-view-row:hover td { background: #f8fafc; }

/* グリッド内の入力欄（通常フォームより低い高さでコンパクトに） */
.cell-input {
    width: 100%;
    min-height: 34px;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .85rem;
    background: #fff;
    color: #1f2937;
}

.cell-input:focus {
    outline: none;
    border-color: #285480;
    box-shadow: 0 0 0 2px rgba(40, 84, 127, 0.15);
}

.cell-input:disabled {
    background: #f3f4f6;
    color: #9ca3af;
}

.cell-input.cell-center { text-align: center; }
.cell-input.cell-money  { text-align: right; }

.cell-input.is-invalid {
    border-color: #dc2626;
    background: #fef2f2;
}

.cell-del-btn {
    width: auto;
    padding: .3rem .6rem;
    font-size: .78rem;
    white-space: nowrap;
}

/* 削除予定の既存行 */
.salary-grid tr.row-deleting td {
    background: #fff5f5;
}

.salary-grid tr.row-deleting .cell-input {
    text-decoration: line-through;
}

/* 保存バー */
.salary-savebar {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: 14px 0 4px;
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, rgba(247, 249, 252, 0), #f7f9fc 40%);
    z-index: 20;
}

/* ===== 保険料マスタ 一括グリッド（列数が多いので独自幅） ===== */
.insurance-grid {
    min-width: 1280px;
}

/* グループ見出し（報酬月額／健康保険料 など）と小見出し（以上・未満・全額・折半額） */
.insurance-grid thead th {
    text-align: center;
    font-size: .8rem;
    line-height: 1.3;
    white-space: nowrap;
}

/* 2行ヘッダの固定: 1行目は top:0、2行目は1行目の高さ分だけ下げて重なりを防ぐ
   （2行目の top は JS が実測してセットする。未計算時の暫定値を変数で持つ） */
.insurance-grid thead tr:first-child th { top: 0; }
.insurance-grid thead tr:last-child th { top: var(--ins-head-h, 56px); }

/* ヘッダ内の料率編集（健康保険料率・支援金率・厚生年金保険料率） */
.insurance-grid .rate-field {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-top: 4px;
}
.insurance-grid .rate-input {
    width: 56px;
    box-sizing: border-box;
    padding: 2px 4px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: .78rem;
    text-align: right;
    background: #fff;
    color: #1f2937;
    font-variant-numeric: tabular-nums;
}
.insurance-grid .rate-input:focus {
    outline: none;
    border-color: #285480;
    box-shadow: 0 0 0 2px rgba(40, 84, 127, 0.15);
}
.insurance-grid .rate-input.is-invalid {
    border-color: #dc2626;
    background: #fef2f2;
}
.insurance-grid .rate-unit {
    font-size: .72rem;
    font-weight: 400;
    color: #64748b;
}
.insurance-grid thead th small {
    display: block;
    font-weight: 400;
    font-size: .68rem;
    color: #64748b;
}

.insurance-grid .col-grade { width: 64px; }
.insurance-grid td.col-grade { white-space: nowrap; }
.insurance-grid .col-op { width: 156px; }

/* 数値セルは右寄せ・等幅。入力欄も含めコンパクトに */
.insurance-grid .view-cell { padding: 8px 10px; font-size: .85rem; }
.insurance-grid .cell-input { font-size: .82rem; padding: 6px 6px; }
.insurance-grid .cell-input.cell-money { min-width: 80px; }

/* ===== 賞与所得税マスタ 一括グリッド（3段ヘッダ・列数が多い） ===== */
.bonus-tax-grid {
    /* 横スクロールを抑えるため内容ぴったりの幅に（width:100% で引き伸ばさない）。
       各セルもコンパクトにして全体幅を最小化する。 */
    width: auto;
    min-width: 0;
    /* collapse だと border がテーブル側レイヤーに描画され、sticky ヘッダーの
       スクロール時に border が取り残されて白く見える。separate にして各セルが
       自前の border を持つことで sticky に追従させる。 */
    border-collapse: separate;
    border-spacing: 0;
}

/* セルの余白（横スクロールは許容しつつ、詰めすぎない程よい余白に） */
.bonus-tax-grid th,
.bonus-tax-grid td {
    padding: 6px 10px;
}

.bonus-tax-grid thead th {
    text-align: center;
    font-size: .78rem;
    line-height: 1.25;
    white-space: nowrap;
    /* separate では隣接セルの border が重ならないため、各セルに下線・左線を
       引いて 3 段ヘッダーの枠を保つ（sticky に追従する）。 */
    border-bottom: 1px solid #e5e7eb;
    border-left: 1px solid #eef2f6;
}

/* 本文セルも separate 用に下線を持たせる（collapse 時と同じ見た目に） */
.bonus-tax-grid tbody td {
    border-bottom: 1px solid #f3f4f6;
}

/* 3段ヘッダの固定: 各行を前段までの高さ分だけ下げて重なりを防ぐ
   （各段の高さは JS が実測して変数にセット。未計算時の暫定値を持つ） */
.bonus-tax-grid thead tr:nth-child(1) th { top: 0; }
.bonus-tax-grid thead tr:nth-child(2) th { top: var(--bt-head-h1, 28px); }
.bonus-tax-grid thead tr:nth-child(3) th {
    top: calc(var(--bt-head-h1, 28px) + var(--bt-head-h2, 24px));
}

.bonus-tax-grid .col-no { width: 34px; }
.bonus-tax-grid .col-rate { width: 60px; }
.bonus-tax-grid td.col-rate { white-space: nowrap; }
/* 操作は「編集／取消」1ボタンのみなので最小幅に */
.bonus-tax-grid .col-op { width: 1%; white-space: nowrap; text-align: center; }
.bonus-tax-grid .col-op .cell-del-btn { padding: .3rem .6rem; font-size: .78rem; }

/* 数値セル・入力欄（横スクロール許容のため詰めすぎない） */
.bonus-tax-grid .view-cell { padding: 7px 10px; font-size: .82rem; }
.bonus-tax-grid .cell-input { min-height: 32px; font-size: .8rem; padding: 5px 7px; }
.bonus-tax-grid .cell-input.cell-money { min-width: 0; }

/* ========== 汎用モーダル ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1000;
}
/* display:flex を上書きして確実に隠す */
.modal-overlay[hidden] { display: none; }

.modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3);
    width: 100%;
    max-width: 760px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e7edf4;
}

.modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.modal-close {
    appearance: none;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 .25rem;
}
.modal-close:hover { color: #475569; }

.modal-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
}

.modal-body .modal-row:hover td { background: #f8fafc; }

/* 従事者数バッジ（クリックでモーダルを開く） */
.staff-count-badge {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .7rem;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font: inherit;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.staff-count-badge:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.18);
}
.staff-count-badge:active { transform: translateY(1px); }
.staff-count-badge:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }

.staff-count-icon { width: 15px; height: 15px; flex-shrink: 0; }
.staff-count-num { font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; }
.staff-count-unit { font-weight: 500; font-size: .75rem; opacity: .85; margin-left: 1px; }

/* 従事者0名（クリック不可・抑えた配色） */
.staff-count-badge.is-empty {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #94a3b8;
    cursor: default;
}
.staff-count-badge.is-empty:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
    box-shadow: none;
}

/* ===== 作業員名簿 編集: 上=基本情報/会社情報/日付(横3列) → 区切り → 作業員、操作は固定フッター ===== */
.wl-header-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: stretch; /* 同じ行のカード高さを揃える */
}
@media (min-width: 992px) {
    .wl-header-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.wl-header-grid > .form-section {
    margin-bottom: 0;
    height: 100%; /* グリッドセルいっぱいに広げて3枚の高さを揃える */
}
.wl-edit-divider {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 22px 0;
}

/* ===== 作業員名簿 作業員選択UI ===== */
.wl-source-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}
.wl-source-tab {
    appearance: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 9px 18px;
    font-size: .9rem;
    font-weight: 600;
    color: #64748b;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .12s ease, border-color .12s ease;
}
.wl-source-tab:hover { color: #1f4168; }
.wl-source-tab.is-active { color: #1f4168; border-bottom-color: #2f6dba; }

.wl-source-panel { display: none; }
.wl-source-panel.is-active { display: block; }

.wl-picker-filters {
    display: flex;
    gap: .75rem;
    margin-bottom: .7rem;
    flex-wrap: wrap;
    align-items: flex-end;
}
.wl-picker-filters > .form-group {
    flex: 1 1 220px;
    min-width: 200px;
    margin-bottom: 0;
}

.wl-person-list {
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}
.wl-person {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background .12s ease;
}
.wl-person:last-child { border-bottom: none; }
.wl-person:hover { background: #f8fafc; }
.wl-person input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: #1f4168; cursor: pointer; }
.wl-person:has(input:checked) { background: #f1f6fb; }
.wl-person.is-added { opacity: .55; cursor: not-allowed; }
.wl-person.is-added:hover { background: #fff; }
.wl-person-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.wl-person-name { font-size: .9rem; font-weight: 600; color: #1f2937; }
.wl-person-kana { font-size: .72rem; color: #94a3b8; }
.wl-person-context { font-size: .75rem; color: #64748b; white-space: nowrap; text-align: right; }
.wl-person-empty { text-align: center; padding: 1.5rem; color: #9ca3af; font-size: .85rem; margin: 0; }

.wl-selected-note { margin: 12px 2px 0; font-size: .82rem; color: #94a3b8; }
.wl-selected-note.is-selected { color: #1f4168; font-weight: 600; }

.wl-check-scroll { max-height: 230px; overflow-y: auto; padding: 2px; }

.wl-person-fixed { display: flex; align-items: center; gap: 10px; }
.wl-badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    background: #eef2f7;
    color: #475569;
    white-space: nowrap;
}
.wl-badge-staff { background: #eaf2fb; color: #1f4168; }
.wl-badge-subcontractor { background: #fdf2e9; color: #9a5b1e; }

/* ===== 従事者名簿 ランディング ===== */
.roster-sheet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
}
.roster-sheet-option {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .85rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.roster-sheet-option:hover { border-color: #cbd5e1; }
.roster-sheet-option:has(input:checked) {
    border-color: #93c5fd;
    background: #eff6ff;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.12);
}
.roster-sheet-option input { margin-top: .2rem; flex-shrink: 0; }
.roster-sheet-name { display: block; font-weight: 700; color: #1e293b; font-size: .9rem; }
.roster-sheet-desc { display: block; font-size: .76rem; color: #64748b; margin-top: .15rem; }
.roster-hint { font-size: .78rem; color: #94a3b8; }
.roster-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.roster-links a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem .9rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #1f4168;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease;
}
.roster-links a:hover { background: #eaf2fb; border-color: #cbd5e1; }

/* ===== 一覧テーブルの列ソート ===== */
.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    position: relative;
}
.sortable-th:hover { color: #1f4168; }
/* 既定の上下矢印（淡色） */
.sortable-th::after {
    content: "⇅";
    margin-left: .35em;
    font-size: .8em;
    color: #cbd5e1;
}
/* 昇順／降順時の矢印（強調） */
.sortable-th[data-sort-dir="asc"]::after  { content: "▲"; color: #2563eb; }
.sortable-th[data-sort-dir="desc"]::after { content: "▼"; color: #2563eb; }

/* ===== 詳細画面: 左ナビ＋本文（アンカー） ===== */
.detail-layout {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    margin-top: 18px;
}
.detail-nav {
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding-right: 2px;
}
.detail-nav-link {
    display: block;
    padding: .5rem .75rem;
    border-radius: 8px;
    border-left: 3px solid transparent;
    color: #475569;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.detail-nav-link:hover { background: #f1f5f9; color: #1f4168; text-decoration: none; }
.detail-nav-link.is-active {
    background: #eaf2fb;
    color: #17314f;
    border-left-color: #2563eb;
}
.detail-content { min-width: 0; }
.detail-section { scroll-margin-top: 16px; }
.detail-section + .detail-section { margin-top: 18px; }
.detail-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    align-items: start;
}

/* 狭い画面: ナビを本文上部の横スクロールに切替 */
@media (max-width: 860px) {
    .detail-layout { grid-template-columns: 1fr; }
    .detail-nav {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        max-height: none;
        gap: 6px;
        padding-bottom: 6px;
    }
    .detail-nav-link { border-left: none; border-bottom: 3px solid transparent; }
    .detail-nav-link.is-active { border-left: none; border-bottom-color: #2563eb; }
}

/* ===== 従業員詳細: フラットなシート型（カードの箱を廃止・.detail-content 限定） ===== */
.detail-content {
    background: #fff;
    border: 1px solid #e7edf4;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    padding: 2px 30px;
    margin-top: 22px;
}
/* セクションは横罫線で区切る */
.detail-content .detail-section { padding: 22px 0; }
.detail-content .detail-section + .detail-section { border-top: 1px solid #eef2f7; }
/* 箱をやめてフラットに（同一セクション内の小グループは横並びのまま） */
.detail-content .detail-section-grid { gap: 8px 36px; }
.detail-content .detail-card {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}
/* 見出し: アイコン付き＋淡色チップ */
.detail-content .detail-card-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    border-radius: 9px;
    padding: 7px 18px 7px 14px;
    margin-bottom: 14px;
    background: #eaf2fb;
    color: #1f4168;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .04em;
}
.detail-content .detail-card-title::before { content: none; }   /* アクセントバー除去 */
.detail-content .detail-card.is-warn .detail-card-title {
    background: #fdecec;
    color: #b91c1c;
}
.detail-card-icon { width: 18px; height: 18px; flex-shrink: 0; }
/* タイルの行罫線を消してすっきり */
.detail-content .detail-dl > div { border-bottom: none; padding: 7px 0; }
.detail-content .detail-dl { padding: 8px 0 4px; }

/* ===== 詳細ページ: カード型（従業員・外注先従事者で共用。余白多め・マルチカラムでバランス配置） ===== */
.detail-sheet { margin-top: 24px; }

/* 2カラムをバランスよく詰める（高さ違いのカードでも隙間が出にくい） */
.detail-cards { column-count: 2; column-gap: 22px; }
.detail-cards .scard { break-inside: avoid; margin: 0 0 22px; }
/* 全幅カード（テーブル・登録情報など）はカラムコンテナの外に置く */
.detail-sheet .scard.is-wide { margin: 0 0 22px; }
.detail-sheet .scard.is-wide:last-child { margin-bottom: 0; }

.scard {
    background: #fff;
    border: 1px solid #edf1f6;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 26px rgba(15, 23, 42, .045);
    padding: 18px 22px 14px;
}

/* 警告カード（退職・死亡など）は赤系のアクセント */
.scard.is-warn { border-color: #f5d9d9; }
.scard.is-warn .scard-ico { background: linear-gradient(135deg, #fdecec 0%, #fbdcdc 100%); color: #b91c1c; }
.scard.is-warn .scard-title { color: #b91c1c; }

/* 見出し: 角丸タイルのアイコン＋文字（青チップの羅列をやめて視覚ノイズを軽減） */
.scard-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 13px;
    margin-bottom: 4px;
    border-bottom: 1px solid #f1f4f8;
}
.scard-ico {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #eef5fe 0%, #e2edfb 100%);
    color: #2a5180;
}
.scard-ico .detail-card-icon { width: 19px; height: 19px; }
.scard-title { font-size: .96rem; font-weight: 700; color: #1f2d3d; letter-spacing: .02em; }

/* 項目: ラベル左・値右の整然としたスペックシート */
.scard-dl { margin: 0; padding: 4px 0 0; }
.scard-dl > div {
    display: flex;
    gap: 16px;
    align-items: baseline;
    padding: 9px 2px;
    border-bottom: 1px solid #f4f6fa;
}
.scard-dl > div:last-child { border-bottom: none; }
.scard-dl dt {
    flex: 0 0 8em;
    color: #94a3b8;
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.45;
}
.scard-dl dd {
    flex: 1;
    margin: 0;
    min-width: 0;
    color: #1e293b;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.5;
    word-break: break-all;
}
.scard-dl dd.is-empty { color: #cbd5e1; font-weight: 500; }

/* タグなど内容が広い項目は縦積みで全幅に */
.scard-dl > div.is-block { flex-direction: column; gap: 7px; align-items: stretch; }
.scard-dl > div.is-block dt { flex: none; }

/* 全幅カードの項目は内部も2列に */
.scard-dl--2col { column-count: 2; column-gap: 40px; }
.scard-dl--2col > div { break-inside: avoid; }

.scard-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.scard-tag {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    background: #eef3f9;
    color: #33598a;
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* カード内のテーブル・小見出し・空表示 */
.scard .detail-table-wrap { overflow-x: auto; margin-top: 6px; }
.scard .detail-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.scard .detail-table th,
.scard .detail-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.scard .detail-table th { color: #94a3b8; font-weight: 600; font-size: .74rem; letter-spacing: .02em; background: #f8fafc; }
.scard .detail-table tr:last-child td { border-bottom: none; }
.scard .detail-table td { color: #1e293b; }
.scard .detail-subtitle { margin: 4px 0 2px; font-size: .78rem; font-weight: 700; color: #64748b; }
.scard .detail-empty { margin: 6px 0 2px; color: #cbd5e1; font-size: .86rem; }

@media (max-width: 820px) {
    .detail-cards { column-count: 1; }
    .scard-dl--2col { column-count: 1; }
}
@media (max-width: 560px) {
    .scard-dl > div { flex-direction: column; gap: 2px; }
    .scard-dl dt { flex: none; }
}

/* ===== 外注先編集: 見出し（アイコンチップ）＋テーブル軽量化 ===== */
.subc-edit .section-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    border-radius: 9px;
    padding: 7px 18px 7px 14px;
    margin: 0 0 1.1rem;
    background: #eaf2fb;
    color: #1f4168;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .04em;
}
.subc-edit .staff-table th {
    background: transparent;
    color: #94a3b8;
    font-size: .72rem;
    letter-spacing: .04em;
    border-bottom: 2px solid #eef2f7;
    padding: .5rem .9rem;
}
.subc-edit .staff-table td {
    border-bottom: 1px solid #f1f5f9;
    padding: .7rem .9rem;
}
.subc-edit .staff-table tbody tr:hover td { background: #f8fafc; }

/* ===== 重要なお知らせ: バナー＋強制モーダル ===== */
.news-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 1.1rem;
    margin-bottom: 4px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    border-radius: 10px;
    color: #991b1b;
    font-size: .88rem;
}
.news-banner-text { display: flex; align-items: center; gap: 8px; min-width: 0; }
.news-banner-text .detail-card-icon { width: 18px; height: 18px; flex-shrink: 0; color: #dc2626; }
.news-banner-btn {
    flex-shrink: 0;
    padding: .42rem .95rem;
    border-radius: 8px;
    background: #dc2626;
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.news-banner-btn:hover { background: #b91c1c; color: #fff; text-decoration: none; }

/* 強制モーダル（重要なお知らせ） */
.news-modal .news-modal-title { font-size: 1.05rem; font-weight: 700; color: #1e293b; margin: 0 0 .35rem; }
.news-modal .news-modal-meta { font-size: .78rem; color: #94a3b8; margin: 0 0 .9rem; }
.news-modal .news-modal-body {
    font-size: .9rem;
    color: #334155;
    line-height: 1.7;
    max-height: 50vh;
    overflow-y: auto;
}
.news-modal .detail-card-icon { width: 18px; height: 18px; }

/* ===== お知らせ画面（閲覧側）: タイトル一覧＋表示モーダル ===== */
/* 未読/既読 セグメントタブ */
.news-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 16px;
    background: #eef2f7;
    border-radius: 12px;
}
.news-tab-btn {
    appearance: none;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 9px;
    color: #64748b;
    font-weight: 700;
    font-size: .88rem;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.news-tab-btn.is-active { background: #fff; color: #1f4168; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14); }
.news-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #dbe3ee;
    color: #475569;
    font-size: .72rem;
    font-weight: 700;
}
.news-tab-btn.is-active .news-tab-count { background: #1f4168; color: #fff; }

/* お知らせ行（通知リスト風） */
.news-feed { display: flex; flex-direction: column; gap: 10px; }
.news-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    text-align: left;
    font: inherit;
    cursor: pointer;
    background: #fff;
    border: 1px solid #e7edf4;
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.news-row:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15, 23, 42, 0.10); border-color: #dbe3ee; }
.news-row-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0edff;
    color: #2563eb;
}
.news-row.is-important .news-row-icon { background: #fde8e8; color: #dc2626; }
.news-row-icon .detail-card-icon { width: 20px; height: 20px; }
.news-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.news-row-title { font-weight: 700; color: #1e293b; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-row-meta { display: flex; align-items: center; gap: 7px; font-size: .76rem; color: #94a3b8; }
.news-row-type { font-weight: 700; color: #2563eb; }
.news-row.is-important .news-row-type { color: #dc2626; }
.news-row-date { display: inline-flex; align-items: center; gap: 4px; }
.news-row-chevron { flex-shrink: 0; color: #cbd5e1; transition: color .15s ease, transform .15s ease; }
.news-row:hover .news-row-chevron { color: #94a3b8; transform: translateX(2px); }
/* お知らせ表示モーダル（おしゃれ版） */
.news-vmodal {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: nvm-fade .18s ease;
}
@keyframes nvm-fade { from { opacity: 0; } to { opacity: 1; } }

.news-vmodal-card {
    position: relative;
    width: 100%;
    max-width: 680px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.34);
    animation: nvm-in .24s cubic-bezier(.2, .8, .2, 1);
}
@keyframes nvm-in {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

.news-vmodal-accent {
    display: block;
    height: 5px;
    flex-shrink: 0;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
}
.news-vmodal.is-important .news-vmodal-accent { background: linear-gradient(90deg, #dc2626, #fb7185); }

.news-vmodal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.news-vmodal-close:hover { background: #e2e8f0; color: #1e293b; }

.news-vmodal-head { display: flex; align-items: center; gap: 10px; padding: 22px 28px 0; }
.news-vmodal-badge {
    padding: 3px 12px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .04em;
    background: #e0edff;
    color: #1d4ed8;
}
.news-vmodal-badge.is-important { background: #fde8e8; color: #b91c1c; }
.news-vmodal-date { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; color: #94a3b8; }

.news-vmodal-title {
    margin: 12px 28px 0;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.45;
    color: #0f172a;
    letter-spacing: .01em;
}
.news-vmodal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    margin: 16px 28px 0;
    padding-top: 16px;
    border-top: 1px solid #eef2f7;
    font-size: .95rem;
    line-height: 1.95;
    color: #334155;
}
.news-vmodal-foot { padding: 18px 28px 24px; display: flex; justify-content: flex-end; }

/* サイドバー: 未読件数バッジ */
.sidebar-badge {
    margin-left: auto;
    flex-shrink: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

/* ===== 従業員一覧: 帳票一括ダウンロードバー ===== */
.bulk-bar-wrap {
    padding: .9rem 1.1rem;
    border-bottom: 1px solid #eef2f7;
}
.bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .8rem;
    padding: .55rem .8rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.bulk-bar-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .85rem;
}
.bulk-bar-divider {
    align-self: stretch;
    width: 1px;
    min-height: 26px;
    background: #e2e8f0;
}
.bulk-bar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
}
.bulk-selected {
    font-size: .85rem;
    color: #475569;
    white-space: nowrap;
}
.bulk-selected strong {
    color: #1e3a5f;
    font-size: 1rem;
}
.bulk-date {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    color: #475569;
    white-space: nowrap;
}
.bulk-date .filter-input {
    width: auto;
    padding: .35rem .5rem;
    font-size: .82rem;
}
.bulk-actions-label {
    font-size: .78rem;
    color: #94a3b8;
    white-space: nowrap;
}
/* 帳票DLボタン（.btn の width:100% / padding を上書きしてコンパクトに揃える） */
.bulk-doc-btn {
    width: auto;
    padding: .42rem .85rem;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    color: #fff;
    background: #1e3a5f;
    border: 1px solid #1e3a5f;
    border-radius: 6px;
}
.bulk-doc-btn:hover:not(:disabled) {
    background: #162d4a;
}
.bulk-doc-btn:disabled {
    cursor: not-allowed;
}
/* 未選択時（実装済みボタン）はグレーアウト */
.bulk-doc-btn:disabled:not(.is-coming-soon) {
    background: #cbd5e1;
    border-color: #cbd5e1;
}
/* 準備中ボタンは終始ミュート表示 */
.bulk-doc-btn.is-coming-soon {
    color: #94a3b8;
    background: #fff;
    border-color: #e2e8f0;
}
.coming-soon-badge {
    display: inline-block;
    margin-left: .35rem;
    padding: .05rem .35rem;
    border-radius: 999px;
    background: #eef2f7;
    color: #94a3b8;
    font-size: .65rem;
    font-weight: 600;
    vertical-align: middle;
}
.bulk-hint {
    font-size: .76rem;
    color: #94a3b8;
    white-space: nowrap;
}
.staff-table th.col-check,
.staff-table td.col-check {
    width: 40px;
    text-align: center;
    white-space: nowrap;
}

/* ===== マスタ機能停止中の案内バナー ===== */
.master-notice {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .85rem 1.1rem;
    margin-bottom: 16px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    color: #9a3412;
}
.master-notice > svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: #ea580c;
}
.master-notice strong {
    display: block;
    font-size: .9rem;
}
.master-notice span {
    display: block;
    margin-top: .15rem;
    font-size: .8rem;
    color: #b45309;
}

/* お知らせ 既読者確認モーダル */
.readers-summary { font-size: .85rem; color: #475569; margin: 0 0 1rem; }
.readers-section { margin-bottom: 1rem; }
.readers-section:last-child { margin-bottom: 0; }
.readers-section-head { font-size: .78rem; font-weight: 700; color: #1f4168; margin-bottom: .45rem; }
.readers-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; max-height: 220px; overflow-y: auto; }
.readers-list li { display: flex; align-items: center; gap: 10px; padding: 7px 11px; border-radius: 8px; background: #f8fafc; font-size: .85rem; }
.readers-name { font-weight: 600; color: #1e293b; flex: 1; min-width: 0; }
.readers-dept { font-size: .76rem; color: #94a3b8; white-space: nowrap; }
.readers-date { font-size: .76rem; color: #64748b; white-space: nowrap; }

/* ============================================================
   従業員詳細（タブ型・青系 / sd-*）
   ============================================================ */
.sd-page { display:flex; flex-direction:column; gap:16px; }

.sd-back { align-self:flex-start; display:inline-flex; align-items:center; gap:6px; font-size:.82rem; color:#5b7088; text-decoration:none; padding:2px 0; }
.sd-back:hover { color:#2563eb; }

/* ---- ヒーローのアバター（他画面と同色のヒーロー内に大きめ表示） ---- */
.sd-hero-avatar {
    flex:0 0 auto; width:94px; height:94px; border-radius:50%; overflow:hidden;
    display:flex; align-items:center; justify-content:center;
    font-size:36px; font-weight:700; color:#fff;
    background:rgba(255,255,255,.16); border:2px solid rgba(255,255,255,.45);
    box-shadow:0 8px 22px rgba(0,0,0,.22);
}
.sd-hero-avatar img { width:100%; height:100%; object-fit:cover; }

/* ヒーロー内のステータスタグ */
.sd-chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.sd-chip { font-size:.74rem; font-weight:700; padding:4px 11px; border-radius:999px; border:1px solid rgba(255,255,255,.3); background:rgba(255,255,255,.16); color:#fff; }
.sd-chip.is-green { background:rgba(52,211,153,.34); border-color:rgba(110,231,183,.6); }
.sd-chip.is-red   { background:rgba(248,113,113,.36); border-color:rgba(252,165,165,.6); }
.sd-chip.is-cyan  { background:rgba(56,189,248,.34); border-color:rgba(125,211,252,.6); }
.sd-chip.is-mute  { background:rgba(148,163,184,.34); border-color:rgba(203,213,225,.55); }
.sd-chip.is-ghost { background:rgba(255,255,255,.12); }
.sd-hero-meta { margin:10px 0 0; font-size:.74rem; color:rgba(255,255,255,.62); }

/* ---- 帳票DLバー ---- */
.sd-docbar { display:flex; align-items:center; flex-wrap:wrap; gap:10px; padding:13px 18px; border-radius:14px; background:#fff; border:1px solid #e8eef6; box-shadow:0 4px 14px rgba(15,23,42,.04); }
.sd-docbar-label { display:inline-flex; align-items:center; gap:7px; font-size:.85rem; font-weight:700; color:#1e3356; }
.sd-docbar-label svg { width:17px; height:17px; color:#2563eb; }
.sd-docbar-date { display:inline-flex; align-items:center; gap:6px; font-size:.8rem; color:#5b7088; }
.sd-docbar-date .filter-input { width:auto; }
.sd-docbar-spacer { flex:1 1 auto; }
.sd-doc-btn { cursor:pointer; font-size:.82rem; font-weight:600; padding:.45rem .9rem; border-radius:9px; color:#1d4ed8; background:#e8f0fe; border:1px solid #cfe0fb; white-space:nowrap; transition:background .15s ease, transform .15s ease; }
.sd-doc-btn:hover { background:#d6e4fd; transform:translateY(-1px); }

/* ---- タブ（従業員フォームと同じ form-tabs を使用。パネル内の複数カードに余白） ---- */
.sd-page .form-tab-panel.is-active { display:flex; flex-direction:column; gap:14px; }

/* ---- カード ---- */
.sd-card { background:#fff; border:1px solid #e8eef6; border-radius:16px; padding:18px 22px 10px; box-shadow:0 4px 16px rgba(15,23,42,.05); }
.sd-card-accent { background:linear-gradient(180deg,#f4f8ff,#fff 64%); border-color:#dbe7fb; }
.sd-card.is-warn { border-color:#fcd34d; background:linear-gradient(180deg,#fffaeb,#fff 64%); }
.sd-card-head { display:flex; align-items:center; gap:10px; padding-bottom:12px; margin-bottom:10px; border-bottom:1px solid #eef2f7; }
.sd-card-ico { flex:0 0 auto; width:32px; height:32px; display:inline-flex; align-items:center; justify-content:center; border-radius:9px; color:#fff; background:linear-gradient(135deg,#2563eb,#3b82f6); box-shadow:0 6px 14px -4px rgba(37,99,235,.55); }
.sd-card-ico svg { width:17px; height:17px; }
.sd-card-head h2 { margin:0; font-size:1.02rem; font-weight:800; color:#0f1e3a; letter-spacing:.01em; }

/* ---- フィールド（全幅オートフィル多カラム） ---- */
.sd-grid { margin:0; display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:0 28px; }
.sd-grid.is-compact { grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); }
.sd-field { min-width:0; padding:9px 2px; }
.sd-field.is-block { grid-column:1 / -1; }
.sd-field dt { font-size:.72rem; font-weight:600; color:#8aa0bd; margin-bottom:3px; }
.sd-field dd { margin:0; font-size:.93rem; font-weight:600; color:#13233f; word-break:break-word; }
.sd-field.is-empty dd { color:#cbd5e1; font-weight:500; }

/* ---- サブグループ（社会保険） ---- */
.sd-subgrid { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:4px 32px; }
.sd-subgroup { min-width:0; }
.sd-subtitle { margin:6px 0 2px; font-size:.8rem; font-weight:700; color:#2563eb; padding-bottom:5px; border-bottom:2px solid #e0ecff; }

/* ---- タグ ---- */
.sd-tags { display:flex; flex-wrap:wrap; gap:6px; padding-top:2px; }
.sd-tag { font-size:.76rem; font-weight:600; padding:4px 10px; border-radius:999px; color:#1d4ed8; background:#e8f0fe; border:1px solid #cfe0fb; }
.sd-tag.is-on { color:#047857; background:#d1fae5; border-color:#a7f3d0; }

/* ---- テーブル ---- */
.sd-wide-2col { display:grid; grid-template-columns:repeat(auto-fit,minmax(340px,1fr)); gap:14px; }
.sd-table-wrap { overflow-x:auto; border:1px solid #eef2f7; border-radius:12px; }
.sd-table { width:100%; border-collapse:collapse; font-size:.85rem; }
.sd-table thead th { text-align:left; font-size:.73rem; font-weight:700; color:#5b7088; background:#f3f7fd; padding:9px 13px; border-bottom:1px solid #e8eef6; white-space:nowrap; }
.sd-table tbody td { padding:9px 13px; border-bottom:1px solid #eef2f7; color:#13233f; }
.sd-table tbody tr:last-child td { border-bottom:0; }
.sd-table tbody tr:hover { background:#f7faff; }
.sd-empty { color:#94a3b8; font-size:.86rem; padding:6px 0 14px; }

@media (max-width: 640px) {
    .sd-grid { grid-template-columns:1fr; }
}

/* ========== 有給管理（台帳） ========== */
.badge-amber { background:#fef3c7; color:#92400e; }

.paid-summary {
    display:grid;
    grid-template-columns:1.4fr 1fr 1fr 1fr 1fr;
    gap:16px;
    margin-bottom:20px;
    align-items:stretch;
}
.paid-summary-card {
    position:relative;
    overflow:hidden;
    background:#fff;
    border:1px solid #edf1f7;
    border-radius:16px;
    padding:18px 20px;
    display:flex;
    align-items:center;
    gap:14px;
    box-shadow:0 1px 2px rgba(15,23,42,.04);
    transition:transform .18s ease, box-shadow .18s ease;
}
.paid-summary-card:hover {
    transform:translateY(-2px);
    box-shadow:0 12px 26px rgba(15,23,42,.10);
}
.paid-summary-ico {
    flex:none;
    width:44px; height:44px;
    border-radius:13px;
    display:grid;
    place-items:center;
    background:#f1f5f9;
    color:#64748b;
}
.paid-summary-ico svg { width:22px; height:22px; }
.paid-summary-body { min-width:0; flex:1 1 auto; display:flex; flex-direction:column; gap:4px; }
.paid-summary-label { font-size:.76rem; color:#64748b; font-weight:600; letter-spacing:.02em; }
.paid-summary-value { font-size:1.7rem; font-weight:800; color:#0f172a; line-height:1; letter-spacing:-.01em; }
.paid-summary-value small { font-size:.8rem; font-weight:600; margin-left:3px; color:#94a3b8; }
.paid-summary-value.is-danger { color:#e11d48; }
.paid-summary-cap { font-size:.72rem; color:#94a3b8; }
.paid-summary-meter {
    display:block;
    width:100%;
    max-width:170px;
    height:5px;
    margin:4px 0 1px;
    background:#eef2f7;
    border-radius:99px;
    overflow:hidden;
}
.paid-summary-meter > i {
    display:block;
    height:100%;
    border-radius:99px;
    background:linear-gradient(90deg,#0d9488,#14b8a6);
}

/* バリアント別アクセント */
.paid-summary-card.is-granted .paid-summary-ico { background:#eef2ff; color:#4f46e5; }
.paid-summary-card.is-used    .paid-summary-ico { background:#ecfdf5; color:#0d9488; }
.paid-summary-card.is-time    .paid-summary-ico { background:#fef9c3; color:#ca8a04; }
.paid-summary-card.is-lost    .paid-summary-ico { background:#fff1f2; color:#e11d48; }

/* 残日数カード（先頭・最大・リッチなグラデーション） */
.paid-summary-card.is-hero {
    border:0;
    color:#fff;
    padding:22px 26px;
    background:
        radial-gradient(circle at 88% 12%, rgba(125,211,252,.30) 0, transparent 45%),
        radial-gradient(circle at 10% 95%, rgba(99,102,241,.32) 0, transparent 48%),
        linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 55%, #2563eb 100%);
    box-shadow:0 14px 30px rgba(29,78,216,.28);
}
.paid-summary-card.is-hero:hover { box-shadow:0 18px 40px rgba(29,78,216,.36); }
.paid-summary-card.is-hero .paid-summary-ico {
    width:56px; height:56px; border-radius:16px;
    background:rgba(255,255,255,.16);
    color:#fff;
}
.paid-summary-card.is-hero .paid-summary-ico svg { width:28px; height:28px; }
.paid-summary-card.is-hero .paid-summary-label { color:rgba(219,234,254,.92); font-size:.88rem; }
.paid-summary-card.is-hero .paid-summary-value { color:#fff; font-size:2.8rem; }
.paid-summary-card.is-hero .paid-summary-value small { color:rgba(191,219,254,.95); font-size:1rem; }
.paid-summary-card.is-hero .paid-summary-cap { color:rgba(191,219,254,.82); }

/* 履歴テーブルは高さを抑えて内側スクロール（ヘッダー固定） */
.paid-hist {
    position: relative;
    max-height: 340px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.paid-hist .sd-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}
/* スクロールバーを常時はっきり表示（スクロール可能の手掛かり） */
.paid-hist::-webkit-scrollbar { width: 10px; height: 10px; }
.paid-hist::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
    border: 2px solid #fff;
}
.paid-hist::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
/* 下にまだ続くときだけ、下端にフェード影を出す */
.paid-hist::after {
    content: "";
    position: sticky;
    bottom: 0;
    left: 0;
    display: block;
    height: 0;
    pointer-events: none;
    box-shadow: 0 -9px 12px -3px rgba(40, 60, 90, .30);
    opacity: 0;
    transition: opacity .15s ease;
    z-index: 3;
}
.paid-hist.is-scrollable:not(.at-end)::after { opacity: 1; }

.paid-panel-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:1rem;
    padding:14px 18px;
    border-bottom:1px solid #eef2f7;
}
.paid-panel-head h2 { font-size:1rem; font-weight:700; color:#0f172a; margin:0; }

.paid-part {
    display:inline-block;
    background:#f1f5f9;
    color:#334155;
    border-radius:6px;
    padding:1px 7px;
    font-size:.76rem;
    margin:1px 4px 1px 0;
    white-space:nowrap;
}

/* 有給台帳ヒーローの管理簿DLフォーム（ラベル｜年｜DL を1つの枠にまとめる） */
.hero-book-form {
    margin: 0;
    display: inline-flex;
    align-items: stretch;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12);
}
.hero-book-label {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 700;
    color: rgba(226, 238, 252, 0.95);
    letter-spacing: .02em;
    white-space: nowrap;
}
.hero-select {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='1.5' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding: 11px 28px 11px 14px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}
.hero-select:focus { outline: none; }
.hero-select option { color: #13233f; background: #fff; }
.hero-book-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 11px 16px;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}
.hero-book-btn:hover { background: rgba(255, 255, 255, 0.24); }

/* 有給台帳ヒーローのメタ情報タグ */
.paid-hero-tags { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.paid-hero-tag {
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:4px 12px;
    background:rgba(255,255,255,0.12);
    border:1px solid rgba(255,255,255,0.20);
    border-radius:99px;
    font-size:.78rem;
    line-height:1.5;
}
.paid-hero-tag-k { color:rgba(199,222,248,0.85); font-weight:600; }
.paid-hero-tag-v { color:#fff; font-weight:700; }

/* ========== 有給管理 一覧テーブル ========== */
.paid-table-wrap { overflow-x:auto; }
.paid-table {
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    font-size:.875rem;
    font-variant-numeric:tabular-nums;
}
.paid-table thead th {
    padding:12px 16px;
    text-align:left;
    font-size:.72rem;
    font-weight:700;
    letter-spacing:.04em;
    color:#5b7088;
    background:#f3f7fd;
    border-bottom:1px solid #e3ebf5;
    white-space:nowrap;
    position:sticky;
    top:0;
    z-index:10;
}
.paid-table thead th.num { text-align:right; }
.paid-table thead th:first-child { padding-left:20px; }
.paid-table thead th:last-child  { padding-right:20px; }
.paid-table tbody td {
    padding:13px 16px;
    border-bottom:1px solid #eef2f7;
    vertical-align:middle;
    color:#1f2d3d;
}
.paid-table tbody td:first-child { padding-left:20px; }
.paid-table tbody td:last-child  { padding-right:20px; }
.paid-table tbody tr:last-child td { border-bottom:0; }
.paid-table tbody tr { transition:background .12s ease; }
.paid-table tbody tr:nth-child(even) td { background:#fbfcfe; }
.paid-table tbody tr:hover td { background:#eff5ff; }
/* 行頭アクセント（ホバー時） */
.paid-table tbody td:first-child { position:relative; }
.paid-table tbody tr:hover td:first-child::before {
    content:""; position:absolute; left:0; top:0; bottom:0;
    width:3px; background:#2563eb;
}
.paid-table .num { text-align:right; }
.paid-table .paid-no {
    font-family:ui-monospace, Menlo, monospace;
    font-size:.85rem;
    color:#64748b;
    white-space:nowrap;
}
.paid-table .num.is-lost { color:#dc2626; font-weight:600; }
.paid-table .num.is-zero { color:#cbd5e1; }
.paid-table .col-act { text-align:right; white-space:nowrap; }

/* 残日数チップ */
.paid-remain-chip {
    display:inline-flex; align-items:baseline; gap:1px;
    padding:4px 12px;
    border-radius:99px;
    background:#eaf1ff;
    color:#1d4ed8;
    font-weight:800;
    font-size:.95rem;
}
.paid-remain-chip small { font-size:.7rem; font-weight:600; color:#60a5fa; margin-left:1px; }

/* 台帳ボタン */
.paid-ledger-btn {
    display:inline-flex; align-items:center; gap:4px;
    padding:5px 12px;
    border:1px solid #d6e0ef;
    border-radius:8px;
    background:#fff;
    color:#1f4168;
    font-size:.78rem;
    font-weight:600;
    text-decoration:none;
    white-space:nowrap;
    transition:background .12s ease, border-color .12s ease, color .12s ease;
}
.paid-ledger-btn span { font-size:1rem; line-height:1; transition:transform .12s ease; }
.paid-ledger-btn:hover {
    background:#1f4168; border-color:#1f4168; color:#fff;
}
.paid-ledger-btn:hover span { transform:translateX(2px); }

.paid-form-row { margin-bottom:.9rem; }
.paid-form-row .filter-input,
.paid-form-row .filter-select { width:100%; }
.paid-hint { display:block; margin-top:4px; font-size:.74rem; color:#94a3b8; }

@media (max-width: 720px) {
    .paid-summary { grid-template-columns:repeat(2, 1fr); }
    .paid-summary-card.is-hero { grid-column:1 / -1; }
    .paid-summary-card.is-hero .paid-summary-value { font-size:2.4rem; }
}
