/**
 * biz-tools.css
 * 業務管理プラグイン 共通スタイルシート
 *
 * 目次:
 *  1. 共通ユーティリティ
 *  2. メッセージ / アラート
 *  3. フォーム部品 (共通)
 *  4. 職員登録フォーム (#2 biz_staff_form)
 *  5. 職員名簿一覧   (#3 biz_staff_list)
 *  6. 休暇申請フォーム (#4 biz_leave_form)
 *  7. 管理者承認画面  (#5 biz_admin_leave_manage)
 *  8. 休暇カレンダー  (#6 biz_leave_calendar)
 *  9. 訂正申請フォーム (#7 biz_leave_apply_edit)
 * 10. 取消申請フォーム (#8 biz_leave_apply_delete)
 * 11. モーダルダイアログ (カレンダー共通)
 * 12. レスポンシブ対応
 */


/* =============================================================
   1. 共通ユーティリティ
   ============================================================= */

.biz-hidden {
    display: none;
}

.biz-section-title {
    font-size: 1.1em;
    font-weight: bold;
    border-left: 4px solid #0073aa;
    padding-left: 10px;
    margin-bottom: 10px;
}

.biz-back-btn-wrap {
    margin-top: 20px;
}

/* サイドバー非表示 (管理画面ページ向け) */
#sidebar,
.sidebar,
.widget-area {
    display: none !important;
}

#primary,
.content-area {
    width: 100% !important;
    margin: 0 !important;
    border: none !important;
}


/* =============================================================
   2. メッセージ / アラート
   ============================================================= */

.biz-message {
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    margin-bottom: 15px;
}

.biz-message--success {
    color: #155724;
    background: #e7f7ed;
    border: 1px solid #b7eb8f;
}

.biz-message--error {
    color: #d9534f;
    background: #fdf2f2;
    border: 1px solid #d9534f;
}

.biz-message--warning {
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffc107;
}

.biz-message--info {
    color: #0c5460;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
}

.biz-message--delete {
    color: #e65100;
    background: #fff3e0;
    border: 1px solid #ffb74d;
}


/* =============================================================
   3. フォーム部品 (共通)
   ============================================================= */

.biz-form__field {
    margin-bottom: 15px;
}

.biz-form__label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

.biz-form__input,
.biz-form__select,
.biz-form__textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
}

.biz-form__input--date,
.biz-form__input--time {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.biz-form__select--narrow {
    max-width: 300px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.biz-form__textarea {
    resize: vertical;
}

/* ボタン共通 */
.biz-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
}

.biz-btn--primary {
    background: #0073aa;
    color: #fff;
}

.biz-btn--primary:hover {
    background: #005a87;
}

.biz-btn--secondary {
    background: #666;
    color: #fff;
}

.biz-btn--secondary:hover {
    background: #444;
}

.biz-btn--success {
    background: #28a745;
    color: #fff;
}

.biz-btn--danger {
    background: #dc3545;
    color: #fff;
}

.biz-btn--danger:hover {
    background: #b71c1c;
}

.biz-btn--neutral {
    background: #eee;
    color: #333;
}

.biz-btn--neutral:hover {
    background: #ddd;
}

.biz-btn--sm {
    padding: 5px 10px;
    font-size: 0.9em;
    border-radius: 3px;
}

/* ボタングループ */
.biz-btn-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.biz-btn-group--center {
    justify-content: center;
}

/* リンクボタン (aタグ用) */
.biz-link-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
}

.biz-link-btn--neutral {
    background: #eee;
    color: #333;
}

.biz-link-btn--neutral:hover {
    background: #ddd;
    color: #333;
}


/* =============================================================
   4. 職員登録フォーム (#2 biz_staff_form)
   ============================================================= */

.staff-entry-form {
    max-width: 400px;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-bottom: 30px;
}

/* 直近の登録テーブル */
.staff-recent {
    max-width: 400px;
}

.staff-recent__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.staff-recent__table thead tr {
    background: #eee;
}

.staff-recent__table th,
.staff-recent__table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}


/* =============================================================
   5. 職員名簿一覧 (#3 biz_staff_list)
   ============================================================= */

/* 検索バー */
.staff-search {
    margin-bottom: 20px;
    background: #f1f1f1;
    padding: 15px;
    border-radius: 5px;
}

.staff-search__form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.staff-search__input {
    padding: 8px;
    width: 200px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.staff-search__clear {
    font-size: 0.9em;
    color: #0073aa;
}

/* 名簿テーブル */
.staff-list-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9em;
}

.staff-list-table thead tr {
    background: #0073aa;
    color: white;
}

.staff-list-table th {
    border: 1px solid #ddd;
    padding: 10px;
}

.staff-list-table td {
    padding: 10px;
    border: 1px solid #ddd;
    border-bottom: 1px solid #eee;
}

