/* ===========================================
   SCMS Partner サイト 共通CSS
   施設管理者向けの軽量スタイル
   =========================================== */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
    background: #F5F4F0;
    color: #1A1916;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

a { color: #185FA5; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== トップバー ===== */
.topbar {
    background: #185FA5;
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.topbar-brand .brand-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.2;
}
.topbar-brand .brand-sub {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    flex-wrap: wrap;
}
.topbar-nav .nav-link {
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.15s;
}
.topbar-nav .nav-link:hover { background: rgba(255,255,255,0.15); text-decoration: none; }
.topbar-nav .nav-link.active { background: rgba(255,255,255,0.22); }
.topbar-nav .nav-logout {
    border: 1px solid rgba(255,255,255,0.4);
}
.topbar-user {
    font-size: 13px;
    opacity: 0.9;
    padding: 0 4px;
}

/* ===== メインコンテンツ ===== */
.main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px;
    min-height: calc(100vh - 130px);
}

/* ===== フラッシュメッセージ ===== */
.flash {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 14px;
}
.flash-success {
    background: #E1F5EE;
    color: #0F6E56;
    border: 1px solid #5CB891;
}
.flash-error {
    background: #FCEBEB;
    color: #A32D2D;
    border: 1px solid #F4C7C7;
}

/* ===== ページヘッダ ===== */
.page-header {
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E0DDD5;
}
.page-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1A1916;
}
.page-header .page-sub {
    margin-top: 4px;
    font-size: 13px;
    color: #7A7975;
}

/* ===== ログインページ ===== */
.login-wrap {
    max-width: 420px;
    margin: 60px auto 40px;
    padding: 0 16px;
}
.login-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 32px 28px 28px;
}
.login-card h1 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}
.login-card .login-sub {
    text-align: center;
    color: #7A7975;
    font-size: 13px;
    margin-bottom: 24px;
}
.login-card .form-row { margin-bottom: 16px; }
.login-card label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #444;
}
.login-card input[type="email"],
.login-card input[type="password"],
.login-card input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #C8C4BA;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
}
.login-card input:focus {
    outline: none;
    border-color: #185FA5;
    box-shadow: 0 0 0 3px rgba(24,95,165,0.15);
}
.login-card .btn-primary {
    width: 100%;
    padding: 11px 14px;
    background: #185FA5;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.login-card .btn-primary:hover { background: #134B81; }
.login-help {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: #7A7975;
}

/* ===== ボタン ===== */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.btn-primary {
    background: #185FA5; color: #fff; border-color: #185FA5;
}
.btn-primary:hover { background: #134B81; text-decoration: none; }
.btn-secondary {
    background: #fff; color: #185FA5; border-color: #C8C4BA;
}
.btn-secondary:hover { background: #F5F4F0; text-decoration: none; }

/* ===== カード ===== */
.card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #E0DDD5;
    padding: 20px;
    margin-bottom: 18px;
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px;
    color: #1A1916;
}

/* カード内フォーム要素(change_password.php 等で利用) */
.card .form-row { margin-bottom: 14px; }
.card .form-row label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #444;
}
.card .form-row input[type="email"],
.card .form-row input[type="password"],
.card .form-row input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #C8C4BA;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    font-family: inherit;
}
.card .form-row input:focus {
    outline: none;
    border-color: #185FA5;
    box-shadow: 0 0 0 3px rgba(24,95,165,0.15);
}
.form-note {
    font-size: 12px;
    color: #7A7975;
    margin-top: 12px;
    line-height: 1.6;
}

/* ===== 担当施設テーブル ===== */
.facility-list {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.facility-list th,
.facility-list td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #E0DDD5;
}
.facility-list th {
    background: #F5F4F0;
    font-weight: 500;
    color: #444;
}
.facility-list tr:last-child td {
    border-bottom: none;
}

/* ===== フッター ===== */
.page-footer {
    border-top: 1px solid #E0DDD5;
    padding: 18px 20px;
    text-align: center;
    font-size: 12px;
    color: #7A7975;
    background: #fff;
}
.page-footer .footer-contact {
    margin-bottom: 6px;
    color: #5A5856;
}
.page-footer .footer-contact a {
    color: #185FA5;
    text-decoration: none;
    font-weight: 500;
}
.page-footer .footer-contact a:hover { text-decoration: underline; }
.page-footer .footer-copy {
    color: #A09D95;
    font-size: 11px;
}

