/* ====================================
   index.php専用スタイル
   ==================================== */

/* 外部CSSの競合を完全に封じ込めるための最強の優先順位設定 */
html body .global-nav,
html body nav.global-nav {
    background-color: #003d6b !important;
    background: #003d6b !important;
    height: 60px !important;
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 99999 !important;
    visibility: visible !important;
    opacity: 1 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

html body .nav-inner,
html body .global-nav .nav-inner {
    display: flex !important;
    height: 100% !important;
    width: 100% !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 25px !important;
    background: transparent !important;
}

/* システムタイトル（左側） */
html body .nav-brand a {
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 1.2rem !important;
    font-weight: bold !important;
    letter-spacing: 0.05em !important;
}

/* 右側エリア（出展者情報と言語） */
html body .nav-right {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
}

html body .nav-exhibitor-info {
    color: #ffffff !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
}

html body .booth-number {
    margin-left: 8px !important;
    font-size: 0.85rem !important;
    opacity: 0.9 !important;
}

/* 言語セレクター（ボタン風） */
html body .lang-selector select {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    padding: 4px 10px !important;
    border-radius: 4px !important;
    font-size: 0.75rem !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    min-width: 42px !important;
    text-align: center !important;
}

html body .lang-selector select:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: #ffffff !important;
}

/* メインエリアの余白（ヘッダーとフッター60px/40pxに合わせる） */
html body .main-content-wrap {
    padding-top: 60px !important;
    padding-bottom: 40px !important;
    /* フッター分の余白 */
    margin-top: 0 !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    display: block !important;
    width: 100% !important;
    min-height: 100vh !important;
    box-sizing: border-box !important;
}

/* サイドバーの保護（ヘッダー60pxに合わせる・常時固定表示） */
html body .sidebar-left {
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    width: 250px !important;
    height: calc(100vh - 60px - 40px) !important;
    /* フッターを避ける */
    z-index: 99998 !important;
    /* ナビ(99999)のすぐ下 */
    background: white !important;
    border-right: 1px solid #e0e0e0 !important;
    display: block !important;
    overflow-y: auto !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* フッターを最前面で固定表示 */
html body .footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 40px !important;
    background: #003366 !important;
    border-top: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 100000 !important;
    /* 最前面 */
    font-size: 0.8rem !important;
    color: #ffffff !important;
    margin: 0 !important;
}

/* コンテンツエリアの左余白（固定サイドバー分 250px + 余白 50px = 300px） */
html body .layout-with-sidebar .container {
    margin-left: 300px !important;
    width: 1300px !important;
    max-width: 1300px !important;
    min-width: 1300px !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    /* パディングをリセットして1300pxを維持 */
}

/* 見出し（罫線用）の幅を1300pxに固定 */
html body .main-content h2 {
    display: block !important;
    border-bottom: 2px solid #003366 !important;
    color: #003366 !important;
    box-sizing: border-box !important;
    margin: 30px 0 20px 0 !important;
    padding-bottom: 12px !important;
}

/* サイドメニューのアクティブ項目のスタイル */
html body #side-menu .menu-list li.active,
html body #side-menu .menu-list li[data-page].active {
    background: linear-gradient(90deg, #7b68ee 0%, #9370db 100%) !important;
    background-color: #9370db !important;
    color: #ffffff !important;
    pointer-events: auto !important;
}

html body #side-menu .menu-list li.active a,
html body #side-menu .menu-list li.active a span,
html body #side-menu .menu-list li.active div {
    color: #ffffff !important;
    font-weight: bold !important;
    background: transparent !important;
}

/* メニュー全体の基本設定 */
html body #side-menu .menu-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

html body #side-menu .menu-list li {
    padding: 0 !important;
    margin: 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
    transition: background 0.2s !important;
}

html body #side-menu .menu-list li a {
    display: block !important;
    padding: 15px 20px !important;
    text-decoration: none !important;
    color: #333333 !important;
    transition: all 0.2s !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ホバー時のスタイル */
html body #side-menu .menu-list li:hover:not(.active) {
    background-color: #f8f9fa !important;
}

html body #side-menu .menu-list li:hover:not(.active) a {
    color: #667eea !important;
    padding-left: 25px !important;
    /* 少し右にずらすアニメーション */
}

/* 非アクティブ時の文字色 */
html body #side-menu .menu-list li:not(.active) a {
    color: #333333 !important;
}

/* ページトップボタンを最前面に */
html body .page-top#pageTop {
    z-index: 200000 !important;
    bottom: 60px !important;
    /* フッター(40px)＋余白 */
    visibility: hidden;
    /* デフォルトは非表示 */
}