.staff-list-table td--center {
    text-align: center;
}

.staff-list-table__input {
    width: 90%;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

/* 操作列のボタン配置 */
.staff-list-table__actions {
    display: flex;
    gap: 5px;
    justify-content: center;
}


/* =============================================================
   6. 休暇申請フォーム (#4 biz_leave_form)
   ============================================================= */

.leave-form {
    /* 全幅 (テーブルレイアウト) */
}

.leave-form__table {
    width: 100%;
    border-collapse: collapse;
}

.leave-form__th {
    text-align: left;
    padding: 10px;
    width: 30%;
    font-weight: bold;
    vertical-align: top;
}

.leave-form__td {
    padding: 10px;
}

.leave-form__radio-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.leave-form__radio-group label {
    margin-left: 4px;
    cursor: pointer;
}

.leave-form__time-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.leave-form__total-hours {
    margin-top: 5px;
    font-size: 0.95em;
}

.leave-form__total-hours-value {
    font-weight: bold;
    color: #1976d2;
}

.leave-form__submit-area {
    margin-top: 20px;
    text-align: center;
}


/* =============================================================
   7. 管理者承認画面 (#5 biz_admin_leave_manage)
   ============================================================= */

.biz-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
}

.biz-admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.85em;
}

.biz-admin-table th {
    background: #0073aa;
    color: white;
    padding: 10px;
    border: 1px solid #ddd;
}

.biz-admin-table__col-meta    { width: 15%; }
.biz-admin-table__col-detail  { width: 25%; }
.biz-admin-table__col-status  { width: 15%; }
.biz-admin-table__col-action  { width: 45%; }

.biz-admin-table td {
    padding: 10px;
    border: 1px solid #ddd;
    vertical-align: top;
}

.biz-admin-table__status {
    font-weight: bold;
}

