/* ================================================
   ▼③ アコーディオン化
=============================================== */

/* セクションタイトル */
.nav-section {
    cursor: pointer;
    user-select: none;
    padding: 10px 16px;
    font-weight: 700;
    color: #558d1d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 開閉用アイコン */
.nav-section::after {
    content: "▼";
    font-size: 10px;
    transition: transform 0.2s;
}

/* 閉じた状態 */
.nav-section.collapsed::after {
    transform: rotate(-90deg);
}

/* セクション中身 */
.sidebar-section-contents {
    display: block;
    margin-left: 8px;
}

/* 閉じたとき非表示 */
.sidebar-section-contents.hidden {
    display: none;
}

/* ================================================
   ▼④ 見出し（h1〜h4）復旧
=============================================== */
h1, h2, h3, h4 {
    font-weight: 700;
    color: #333;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.55rem;
    border-left: 6px solid #558d1d;
    padding-left: 0.6rem;
}

h3 {
    font-size: 1.35rem;
    border-left: 4px solid #6c757d;
    padding-left: 0.5rem;
}

h4 {
    font-size: 1.2rem;
    color: #444;
    border-left: 3px solid #adb5bd;
    padding-left: 0.45rem;
}

/* =========================================================
   セクション余白・レイアウト
   ========================================================= */
section {
    margin-bottom: 3rem;
}

/* テーブル共通デザイン */
table.table {
    background: white;
}
table.table th {
    background: #eef2f6;
    font-weight: 600;
}

/* =========================================================
   item-block（区切り線のみ）
   ========================================================= */
.item-block {
    padding: 1rem 0;
    border-bottom: 1px solid #e5e5e5;
}

/* 項目名 */
.item-title {
    font-size: 1.1rem;
    font-weight: 700;
}

/* コメントを少し濃く大きく */
.item-comment {
    font-size: 0.98rem;
    color: #444;
    line-height: 1.55;
}

/* =========================================================
   写真
   ========================================================= */
.whole-photo-wrapper,
.inspection-photo-wrapper {
    background: #f8f9fa;
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.whole-photo-wrapper {
    height: 330px;
}

.inspection-photo-wrapper {
    height: 260px;
}

.whole-photo-wrapper img,
.inspection-photo-wrapper img {
    max-height: 100%;
    object-fit: contain;
}

/* 公開・非公開ボタン */
.photo-staffonly-toggle {
    border-radius: 0 !important;
    font-size: 0.95rem;
    font-weight: 600;
}

.print-only { display: none; }
/* =========================================================
   フォーム（添付ファイルなど）
   ========================================================= */
#attachment-list table td {
    vertical-align: middle;
}

/* =========================================================
   inspection_detail（完全維持）
   ========================================================= */

/* アコーディオン */
.accordion-item {
    background: #fff;
    border: 1px solid #dcdcdc !important;
    margin-bottom: 1rem;
    border-radius: 6px;
    overflow: hidden;
}
.accordion-button {
    background: #f7f9fc;
    padding: 1.2rem 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}
.accordion-button::after {
    margin-left: auto;
}

/* ヘッダーレイアウト */
.acc-head-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: .75rem;
}
.acc-floorname {
    font-size: 1.35rem;
    font-weight: 700;
}
.acc-floorinfo {
    font-size: 1.05rem;
}

/* コメント */
.acc-col-right {
    font-size: .95rem;
    color: #444;
}

/* item-block */
.item-block {
    border-bottom: 1px solid #e5e5e5;
    padding: 1rem 0;
}
.item-title {
    font-size: 1.1rem;
    font-weight: 700;
}
.item-comment {
    font-size: .98rem;
}

/* 写真 */
.whole-photo-wrapper,
.inspection-photo-wrapper {
    background: #f8f9fa;
    border: 1px solid #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
}
.whole-photo-wrapper {
    height: 330px;
}
.inspection-photo-wrapper {
    height: 260px;
}


/* =========================================================
   ▼ 基本リンク設定（全体）
   ========================================================= */
a {
    color: #2a55cc;
    text-decoration: underline;
}

