/* ==========================================================================
   美食家智能接單後台 — 介面優化（2026-10-29）
   1. 補齊 Bootstrap 5.3 *-subtle 柔和底色（本專案為 BS 5.1.3）
   2. 放大過小字級
   3. 柔化 hover（按鈕、卡片、表格列、清單）
   4. 列表頁篩選列：下拉選單 / 輸入框 / 按鈕高度一致
   5. Choices.js 外觀與一般下拉一致；Tooltip 樣式
   ========================================================================== */
:root {
    --fm-ctl-h: 34px;          /* 篩選列控制項統一高度 */
    --fm-ctl-fs: 13px;
    --fm-primary-rgb: 37, 160, 226;
}

/* ── 1. *-subtle 底色 ─────────────────────────────────────────────────── */
.bg-primary-subtle   { background-color: rgba(37, 160, 226, .12) !important; }
.bg-secondary-subtle { background-color: rgba(135, 138, 153, .14) !important; }
.bg-success-subtle   { background-color: rgba(0, 189, 157, .13) !important; }
.bg-info-subtle      { background-color: rgba(50, 204, 255, .15) !important; }
.bg-warning-subtle   { background-color: rgba(255, 188, 10, .17) !important; }
.bg-danger-subtle    { background-color: rgba(240, 101, 72, .13) !important; }
.bg-dark-subtle      { background-color: rgba(52, 58, 64, .12) !important; }
.bg-light-subtle     { background-color: rgba(243, 246, 249, .7) !important; }
/* 淺色系文字在淺底上對比不足 → 加深 */
.text-warning:is(.bg-warning-subtle, .bg-soft-warning), .bg-warning-subtle .text-warning, .badge.bg-warning-subtle { color: #a87800 !important; }
.text-info:is(.bg-info-subtle, .bg-soft-info), .badge.bg-info-subtle { color: #0b88b3 !important; }
.text-success:is(.bg-success-subtle, .bg-soft-success), .badge.bg-success-subtle { color: #00866f !important; }
.badge.bg-danger-subtle { color: #c8432a !important; }
.badge.bg-primary-subtle { color: #1a7fb6 !important; }
.badge.bg-secondary-subtle { color: #5d6070 !important; }
.badge.bg-warning { color: #3d2e00 !important; }
.badge.bg-info { color: #053b4e !important; }

/* avatar-title 與 avatar-sm 同元素時會被拉滿寬度 → 固定為方形 */
.avatar-title.avatar-sm { width: 3rem; height: 3rem; flex: 0 0 3rem; }
.avatar-title.avatar-xs { width: 2rem; height: 2rem; flex: 0 0 2rem; }
.stat-icon { width: 2.75rem; height: 2.75rem; flex: 0 0 2.75rem; display: inline-flex; align-items: center; justify-content: center; border-radius: .5rem; font-size: 1.35rem; }

/* ── 2. 字級 ──────────────────────────────────────────────────────────── */
.fs-10 { font-size: 11px !important; }
.fs-11 { font-size: 12px !important; }
.fs-12 { font-size: 13px !important; }
.table-sm-fs, .table { font-size: 14px; }
.table.fs-12, .table.fs-13 { font-size: 13.5px !important; }
.table thead th { font-size: 13px; font-weight: 600; color: #495057; white-space: nowrap; }
.badge { font-size: .8em; font-weight: 500; padding: .4em .65em; }
.table .badge, .list-group .badge, .card-header .badge { font-size: 12px; }
.form-label { font-size: 13.5px; font-weight: 500; color: #495057; }
.form-text { font-size: 12.5px; }
.form-control-sm, .form-select-sm, .input-group-sm > .form-control, .input-group-sm > .input-group-text, .input-group-sm > .form-select { font-size: var(--fm-ctl-fs); }
.btn-sm { font-size: 13px; }
.dropdown-item { font-size: 14px; }
.breadcrumb { font-size: 13px; }
.card-header .card-title { font-size: 15px; }
.navbar-menu .navbar-nav .nav-sm .nav-link { font-size: .9rem; }
.text-muted.small, small.text-muted { font-size: 12.5px; }

/* ── 3. 柔化 hover ────────────────────────────────────────────────────── */
.btn { transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.btn-soft-primary:is(:hover, :focus)   { color: #1a7fb6; background-color: rgba(37, 160, 226, .2); }
.btn-soft-secondary:is(:hover, :focus) { color: #5d6070; background-color: rgba(135, 138, 153, .2); }
.btn-soft-success:is(:hover, :focus)   { color: #00866f; background-color: rgba(0, 189, 157, .2); }
.btn-soft-info:is(:hover, :focus)      { color: #0b88b3; background-color: rgba(50, 204, 255, .22); }
.btn-soft-warning:is(:hover, :focus)   { color: #a87800; background-color: rgba(255, 188, 10, .24); }
.btn-soft-danger:is(:hover, :focus)    { color: #c8432a; background-color: rgba(240, 101, 72, .2); }
.btn-soft-dark:is(:hover, :focus)      { color: #212529; background-color: rgba(52, 58, 64, .18); }
.btn-soft-light:is(:hover, :focus)     { color: #212529; background-color: rgba(135, 138, 153, .15); }
[class*="btn-soft-"]:is(:hover, :focus) { box-shadow: none; }
.btn-soft-info, .btn-soft-warning, .btn-soft-success { font-weight: 500; }
.btn-soft-info { color: #0b9ccc; }
.btn-soft-warning { color: #c08b00; }
.btn-link:hover { opacity: .8; }
.card-animate { transition: box-shadow .2s ease; }
.card-animate:hover { transform: none; box-shadow: 0 3px 10px rgba(30, 32, 37, .07); }
.table-hover > tbody > tr { transition: background-color .12s ease; }
.table-hover > tbody > tr:hover > * { --vz-table-accent-bg: rgba(var(--fm-primary-rgb), .045); }
.list-group-item-action { transition: background-color .12s ease, color .12s ease; }
.list-group-item-action:not(.active):hover { background-color: rgba(var(--fm-primary-rgb), .05); }
.dropdown-item { transition: background-color .12s ease, color .12s ease; }
.dropdown-item:hover, .dropdown-item:focus { background-color: rgba(var(--fm-primary-rgb), .06); color: #1a7fb6; }
.nav-pills .nav-link, .nav-tabs-custom .nav-link { transition: color .15s ease, background-color .15s ease; }
.waves-effect .waves-ripple { display: none !important; }

/* ── 4. 篩選列（所有 GET 表單）控制項高度一致 ─────────────────────────── */
form[method="get" i] :is(.form-control, .form-select):not(textarea),
form[method="get" i] .input-group > .input-group-text,
form[method="get" i] .btn:not(.btn-link) {
    height: var(--fm-ctl-h);
    min-height: var(--fm-ctl-h);
}
form[method="get" i] :is(.form-control, .form-select):not(textarea) {
    font-size: var(--fm-ctl-fs);
    padding-top: .25rem;
    padding-bottom: .25rem;
    line-height: 1.5;
}
form[method="get" i] .form-control { padding-left: .6rem; padding-right: .6rem; }
form[method="get" i] .form-select { padding-left: .6rem; padding-right: 2rem; background-position: right .55rem center; }
form[method="get" i] .btn:not(.btn-link) { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; padding-top: 0; padding-bottom: 0; white-space: nowrap; font-size: 13px; }
form[method="get" i] .form-label { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: .3rem; font-size: 13px; }
form[method="get" i] .form-check { min-height: var(--fm-ctl-h); display: inline-flex; align-items: center; gap: .35rem; margin-bottom: 0; padding-left: 0; }
form[method="get" i] .form-check .form-check-input { margin: 0; float: none; }
form[method="get" i] .input-group > input[data-datepicker] { background-image: none; padding-right: .5rem; min-width: 0; }

/* ── 5. Choices.js：外觀與一般下拉一致 ─────────────────────────────────── */
.choices { margin-bottom: 0; }
.choices__inner { background-color: var(--vz-input-bg, #fff) !important; border: 1px solid var(--vz-input-border, #ced4da) !important; border-radius: .25rem; font-size: 14px; }
.choices.is-focused .choices__inner, .choices.is-open .choices__inner { border-color: rgba(var(--fm-primary-rgb), .6) !important; }
.choices-sm .choices__inner,
form[method="get" i] .choices .choices__inner {
    min-height: var(--fm-ctl-h) !important;
    height: var(--fm-ctl-h);
    padding: 0 2rem 0 .6rem !important;
    display: flex;
    align-items: center;
    font-size: var(--fm-ctl-fs);
    border-radius: .2rem;
}
.choices-sm .choices__list--single,
form[method="get" i] .choices .choices__list--single { padding: 0 !important; width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.choices-sm .choices__list--dropdown .choices__item,
form[method="get" i] .choices__list--dropdown .choices__item { font-size: 13px; }
.choices[data-type*="select-one"]::after { right: .7rem; }
.choices__list--dropdown, .choices__list[aria-expanded] { z-index: 1060; }

/* ── Tooltip / 其他 ───────────────────────────────────────────────────── */
.tooltip { font-size: 12.5px; }
.tooltip-inner { padding: .3rem .6rem; max-width: 260px; }
.topbar-user .dropdown-menu { min-width: 220px; }
.topbar-user .dropdown-header { white-space: normal; }
.scope-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border-radius: 1rem; font-size: 12.5px; background: rgba(var(--fm-primary-rgb), .1); color: #1a7fb6; }
.notification-item .notif-title { font-size: 13.5px; line-height: 1.45; }
.notification-item { padding: .65rem 1rem !important; white-space: normal; }
td.actions, td.text-nowrap { white-space: nowrap; }

/* ── 列表動作欄固定於右側（foodsmart-ui.js initStickyActions）────────────── */
.table > :not(caption) > * > .col-actions {
    position: sticky; right: 0; z-index: 2; white-space: nowrap;
    background-color: var(--vz-card-bg, #fff);
    background-image: linear-gradient(var(--vz-table-bg, transparent), var(--vz-table-bg, transparent));
}
.table-responsive.fm-overflow:not(.fm-scrolled-end) > .table > :not(caption) > * > .col-actions {
    box-shadow: inset 0 0 0 9999px var(--vz-table-accent-bg), -10px 0 10px -10px rgba(0, 0, 0, .22);
}

/* ── 品牌 logo（側欄） ─────────────────────────────────────────────── */
.navbar-brand-box .fs-brand { display: inline-flex; align-items: center; gap: 10px; vertical-align: middle; }
.navbar-brand-box .fs-brand img { flex: none; }
.navbar-brand-box .fs-brand-name { font-size: 19px; font-weight: 700; letter-spacing: .04em; }
