/* ==========================================================
   ▼ 福岡ギルド：共通ヘッダー
   ========================================================== */

/* --- 全体レイアウト --- */
.fg-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px 16px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;

    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    box-sizing: border-box;
    font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", sans-serif;
}

/* --- タイトルと鍵アイコン --- */
.fg-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.fg-login-icon {
    cursor: pointer;
    font-size: 1rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: #f3f3f3;
    border: 1px solid #ddd;
    transition: 0.15s;
}
.fg-login-icon:hover {
    background: #e7e7e7;
}

/* --- サブタイトル --- */
.fg-subtitle {
    margin: 6px 0 22px;
    font-size: 0.95rem;
    color: #666;
}

/* --- ナビゲーション --- */
.fg-nav {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;

    width: 100%;
    padding: 0 10px;
    max-width: 1100px;
    box-sizing: border-box;
}

/* --- ボタン（幅統一） --- */
.fg-nav-btn {
    flex: 1;
    max-width: 180px;
    min-width: 150px;
    height: 46px;

    display: flex;
    justify-content: center;
    align-items: center;

    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 10px;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    white-space: nowrap;
    box-sizing: border-box;

    transition: 0.15s;
}
.fg-nav-btn:hover {
    background: #e9e9e9;
}

/* --- スマホ対応 --- */
@media (max-width: 600px) {
    .fg-nav {
        gap: 12px;
        padding: 0 6px;
    }
    .fg-nav-btn {
        max-width: none;
        width: 100%;
    }
}


/* ==========================================================
   ▼ Excel風テーブル（共通）
   ========================================================== */

.fg-table-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 20px;
    overflow-x: auto;
}

.fg-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
    font-size: 0.95rem;
    color: #333;
}