a:hover {
    color: #1e3ea8;
    text-decoration: none;
}

/* =========================================================
   ▼ table内リンクを見やすく（上書き）
   ========================================================= */
table a {
    color: #2358a0;
    font-weight: 600;
    text-decoration: underline;
}

table a:hover {
    color: #163d70;
    text-decoration: none;
}

/* =========================================================
   ▼ SP時 table をカード型に変換（共通）
   ========================================================= */
@media (max-width: 767px) {

    /* カード化対象のテーブル */
    .table-card {
        border: none;
    }

    .table-card thead {
        display: none !important; /* ヘッダー非表示 */
    }

    .table-card tbody,
    .table-card tr,
    .table-card td {
        display: block !important;
        width: 100%;
    }

    /* 行 = 1カード */
    .table-card tr {
        margin-bottom: 1.2rem;
        border: 1px solid #ddd;
        border-radius: 10px;
        padding: 0.8rem 1rem;
        background: #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    /* 各セルを縦並び＋左にラベル */
    .table-card td {
        border: none !important;
        padding: 0.35rem 0;
        position: relative;
        padding-left: 44%;   /* 左側にラベルスペース確保 */
        font-size: 14px;
    }

    .table-card td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: 0;
        width: 40%;
        font-weight: 600;
        color: #444;
        font-size: 13px;
        padding-right: 0.5rem;
        white-space: nowrap;
    }

    /* ボタンだけのセルとかは特例で中央寄せ */
    .table-card td.text-center {
        padding-left: 0 !important;
        text-align: center !important;
    }
     /* 行（カード）の外観 */
    .table-card tr {
        margin-bottom: 1.5rem;
        padding: 1rem 1.2rem;
        border-radius: 12px;
        border: 1px solid #dcdcdc;
        background: #fff;
        box-shadow: 0 3px 6px rgba(0,0,0,0.06);
    }

    /* 各セル */
    .table-card td {
        display: block !important;
        width: 100%;
        font-size: 15px;
        line-height: 1.4;
        padding: 0.5rem 0;
        padding-left: 42%;
        border: none !important;
    }

    /* ラベル（左側） */
    .table-card td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: 0;
        width: 38%;
        font-size: 14px;
        font-weight: 600;
        color: #333;
        padding-top: 0.45rem;
        white-space: nowrap;
    }

    /* 入力（点検予定日など） */
    .table-card td input[type="date"],
    .table-card td input[type="text"],
    .table-card td select {
        width: 100% !important;
        font-size: 15px;
        padding: 0.4rem 0.6rem;
        margin-top: 0.3rem;
        box-sizing: border-box;
    }

    /* 点検ボタンを大きく */
    .table-card .btn-inspect {
        display: inline-block;
        width: 100%;
        text-align: center;
        padding: 0.6rem 0;
        margin-top: 0.8rem;
        font-size: 16px;
        font-weight: 600;
        border-radius: 8px;
    }

    /* ボタンだけの行（td）中央揃え */
    .table-card td.text-center {
        padding-left: 0 !important;
        text-align: center !important;
    }

     /* ---- 共通テキストサイズを上げる ---- */
    .table-card td {
        font-size: 16px !important;
        line-height: 1.5;
        padding: 0.65rem 0 !important;
        padding-left: 42% !important;
    }

    /* ラベル側も少し大きく */
    .table-card td::before {
        font-size: 15px !important;
        padding-top: 0.65rem !important;
    }

    /* ---- 点検予定日の input の高さ統一 ---- */
    .table-card td input[type="date"],
    .table-card td input[type="text"],
    .table-card td select {
        width: 100% !important;
        font-size: 16px;
        padding: 0.55rem 0.75rem;
        height: 42px;
        box-sizing: border-box;
        margin-top: 0.25rem;
    }

    /* ---- 点検日（表示のみ）の高さを合わせる ---- */
    .table-card td[data-label="点検日"] {
        padding-top: 1rem !important;
    }

    /* ---- [点検] の th は SP では非表示 ---- */
    .table-card th[data-label="点検"],
    .table-card td[data-label="点検"]::before {
        display: none !important;
        content: "" !important;
    }

    /* ---- ボタン行は横幅100% + 余白確保 ---- */
    .table-card td.text-center {
        padding-left: 0 !important;
        padding-top: 1rem !important;
        text-align: center;
    }

    /* 大きくて押しやすい点検ボタン */
    .table-card .btn-inspect {
        width: 100%;
        padding: 0.9rem 0;
        border-radius: 10px;
        font-size: 17px;
        font-weight: 700;
    }

    /* ---- 点検済み表示を大きく太字に ---- */
    .table-card .inspected-label {
        font-size: 17px;
        font-weight: 700;
        color: #007bff;
        display: inline-block;
        padding: 0.5rem 0;
    }
    /* ラベルと中身を全体的に大きく */
    .table-card td {
        font-size: 16px;
        line-height: 1.5;
        padding: 0.7rem 0;
        padding-left: 42%;
    }

    .table-card td::before {
        font-size: 15px;
        padding-top: 0.7rem;
    }

    /* 点検予定日・点検日セルの高さをそろえる */
    .table-card td[data-label="点検予定日"],
    .table-card td[data-label="点検日"] {
        min-height: 46px;
    }

    .table-card td input[type="date"] {
        width: 100%;
        font-size: 16px;
        padding: 0.5rem 0.8rem;
        height: 42px;
        box-sizing: border-box;
        margin-top: 0.25rem;
    }

    /* 点検列（ボタンの列）はラベル不要＆中央寄せ */
    .table-card th:last-child {
        display: none;
    }
    .table-card td.action-cell {
        padding-left: 0;
        padding-top: 1rem;
        text-align: center;
    }
    .table-card td.action-cell::before {
        content: "" !important;
    }

    /* 点検ボタン大きく */
    .table-card .btn-inspect {
        width: 100%;
        padding: 0.9rem 0;
        border-radius: 10px;
        font-size: 17px;
        font-weight: 700;
    }

    /* 点検済み／承認済みの見た目 */
    .table-card .status-label {
        display: inline-block;
        font-size: 17px;
        font-weight: 700;
        padding: 0.4rem 0;
    }
    .table-card .status-inspected {
        color: #007bff;
    }
    .table-card .status-approved {
        color: #28a745;
    }

    /* 「点検を完了すると日付が入ります」メモ用 */
    .table-card .inspected-help {
        font-size: 14px;
        line-height: 1.4;
        display: inline-block;
        margin-top: 0.2rem;
    }

    /* h2・h3が長い場合のSP最適化 */
    h2, h3 {
        font-size: 18px !important;
        line-height: 1.4 !important;
        word-break: break-all; /* 日本語でも自然に折返し */
        margin-bottom: 0.8rem;
    }

    /* h2は特に長いと2行になるので余白調整 */
    .content-wrapper h2 {
        font-size: 20px !important;
        line-height: 1.4;
        margin-bottom: 1rem;
    }

    /* 業者名が長すぎる場合の対策 */
    .contractor-title {
        font-size: 20px !important;
        line-height: 1.4;
        word-break: break-word;
    }
}