html body .page-top#pageTop.show {
    visibility: visible !important;
    opacity: 1 !important;
}

/* 不要なスクロールバーを防止 */
html body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

/* ====================================
   共通スタイル（元のindex.css）
   ==================================== */

/* 管理画面と同一の共通スタイルを強制適用 */
html body {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    overflow-x: hidden !important;
}

/* 固定グローバルメニュー */
.global-nav {
    background: #003366 !important;
    height: 60px;
    box-shadow: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    box-sizing: border-box;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

.global-nav .nav-brand a {
    color: white !important;
    text-decoration: none !important;
    font-size: 1.4em !important;
    font-weight: bold !important;
    display: flex;
    align-items: center;
}

.nav-exhibitor-info {
    color: white;
    font-size: 1em;
    font-weight: 500;
    display: flex;
    align-items: center;
}

/* 言語選択プルダウン */
.lang-selector {
    margin-left: 20px;
}

.lang-selector select {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.lang-selector select:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.lang-selector select option {
    background: #003366;
    color: white;
}

.main-content-wrap {
    flex: 1;
    padding-top: 28px;
    /* ブラウザ上部から28pxの余白に調整 */
}

/* 備品グリッド設定 */
.items-grid {
    display: grid;
    grid-template-columns: repeat(4, 280px);
    gap: 10px;
    justify-content: start;
    align-items: start;
    margin-right: 340px;
    /* カートとの重なりを防ぐための余白 */
}

/* 備品カード本体 */
.item-card {
    background: white;
    border: 1px solid #ccc;
    /* 柔らかい境界線 */
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
    border-radius: 10px;
    /* 角丸を追加 */
    overflow: hidden;
    /* 角丸を中身にも適用 */
    width: 280px;
}

/* カードヘッダー（品名） */
.item-card-header {
    background: #fff;
    border-bottom: 1px solid #ccc;
    padding: 8px 12px;
    font-weight: bold;
    font-size: 0.9em;
    /* 一回り小さく (元は1.05em) */
    color: #000;
    text-align: left;
}

.item-name-sub {
    font-size: 0.85em;
    /* もう一回り小さく */
    font-weight: normal;
    /* 太字にしない */
    color: #666;
    /* 少し色を薄くして差別化 */
}

/* 画像エリア（サムネイル） */
.item-image-area {
    width: 100%;
    height: 220px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-bottom: 1px solid #ddd;
    box-sizing: border-box;
    overflow: hidden;
}

.item-image-area img.thumb {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
}

/* 画像モーダルスタイル */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* 背景をより暗く */
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.image-modal.show {
    display: flex;
}

.image-modal-content {
    position: relative;
    width: 500px;
    height: 500px;
    background: #fff;
    border: 6px solid #ef7d16;
    /* オレンジの太枠 */
    padding: 20px;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-modal-close {
    position: absolute;
    top: -45px;
    right: -45px;
    width: 40px;
    height: 40px;
    background: none;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* 詳細テーブルスタイル */
.item-details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.item-details-table tr {
    border-bottom: 1px solid #eee;
}

.item-details-table tr:last-child {
    border-bottom: none;
}

.item-details-table th,
.item-details-table td {
    padding: 6px 10px;
    text-align: left;
}

.item-details-table th {
    background: #f0f0f0;
    /* 見本の薄いグレー */
    width: 70px;
    font-weight: normal;
    color: #333;
    border-right: 1px solid #eee;
}

.item-details-table td {
    color: #333;
    background: #fff;
}

/* 備考の文字サイズを調整 */
.item-details-table tr:last-child td {
    font-size: 0.85em;
    line-height: 1.3;
}

/* 在庫アラート色 */
.stock-alert {
    color: #ef4444;
    font-weight: bold;
}

/* レンタル数入力エリア（カード下部） */
.item-order-area {
    margin-top: auto;
    padding: 12px 10px;
    background: #fff;
    border-top: 1px solid #000;
    /* 区切り線を黒で強調 */
}

.order-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 0 5px;
}

.stock-status {
    font-size: 0.8em;
    color: #333;
    white-space: nowrap;
    font-weight: bold;
    margin-right: 5px;
}

.stock-status.alert {
    color: #ef4444;
    /* 在庫わずかの場合は赤 */
}

.rental-box {
    display: flex;
    border: 1px solid #003366;
    overflow: hidden;
    border-radius: 0;
    height: 32px;
}

.rental-label {
    background: #fff;
    padding: 0 5px;
    border-right: 1px solid #003366;
    font-size: 0.7em;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-weight: normal;
    width: 90px;
}

.rental-input-wrap {
    width: 50px;
    display: flex;
    align-items: center;
    background: #fff;
}

.quantity-select {
    width: 100%;
    height: 100%;
    border: none;
    padding: 0 2px;
    font-size: 0.85em;
    outline: none;
    background: #fff;
    color: #000;
    cursor: pointer;
    text-align: center;
}

/* 申請ボタンとアクションエリア */
.form-actions {
    margin-top: 50px;
    text-align: center;
    padding-bottom: 50px;
}

.btn-primary {
    background: #003366;
    color: white;
    padding: 16px 80px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: none !important;
}

.btn-primary:hover {
    background: #004c99;
    transform: translateY(-2px);
    box-shadow: none !important;
}

/* 確認画面用テーブル */
.confirm-table {
    width: 1300px !important;
    border-collapse: collapse;
    background: #fff;
    border-radius: 0 !important;
    overflow: hidden;
    box-shadow: none !important;
    margin-bottom: 30px;
    border: 1px solid #ccc !important;
}

.confirm-table th,
.confirm-table td {
    padding: 15px;
    border: 1px solid #ccc !important;
    text-align: left;
}

.confirm-table th {
    background: #f8fafc;
    color: #003366;
    font-weight: bold;
}

.confirm-thumb {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    cursor: pointer;
    vertical-align: middle;
    margin-right: 15px;
    transition: transform 0.2s;
}

.confirm-thumb:hover {
    transform: scale(1.1);
    border-color: #ef7d16;
}

.total-row {
    background: #f0f4f8;
    font-weight: bold;
    font-size: 1.2em;
}

.btn-secondary {
    background: #94a3b8;
    color: white;
    padding: 16px 50px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.2em;
    cursor: pointer;
    margin-right: 15px;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: #64748b;
}

/* ページトップボタン */
.page-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    background: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 5px;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 3000;
    box-shadow: none !important;
}

.page-top.show {
    opacity: 1;
    visibility: visible;
}

.page-top:hover {
    background: #0056b3;
    transform: translateY(-5px);
}

/* フッター */
.footer {
    background: #003366;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9em;
    width: 100%;
    z-index: 1000;
    position: fixed;
    bottom: 0;
    left: 0;
}

/* 浮動申請内容エリア */
.floating-summary {
    position: fixed;
    right: 20px;
    top: 90px;
    width: 300px;
    background: white;
    border: 8px solid #16a34a;
    /* 緑色 */
    border-radius: 12px;
    padding: 12px;
    /* 余白を短く */
    box-shadow: none !important;
    z-index: 2100;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

.floating-summary h3 {
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #16a34a;
    font-size: 1.1em;
    color: #16a34a;
    text-align: center;
}

.summary-content {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.65em;
    border: 1px solid #ccc !important;
}

.summary-table th {
    background: #f8fafc;
    padding: 4px 3px;
    border: 1px solid #ccc !important;
}

.summary-table th:last-child {
    border-right: none;
}

/* 各列の文字揃えをデータに合わせる */
.summary-table th:nth-child(1),
.summary-table td:nth-child(1) {
    text-align: left;
    width: 45px;
}

.summary-table th:nth-child(2),
.summary-table td:nth-child(2) {
    text-align: left;
}

.summary-table th:nth-child(3),
.summary-table td:nth-child(3) {
    text-align: center;
    width: 40px;
}

.summary-table th:nth-child(4),
.summary-table td:nth-child(4) {
    text-align: right;
    width: 70px;
}

.summary-table td {
    padding: 4px 3px;
    border: 1px solid #ccc !important;
}

.summary-table .total-row td {
    background: #f1f5f9;
    border-top: 2px solid #16a34a;
    font-weight: bold;
    font-size: 1.1em;
    padding: 10px 6px;
}

.summary-table .total-row td:last-child {
    text-align: right;
}

.summary-table .total-row td:first-child {
    text-align: left;
    padding-left: 10px;
}

.floating-summary .btn-primary {
    background: #16a34a !important;
    border-color: #16a34a !important;
}

.btn-block {
    width: 100%;
    padding: 10px !important;
    font-size: 0.9em !important;
}

/* 画面幅が狭い場合は非表示に */
@media (max-width: 1300px) {
    .floating-summary {
        display: none !important;
    }
}

/* コンテナの幅調整 */
.container {
    width: 1300px !important;
    max-width: 1300px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* セクション見出し (管理画面準拠) */
.main-content h2 {
    color: #003366;
    border-bottom: 2px solid #003366;
    padding-bottom: 12px;
    margin-top: 30px !important;
    margin-bottom: 15px !important;
    font-weight: bold;
    font-size: 1.8em;
    box-sizing: border-box;
}