/* --- ヘッダー --- */
.fg-table thead th {
    background: #f1f1f1;
    color: #333;
    font-weight: 600;
    padding: 10px 8px;
    border-bottom: 2px solid #ddd;

    position: sticky;
    top: 0;
    z-index: 10;
    text-align: left;

    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* --- セル --- */
.fg-table td {
    padding: 8px 8px;
    border-bottom: 1px solid #e5e5e5;

    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;

    max-width: 220px;
}

/* --- ストライプ --- */
.fg-table tbody tr:nth-child(even) {
    background: #fafafa;
}

/* --- 行ホバー --- */
.fg-table tbody tr:hover {
    background: #eaf3ff;
}

/* --- 数字列 --- */
.fg-table td.num,
.fg-table th.num {
    text-align: right;
}


/* ==========================================================
   ▼ ログイン・ログアウト共通モーダル
   ========================================================== */

.fg-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.fg-modal-content {
    background: #fff;
    padding: 25px 30px;
    border-radius: 12px;
    width: 360px;
    text-align: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

/* 入力欄 */
.fg-modal-input {
    width: 100%;
    padding: 10px;
    margin: 12px 0 18px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fffdcf;
}

/* メインボタン */
.fg-modal-main-btn {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.fg-modal-main-btn:hover {
    background: #43a047;
}

/* 共通ボタン */
.fg-modal-btn {
    display: inline-block;
    min-width: 120px;
    padding: 9px 0;
    font-size: 0.95rem;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    border: 1px solid #ccc;
    background: #f7f7f7;
    transition: 0.2s;
    text-decoration: none;
    color: #333;
}
.fg-modal-btn:hover {
    background: #eaeaea;
}

/* 赤系ログアウトボタン */
.fg-modal-btn-logout {
    background: #fff2f2;
    border-color: #e0b3b3;
}
.fg-modal-btn-logout:hover {
    background: #ffe5e5;
}

/* キャンセル */
.fg-modal-btn-cancel:hover {
    background: #ececec;
}


/* ==========================================================
   ▼ 編集モーダル（施設・サービス共通）
   ========================================================== */

.fg-modal-inner {
    background: #fff;
    padding: 30px;
    width: 700px;
    max-height: 90%;
    overflow-y: auto;
    border-radius: 14px;
    border: 1px solid #ddd;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.fg-modal-inner h3 {
    font-size: 1.4rem;
    margin-bottom: 22px;
    border-left: 5px solid #4a90e2;
    padding-left: 12px;
}

/* ラベル & 入力欄 */
.fg-modal-inner label {
    display: block;
    margin: 18px 0 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.fg-modal-inner input,
.fg-modal-inner select,
.fg-modal-inner textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fafafa;
    transition: 0.2s;
}

.fg-modal-inner input:focus,
.fg-modal-inner select:focus,
.fg-modal-inner textarea:focus {
    background: #fff;
    border-color: #4a90e2;
}

/* 読み取り専用 */
.fg-readonly {
    padding: 12px 14px;
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #555;
}

/* ボタンエリア */
.fg-modal-btns {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 28px;
}

.fg-btn {
    padding: 10px 20px;
    font-size: 0.95rem;
    border-radius: 8px;
    border: 1px solid #bbb;
    cursor: pointer;
    background: #f3f3f3;
    transition: 0.2s;
}
.fg-btn:hover {
    background: #e5e5e5;
}

/* 決定 */
.fg-btn.ok {
    background: #4a90e2;
    border-color: #3f7fc5;
    color: white;
}

/* 複製 */
.fg-btn.copy-btn {
    background: #6cbe6c;
    border-color: #5aaa5a;
    color: #fff;
}

/* 削除 */
.fg-btn.delete-btn {
    background: #e45c5c;
    border-color: #d64c4c;
    color: #fff;
}

/* 閉じる */
.fg-btn.cancel {
    background: #ccc;
    border-color: #bbb;
}
.fg-btn.cancel:hover {
    background: #bbb;
}

/* 検索行レイアウト */
.fg-search-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin: 25px auto;
    flex-wrap: wrap;
}

/* メイン検索ボックス */
.fg-search-main {
    width: 260px;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.95rem;
}

/* 数字フィルタ */
.fg-search-price {
    width: 160px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.95rem;
}

/* クリアボタン */
.fg-clear-btn {
    padding: 10px 16px;
    background: #eee;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}
.fg-clear-btn:hover {
    background: #ddd;
}


/*テーブルの幅調整*/
/* ==========================================
   ▼ fg-table 列幅調整（Excel風）
   ========================================== */

/* 基本設定：テーブルは固定レイアウト */
.fg-table {
    table-layout: fixed;
    width: 100%;
}

/* ▼ カラム幅（％で調整） */
.fg-table th[data-col="col-category"],
.fg-table td[data-col="col-category"] {
    width: 8%;
}

.fg-table th[data-col="col-name"],
.fg-table td[data-col="col-name"] {
    width: 18%;
}

.fg-table th[data-col="col-address"],
.fg-table td[data-col="col-address"] {
    width: 16%;
}

.fg-table th[data-col="col-tel"],
.fg-table td[data-col="col-tel"] {
    width: 8%;
}

.fg-table th[data-col="col-init"],
.fg-table td[data-col="col-init"] {
    width: 8%;
}

.fg-table th[data-col="col-month"],
.fg-table td[data-col="col-month"] {
    width: 8%;
}

.fg-table th[data-col="col-accept"],
.fg-table td[data-col="col-accept"] {
    width: 8%;
}

.fg-table th[data-col="col-seikatsu"],
.fg-table td[data-col="col-seikatsu"] {
    width: 6%;
}

.fg-table th[data-col="col-room"],
.fg-table td[data-col="col-room"] {
    width: 5%;
}

.fg-table th[data-col="col-web"],
.fg-table td[data-col="col-web"] {
    width: 5%;
}

.fg-table th[data-col="col-memo"],
.fg-table td[data-col="col-memo"] {
    width: 5%;
}

/* ▼ 管理者のみ表示する列（ID, token, next_update） */
.fg-table th[data-col="col-id"],
.fg-table td[data-col="col-id"] {
    width: 6%;
}

.fg-table th[data-col="col-token"],
.fg-table td[data-col="col-token"] {
    width: 10%;
}

.fg-table th[data-col="col-next"],
.fg-table td[data-col="col-next"] {
    width: 10%;
}
/* ============================
   モーダル共通スタイル
============================ */

.fg-modal-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.35);
    justify-content: center;
    align-items: center;
}

.fg-modal-window {
    background: #fff;
    width: 360px;
    padding: 28px 26px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 18px rgba(0,0,0,0.18);
}

.fg-modal-title {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.fg-modal-text {
    margin: 0 0 20px 0;
    color: #555;
}

/* ボタン */
.fg-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.fg-btn-logout {
    padding: 10px 20px;
    border-radius: 6px;
    border: 1px solid #e3b4b4;
    background: #fbe9e9;
    color: #a44;
    font-size: 0.95rem;
    cursor: pointer;
}

.fg-btn-cancel {
    padding: 10px 20px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #f7f7f7;
    color: #444;
    font-size: 0.95rem;
    cursor: pointer;
}

.fg-btn-logout:hover {
    background: #f6dcdc;
}

.fg-btn-cancel:hover {
    background: #efefef;
}
/* ===== モーダル全体 ===== */
.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-content {
    background: #fff;
    padding: 28px;
    width: 90%;
    max-width: 480px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

/* ===== 見出し ===== */
.fg-modal-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

/* ===== ラベル ===== */
.fg-label {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #444;
    display: block;
}

/* ===== 入力欄 ===== */
.fg-input {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fff;
    box-sizing: border-box;
}

/* ===== ボタン群 ===== */
.fg-modal-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
}

.fg-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.fg-btn-update { background: #007aff; color: #fff; }
.fg-btn-copy   { background: #5c5c5c; color: #fff; }
.fg-btn-delete { background: #d9534f; color: #fff; }
.fg-btn-cancel { background: #ccc;    color: #333; }
/* モーダル全体 */
.fg-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* コンテンツ部分（スクロール対応） */
.fg-modal-content {
    background: #fff;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;   /* 画面の9割まで */
    overflow-y: auto;   /* ← ここ重要！スクロール */
    padding: 20px;
    border-radius: 12px;
}
.fg-display {
    padding: 8px 4px;
    font-size: 1rem;
    color: #333;
    text-align: left;
    border-bottom: 1px solid #ddd;
    margin-bottom: 6px;
}

.fg-modal-content {
    text-align: left;
}
.fg-modal-title {
    text-align: center;
}

.fg-modal-content label,
.fg-display,
.fg-input,
textarea {
    text-align: left !important;
}
/* ログインモーダルのボタン整形 */
.fg-login-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.fg-login-btn {
    padding: 10px 22px;
    background: #f3f3f3;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.fg-login-btn:hover {
    background: #e4e4e4;
}

.fg-login-btn-cancel {
    background: #fafafa;
}
.fg-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
}