/* ================================================
   ▼ SPカード（order_list 共通）
================================================ */
.sp-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.sp-card + .sp-card {
    margin-top: 1.2rem;
}

.sp-card-title-big {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

.sp-card-title-big .sp-card-sub {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 2px;
}

.sp-card-item {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.sp-card-item .label {
    font-weight: 600;
    color: #444;
}

/* ======================================
   ▼ order_detail 専用スタイル
====================================== */

/* 日付入力（共通） */
.order-date-input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 2px 4px;
    outline: none;
    box-shadow: none;
}

/* Excel アイコン */
.excel-icon {
    color: #217346 !important;
    font-size: 1.4rem;
}

/* ===== SP カード ===== */
.sp-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    border: 1px solid #ddd;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.sp-card + .sp-card {
    margin-top: 1.2rem;
}

.sp-card-title-big {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.sp-card-title-big .sp-card-sub {
    display: block;
    font-size: 0.9rem;
    color: #777;
    margin-top: 2px;
}

.sp-card-item {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.sp-card-item .label {
    font-weight: 600;
    color: #444;
}

/* ボタン間隔 */
.sp-card .btn {
    font-size: 0.9rem;
}

/* ↓ カードの余白をより読みやすく */
@media (max-width: 767px) {
    .page-section h2 {
        font-size: 1.35rem !important;
        margin-bottom: 1.2rem !important;
    }
}


/* ============================================================
   ▼ グローバル共通ボタンUI（公式）
   - 一時保存（青）
   - 主アクション：送信 / 完了 / 決定（緑）
   - 戻る / キャンセル（グレー）
   ※ 全ページ横断で統一使用する
=========================================================== */

/* ベース共通 */
.btn-temp,
.btn-complete,
.btn-back {
    border-radius: 999px;
    padding: 0.55rem 1.8rem;
    font-size: 1rem;
    font-weight: 600;
    border-width: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-decoration: none;
}

/* ------------------------
   一時保存（青系）
------------------------ */
.btn-temp {
    background-color: #e5f0ff;
    border-color: #93b5e8;
    color: #235a9b;
}
.btn-temp:hover {
    background-color: #d4e4ff;
    border-color: #7aa4e1;
    color: #1d4b80;
}

/* ------------------------
   主ボタン：送信 / 完了（緑）
------------------------ */
.btn-complete {
    background-color: #90c31f;
    border-color: #6aa322;
    color: #ffffff;
}
.btn-complete:hover:not(:disabled) {
    background-color: #83b41c;
    border-color: #5b8f1d;
    color: #ffffff;
}
.btn-complete:disabled {
    background-color: #dde4d4;
    border-color: #b6beae;
    color: #888f82;
    cursor: not-allowed;
    opacity: 1;
}

/* ------------------------
   戻る（グレー）
------------------------ */
.btn-back {
    background-color: #f2f3f5;
    border-color: #c3c7cf;
    color: #555a60;
}
.btn-back:hover {
    background-color: #e5e7eb;
    border-color: #b5bac3;
    color: #33363a;
}

/* ------------------------
   SP最適化
------------------------ */
@media (max-width: 767px) {
    .btn-temp,
    .btn-complete,
    .btn-back {
        width: 100%;
        font-size: 1.05rem;
        padding: 0.8rem 0;
    }
}

/* ============================================================
   ▼ 情報カード（物件・点検・ユーザー情報など共通表示）
   - inquiry / monthly_inspect / inspection_detail / property_detail
     すべてで使える公式UI
=========================================================== */

.info-card {
    background: #ffffff;
    border: 1px solid #e5e6e8;           /* 薄い境界線 */
    border-radius: 6px;                 /* 統一角丸 */
    padding: 1.2rem 1.4rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);  /* 程よい影 */
    margin-bottom: 1.5rem;
}

.info-card .row > div {
    font-size: 1rem;
    margin-bottom: 0.4rem;              /* 行間 */
}

.info-card strong {
    font-weight: 600;
    color: #333;
}

/* 進捗の表示 */
.status-点検中 {
  background: #e0f2fe;
  color: #0369a1;
}

.status-上長承認中 {
  background: #fff7ed;
  color: #c2410c;
}

.status-完了 {
  background: #ecfdf5;
  color: #047857;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ローディング表示制御 */
#loadingOverlay {
  display: none;
}

#loadingOverlay.is-active {
  display: flex !important;
}

/* 自動保存トースト表示制御 */
#autosave-message {
  display: none;
}

#autosave-message.show {
  display: flex !important;
}

#loadingOverlay{
  position:fixed;
  inset:0;
  background:rgba(255,255,255,0.7);
  z-index:9999;
  display:none;
  align-items:center;
  justify-content:center;
}

#loadingOverlay.is-active{
  display:flex;
}

.loading-spinner{
  font-size:32px;
  color:#e60012;
}


.loading-box{
    background:#fff;
    padding:24px 32px;
    border-radius:12px;
    box-shadow:0 4px 12px rgba(0,0,0,.15);

    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;

    min-width:240px;

    text-align:center;
}

#loadingText{
    margin-top:12px;
    font-size:1rem;
    color:#333;
}