/* CUSTOM */
/* root:設定 */
:root {
    --font-family-primary: Roboto,Helvetica Neue,Helvetica,Arial,ヒラギノ角ゴ Pro W3,Hiragino Kaku Gothic Pro,メイリオ,Meiryo,sans-serif;
    --bs-font-sans-serif: var(--font-family-primary);

    --bs-root-font-size: 15px;

    --primary: #79aec8;
    --secondary: #282828;
    --accent: #ffe44b;
    --primary-fg: #fff;

    --body-fg: #333;
    --body-bg: #fff;
    --body-quiet-color: #666;
    --body-loud-color: #000;

    --header-color: #ffc;
    --header-branding-color: var(--accent);
    --header-bg: var(--secondary);
    --header-link-color: var(--primary-fg);

    --breadcrumbs-fg: #c4dce8;
    --breadcrumbs-link-fg: var(--body-bg);
    --breadcrumbs-bg: #555555;

    --link-fg: #36383a;
    --link-hover-color: #036;
    --link-selected-fg: var(--secondary);

    --section-title:#16b69f;

    --hairline-color: #e8e8e8;
    --border-color: #d9dee3;

    --error-fg: #ba2121;

    --message-success-bg: #dfd;
    --message-warning-bg: #ffc;
    --message-error-bg: #ffefef;

    --darkened-bg: #f8f8f8; /* A bit darker than --body-bg */
    --selected-bg: #e4e4e4; /* E.g. selected table cells */
    --selected-row: #ffc;

    --button-fg: #fff;
    --button-bg: var(--secondary);
    --button-hover-bg: #205067;
    --default-button-bg: #205067;
    --default-button-hover-bg: var(--secondary);
    --close-button-bg: #747474;
    --close-button-hover-bg: #333;
    --delete-button-bg: #ba2121;
    --delete-button-hover-bg: #a41515;

    --object-tools-fg: var(--button-fg);
    --object-tools-bg: var(--close-button-bg);
    --object-tools-hover-bg: var(--close-button-hover-bg);

    --bs-body-font-size: 0.9375rem;
    --bs-body-font-weight: 400;
    --bs-body-line-height: 1.53;

    /* Bootstrap Colors */
    --bs-blue: #007bff;
    --bs-indigo: #6610f2;
    --bs-purple: #696cff;
    --bs-pink: #e83e8c;
    --bs-red: #ff3e1d;
    --bs-orange: #fd7e14;
    --bs-yellow: #ffab00;
    --bs-green: #71dd37;
    --bs-teal: #20c997;
    --bs-cyan: #03c3ec;
    --bs-white: #fff;
    --bs-gray: rgba(67, 89, 113, 0.6);
    --bs-gray-dark: rgba(67, 89, 113, 0.8);
    --bs-gray-25: rgba(67, 89, 113, 0.025);
    --bs-gray-50: rgba(67, 89, 113, 0.05);

    --bs-primary: #696cff;
    --bs-secondary: #8592a3;
    --bs-success: #16a957;
    --bs-info: #03c3ec;
    --bs-warning: #ffab00;
    --bs-danger: #ff3e1d;
    --bs-light: #fcfdfd;
    --bs-dark: #233446;

    --bs-gray: rgba(67, 89, 113, 0.1);
}

/* Hタグの文字サイズ調整 */
h1 {
    font-size: 1.5rem; /* base.css より少し大きめ */
}

h2 {
    font-size: 1.25rem; /* base.css より少し大きめ */
}

h3 {
    font-size: 1rem; /* base.css より少し大きめ */
}

.text-success {
    color: var(--bs-success) !important;
}

.bg-success {
    background-color: var(--bs-success) !important;
}

.bg-purple {
    background-color: var(--bs-purple) !important;
    color: #fff !important;
}

.bg-cyan {
    background-color: var(--bs-cyan) !important;
    color: #fff !important;
}

.badge {
    font-weight: bold;
    position: relative;
    top: -1.5px;
}

.btn-outline-primary {
    background: #fff;
}

.btn-success {
    color: #fff;
    background-color: #06b444;
    border-color: #06b444;
    box-shadow: 0 0.125rem 0.25rem 0 rgba(113, 221, 55, 0.4);
}

