/*
 * Bridge modern admin helpers onto the legacy lladmin/layui shell.
 * Authority: copy from lladmin_skeleton/public/vendor/legacy/admin-bridge.css then sync here
 * (see AGENTS.md). Form shell: .fihk-form + .fihk-card = gray #f6f7f9 canvas + white cards
 * (AO / reimburse / mtk_budget add-page chrome). Tips: #zhusi. Title bar: #right01.
 */
.SidebarLogo { padding: 12px 16px 8px; text-align: center; }
.SidebarLogo img { max-width: 120px; max-height: 48px; width: auto; height: auto; margin: 0 auto; display: block; }
.left_nav h3 a i { margin-right: 4px; }
.tips-box {
    max-width: 100%; margin: 0 0 12px; float: none;
    background: #fffbe6; border: 1px solid #ffe58f; color: #d48806;
    padding: 10px 14px; font-size: 12px; line-height: 1.6; border-radius: 2px;
}
.tips-box ol, .tips-box ul { margin: 0; padding-left: 18px; }
.tips-box li { margin: 2px 0; }
/* Keep legacy lladmin #zhusi icon tip bar; only allow wrap */
#zhusi {
    white-space: normal; line-height: 1.6; min-height: 30px;
    padding: 6px 12px 6px 34px; box-sizing: border-box;
}
/* the "view full instructions" link of the summary bar */
#zhusi .zhusi-more { margin-left: 8px; color: #1E9FFF; }
#zhusi .zhusi-more:hover { text-decoration: underline; }
#zhusi-detail p { margin: 0 0 8px; line-height: 1.7; }
/* the tips popup: layer's content div has no padding, so the wrapper carries it; the detail
   <p> lines are rendered inside a bulleted list, one rule per line */
.zhusi-popup { padding: 18px 22px; }
.zhusi-popup .zhusi-list { margin: 0; padding-left: 20px; list-style: disc; }
.zhusi-popup .zhusi-list p { margin: 0 0 10px; line-height: 1.8; }
.zhusi-popup .zhusi-list p:last-child { margin-bottom: 0; }
#RightMain { min-height: calc(100vh - 60px); padding: 15px; box-sizing: border-box; }
.Rightbox { margin: 0; background: transparent; padding: 0 0 16px; overflow: hidden; }
/* Match html_template .data-v-app #right01 — title + action buttons */
#right01 {
    display: flex !important; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 8px; margin: 0 0 12px; padding: 0; border-bottom: none; width: 100%;
}
#right01 h2 {
    float: none !important; width: auto !important; flex: 1 1 auto; margin: 0;
    font: normal 24px/35px "微软雅黑","Microsoft YaHei","宋体",Arial; color: #222;
}
#right01 .layui-btn { margin: 0; flex: 0 0 auto; }
#RightMain .layui-form-label {
    width: 150px; padding: 8px 10px; white-space: normal; height: auto;
    line-height: 1.35; box-sizing: border-box; vertical-align: top;
}
#RightMain .layui-input-block { margin-left: 160px; vertical-align: top; }
#RightMain .layui-form-item .layui-input-inline { margin-left: 0; width: 220px; max-width: calc(100% - 160px); }
#RightMain .layui-col-md4,
#RightMain .layui-col-md6,
#RightMain .layui-col-md8,
#RightMain .layui-col-md12 { box-sizing: border-box; }
#RightMain .layui-col-md4 .layui-form-label,
#RightMain .layui-col-md6 .layui-form-label { float: left; }
#RightMain .layui-col-md4 .layui-input-inline,
#RightMain .layui-col-md6 .layui-input-inline { float: left; margin-left: 0; }
#RightMain .layui-form-item:after { content: ""; display: table; clear: both; }
/* Form page shell — match AO / reimburse / mtk_budget add: gray canvas + white cards */
#RightMain.fihk-form-page,
#RightMain:has(.fihk-form) {
    background: #f6f7f9;
}
#RightMain .fihk-form {
    max-width: 1280px;
    margin: 0 auto;
}
/* fihk-order stacked card fields (label above input) */
#RightMain .fihk-card {
    background: #fff;
    border: 1px solid #e5e6eb;
    border-radius: 4px;
    margin: 0 0 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}
