/* ==========================================================
   page-cm_office.css
   居宅介護支援事業所（ケアマネ事務所）ページ専用
   列幅だけを担当するミニマルCSS
   ========================================================== */

/* ---- テーブル基本設定 ---- */
.fg-table {
    width: 100%;
    table-layout: fixed;
}

/* ==========================================================
   ▼ 一般ユーザー（非ログイン）表示範囲：4,5,6,7,11,12
========================================================== */

/* 4: カテゴリ */
body:not(.admin-mode) .fg-table th:nth-child(4),
body:not(.admin-mode) .fg-table td:nth-child(4) {
    width: 12%;
}

/* 5: 事業所名 */
body:not(.admin-mode) .fg-table th:nth-child(5),
body:not(.admin-mode) .fg-table td:nth-child(5) {
    width: 20%;
}

/* 6: 住所 */
body:not(.admin-mode) .fg-table th:nth-child(6),
body:not(.admin-mode) .fg-table td:nth-child(6) {
    width: 20%;
}

/* 7: TEL */
body:not(.admin-mode) .fg-table th:nth-child(7),
body:not(.admin-mode) .fg-table td:nth-child(7) {
    width: 10%;
}

/* 11: 備考 */
body:not(.admin-mode) .fg-table th:nth-child(11),
body:not(.admin-mode) .fg-table td:nth-child(11) {
    width: 18%;
}

/* 12: WEB */
body:not(.admin-mode) .fg-table th:nth-child(12),
body:not(.admin-mode) .fg-table td:nth-child(12) {
    width: 5%;
}


/* ==========================================================
   ▼ 管理者モード（12 列すべて表示）
========================================================== */

/* 1: ID */
body.admin-mode .fg-table th:nth-child(1),
body.admin-mode .fg-table td:nth-child(1) {
    width: 3%;
}

/* 2: token */
body.admin-mode .fg-table th:nth-child(2),
body.admin-mode .fg-table td:nth-child(2) {
    width: 10%;
}

/* 3: next_update */
body.admin-mode .fg-table th:nth-child(3),
body.admin-mode .fg-table td:nth-child(3) {
    width: 10%;
}

/* 4: category */
body.admin-mode .fg-table th:nth-child(4),
body.admin-mode .fg-table td:nth-child(4) {
    width: 15%;
}

/* 5: name */
body.admin-mode .fg-table th:nth-child(5),
body.admin-mode .fg-table td:nth-child(5) {
    width: 20%;
}

/* 6: address */
body.admin-mode .fg-table th:nth-child(6),
body.admin-mode .fg-table td:nth-child(6) {
    width: 20%;
}

/* 7: tel */
body.admin-mode .fg-table th:nth-child(7),
body.admin-mode .fg-table td:nth-child(7) {
    width: 8%;
}

/* 8: business_days（fg-hide だが番号は固定） */
body.admin-mode .fg-table th:nth-child(8),
body.admin-mode .fg-table td:nth-child(8) {
    width: 8%;
}

/* 9: business_hours */
body.admin-mode .fg-table th:nth-child(9),
body.admin-mode .fg-table td:nth-child(9) {
    width: 8%;
}

/* 10: range_area */
body.admin-mode .fg-table th:nth-child(10),
body.admin-mode .fg-table td:nth-child(10) {
    width: 15%;
}

/* 11: memo */
body.admin-mode .fg-table th:nth-child(11),
body.admin-mode .fg-table td:nth-child(11) {
    width: 10%;
}

/* 12: web */
body.admin-mode .fg-table th:nth-child(12),
body.admin-mode .fg-table td:nth-child(12) {
    width: 5%;
}


/* =============================================
   モーダル共通デザイン
============================================= */

.fg-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.fg-modal.open {
    display: flex;
}

.fg-modal-content {
    background: #fff;
    width: 540px;
    padding: 28px 32px;
    border-radius: 12px;
    border: 1px solid #dadada;
    box-shadow: 0px 4px 16px rgba(0,0,0,0.08);

    /* ← これ超重要！！ */
    max-height: 80vh;
    overflow-y: auto;
}

.fg-modal-title {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 24px;
    color: #333;
}

.fg-modal-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.fg-modal-row label {
    width: 120px;
    font-size: 13px;
    font-weight: bold;
    color: #555;
    text-align: right;
}

.fg-modal-row input,
.fg-modal-row textarea,
.fg-modal-row select {
    flex: 1;
    padding: 8px 10px;
    font-size: 14px;
    background: #fafafa;
    border: 1px solid #ccc;
    border-radius: 6px;
    transition: border-color 0.2s, background 0.2s;
}

.fg-modal-row textarea {
    height: 80px;
    resize: vertical;
}

.fg-modal-buttons {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.fg-modal-buttons button {
    flex: 1;
    padding: 8px 0;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #bbb;
    background: #f7f7f7;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.fg-btn-save {
    background: #dfefff;
    border-color: #8fb6ff;
}

.fg-btn-delete {
    background: #ffe0e0;
    border-color: #ff9999;
}

/* モーダル内の行を完全に非表示にする */
.fg-modal-row.hidden-field {
    display: none !important;
}