.alert-info {
    background-color: #dbf8ff;
    border-color: #b3edf9;
    color: #009dbf;
}

.alert-success {
    background-color: #f2ffeb;
    border-color: #d4f5c3;
    color: #38a000;
}

.alert-warning {
    background-color: #fff8e8;
    border-color: #ffe6b3;
    color: #e79b00;
}

.alert-danger {
    background-color: #fff5f3;
    border-color: #ffc5bb;
    color: #ef2300;
}

/* テーブルキャプションは上に表示 */
table {
    caption-side: top;
}

.table th a {
    color: #333;
}

.table th {
    text-transform: none;
}

.table thead th {
    white-space: nowrap;
}

.nowrap {
    white-space: nowrap;
}

/* 個別指定 */
/* 改行しないカラム */
th.field-email,
.field-display_product_code,
.field-display_other_code,
.field-title,
.field-company_name,
.field-contract_type_name,
.field-role_type,
.field-role_detail,
.field-last_name,
.field-first_name,
.field-email,
.field-company,
.field-api_name,
.field-payment_method,
.field-display_datetime,
.field-display_location,
.field-product_code_jp,
.field-display_identification_number,
.field-get_location,
.field-model_type,
.field-get_arrival_status,
.field-display_order_code,
.field-display_order_status,
.field-display_payment_method,
.field-refund_method,
.field-display_users,
.field-completion_button,
.field-display_product_info,
.field-display_product_category,
.field-notification_link,
.field-msn_link,
.field-device_name,
.field-smartphone_name,
.field-series_name,
.field-tid,
.field-indented_company_name,
.field-bank_account_button,
.field-warehouse_button,
.field-name,
.field-remarks,
.field-api_type,
.field-display_order_info,
.field-display_simple_payment_method,
.field-terminal_identifier,
.field-payment_type,
.field-display_date,
.field-display_location_and_terminal,
.field-display_payment_details,
.field-gmo_sales_summary,
.field-app_sale_summary,
.field-contract_type_with_machine_type,
.field-company_and_location,
.field-contract_period,
.field-installation_period,
.field-bank_and_invoice_info,
.field-economic_conditions,
.field-closing_and_payment,
.field-get_contract_location,
.field-user_display,
.field-browser_display,
.field-notification_settings,
.field-last_activity,
.field-display_dates,
.field-display_reason,
.field-display_action_details,
.field-display_name,
.field-color_preview,
.field-website_publication_status,
.field-transaction_id,
.field-display_device_with_location,
.field-display_datetime,
.field-display_status,
.field-display_amount,
.field-is_matched_display,
.field-display_matched_sale_detail
{
    white-space: nowrap;
}

/* 数値関連カラムの右寄せ */
#result_list .field-formatted_price,
#result_list .field-formatted_cost,
#result_list .field-sale_price,
#result_list .field-discount_price,
#result_list .field-total_payment,
#result_list .field-free_stock,
#result_list .field-logiless_stock,
#result_list .field-disp_cleaning_solution_remaining_percentage,
#result_list .field-cleaning_solution_remaining_uses,
#result_list .field-disp_cleaning_cloth_remaining_percentage,
#result_list .field-cleaning_cloth_remaining_uses,
#result_list .field-cleaning_solution_status,
#result_list .field-cleaning_cloth_status,
#result_list .field-display_total_payment,
#result_list .field-display_amount,
.field-user_count
{
    white-space: nowrap;
    text-align: right;
}

/* アイコン関係カラムの中央寄せ */
.field-get_payment_terminal_status,
.field-get_sim_card_status,
.field-get_app_registration_status,
.field-get_slot_stock_link,
.field-device_status_display,
.field-network_status_display,
.field-bank_account_button,
.field-warehouse_button,
.field-completion_button,
.field-invite_user_button,
.field-notification_status_button,
.field-display_snapshot,
.field-display_processing_type,
.field-display_refund_method,
.field-status_badge,
.field-maintenance_status
{
    white-space: nowrap;
    text-align: center;
}

#location_note_image-clear_id,
#image-clear_id {
    margin-left: 1rem;
}

input#id_email {
    min-width: 20rem;
}