.biz-admin-table__status--pending  { color: #666; }
.biz-admin-table__status--approved { color: green; }
.biz-admin-table__status--rejected { color: red; }

.biz-admin-table__updated-at {
    color: #999;
    font-size: 0.85em;
}

/* 承認フォーム (各行内) */
.biz-approve-form {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.biz-approve-form__memo {
    width: 100%;
    height: 50px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    box-sizing: border-box;
}

.biz-approve-form__action-row {
    display: flex;
    gap: 5px;
    align-items: center;
}

.biz-approve-form__select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

/* 申請区分バッジ */
.biz-leave-badge {
    display: inline-block;
    background: #eee;
    padding: 2px 5px;
    border-radius: 3px;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.biz-admin-table__reason {
    color: #666;
    font-size: 0.85em;
}


/* =============================================================
   8. 休暇カレンダー (#6 biz_leave_calendar)
   ============================================================= */

.biz-calendar-container {
    max-width: 100%;
    background: #fff;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* カレンダーヘッダー (月ナビ) */
.biz-calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.biz-calendar-nav__title {
    margin: 0;
    font-size: 1.25em;
}

/* 前月・次月 + 任意移動フォームをまとめるコンテナ */
.biz-calendar-nav__controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.biz-calendar-nav__link {
    text-decoration: none;
    padding: 5px 10px;
    background: #eee;
    border-radius: 4px;
    color: #333;
}

.biz-calendar-nav__link:hover {
    background: #ddd;
    color: #333;
}

/* 任意移動フォーム */
.biz-calendar-nav__jump-form {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid #ddd;  /* 前月・次月と視覚的に区切る */
}

.biz-calendar-nav__select {
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}

/* カレンダースクロール */
.biz-calendar-scroll {
    overflow-x: auto;
}

/* カレンダー本体テーブル */
.biz-calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.biz-calendar-table th,
.biz-calendar-table td {
    border: 1px solid #ddd;
    padding: 5px;
}

.biz-calendar-table thead th {
    text-align: center;
    font-weight: bold;
    padding: 8px 5px;
}

.biz-calendar-table td {
    height: 110px;
    vertical-align: top;
    text-align: left;
    background: #fff;
}

/* 曜日カラー */
.biz-calendar-table .cal-sun {
    color: red;
    background: #fff5f5;
}

.biz-calendar-table .cal-sat {
    color: blue;
    background: #f5faff;
}

/* 空セル */
.biz-calendar-table .cal-empty {
    background: #fafafa;
}

/* 今日のセル */
.biz-calendar-table .cal-today {
    border: 2px solid #0073aa;
}

/* 日付ラベル */
.cal-day-num {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

/* 休暇ラベル */
.cal-leave-label {
    font-size: 0.75em;
    padding: 2px 4px;
    margin-bottom: 3px;
    border-radius: 3px;
    border-left: 4px solid transparent;
    overflow: hidden;
    white-space: nowrap;
    line-height: 1.4;
    cursor: pointer;
    transition: opacity 0.2s;
}

.cal-leave-label:hover {
    opacity: 0.7;
}

/* 承認待ち: 破線ボーダー */
.cal-leave-label--pending {
    border-style: dashed !important;
    border-width: 1px 1px 1px 4px !important;
    background: #f5f5f5 !important;
    color: #757575 !important;
    border-color: #757575 !important;
}

/* 休暇種別カラー (承認済み) */
.cal-leave-label--paid {       /* 有給・特休 */
    background: #e3f2fd;
    color: #1976d2;
    border-color: #1976d2;
}

.cal-leave-label--absence {    /* 欠勤 */
    background: #ffebee;
    color: #d32f2f;
    border-color: #d32f2f;
}

.cal-leave-label--substitute { /* 振替 */
    background: #f1f8e9;
    color: #388e3c;
    border-color: #388e3c;
}


/* =============================================================
   9. 訂正申請フォーム (#7 biz_leave_apply_edit)
   ============================================================= */

.edit-form-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 25px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.edit-form-container__title {
    font-size: 1.4em;
    border-left: 5px solid #0073aa;
    padding-left: 15px;
    margin-bottom: 25px;
    color: #333;
}

.edit-form__original-summary {
    background: #f0f7ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #1976d2;
    font-size: 0.95em;
    line-height: 1.8;
}

.edit-form__row {
    margin-bottom: 20px;
}

.edit-form__label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #555;
}

.edit-form__input,
.edit-form__select,
.edit-form__textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
}

.edit-form__textarea {
    resize: vertical;
}

.edit-form__btn-box {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

.edit-form__btn-submit {
    flex: 2;
    padding: 12px;
    font-size: 1.1em;
}

.edit-form__btn-cancel {
    flex: 1;
    padding: 12px;
    font-size: 1em;
}


/* =============================================================
   10. 取消申請フォーム (#8 biz_leave_apply_delete)
   ============================================================= */

.delete-form-container {
    max-width: 500px;
    margin: 20px auto;
    padding: 25px;
    border: 2px solid #ffcdd2;
    border-radius: 12px;
    background: #fff;
}

.delete-form-container__title {
    color: #d32f2f;
    font-size: 1.3em;
    margin-bottom: 20px;
    text-align: center;
}

.delete-form__target-box {
    background: #fafafa;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    line-height: 1.8;
}

.delete-form__target-box hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 10px 0;
}

.delete-form__row {
    margin-bottom: 20px;
}

.delete-form__label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

.delete-form__textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    resize: vertical;
}

.delete-form__btn-box {
    display: flex;
    gap: 10px;
}

.delete-form__btn-exec {
    flex: 2;
    padding: 12px;
    font-weight: bold;
}

.delete-form__btn-cancel {
    flex: 1;
    padding: 12px;
}


/* =============================================================
   11. モーダルダイアログ (カレンダー共通)
   ============================================================= */

.biz-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.biz-modal-overlay--active {
    display: flex;
}

.biz-modal {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.biz-modal__title {
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 1.1em;
    line-height: 1.5;
}

.biz-modal__btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.biz-modal__btn {
    padding: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
}

.biz-modal__btn--edit {
    background: #1976d2;
    color: #fff;
}

.biz-modal__btn--delete {
    background: #d32f2f;
    color: #fff;
}

.biz-modal__btn--cancel {
    background: #eee;
    color: #333;
}


/* =============================================================
   12. レスポンシブ対応
   ============================================================= */

@media screen and (max-width: 768px) {
    .biz-admin-table {
        min-width: 700px;
    }

    .biz-calendar-table {
        min-width: 600px;
    }

    .staff-search__input {
        width: 100%;
    }

    .leave-form__th {
        width: 100%;
        display: block;
    }

    .leave-form__td {
        display: block;
    }

    .edit-form__btn-box,
    .delete-form__btn-box {
        flex-direction: column;
    }

    .edit-form__btn-submit,
    .edit-form__btn-cancel,
    .delete-form__btn-exec,
    .delete-form__btn-cancel {
        flex: none;
    }
}

/* =============================================================
   ページヘッダー（タイトルブロック）非表示
   Lightning 15.x : .page-header ブロックごと非表示
   パンくずリスト (.vk-breadcrumb) は .page-header の外のため影響なし
   ============================================================= */

.biz-no-page-header .page-header {
    display: none;
}

/* 取消申請待ち */
.cal-leave-label--cancel {
    background: #fff8e1;
    color: #f57f17;
    border-color: #f57f17;
    border-style: dashed !important;
    border-width: 1px 1px 1px 4px !important;
}

/* 日付範囲エラーメッセージ */
.biz-date-error {
    color: #d9534f;
    background: #fdf2f2;
    border: 1px solid #d9534f;
    border-radius: 4px;
    padding: 6px 10px;
    margin-top: 6px;
    font-size: 0.9em;
}
