/* Bootstrap 5 visual bridge for legacy Home views.
 * It changes presentation while preserving the existing names, values and
 * JavaScript hooks used by the library workflows. */
.libnet-app {
  --libnet-primary: #0d9dcc;
  --libnet-primary-dark: #087da5;
  --libnet-border: #d7e4ec;
  --libnet-surface: #fff;
  --libnet-page: #f4f8fb;
  color: #17324d;
  /* Prefer the installed Windows CJK regular face; Source Han/Noto remain
     fallbacks for hosts that provide those families. */
  font-family: "Microsoft YaHei", "PingFang SC", "Source Han Sans SC",
    "Source Han Sans CN", "Noto Sans SC", "Noto Sans CJK SC", "Segoe UI", "宋体", sans-serif;
  font-size: 14px;
  font-weight: 400;
  background: var(--libnet-page);
}

.libnet-app *, .libnet-app *::before, .libnet-app *::after { box-sizing: border-box; }
.libnet-app a { color: #087da5; }
.libnet-app a:hover { color: #055a78; }

/* Keep the legacy breadcrumb markup and links for compatibility, but hide
 * this redundant navigation bar from every page. */
.libnet-app .system_local { display: none !important; }

.libnet-app input[type="text"],
.libnet-app input[type="password"],
.libnet-app input[type="number"],
.libnet-app input[type="date"],
.libnet-app input[type="email"],
.libnet-app input[type="search"],
.libnet-app input[type="file"],
.libnet-app textarea,
.libnet-app select,
.libnet-app .form-control,
.libnet-app .form-select {
  min-height: 32px;
  border: 1px solid #c9d9e4;
  border-radius: .375rem;
  background: #fff;
  color: #17324d;
  padding: .375rem .65rem;
  font: inherit;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.libnet-app input[type="text"]:focus,
.libnet-app input[type="password"]:focus,
.libnet-app input[type="number"]:focus,
.libnet-app input[type="date"]:focus,
.libnet-app input[type="email"]:focus,
.libnet-app input[type="search"]:focus,
.libnet-app textarea:focus,
.libnet-app select:focus,
.libnet-app .form-control:focus,
.libnet-app .form-select:focus {
  border-color: #71c8e5;
  outline: 0;
  box-shadow: 0 0 0 .2rem rgba(13, 157, 204, .16);
}
.libnet-app input[type="checkbox"], .libnet-app input[type="radio"] { accent-color: var(--libnet-primary); }

.libnet-app .btn_1,
.libnet-app input[type="submit"],
.libnet-app input[type="button"],
.libnet-app button:not(.ui-button) {
  min-height: 32px;
  border: 1px solid var(--libnet-primary);
  border-radius: .375rem;
  padding: .375rem .8rem;
  background: var(--libnet-primary);
  color: #fff;
  cursor: pointer;
  font: inherit;
  text-shadow: none;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.libnet-app .btn_1:hover,
.libnet-app input[type="submit"]:hover,
.libnet-app input[type="button"]:hover,
.libnet-app button:not(.ui-button):hover {
  border-color: var(--libnet-primary-dark);
  background: var(--libnet-primary-dark);
}
.libnet-app .btn_1:focus,
.libnet-app input[type="submit"]:focus,
.libnet-app input[type="button"]:focus,
.libnet-app button:not(.ui-button):focus { box-shadow: 0 0 0 .2rem rgba(13, 157, 204, .2); outline: 0; }
.libnet-app .btn-secondary { border-color: #b7c9d6; background: #fff; color: #38566b; }

.libnet-app .top_block,
.libnet-app .search_block,
.libnet-app .formtable,
.libnet-app .panel,
.libnet-app .m-datalist,
.libnet-app .datalist {
  border: 1px solid var(--libnet-border);
  border-radius: .75rem;
  background: var(--libnet-surface);
  box-shadow: 0 .15rem .7rem rgba(26, 76, 102, .06);
}
.libnet-app .panel { margin: 1rem 0; overflow: hidden; }
.libnet-app .panel-heading { padding: .75rem 1rem; border-bottom: 1px solid var(--libnet-border); background: #eaf6fb; font-weight: 600; }
.libnet-app .panel-body { padding: 1rem; }
.libnet-app .m-tab, .libnet-app .m-tabs { margin: 1rem auto; max-width: 1180px; }
.libnet-app .nav-tabs { border-bottom-color: var(--libnet-border); }
.libnet-app .nav-tabs .nav-link, .libnet-app .nav-tabs > li > a { color: #426176; }
.libnet-app .nav-tabs .nav-link.active, .libnet-app .nav-tabs > li.active > a { color: var(--libnet-primary-dark); border-color: var(--libnet-border) var(--libnet-border) #fff; }
.libnet-app .form-horizontal .form-group { margin-bottom: 1rem; }
.libnet-app .top_block, .libnet-app .search_block, .libnet-app .formtable { padding: 1rem; }

/* Legacy report forms use a compact table with 26px line-height. The
 * Bootstrap-sized controls are taller than that row, so collapsed borders
 * make consecutive rows touch or visually overlap. Separate the rows while
 * keeping the existing table markup and field alignment intact. */
.libnet-app table.lib_table {
  border-collapse: separate;
  border-spacing: 0 .35rem;
}
.libnet-app table.lib_table th,
.libnet-app table.lib_table td {
  vertical-align: middle;
}
.libnet-app table.lib_table td > input + input,
.libnet-app table.lib_table td > select + select {
  margin-left: .4rem;
}
/* Sorting pairs already contain a visible hyphen in the legacy markup.
 * Remove the generic sibling gap so the second select stays within the
 * same right edge as the report-format control. */
.libnet-app #report_form select[name="order_seq"] {
  margin-left: 0 !important;
}
.libnet-app #report_form select[name="order_seq"][style*="204px"] {
  width: 202px !important;
}
/* Date ranges are written by legacy templates as two fixed 200px inputs.
 * Let the pair share the available cell width on narrow report forms. */
.libnet-app td.tab-align-l > input[style*="width:200px"][id$="_beg"],
.libnet-app td.tab-align-l > input[style*="width:200px"][id$="_end"] {
  display: inline-block;
  width: calc(50% - .75rem) !important;
  max-width: 200px;
  min-width: 0;
  vertical-align: middle;
}
.libnet-app td.tab-align-l > input[id$="_end"] { margin-left: .35rem; }
/* Some report templates omit the legacy table class (and a few render the
 * range from a different cell). Keep the date pair responsive by name too. */
.libnet-app input[name="time_beg"],
.libnet-app input[name="time_end"],
.libnet-app input[name="search_beg"],
.libnet-app input[name="search_end"] {
  width: calc(50% - .75rem) !important;
  max-width: 200px;
  min-width: 0;
}

/* bootstrap-select defaults to a narrow 220px wrapper and overrides the
 * width written on the legacy select element. Match report controls to the
 * 413px fields used by the surrounding form. */
.libnet-app table.lib_table .bootstrap-select {
  width: 413px !important;
  max-width: 100%;
  margin-bottom: .35rem;
}
.libnet-app table.lib_table .bootstrap-select > .dropdown-toggle,
.libnet-app table.lib_table .bootstrap-select > .dropdown-toggle:hover,
.libnet-app table.lib_table .bootstrap-select > .dropdown-toggle:focus,
.libnet-app table.lib_table .bootstrap-select.show > .dropdown-toggle {
  min-height: 40px;
  border: 1px solid #c9d9e4;
  border-radius: .375rem;
  background: #fff;
  color: #17324d;
  box-shadow: none;
  text-align: left;
}
.libnet-app table.lib_table .bootstrap-select > .dropdown-toggle:focus {
  border-color: #71c8e5;
  box-shadow: 0 0 0 .2rem rgba(13, 157, 204, .16);
}

/* Legacy report filters mix native inputs, selects and tree-selector buttons.
 * Give the report form one control baseline so adjacent rows stay aligned. */
.libnet-app #main_block form#report_form table.lib_table th,
.libnet-app #main_block form#report_form table.lib_table td {
  height: 38px;
  line-height: 1.4;
  vertical-align: middle;
}
.libnet-app #main_block form#report_form table.lib_table td > input[type="text"],
.libnet-app #main_block form#report_form table.lib_table td > select {
  height: 38px !important;
  min-height: 38px;
  line-height: 1.4;
  box-sizing: border-box;
  vertical-align: middle;
}
.libnet-app #main_block form#report_form table.lib_table .m-ztree .ztree_head .ztree_ipt {
  height: 38px;
  min-height: 38px;
  line-height: 1.4;
  box-sizing: border-box;
}

.libnet-app .datalist { overflow-x: auto; }

/* Bootstrap-styled calendar used by report date fields. It is appended to
 * body so table rows and select popups cannot clip the calendar. */
.brdp-popup {
  position: fixed;
  z-index: 3000;
  width: 286px;
  max-width: calc(100vw - 20px);
  box-sizing: border-box;
  padding: .75rem;
  border: 1px solid #c9d9e4;
  border-radius: .5rem;
  background: #fff;
  box-shadow: 0 .5rem 1.25rem rgba(23, 50, 77, .2);
  color: #17324d;
  font-family: inherit;
}
.brdp-header, .brdp-footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.brdp-header { padding-bottom: .6rem; border-bottom: 1px solid #e5eef3; }
.brdp-header strong { flex: 1; text-align: center; font-size: .95rem; }
.brdp-header button, .brdp-footer button { min-height: 30px; padding: .2rem .55rem; border: 1px solid #c9d9e4; border-radius: .3rem; background: #fff; color: #176486; cursor: pointer; }
.brdp-header button { width: 32px; font-size: 1.25rem; line-height: 1; }
.brdp-header button:hover, .brdp-footer button:hover { border-color: #0d9dcc; background: #eaf6fb; }
.brdp-week, .brdp-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .2rem; }
.brdp-week { padding: .5rem 0 .25rem; color: #6a8292; font-size: .78rem; text-align: center; }
.brdp-days { padding-bottom: .6rem; }
.brdp-day { min-height: 30px; padding: .2rem; border: 1px solid transparent; border-radius: .3rem; background: #fff; color: #17324d; cursor: pointer; }
.brdp-day:hover { border-color: #71c8e5; background: #eaf6fb; }
.brdp-day.brdp-selected { border-color: #0d9dcc; background: #0d9dcc; color: #fff; }
.brdp-empty { min-height: 30px; }
.brdp-footer { padding-top: .55rem; border-top: 1px solid #e5eef3; }
.brdp-footer .brdp-today { border-color: #0d9dcc; background: #0d9dcc; color: #fff; }
/* Calendar cells must override the app-wide button padding and sibling
 * margins; otherwise the seven intrinsic-width tracks exceed the popup. */
.libnet-app .brdp-popup .brdp-days > button.brdp-day {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: .2rem 0;
  min-height: 30px;
  box-sizing: border-box;
  background: #fff;
  border-color: transparent;
  color: #17324d;
  text-align: center;
}
.libnet-app .brdp-popup .brdp-days > button.brdp-day:hover {
  background: #eaf6fb;
  border-color: #71c8e5;
}
.libnet-app .brdp-popup .brdp-days > button.brdp-selected {
  background: #0d9dcc;
  border-color: #0d9dcc;
  color: #fff;
}
.libnet-app .datalist_head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  width: 100%;
  min-height: 48px !important;
  height: auto !important;
  margin: 0 !important;
  padding: .5rem .75rem;
  overflow: visible;
  position: relative;
  z-index: 2;
  background: #fff;
  clear: both;
}
.libnet-app .datalist_head ul {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
.libnet-app .datalist_head ul li,
.libnet-app .datalist_head .btn,
.libnet-app .datalist_head .btn_1 {
  float: none !important;
  position: static !important;
  display: inline-flex;
  align-items: center;
  width: auto !important;
  min-height: 32px;
  margin: 0 !important;
  padding: 0;
  text-align: center;
  justify-content: center;
  white-space: nowrap;
}
.libnet-app .datalist_head ul li.btn {
  gap: .4rem;
}
.libnet-app .datalist_head ul li.btn > input,
.libnet-app .datalist_head ul li.btn > button,
.libnet-app .datalist_head ul li.btn > .btn,
.libnet-app .datalist_head ul li.btn > .btn_1 {
  flex: 0 0 auto;
  width: max-content !important;
  min-width: max-content;
  padding-inline: .8rem;
  text-align: center;
  justify-content: center;
}

/* Give adjacent action controls a visible separation throughout the app. */
.libnet-app button + button,
.libnet-app input[type="button"] + input[type="button"],
.libnet-app input[type="submit"] + input[type="button"],
.libnet-app input[type="button"] + input[type="submit"],
.libnet-app .btn + .btn,
.libnet-app .btn_1 + .btn_1 {
  margin-left: .4rem;
}
.libnet-app .datalist_head + .datalist,
.libnet-app .datalist_head + table {
  clear: both;
  margin-top: .5rem;
}
.libnet-app .datalist #page_td {
  height: 40px;
  padding: .25rem .5rem !important;
  vertical-align: middle;
}
.libnet-app .datalist #page_td .page_info {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .2rem;
  min-height: 32px;
  padding: 0;
  line-height: 1.4;
}
.libnet-app .switch_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 0 .15rem .25rem 0;
  padding: .4rem .7rem;
  border: 1px solid #b9cbd7;
  border-radius: .375rem;
  background: #f7fafc;
  color: #24536b;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
}
.libnet-app .switch_btn:hover,
.libnet-app .switch_btn.dck_btn,
.libnet-app .switch_btn.ys_btn,
.libnet-app .switch_btn.yd_btn { text-decoration: none; }
.libnet-app .datalist table { min-width: 720px; width: 100%; }
.libnet-app .datalist table thead tr { background: #2387aa; }
.libnet-app .datalist table thead th,
.libnet-app .datalist table tbody td { text-align: center; vertical-align: middle; }
.libnet-app .datalist table thead th[align="left"],
.libnet-app .datalist table tbody td[align="left"] { text-align: left; }
.libnet-app .datalist table .page_td,
.libnet-app .datalist table .page_td .page_info { text-align: right; }
.libnet-app .datalist table tbody tr td[colspan] { text-align: left; }
.libnet-app .datalist table tbody tr { border-bottom: 1px solid #e5eef3; }
.libnet-app .datalist table tbody tr.even { background: #f1f7fa; }
.libnet-app .datalist table tbody tr:hover { background: #dff3fa; }
.libnet-app .page_info { padding: .5rem; }
.libnet-app .page_info a, .libnet-app .page_info .z-crt,
.libnet-app .page_info span.disabled { display: inline-block; border-radius: .25rem; padding: .25rem .5rem; }

@media (max-width: 900px) {
  .libnet-app .search_block .search_ul li { width: min(100%, 320px); margin-left: 0; margin-right: .75rem; }
  .libnet-app .top_block, .libnet-app .search_block, .libnet-app .formtable { padding: .75rem; }
}