div#id_password {
    padding: 0;
    border: none;
}

td.field-product_name {
    min-width: 20rem;
}

td.delete {
    white-space: nowrap;
    text-align: center;
}

tbody td.action-checkbox {
    width: 52px;
}

.table tbody th {
    font-size: 0.9375rem;
}

input[type="text"] {
    min-width: 9rem;
}

input[type="number"] {
    min-width: 7rem;
}

span.sortpriority {
    display: none;
}

p.date {
    margin: 0;
}

a.change-related, a.add-related, a.view-related, a.delete-related {
    display: none;
}

.inline-icon {
    vertical-align: text-bottom;
}

/* ========================================
   Boxicons インライン表示最適化
   ======================================== */

/* 全てのBoxiconsアイコンのインライン表示を改善 */
.bx, .bxs, .bxl {
    vertical-align: middle;
    position: relative;
    top: -0.05em; /* わずかに下げて中央揃え */
    font-size: 1.15em; /* テキストより少し大きく */
    line-height: 1;
}

/* 見出しタグ内のアイコンサイズ調整 */
h1 .bx, h1 .bxs, h1 .bxl {
    font-size: 1.1em;
}

h2 .bx, h2 .bxs, h2 .bxl {
    font-size: 1.1em;
}

h3 .bx, h3 .bxs, h3 .bxl,
h4 .bx, h4 .bxs, h4 .bxl,
h5 .bx, h5 .bxs, h5 .bxl,
h6 .bx, h6 .bxs, h6 .bxl {
    font-size: 1.15em;
    top: -0.05em;
}

/* ボタン内のアイコン */
.btn .bx, .btn .bxs, .btn .bxl,
button .bx, button .bxs, button .bxl {
    font-size: 1.1em;
    top: -0.05em;
}

/* バッジ内のアイコン */
.badge .bx, .badge .bxs, .badge .bxl {
    font-size: 1em;
    top: -0.05em;
}

/* テーブル内のアイコン */
.table .bx, .table .bxs, .table .bxl {
    font-size: 1.15em;
    top: -0.05em;
}

/* カード内のアイコン */
.card .bx, .card .bxs, .card .bxl {
    font-size: 1.15em;
    top: -0.05em;
}

/* アラート・通知内のアイコン */
.alert .bx, .alert .bxs, .alert .bxl,
.toast .bx, .toast .bxs, .toast .bxl {
    font-size: 1.15em;
    top: -0.05em;
}

/* ナビゲーション・メニュー内のアイコン */
.nav .bx, .nav .bxs, .nav .bxl,
.menu .bx, .menu .bxs, .menu .bxl,
.breadcrumb .bx, .breadcrumb .bxs, .breadcrumb .bxl {
    font-size: 1.1em;
    top: -0.05em;
}

fieldset .fieldset-heading, fieldset .inline-heading, :not(.inline-related) .collapse summary {
    padding: 4px;
    font-size: 0.8125rem;
    color: var(--section-title);
    border-bottom: 1px #ccc solid;
    border-top: none;
    border-left: none;
    border-right: none;
    margin-bottom: 1.5rem;
    font-weight: bold;
    background: none;
    letter-spacing: 2px;
}

.code-icon {
    border: 1px solid #ccc;
    margin: 2px 5px 2px 0px;
}

.code-badge {
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 4px 2px;
    border: 1px solid #666;
    line-height: 1;
    margin: 0px 5px 0px 0;
    display: inline-block;
    border-radius: 3px;
    color: #666;
    vertical-align: middle;
    background-color: #fff;
}

.source-badge {
    text-align: center;
    width: 3rem;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 4px 2px;
    border: 1px solid #666;
    line-height: 1;
    margin: 0px 5px 0px 0;
    display: inline-block;
    border-radius: 3px;
    color: #666;
    vertical-align: middle;
    background-color: #fff;
}

.text-badge {
    text-align: center;
    width: 4.6rem;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 4px 2px;
    border: 1px solid #666;
    line-height: 1;
    margin: 0px 5px 0px 0;
    display: inline-block;
    border-radius: 3px;
    color: #666;
    vertical-align: middle;
    background-color: #fff;
}