#RightMain .fihk-card > .layui-card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: #fafafa; border-bottom: 1px solid #e5e6eb;
    padding: 12px 16px; height: auto; line-height: 1.4;
}
#RightMain .fihk-card .layui-card-header h3 {
    margin: 0; font-size: 15px; font-weight: 600; color: #1d2129;
}
#RightMain .fihk-card > .layui-card-body,
#RightMain .fihk-card > .layui-form-item.layui-card-body {
    padding: 16px 16px 8px;
}
#RightMain .fihk-card .layui-form-label {
    float: none !important; display: block; width: auto !important; max-width: 100%;
    text-align: left; padding: 0 0 6px !important; height: auto; line-height: 1.4;
    white-space: normal; color: #4e5969; font-size: 13px;
}
#RightMain .fihk-card .layui-col-xs12 { float: none; width: 100%; padding: 0; }
#RightMain .fihk-card .layui-col-xs12 .layui-input,
#RightMain .fihk-card .layui-col-xs12 .layui-textarea,
#RightMain .fihk-card .layui-col-xs12 .layui-form-select { width: 100%; box-sizing: border-box; }
#RightMain .fihk-card .label-required:after { content: " *"; color: #FF5722; }
#RightMain .fihk-card .item_total {
    padding: 12px 16px; margin: 0; background: #fafafa; border-top: 1px solid #e5e6eb;
}
#RightMain .fihk-card .item_total > span { display: inline-block; margin-right: 24px; }
#RightMain .fihk-card .item_total .layui-form-label {
    display: inline-block; width: auto !important; padding: 9px 8px 9px 0 !important;
    vertical-align: middle; color: #1d2129; font-weight: 600;
}
#RightMain .fihk-card .item_total .layui-input-inline {
    display: inline-block; float: none; width: 140px; vertical-align: middle;
}
/* html_template goods row: wider cols + ops */
#RightMain .fihk-card #goods_box .layui-input-inline {
    float: left; width: 160px; margin-right: 8px; max-width: none;
}
#RightMain .fihk-card #goods_box .layui-input-inline.goods-ops {
    width: 210px;
}
#RightMain .fihk-card #goods_box .lladmin-item-left .layui-input-inline {
    font-weight: 600; font-size: 12px; line-height: 38px; text-align: center;
    color: #4e5969; background: #f7f8fa; border-radius: 2px; margin-bottom: 8px;
}
#RightMain .fihk-card #goods_box .item-row {
    padding: 6px 0; border-bottom: 1px dashed #eee; clear: both;
}
#RightMain .fihk-card #goods_box .item-row:last-child { border-bottom: none; }
#RightMain .lladmin-item-left > div,
#RightMain .lladmin-item-right > div { text-align: center; font-size: 12px; }
#RightMain .lladmin-item-right .layui-input { width: 100%; box-sizing: border-box; }
#RightMain .layui-table-view { margin-top: 4px; }