/* ===== 2段階認証(setup_2fa.php / otp_verify.php)===== */
/* 注意ボックス */
.notice {
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.7;
}
.notice-warn {
    background: #FFF8E5;
    border: 1px solid #F4C16A;
    color: #7A5300;
}

/* 危険系ボタン(2FA無効化用) */
.btn-danger {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #A32D2D;
    background: #A32D2D;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: background 0.15s;
}
.btn-danger:hover { background: #862424; }

/* 手順リスト */
.setup-steps {
    font-size: 13px;
    line-height: 2;
    margin: 0 0 20px;
    padding-left: 20px;
    color: #3D3B38;
}

/* ストアバッジ */
.store-links {
    display: inline-flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.store-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}
.store-ios     { background: #000; }
.store-android { background: #01875F; }
.store-btn:hover { text-decoration: none; opacity: 0.9; }

/* QR表示ブロック */
.qr-block {
    text-align: center;
    margin: 24px 0;
}
.qr-img {
    width: 200px;
    height: 200px;
    border: 8px solid #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
    border-radius: 8px;
}
.qr-manual-label {
    margin-top: 12px;
    font-size: 12px;
    color: #7A7975;
}
.qr-secret {
    margin-top: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 3px;
    background: #F5F4F0;
    padding: 8px 16px;
    border-radius: 6px;
    display: inline-block;
    word-break: break-all;
}

/* OTP入力欄(setup Step2 用・カード内) */
.otp-input {
    width: 180px;
    padding: 14px;
    border: 1px solid #C8C4BA;
    border-radius: 8px;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 12px;
    font-family: 'Courier New', monospace;
    background: #FAFAF8;
}
.otp-input:focus {
    outline: none;
    border-color: #185FA5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(24,95,165,0.15);
}

/* OTP入力欄(otp_verify.php 用・ログインカード内) */
.login-card .otp-input-inline {
    width: 100%;
    padding: 14px;
    border: 1px solid #C8C4BA;
    border-radius: 8px;
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 10px;
    font-family: 'Courier New', monospace;
    background: #FAFAF8;
}
.login-card .otp-input-inline:focus {
    outline: none;
    border-color: #185FA5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(24,95,165,0.15);
}

/* ===== 空室数更新UI(Phase 5-5)===== */
.vacancy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    margin-top: 6px;
}
.vacancy-card {
    background: #fff;
    border: 1px solid #E0DDD5;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.vacancy-card-head {
    border-bottom: 1px solid #F0EDE5;
    padding-bottom: 10px;
}
.vacancy-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1A1916;
    line-height: 1.4;
    margin-bottom: 4px;
}
.vacancy-card-sub {
    font-size: 12px;
    color: #7A7975;
    line-height: 1.5;
}
.vacancy-card-meta {
    font-size: 11px;
    color: #A09D95;
    margin-top: 4px;
}
.vacancy-edit {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.vacancy-label {
    font-size: 13px;
    font-weight: 500;
    color: #444;
}
.vacancy-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.vacancy-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #C8C4BA;
    background: #F5F4F0;
    border-radius: 6px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    color: #444;
    font-family: inherit;
    transition: background 0.15s;
    user-select: none;
}
.vacancy-btn:hover { background: #E8E5DD; }
.vacancy-btn:active { background: #DCD8CE; }
.vacancy-input {
    flex: 1;
    min-width: 60px;
    padding: 10px;
    border: 1px solid #C8C4BA;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    background: #fff;
    font-family: inherit;
}
.vacancy-input:focus {
    outline: none;
    border-color: #185FA5;
    box-shadow: 0 0 0 3px rgba(24,95,165,0.15);
}
.vacancy-input::-webkit-outer-spin-button,
.vacancy-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.vacancy-input { -moz-appearance: textfield; }
.vacancy-unit {
    font-size: 13px;
    color: #5A5856;
    padding-left: 2px;
}
.vacancy-save-btn {
    width: 100%;
}
.vacancy-meta {
    font-size: 11px;
    color: #7A7975;
    line-height: 1.5;
}
.vacancy-meta-label { color: #A09D95; }
.vacancy-meta-time  { font-weight: 500; color: #5A5856; }
.vacancy-meta-by    { color: #A09D95; }
.vacancy-result {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}
.vacancy-result-ok {
    background: #EAF3DE;
    color: #3B6D11;
    border: 1px solid #7CB342;
}
.vacancy-result-ng {
    background: #FEF2F2;
    color: #A32D2D;
    border: 1px solid #FCA5A5;
}

/* ===== Phase 5-3: 施設情報編集UI ===== */
/* タブ */
.facility-edit-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #E0DDD5;
    background: #FAFAF8;
}
.facility-edit-tabs .tab-link {
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #5A5856;
    text-decoration: none;
    border-right: 1px solid #E8E5DD;
    transition: background 0.15s, color 0.15s;
}
.facility-edit-tabs .tab-link:hover:not(.tab-disabled) {
    background: #fff;
    color: #185FA5;
}
.facility-edit-tabs .tab-link.active {
    background: #fff;
    color: #185FA5;
    font-weight: 600;
    border-bottom: 2px solid #185FA5;
    margin-bottom: -1px;
}
.facility-edit-tabs .tab-disabled {
    color: #B5B2A9;
    cursor: not-allowed;
    background: transparent;
}
.facility-edit-body {
    padding: 24px 20px;
}
.tab-placeholder {
    text-align: center;
    color: #A09D95;
    padding: 32px 16px;
    font-size: 13px;
}

/* 申請中の通知 */
.pending-notice {
    background: #FFF8E5;
    border: 1px solid #F4C16A;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 22px;
}
.pending-notice-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    color: #7A5300;
    margin-bottom: 6px;
}
.pending-notice-time {
    font-size: 12px;
    color: #A07B3A;
    font-weight: normal;
}
.pending-notice-body {
    font-size: 13px;
    color: #7A5300;
    line-height: 1.6;
}

/* フォームセクション */
.form-section {
    margin-bottom: 22px;
}
.form-section > label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1A1916;
    margin-bottom: 6px;
}
.form-help {
    font-size: 12px;
    color: #7A7975;
    margin-bottom: 8px;
    line-height: 1.6;
}
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #C8C4BA;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    background: #fff;
    font-family: inherit;
    resize: vertical;
}
.form-textarea:focus {
    outline: none;
    border-color: #185FA5;
    box-shadow: 0 0 0 3px rgba(24,95,165,0.15);
}

/* 「現在公開中」の比較表示 */
.form-current {
    margin-top: 8px;
    padding: 8px 10px;
    background: #F5F4F0;
    border-left: 3px solid #C8C4BA;
    border-radius: 4px;
    font-size: 12px;
}
.form-current-label {
    color: #7A7975;
    font-weight: 500;
}
.form-current-text {
    color: #5A5856;
    line-height: 1.6;
    margin-top: 4px;
    white-space: pre-wrap;
}

/* フォーム下部のアクション */
.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* 小さめボタン */
.btn-small {
    padding: 5px 12px;
    font-size: 12px;
}
.btn-block-sm {
    display: block;
    text-align: center;
    width: 100%;
}

/* ダッシュボード:施設カードの編集ボタン領域 */
.facility-actions {
    border-top: 1px dashed #E0DDD5;
    padding-top: 10px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.facility-pending-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #FFF8E5;
    color: #7A5300;
    border: 1px solid #F4C16A;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}

/* ===== Phase 5-3b: フォーム入力(select, number, grid) ===== */
.form-select,
.form-number {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #C8C4BA;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    font-family: inherit;
}
.form-select:focus,
.form-number:focus {
    outline: none;
    border-color: #185FA5;
    box-shadow: 0 0 0 3px rgba(24,95,165,0.15);
}
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ===== Phase 5-3c: チップUI(顧客ADL画面と同じデザイン)===== */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 0.5px solid #E0DDD5;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #7A7975;
    background: #fff;
    user-select: none;
    min-height: 30px;
    transition: all 0.15s;
}
.chip:hover { border-color: #185FA5; color: #185FA5; }
.chip.selected {
    border-color: #185FA5;
    background: #E6F1FB;
    color: #185FA5;
    font-weight: 500;
}

/* ===== Phase 5-3d: 受入態勢テーブル(看護医療・感染症) ===== */
.acceptance-wrap {
    overflow-x: auto;
    margin-bottom: 6px;
}
.acceptance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 540px;
}
.acceptance-table th {
    background: #F5F4F0;
    padding: 8px 10px;
    border: 0.5px solid #E0DDD5;
    font-weight: 500;
    text-align: center;
}
.acceptance-table th.col-item {
    text-align: left;
    width: 38%;
}
.acceptance-table th.col-note {
    text-align: left;
}
.acceptance-table td {
    padding: 6px 10px;
    border: 0.5px solid #E0DDD5;
}
.acceptance-table td.col-level {
    text-align: center;
    padding: 4px;
    width: 56px;
}
.acceptance-table .lvl-accept  { color: #1D9E75; font-weight: 600; }
.acceptance-table .lvl-consult { color: #BA7517; font-weight: 600; }
.acceptance-table .lvl-reject  { color: #A32D2D; font-weight: 600; }
.acc-radio {
    cursor: pointer;
    display: block;
    padding: 6px 0;
}
.acc-radio input[type="radio"] {
    margin: 0;
    vertical-align: middle;
}
.acc-note-input {
    width: 100%;
    padding: 5px 7px;
    border: 1px solid #E0DDD5;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
}
.acc-note-input:focus {
    outline: none;
    border-color: #185FA5;
    box-shadow: 0 0 0 2px rgba(24,95,165,0.15);
}

/* ===== Phase 5-3e: 物件スペック (form-grid-3, form-subheading) ===== */
.form-subheading {
    font-size: 14px;
    font-weight: 600;
    color: #1A1916;
    margin: 22px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #E8E5DD;
}
.form-subheading:first-of-type { margin-top: 6px; }
.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px 14px;
}

/* ===== Phase 5-9: パートナー向けお知らせ ===== */
.notice-card {
    border-left: 4px solid #185FA5;
    background: #F8FAFD;
}
.notice-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
}
.notice-item {
    background: #fff;
    border: 1px solid #E0DDD5;
    border-radius: 6px;
    padding: 12px 14px;
}
.notice-item + .notice-item {
    /* 既に gap で間隔取れている */
}
.notice-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.notice-title {
    font-weight: 600;
    color: #1A1916;
    font-size: 14px;
    line-height: 1.5;
}
.notice-date {
    font-size: 11px;
    color: #A09D95;
    flex-shrink: 0;
}
.notice-body {
    font-size: 13px;
    color: #5A5856;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===== レスポンシブ ===== */
@media (max-width: 600px) {
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .topbar-nav {
        width: 100%;
        gap: 8px;
    }
    .topbar-user { width: 100%; }
    .main-content { padding: 16px 12px; }
    .login-wrap { margin: 30px auto; }
    .login-card { padding: 24px 18px 20px; }
    .facility-list th,
    .facility-list td { padding: 8px 10px; font-size: 13px; }
    .qr-img { width: 180px; height: 180px; }
    .qr-secret { font-size: 13px; letter-spacing: 2px; }
    .otp-input { width: 100%; font-size: 24px; letter-spacing: 8px; padding: 12px; }
    .login-card .otp-input-inline { font-size: 22px; letter-spacing: 8px; padding: 12px; }
    .vacancy-grid { grid-template-columns: 1fr; gap: 12px; }
    .vacancy-btn { width: 44px; height: 44px; font-size: 22px; }
    .vacancy-input { font-size: 20px; padding: 12px; }
    .facility-edit-tabs .tab-link { padding: 10px 12px; font-size: 12px; }
    .facility-edit-body { padding: 18px 14px; }
    .form-grid-2 { grid-template-columns: 1fr; gap: 0; }
    .form-grid-3 { grid-template-columns: 1fr; gap: 0; }
    .acceptance-table { font-size: 12px; min-width: 480px; }
    .acceptance-table th.col-item, .acceptance-table td.col-item { width: 35%; }
    .acceptance-table td.col-level { width: 44px; padding: 2px; }
}