.datetime-badge {
    text-align: center;
    width: 80px;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 4px 2px;
    border: 1px solid #666;
    line-height: 1;
    margin: 0px 5px 0px 0;
    display: inline-block;
    border-radius: 3px;
    color: #666;
    vertical-align: middle;
    background-color: #fff;
}

.f-badge {
    background-color: #333;
    color: yellow;
    width: 80px;
    text-align: center;
    vertical-align: middle;
    letter-spacing: 0;
}

.m-badge {
    background-color: #3fad9e;
    color: #fff;
    width: 80px;
    text-align: center;
    text-transform: none;
    vertical-align: middle;
    letter-spacing: 0;
}

h4 .f-badge, h4 .m-badge,
h5 .f-badge, h5 .m-badge {
    width: auto;
    font-size: 14px;
    font-weight: bold;
    padding: 6px 10px;
    vertical-align: bottom;
}

/* 自販機タイプアイコン */
.machine-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 1rem;
    flex-shrink: 0;
    position: relative;
    top: -1px;
}

.machine-type-icon.filmlabo {
    background-color: #333;
}

.machine-type-icon.mycaselabo {
    background-color: #3fad9e;
}

.machine-type-icon i {
    font-size: 14px;
    margin-top: 3px;
}

.machine-type-icon.filmlabo i {
    color: #FFD700;
}

.machine-type-icon.mycaselabo i {
    color: #fff;
}





a[id^="change_id_details-"][id$="-product"],
a[id^="add_id_details-"][id$="-product"],
a[id^="view_id_details-"][id$="-product"] {
    display: none;
}

/* ========================================
   Select2カスタムスタイル（統一デザイン）
   全テンプレートで統一された見た目を実現
   ======================================== */

/* Select2コンテナ - 幅を100%に統一 */
.select2-container {
    width: 100% !important;
}

/* Select2選択フィールド - 全テーマ共通（Bootstrap 5 / デフォルト / Admin Autocomplete） */
body .select2-container--admin-autocomplete .select2-selection--single,
body .select2-container--admin-autocomplete .select2-selection--multiple,
body .select2-container--default .select2-selection--single,
body .select2-container--default .select2-selection--multiple,
body .select2-container--bootstrap-5 .select2-selection--single,
body .select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 38px !important;
    height: 38px !important;
    padding: 0;
    border: 1px solid #d9dee3 !important;
    border-radius: 0.375rem !important;
    background-color: #fff !important;
    font-size: 0.9375rem !important;
}

/* Select2選択フィールド内のテキスト */
body .select2-container--admin-autocomplete .select2-selection--single .select2-selection__rendered,
body .select2-container--default .select2-selection--single .select2-selection__rendered,
body .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #697a8d !important;
    line-height: 38px !important;
    display: block;
    padding-left: 12px !important;
    padding-right: 20px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Select2プレースホルダー */
body .select2-container--default .select2-selection--single .select2-selection__placeholder,
body .select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
    color: #697a8d !important;
}

/* Select2矢印アイコン */
body .select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow,
body .select2-container--default .select2-selection--single .select2-selection__arrow,
body .select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
    right: 1px !important;
    width: 20px !important;
}

/* Select2フォーカス時とオープン時のスタイル */
body .select2-container--admin-autocomplete.select2-container--focus .select2-selection,
body .select2-container--admin-autocomplete.select2-container--open .select2-selection,
body .select2-container--default.select2-container--focus .select2-selection,
body .select2-container--default.select2-container--open .select2-selection,
body .select2-container--bootstrap-5.select2-container--focus .select2-selection,
body .select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: #696cff !important;
    box-shadow: 0 0 0 0.2rem rgba(105, 108, 255, 0.25) !important;
    outline: 0 !important;
    min-height: 38px !important;
}

/* Select2ドロップダウン */
.select2-dropdown {
    border: 1px solid #d1d3e2 !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15) !important;
}

/* Select2ドロップダウン内の選択済みオプション */
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--selected, 
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option[aria-selected=true]:not(.select2-results__option--highlighted) {
    background-color: #dce9fc !important;
}