.admin-modal-body .layui-input-block[style*="max-width"] .layui-input { width: 100%; }
.page-title { margin: 0 0 12px; font-size: 18px; }
.page-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.pagination { margin: 12px 0; text-align: right; }
.hint { color: #999; font-size: 12px; margin-left: 8px; }
.checkbox { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; }
.admin-modal-body { background: #fff; }
.bg_readonly { background: #F5F5F5 !important; }
.layui-table-page { text-align: right !important; }
.layui-table-pagebar { float: left; }
.stats { margin: 12px 0; display: flex; flex-wrap: wrap; gap: 12px; }
.stat { flex: 1 1 140px; background: #f8f8f8; border: 1px solid #eee; padding: 12px; }
.stat .label { color: #888; font-size: 12px; }
.stat .value { font-size: 22px; font-weight: 600; margin-top: 4px; }
/* Legacy card/form-grid kept for pages not yet migrated */
.card { margin: 12px 0; background: #fff; border: 1px solid #e6e6e6; border-radius: 2px; padding: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.field label { display: block; margin-bottom: 4px; color: #666; font-size: 13px; }
.field input, .field select, .field textarea { width: 100%; box-sizing: border-box; }
.layui-textarea { box-sizing: border-box; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { border: 1px solid #e6e6e6; padding: 8px 10px; font-size: 13px; }
table.data th { background: #fafafa; text-align: left; }
.btn, a.btn {
    display: inline-block; padding: 0 15px; height: 32px; line-height: 32px;
    background: #009688; color: #fff !important; border: none; border-radius: 2px;
    text-decoration: none; cursor: pointer; font-size: 13px;
}
.btn-secondary, a.btn-secondary, .btn-ghost, a.btn-ghost { background: #fff; color: #333 !important; border: 1px solid #d2d2d2; }
.btn-danger, a.btn-danger { background: #FF5722; }
.btn-sm { height: 28px; line-height: 28px; padding: 0 10px; font-size: 12px; }
.flash { margin: 12px 16px; padding: 10px 14px; border-radius: 2px; }
.flash-success { background: #f0f9eb; color: #67c23a; border: 1px solid #e1f3d8; }
.flash-error { background: #fef0f0; color: #f56c6c; border: 1px solid #fde2e2; }
.login-body { min-height: 100vh; }
#login_right .flash { text-align: left; }
.search_box { margin: 8px 0 12px; overflow: visible; }
.search_box > .layui-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.search_box .layui-form-label {
    float: none; width: auto; padding: 9px 0; line-height: 20px; text-align: left; white-space: nowrap;
}
.search_box .layui-col-md1,
.search_box .layui-col-md2 { float: none; width: auto; min-width: 120px; max-width: 220px; padding: 0; }
.search_box .layui-col-md1 .layui-input,
.search_box .layui-col-md2 .layui-input,
.search_box .layui-col-md1 .layui-form-select,
.search_box .layui-col-md2 .layui-form-select { width: 100%; }
.search_box .layui-btn.reload { margin: 0; }
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 2px; font-size: 12px;
    background: #eee; color: #666;
}
.badge-muted { background: #eee; color: #999; }
.badge-success { background: #009688; color: #fff; }
.badge-warning { background: #FFB800; color: #fff; }
.badge-danger { background: #FF5722; color: #fff; }
.badge-info { background: #1E9FFF; color: #fff; }
.items-table input, .items-table select { min-width: 80px; }
/* permission fieldset grid */
.permission-module-item { cursor: pointer; }
.permission-unit-item { cursor: pointer; }
.mail-template-layout { display: flex; gap: 16px; min-height: 480px; }
.mail-template-nav { width: 240px; border-right: 1px solid #eee; padding-right: 12px; }
.mail-template-nav .group-title { font-weight: bold; margin: 12px 0 6px; }
.mail-template-nav a { display: block; padding: 6px 8px; color: #333; }
.mail-template-nav a.active { background: #F21600; color: #fff; }
.mail-template-editor { flex: 1; }
.var-chip { display: inline-block; margin: 2px; padding: 2px 8px; background: #f0f0f0; border-radius: 2px; cursor: pointer; font-size: 12px; }
.var-chip:hover { background: #009688; color: #fff; }
.settings-tabs .layui-tab-content { padding-top: 16px; }
.ah-wrap { padding: 8px; }
.ah-badge { display: inline-block; padding: 2px 8px; border-radius: 2px; font-size: 12px; color: #fff; }
.ah-green { background: #009688; }
.ah-red { background: #FF5722; }
.ah-blue { background: #1E9FFF; }
.ah-orange { background: #FFB800; }
.ah-gray { background: #999; }
ul.check_info_list { list-style: none; padding: 0; margin: 0; }
ul.check_info_list li { background: #f8f8f8; border-left: 4px solid #009688; margin-bottom: 10px; padding: 10px 12px 10px 36px; }
ul.check_info_list .audit-item { border-left: 2px solid #f0f0f0; margin: 8px 0 0 8px; padding-left: 10px; }
dl.checking_part { margin: 0 0 12px; }
.qq-minus, .qq-plus { cursor: pointer; color: #FF5722; font-size: 18px; line-height: 38px; text-align: center; }
.qq-plus { color: #009688; }
.lladmin-item-left, .lladmin-item-right { clear: both; }
.lladmin-item-left { font-weight: bold; background: #fafafa; padding: 8px 0; margin-bottom: 4px; }
.lladmin-item-right { padding: 4px 0; border-bottom: 1px dashed #eee; }

/* Modal CRUD forms — horizontal layui-form-label (departments pattern).
   The label is 150px wide: a "中文/English" label then always breaks into two lines (one per
   language) instead of three, and it is a flex box that centres its text vertically, so the
   label and its control stay on the same line however many lines the label needs. */
.admin-modal-body .card { border: none; margin: 0; padding: 0 8px 8px; }
.admin-modal-body .form-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; }
.admin-modal-body .field label { color: #333; font-size: 13px; line-height: 1.35; white-space: normal; }
.admin-modal-body .field.full { grid-column: 1 / -1; }
.admin-modal-body .layui-form-label {
    float: left; display: flex; align-items: center; justify-content: flex-end;
    width: 150px; min-height: 38px; padding: 9px 10px;
    text-align: right; line-height: 1.35; height: auto; white-space: normal; box-sizing: border-box;
    vertical-align: top;
}
.admin-modal-body .layui-form-item .layui-input-block { margin-left: 170px; min-height: 38px; vertical-align: top; }
.admin-modal-body .layui-form-item:after { content: ""; display: table; clear: both; }
.admin-modal-body .actions, .admin-modal-body .layui-form-item:last-child { margin-top: 12px; }
/* Bottom action bar — cancel left of primary save, right aligned, separated from fields */
.admin-form-actions {
    display: flex; justify-content: flex-end; align-items: center; gap: 10px;
    margin: 18px 8px 0; padding: 12px 140px 12px 12px;
    border-top: 1px solid #e8e8e8; background: #fbfbfb; border-radius: 2px;
}
.admin-form-actions .layui-btn { min-width: 88px; margin: 0; }
/* Full-page sticky save bar (settings / mail templates): pins to the bottom of the
   #RightMain scroll viewport while the page is taller than it, and sits at the natural
   end of the content otherwise. Not scoped to .admin-modal-body on purpose. */
.admin-form-actions.admin-sticky-bar {
    position: sticky; bottom: 0; z-index: 10;
    margin: 16px 0 0; padding: 12px;
    border-radius: 0;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, .04);
}
.admin-form-actions.is-modal {
    position: sticky; bottom: 0; z-index: 10;
    margin-bottom: 0; border-radius: 0;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, .04);
}
/* Modal shell: flex column so short forms still pin action bar to modal bottom */
.admin-modal-body { display: flex; flex-direction: column; min-height: 100vh; }
.admin-modal-body #content-table { flex: 1 0 auto; display: flex; flex-direction: column; padding-top: 12px; padding-bottom: 0; }
.admin-modal-body #content-table > :where(.Rightbox, form.layui-form) { flex: 1 0 auto; display: flex; flex-direction: column; }
.admin-modal-body :where(.Rightbox, form.layui-form) > form.layui-form { flex: 1 0 auto; display: flex; flex-direction: column; }
.admin-modal-body .admin-form-actions.is-modal { padding-right: 12px; }
.admin-modal-body .admin-form-actions.is-modal { margin-top: auto; }
/* Page forms still on page-title → visually match #right01 */
#RightMain h1.page-title {
    margin: 0 0 12px; font-size: 24px; line-height: 35px; font-weight: normal;
    font-family: "微软雅黑","Microsoft YaHei",Arial,sans-serif;
}
#RightMain .card { border: none; box-shadow: none; padding: 0; margin: 0 0 12px; }
#RightMain table.data { width: 100%; }
#RightMain table.data th { white-space: normal; }
/*
 * Bilingual list headers — ficn_application / ficn_reimburse / mtk_budget pattern:
 *   .layui-table thead .layui-table-cell{height:auto !important; line-height:18px !important;}
 * Keep layui nowrap (do NOT set white-space:normal) so <br> yields exactly two lines;
 * English must not soft-wrap to a 3rd line (uneven thead heights = 错位 root cause).
 * min-height: equalize main vs fixed-r when only some cols have sort icons (~2px drift).
 */
.layui-table thead .layui-table-cell {
    height: auto !important;
    min-height: 52px;
    line-height: 18px !important;
    box-sizing: border-box;
}
/* Body: keep layui nowrap + fixed row height so HTML badges never grow a row and desync fixed cols */
.layui-table-body td .layui-table-cell {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 38px !important;
    line-height: 28px !important;
    max-height: 38px;
    box-sizing: border-box;
}
/* layui table pager right-aligned per legacy _common_link */
.layui-table-page { text-align: right; }
.layui-table-pagebar { float: left; }

/* Dashboard card wall — ficn_application home.blade.php DNA */
.home-card-wall .border10 { border: 1px solid #e6e6e6; background: #fff; margin-bottom: 15px; padding: 10px 12px 4px; box-sizing: border-box; }
.home-card-wall .border10 > h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; color: #333; }
.home-card-wall ul.layui-row { margin: 0; padding: 0; list-style: none; }
.home-card-wall li.layui-col-xs3 { padding: 4px; box-sizing: border-box; }
.home-card-wall a.li-backcolor {
    display: block; background: #f5f5f5; text-align: center; padding: 16px 8px;
    text-decoration: none; color: #666; border-radius: 2px; transition: all .15s;
}
.home-card-wall a.li-backcolor:hover { background: #e8f4ff; color: #1E9FFF; }
.home-card-wall a.li-backcolor h3 { margin: 0 0 6px; font-size: 13px; font-weight: normal; color: inherit; }
.home-card-wall a.li-backcolor p { margin: 0; font-size: 22px; font-weight: 600; color: inherit; }
.home-card-wall cite.red { color: #FF5722; font-style: normal; }
.perm-state { display: inline-block; width: 1.1em; margin-right: 4px; font-size: 14px; color: #666; }
.admin-form-actions { padding-right: 160px; }
.admin-modal-body .admin-form-actions.is-modal { padding-right: 12px; }