/* Select2ドロップダウン内のオプション */
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option,
.select2-container--default .select2-dropdown .select2-results__options .select2-results__option {
    font-size: 0.9375rem !important;
    color: #5a5c69 !important;
    padding: 8px 12px;
}

/* Select2ドロップダウンでハイライトされたオプション */
body .select2-container--default .select2-results__option--highlighted[aria-selected],
body .select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background-color: #ebedce !important;
    color: white !important;
}

/* Select2選択済みオプション（複数選択時） */
.select2-container--default .select2-results__option[aria-selected=true],
.select2-container--bootstrap-5 .select2-results__option[aria-selected=true] {
    background-color: #f8f9fa !important;
}

/* モバイル対応 */
@media (max-width: 767.98px) {
    .select2-container {
        font-size: 16px !important; /* iOS Safariのズーム防止 */
    }
}

.menu-vertical .menu-header {
    margin: 0.6rem 0 0.3rem 0;
    padding: 0.3rem 2rem 0.3rem 2rem;
}

.bg-menu-theme .menu-header:before {
    top: 0.87rem;
}

.menu-vertical .menu-inner > .menu-item .menu-link {
    margin: 0rem 1rem;
}
.menu-vertical .menu-sub .menu-link {
    padding-left: 3rem;
}
.menu-vertical .menu-sub .menu-link {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.menu-vertical .menu-item .menu-link {
    font-size: 0.9rem;
}

/* ダッシュボードテーブルのスタイル */
#dashboard-contracts table td.contract-id {
    width: 2rem;
}


#id_usable_password input[type="radio"] {
    float: left;
    margin-right: .5rem;
}

#id_usable_password > div {
    display: inline;
    margin-right: .5rem;
}

ul.errorlist {
    margin: 0;
    padding-left: 1.4rem;
}

ul.errorlist > li {
    color: rgba(var(--bs-danger-rgb)) !important;
}

.bg-success.toast, .bg-success.bs-toast {
    color: #fff;
    background-color: rgba(75, 179, 19, 0.85) !important;
}

select#id_target_companies {
    height: 20rem;
}

input, textarea, .select2.select2-container {
    max-width: 100%;
}

footer .poweredby {
    background: #fff;
    padding: .2rem 1rem;
    border-radius: 1rem;
}

.order-detail label {
    background: #f9f9f9;
    margin: .3rem 0;
    font-weight: bold;
}

input[type="date"] {
    min-width: 150px;
}

table.slot-table {
    white-space: nowrap;
}

table.slot-table th.slot-num {
    width: 1rem;
    height: 200px;
}

table.slot-table td.slot-contents {
    min-width: 15rem;
    align-content: start;
}

table.slot-table td.slot-stock {
    min-width: 4.5rem;
}

.debug-mode {
    background-image: repeating-linear-gradient(315deg, #ff3f3f, #ff3f3f 10px, #fd0000 10px, #fd0000 20px);
    position: fixed; 
    top: 0; 
    width: 100%; 
    color: white; 
    text-align: center; 
    z-index: 1500; 
    padding: 5px; 
    font-weight: bold;
    letter-spacing: 1px;
}

/* 案件管理: モバイル対応スタイル */
@media (max-width: 575.98px) {
    /* タイトル部分のレスポンシブ調整 */
    .d-flex.justify-content-between.align-items-center h4 {
        font-size: 1.1rem;
    }

    .d-flex.justify-content-between.align-items-center h4 .text-muted {
        font-size: 0.8rem;
    }

    #add-project-btn-mobile i {
        font-size: 1.2rem;
    }
}

/* タブレット表示用の調整 */
@media (min-width: 576px) and (max-width: 991.98px) {
    /* デスクトップ用ボタンをタブレットでも表示 */
    #add-project-btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}

/* スマホ表示用メニューボタンの固定表示 */
@media (max-width: 1199.98px) {
    /* 元のメニューボタンがスクロール時に固定位置に移動 */
    .scrolled-fixed,
    .layout-menu-toggle.scrolled-fixed,
    .d-xl-none.scrolled-fixed {
        position: fixed !important;
        top: 20px !important;
        left: 20px !important;
        z-index: 9999 !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border-radius: 8px !important;
        padding: 8px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        border: 1px solid rgba(0, 0, 0, 0.1) !important;
        transition: all 0.3s ease !important;
        animation: slideInFromTop 0.3s ease forwards !important;
        display: block !important;
        width: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
    }
    
    /* d-xl-noneクラスの上書き */
    .scrolled-fixed.d-xl-none {
        display: block !important;
    }
    
    .layout-menu-toggle.scrolled-fixed:hover {
        background: rgba(255, 255, 255, 1) !important;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
        transform: translateY(-2px) !important;
    }
    
    .scrolled-fixed .bx-menu,
    .scrolled-fixed i.bx-menu {
        color: #333 !important;
        font-size: 24px !important;
        display: inline-block !important;
        visibility: visible !important;
    }
    
    /* メニューリンクのスタイル */
    .scrolled-fixed a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: inherit !important;
        text-decoration: none !important;
    }
    
    /* 通知アイコンの調整（固定時） */
    .layout-menu-toggle.scrolled-fixed .bxs-bell {
        top: -8px !important;
        right: -8px !important;
        font-size: 0.7rem !important;
        background: #fff !important;
        border-radius: 50% !important;
        padding: 2px !important;
        border: 2px solid #ffab00 !important;
    }
    
    /* サイドバーが開いている時は固定メニューボタンを非表示 */
    .layout-container.layout-menu-expanded .layout-menu-toggle.scrolled-fixed {
        display: none !important;
    }
    
    /* 元のナビゲーションバー内のメニューボタンもサイドバー開時は非表示 */
    .layout-container.layout-menu-expanded .layout-navbar .layout-menu-toggle {
        display: none !important;
    }
    
    /* デバッグモード時の上部余白調整 */
    .debug-mode + div .layout-menu-toggle.scrolled-fixed {
        top: 60px !important;
    }
    
    /* アニメーション */
    @keyframes slideInFromTop {
        0% {
            opacity: 0;
            transform: translateY(-20px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes slideOutToTop {
        0% {
            opacity: 1;
            transform: translateY(0);
        }
        100% {
            opacity: 0;
            transform: translateY(-20px);
        }
    }
    
    /* スクロール時の元のメニューボタンを非表示 */
    .layout-navbar.navbar-scrolled .layout-menu-toggle:not(.scrolled-fixed) {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    /* 固定メニューボタンがある場合の元の位置を透明に */
    .layout-navbar .layout-menu-toggle.scrolled-fixed ~ .layout-menu-toggle {
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* TOAST通知の閉じるボタンスタイル */
.toast .btn-close,
.bs-toast .btn-close {
    opacity: 1 !important;
}

.toast .btn-close:hover,
.bs-toast .btn-close:hover {
    opacity: 0.75 !important;
}

/* TOASTヘッダーの閉じるボタン（デフォルトの黒） */
.toast-header .btn-close,
.bs-toast .toast-header .btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: none;
    width: 1em;
    height: 1em;
    filter: none !important;
}

/* 暗い背景のTOAST bodyの閉じるボタンのみ白く */
.toast.bg-success .toast-body .btn-close,
.toast.bg-warning .toast-body .btn-close,
.toast.bg-danger .toast-body .btn-close,
.toast.bg-info .toast-body .btn-close,
.toast.bg-primary .toast-body .btn-close,
.toast.bg-secondary .toast-body .btn-close,
.toast.bg-dark .toast-body .btn-close,
.bs-toast.bg-success .toast-body .btn-close,
.bs-toast.bg-warning .toast-body .btn-close,
.bs-toast.bg-danger .toast-body .btn-close,
.bs-toast.bg-info .toast-body .btn-close,
.bs-toast.bg-primary .toast-body .btn-close,
.bs-toast.bg-secondary .toast-body .btn-close,
.bs-toast.bg-dark .toast-body .btn-close {
    filter: brightness(0) invert(1) !important;
}

/* ========================================
   iPhoneタップ最適化（レイアウト変更なし）
   ======================================== */
   
/* 最小限のタッチ最適化 - Sneatテーマとの干渉を避ける */
a, button, 
input[type="submit"], input[type="button"], input[type="reset"],
.btn, .button,
[role="button"],
[onclick],
.clickable {
    /* iOSの300ms遅延を除去（基本のみ） */
    touch-action: manipulation;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: #fcfdff;
}

/* テーブルヘッダー固定のためのCSS */
.table-fixed-header {
    position: relative;
    border-spacing: 0;
    overflow-x: auto;
}

/* iOS Safari対応: シンプルなスティッキーヘッダー */
.table-fixed-header thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #ffffff;
}

/* 各ヘッダーセルの基本設定 */
.table-fixed-header thead th {
    position: relative;
    background-color: #ffffff !important;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 1px 0 0 #dee2e6;
    z-index: inherit;
}

/* 複数行ヘッダーの各行設定 */
.table-fixed-header thead tr th {
    background-color: #ffffff !important;
    box-sizing: border-box;
}

/* iOS Safari専用の追加修正 */
@supports (-webkit-overflow-scrolling: touch) {
    .table-fixed-header {
        -webkit-overflow-scrolling: touch;
    }

    .table-fixed-header thead {
        position: -webkit-sticky;
        position: sticky;
        background-color: #ffffff;
        transform: translateZ(0);
        will-change: transform;
    }

    .table-fixed-header thead th {
        transform: translateZ(0);
    }
}

/* 左端の列の左ボーダーを除去 */
.table-fixed-header thead tr th:first-child {
    border-left: none;
}

/* 右端の列の右ボーダーを除去 */
.table-fixed-header thead tr th:last-child {
    border-right: none;
}

/* 最下段の行のボーダーを強調 */
.table-fixed-header thead tr:last-child th {
    border-bottom: 2px solid #333;
}

/* テーブルライトテーマ対応 */
.table-fixed-header thead.table-light th {
    background-color: #f8f9fa !important;
}

@supports (-webkit-overflow-scrolling: touch) {
    .table-fixed-header thead.table-light th {
        background-color: #f8f9fa !important;
    }
}

/* table-responsiveコンテナ内でのスクロール設定 */
.table-responsive {
    max-height: 70vh;
    overflow-y: auto;
}

/* Multiple Select Bootstrap 5対応スタイル調整 */
.ms-parent {
    width: 100% !important;
}

.ms-choice {
    height: 36px !important;
    border: 1px solid #d9dee3 !important;
    border-radius: 0.375rem !important;
    background-color: #fff !important;
    font-size: 0.9375rem !important;
    line-height: 34px !important;
    color: #697a8d !important;
    padding: 0.4375rem 1.875rem 0.4375rem 0.875rem !important;
    position: relative !important;
}

.ms-choice:focus,
.ms-choice.ms-choice-focus {
    border-color: #696cff !important;
    box-shadow: 0 0 0 0.2rem rgba(105, 108, 255, 0.25) !important;
    outline: 0 !important;
}

.ms-choice:focus > div,
.ms-choice.ms-choice-focus > div {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%28105, 108, 255, 0.8%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
}

.ms-choice > span {
    color: #697a8d !important;
    font-weight: 400 !important;
    padding-left: 12px;
}

.ms-choice > div {
    border: none !important;
    background: none !important;
    position: absolute !important;
    right: 0.875rem !important;
    top: 55% !important;
    transform: translateY(-50%) !important;
    width: 17px !important;
    height: 12px !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%2867, 89, 113, 0.6%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 17px 12px !important;
}

.ms-choice > div:after {
    content: '' !important;
}

.ms-drop {
    border: 1px solid #d1d3e2 !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15) !important;
    background-color: #fff !important;
    z-index: 1050 !important;
    min-width: 200px !important;
    width: auto !important;
}

.ms-drop ul {
    max-height: 250px !important;
    overflow-y: auto !important;
    padding: 4px 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

.ms-drop ul > li {
    padding: 8px 12px !important;
    font-size: 0.9375rem !important;
    color: #5a5c69 !important;
    border-bottom: none !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    min-height: 36px !important;
    line-height: 1.5 !important;
}

.ms-drop ul > li:hover {
    background-color: #f8f9fa !important;
}

.ms-drop ul > li.selected {
    background-color: #f0f0f9 !important;
    color: #555 !important;
}

.ms-drop ul > li.highlighted {
    background-color: #e7e9fc !important;
}

.ms-drop ul > li.group {
    font-weight: bold !important;
    background-color: #f8f9fa !important;
}

/* チェックボックスのスタイル */
.ms-drop ul > li input[type="checkbox"] {
    margin-right: 8px !important;
    accent-color: #696cff !important;
    flex-shrink: 0 !important;
}

.ms-drop ul > li label {
    margin: 0 !important;
    flex: 1 !important;
    cursor: pointer !important;
    font-weight: normal !important;
}

/* 検索フィルターのスタイル */
.ms-search input {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid #d9dee3 !important;
    border-radius: 0.25rem !important;
    font-size: 0.875rem !important;
    margin: 8px !important;
    box-sizing: border-box !important;
}

/* プレースホルダースタイル */
.ms-choice span.placeholder {
    cursor: pointer !important;
    background:  #fff !important;
}

/* テキストが正しく表示されるように調整 */
.ms-drop ul > li > span {
    width: 100% !important;
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: nowrap !important;
}

/* リストアイテムの幅を確保 */
.ms-drop ul > li {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ドロップダウンの最小幅を確保 */
.ms-drop {
    min-width: 250px !important;
}

/* 理由カテゴリ用により大きな幅 */
#reason_category + .ms-parent .ms-drop {
    min-width: 300px !important;
}

/* ラベルの表示を修正 */
.ms-drop ul > li > label > span {
    display: inline !important;
    width: auto !important;
}

/* "No matches found"メッセージを非表示 */
.ms-drop .ms-no-results {
    display: none !important;
}

/* エラー時の枠線スタイル */
.ms-choice.border-danger {
    border: 1px solid #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* エラー解除時のトランジション */
.ms-choice {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* 未選択時のエラー表示 */
.ms-choice.selection-required {
    background-color: rgba(220, 53, 69, 0.1) !important;
    border: 1px solid #dc3545 !important;
}

.ms-choice.selection-required span {
    color: #e80016 !important;
    font-weight: bold !important;
    background-color: transparent !important;
}

/* ========================================
   確度ランクバッジ（S, A, B, C, D）
   ======================================== */

/* 確度Sバッジ - エメラルドグリーン（90%以上・成約間近） */
.probability-badge-s {
    display: inline-block;
    padding: 0.28rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: #10B981; /* エメラルドグリーン */
    border-radius: 0.25rem;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

/* 確度Aバッジ - ライムグリーン（70-90%・有望） */
.probability-badge-a {
    display: inline-block;
    padding: 0.28rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: #84CC16; /* ライムグリーン */
    border-radius: 0.25rem;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

/* 確度Bバッジ - アンバー（50-70%・要フォロー） */
.probability-badge-b {
    display: inline-block;
    padding: 0.28rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: #F59E0B; /* アンバー */
    border-radius: 0.25rem;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

/* 確度Cバッジ - オレンジ（30-50%・注意） */
.probability-badge-c {
    display: inline-block;
    padding: 0.28rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: #F97316; /* オレンジ */
    border-radius: 0.25rem;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

/* 確度Dバッジ - レッド（30%未満・低確度） */
.probability-badge-d {
    display: inline-block;
    padding: 0.28rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: #EF4444; /* レッド */
    border-radius: 0.25rem;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

/* ================================================
   メンテナンス状態表示（ナビゲーションバー）
   ================================================ */
.maintenance-status-nav {
    font-size: 1rem;
}

.machine-type-badge {
    background: #eee;
    padding: 6px 8px 4px 8px;
    line-height: 1;
    border-radius: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.machine-type-badge:hover {
    opacity: 0.8;
}

/* tooltip内のリスト表示スタイル */
.tooltip-inner {
    text-align: left;
    max-width: 300px;
}

/* =========================================
   マニュアル管理フォーム - 閲覧権限チェックボックス
   Bootstrap/Sneat標準スタイルを使用
   ========================================= */
#id_viewing_permissions .form-check {
    margin-bottom: 0.5rem;
}

/* =========================================
   Nayax取引データ - 日時カラムのcode-badgeスタイル
   ========================================= */
.code-badge {
    display: inline-block;
    padding: 2px 6px;
    margin-right: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: #6c757d;
    border-radius: 3px;
}
