/* EMS 委托方级应用主题集成样式 */

/* 精确禁用页面级水平滚动条 - 只针对整体布局 */
html {
  overflow: hidden !important;
  height: 100% !important;
}

body {
  overflow: hidden !important;
  height: 100% !important;
  max-width: 100vw !important;
  width: 100% !important;
}

/* 只对主要布局容器禁用水平滚动，不影响组件内部 */
.bb-layout,
.bb-layout.layout {
  overflow: hidden !important;
  max-width: 100% !important;
  height: 100vh !important;
}

/* 约束 .has-sidebar 高度，阻止内容撑大 flex 项 */
.bb-layout .has-sidebar,
.layout .has-sidebar {
  overflow: hidden !important;
  min-height: 0 !important;
}

/* .layout-main 自身不滚动，滚动由内部 .tabs-body 承担 */
.bb-layout .layout-main {
  overflow: hidden !important;
  max-width: 100% !important;
}

/* 给 .tabs 一个确定的有界高度（与 BootstrapBlazor is-fixed-tab 行为一致） */
.bb-layout .layout-main > .tabs,
.layout .layout-main > .tabs {
  height: calc(var(--bb-layout-height, 100vh) - var(--bb-layout-header-height, 50px) - var(--bb-layout-footer-height, 0px)) !important;
}

/* .tabs-body 作为实际的滚动容器 */
.bb-layout .layout-main > .tabs > .tabs-body,
.layout .layout-main > .tabs > .tabs-body {
  overflow-y: auto !important;
}

/* 确保主内容区域不会超出 */
.bb-layout .layout-body {
  overflow: hidden !important;
  max-width: 100% !important;
}

/* 确保组件内部的滚动不受影响 */
.table-responsive,
.table-container,
.modal-body,
.card-body,
.form-container {
  overflow: auto !important;
}

/* BootstrapBlazor 布局组件滚动由 .tabs-body 处理，不再需要单独设置 */

:root {
  /* 整合原有颜色变量与委托方主题 */
  --bb-header-color: #ffffff;
  --bb-header-bg: var(--enterprise-primary);
  /* 布局变量更新 */
  --bb-layout-header-background: var(--enterprise-primary);
  --bb-layout-sidebar-banner-background: white;
  --bb-layout-header-color: var(--bb-header-color);
  --bb-layout-title-color: var(--bb-header-color);
}

/* 统一渐变头部公共样式，供多处弹窗/卡片复用 */
.bg-gradient-primary {
  background: #007bff !important;
  color: #fff !important;
}

.bg-gradient-info {
  background: #17a2b8 !important;
  color: #fff !important;
}

.bg-gradient-success {
  background: #28a745 !important;
  color: #fff !important;
}

.bg-gradient-warning {
  background: #ffc107 !important;
  color: #212529 !important;
}

.bg-gradient-purple {
  background: #667eea !important;
  color: #fff !important;
}

/* 用于在渐变背景上确保部分小字样颜色 */
.text-on-gradient {
  color: rgba(255,255,255,0.85) !important;
}

/* 统一渐变变量，供组件样式通过 var() 使用以实现集中维护 */
:root {
  --gradient-primary: #007bff;
  --gradient-info: #17a2b8;
  --gradient-success: #28a745;
  --gradient-warning: #ffc107;
  --gradient-purple: #667eea;
}

/* 布局样式增强 */
.bb-layout.layout {
  --bb-layout-header-background: transparent;
  --bb-layout-sidebar-banner-background: var(--enterprise-gray-50);
  --bb-layout-header-color: var(--bb-header-color);
  --bb-layout-title-color: var(--bb-header-color);
}

.bb-layout .layout-header {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.bb-layout .layout-banner {
  border-bottom: 1px solid var(--enterprise-border-color);
  background: var(--enterprise-gray-50);
}

  .bb-layout .layout-banner .layout-logo {
    border: 2px solid var(--enterprise-primary-lighter);
    border-radius: var(--enterprise-border-radius);
  }

.bb-layout .layout-side {
  border-right: 1px solid var(--enterprise-border-color);
  background: white;
}

.bb-layout .layout-footer {
  border-top: 1px solid var(--enterprise-border-color);
  background: var(--enterprise-gray-50);
}

/* 用户信息下拉菜单样式 */
.dropdown-logout {
  --bb-logout-text-color: var(--bb-header-color);
}

.logout-avatar {
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: var(--enterprise-shadow-sm);
}

.dropdown-user img {
  border-radius: 50%;
  border: 2px solid white;
}

/* 布局抽屉样式 */
.bb-layout .layout-drawer {
  padding: 8px;
  cursor: pointer;
  border-radius: var(--enterprise-border-radius);
  transition: all 0.2s ease-in-out;
  color: white;
}

  .bb-layout .layout-drawer:hover {
    background: rgba(255, 255, 255, 0.1);
  }

/* Widget 组件样式 */
.widget {
  --bb-widget-toggle-color: var(--bb-header-color);
}

  .widget .dropdown-menu {
    --bs-dropdown-min-width: 18rem;
    border: none;
    box-shadow: var(--enterprise-shadow-lg);
    border-radius: var(--enterprise-border-radius);
  }

  .widget .dropdown-body h3 {
    color: var(--enterprise-text-primary);
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 600;
  }

  .widget .dropdown-body h4 {
    color: var(--enterprise-text-primary);
    font-size: 15px;
    margin: 0;
    font-weight: 500;
  }

  .widget .dropdown-body small {
    color: var(--enterprise-text-muted);
    font-size: 10px;
    position: absolute;
    top: 0;
    right: 0;
  }

  .widget .dropdown-item {
    padding: 0.75rem 1rem;
    min-width: 120px;
    border-radius: var(--enterprise-border-radius-sm);
    margin: 0.25rem 0.5rem;
    transition: all 0.2s ease-in-out;
  }

    .widget .dropdown-item > div:not(.progress):last-child {
      width: calc(100% - 40px);
    }

    .widget .dropdown-item.active,
    .widget .dropdown-item:active {
      color: white;
      background: var(--enterprise-primary);
    }

    .widget .dropdown-item:not(:nth-of-type(odd)):active {
      background-color: var(--enterprise-primary);
    }

    .widget .dropdown-item:hover {
      background: var(--enterprise-gray-50);
      color: var(--enterprise-primary);
    }

  .widget .progress {
    height: 8px;
    border-radius: 4px;
    background: var(--enterprise-gray-200);
  }

/* 表格样式增强 - 已移除以恢复 BootstrapBlazor 表格默认样式 */
/* 原先定义的 .table-cell, .data-table, .table-demo, .table-users-demo, .table-users, .cell-label 等样式
   已全部删除，保留表格样式应由组件库或局部组件 CSS 管理。 */

/* 菜单样式增强 */
.menu {
  --bb-menu-active-color: var(--enterprise-primary);
  --bb-menu-bar-bg: var(--enterprise-primary);
  --bb-menu-item-hover-bg: var(--enterprise-gray-50);
  --bb-menu-item-hover-color: var(--enterprise-primary);
  /* 修复：允许菜单组件根据内容自适应高度 */
  overflow-y: auto !important;
  overflow-x: hidden !important;
  /* 移除固定高度限制，让菜单根据内容调整 */
  height: auto !important;
  max-height: none !important;
}

.submenu .submenu {
  margin: 0 !important;
  padding-left: 20px !important;
  list-style: none !important;
}

/* 菜单项样式 */
.menu-item {
  border-radius: var(--enterprise-border-radius-sm);
  margin: 0.25rem 0.5rem;
  transition: all 0.2s ease-in-out;
}

  .menu-item:hover {
    background: var(--enterprise-gray-50);
  }

  .menu-item.active {
    background: var(--enterprise-primary);
    color: white;
    box-shadow: var(--enterprise-shadow-sm);
  }

/* 布局抽屉体样式 */
.bb-layout .layout-drawer-body {
  background: white;
}

  .bb-layout .layout-drawer-body .btn {
    border-radius: var(--enterprise-border-radius);
    font-weight: 500;
  }

/* 布局项目样式 */
.bb-layout .layout-item {
  border: 2px solid var(--enterprise-border-color);
  border-radius: var(--enterprise-border-radius);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  height: 80px;
}

  .bb-layout .layout-item:hover {
    border-color: var(--enterprise-primary-lighter);
    box-shadow: var(--enterprise-shadow-sm);
  }

  .bb-layout .layout-item.active {
    border-color: var(--enterprise-primary);
    background: rgba(26, 54, 93, 0.05);
  }

.bb-layout .layout-left {
  background: var(--enterprise-gray-200);
  border-radius: 2px;
}

.bb-layout .layout-right {
  background: var(--enterprise-gray-100);
  border-radius: 2px;
}

.bb-layout .layout-left-header,
.bb-layout .layout-right-header,
.bb-layout .layout-top {
  background: var(--enterprise-primary-lighter);
  height: 20%;
  border-radius: 2px;
}

.bb-layout .layout-left-body,
.bb-layout .layout-right-body,
.bb-layout .layout-body {
  background: var(--enterprise-gray-100);
  border-radius: 2px;
}

.bb-layout .layout-right-footer {
  background: var(--enterprise-gray-300);
  height: 15%;
  border-radius: 2px;
}

/* 错误 UI 样式 */
#blazor-error-ui {
  background: white;
  bottom: 0;
  box-shadow: var(--enterprise-shadow-xl);
  display: none;
  left: 0;
  padding: 2rem;
  position: fixed;
  right: 0;
  z-index: 1000;
  border-top: 3px solid var(--enterprise-danger);
}

  #blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    color: var(--enterprise-text-muted);
  }

/* 加载和连接状态样式 */
.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--enterprise-primary) 0%, var(--enterprise-primary-light) 100%);
  z-index: 9999;
  animation: loading-pulse 2s ease-in-out infinite;
}

@keyframes loading-pulse {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* 响应式增强 */
@media (max-width: 768px) {
  .bb-layout .layout-header {
    padding: 0.5rem 1rem;
  }

  .enterprise-layout-title {
    font-size: 1rem;
  }

  .enterprise-layout-subtitle {
    font-size: 0.75rem;
  }

  .bb-layout .layout-drawer-body {
    padding: 1rem !important;
  }

  .widget .dropdown-menu {
    --bs-dropdown-min-width: 16rem;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  [data-bs-theme="auto"] {
    --enterprise-primary: #4299e1;
    --enterprise-gray-50: #1a202c;
    --enterprise-gray-100: #2d3748;
    --enterprise-text-primary: #e2e8f0;
    --enterprise-text-secondary: #a0aec0;
  }
}

/* 打印样式 */
@media print {
  .bb-layout .layout-header,
  .bb-layout .layout-side,
  .bb-layout .layout-footer,
  .bb-layout .layout-drawer,
  #blazor-error-ui {
    display: none !important;
  }

  .bb-layout .layout-main {
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* 高对比度支持 */
@media (prefers-contrast: high) {
  :root {
    --enterprise-border-color: #000000;
    --enterprise-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  }

  .bb-layout .layout-item {
    border-width: 3px;
  }
}

/* 减少动画支持 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================== */
/* 编辑组件Header样式增强 */
/* =========================== */

/* 编辑头部容器样式 - 增强特殊性 */
.edit-modal .edit-header,
.modal .edit-header {
  background: #f8f9fa !important;
  border-radius: 12px !important;
  padding: 1.0rem !important;
  border: 1px solid #dee2e6 !important;
  box-shadow: none !important;
  margin-bottom: 0.7rem !important;
  position: relative !important;
  overflow: hidden !important;
}

  .edit-modal .edit-header::before,
  .modal .edit-header::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: var(--enterprise-primary, #007bff) !important;
  }

/* 编辑图标容器样式 - 增强特殊性 */
.edit-modal .edit-icon,
.modal .edit-icon {
  width: 50px !important;
  height: 50px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.25rem !important;
  box-shadow: none !important;
  position: relative !important;
  overflow: hidden !important;
}

  .edit-modal .edit-icon.bg-success,
  .modal .edit-icon.bg-success {
    background: #28a745 !important;
    color: white !important;
  }

  .edit-modal .edit-icon.bg-primary,
  modal .edit-icon.bg-primary {
    background: #007bff !important;
    color: white !important;
  }

  .edit-modal .edit-icon.bg-info,
  .modal .edit-icon.bg-info {
    background: #17a2b8 !important;
    color: white !important;
  }

  .edit-modal .edit-icon.bg-warning,
  .modal .edit-icon.bg-warning {
    background: #ffc107 !important;
    color: #212529 !important;
  }

  .edit-modal .edit-icon::before,
  .modal .edit-icon::before {
    display: none !important;
  }

  .edit-modal .edit-icon:hover::before,
  .modal .edit-icon:hover::before {
    display: none !important;
  }

  .edit-modal .edit-icon:hover,
  .modal .edit-icon:hover {
    opacity: 0.9 !important;
  }

/* =========================== */
/* 查看组件Header样式增强 */
/* =========================== */

/* 查看图标容器样式 - 与编辑图标样式保持一致 */
.view-modal .view-icon,
.modal .view-icon {
  width: 50px !important;
  height: 50px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.25rem !important;
  box-shadow: none !important;
  position: relative !important;
  overflow: hidden !important;
}

  .view-modal .view-icon.bg-success,
  .modal .view-icon.bg-success {
    background: #28a745 !important;
    color: white !important;
  }

  .view-modal .view-icon.bg-primary,
  .modal .view-icon.bg-primary {
    background: #007bff !important;
    color: white !important;
  }

  .view-modal .view-icon.bg-info,
  .modal .view-icon.bg-info {
    background: #17a2b8 !important;
    color: white !important;
  }

  .view-modal .view-icon.bg-warning,
  .modal .view-icon.bg-warning {
    background: #ffc107 !important;
    color: #212529 !important;
  }

  .view-modal .view-icon::before,
  .modal .view-icon::before {
    display: none !important;
  }

  .view-modal .view-icon:hover::before,
  .modal .view-icon:hover::before {
    display: none !important;
  }

  .view-modal .view-icon:hover,
  .modal .view-icon:hover {
    opacity: 0.9 !important;
  }

/* 查看模式特有的Header样式 */
.view-modal .edit-header,
.modal.view-modal .edit-header {
  background: #f8f9fa !important;
  border-radius: 12px !important;
  padding: 1.0rem !important;
  border: 1px solid #dee2e6 !important;
  box-shadow: none !important;
  margin-bottom: 1.5rem !important;
  position: relative !important;
  overflow: hidden !important;
}

  .view-modal .edit-header::before,
  .modal.view-modal .edit-header::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: var(--enterprise-info, #17a2b8) !important;
  }

/* Info颜色的badge样式支持 */
.edit-modal .edit-badges .badge.bg-info,
.modal .edit-badges .badge.bg-info,
.view-modal .edit-badges .badge.bg-info {
  background: #17a2b8 !important;
  color: white !important;
}

/* BootstrapBlazor Badge组件Info颜色样式覆盖 */
.edit-modal .bb-badge.bg-info,
modal .bb-badge.bg-info,
.view-modal .bb-badge.bg-info,
.edit-modal .badge-sm.bg-info,
modal .badge-sm.bg-info,
.view-modal .badge-sm.bg-info {
  background: #17a2b8 !important;
  color: white !important;
  border-radius: 20px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}

/* Color.Info对应的样式 */
.bb-badge[data-bb-color="Info"],
.badge[data-bb-color="Info"] {
  background: #17a2b8 !important;
  color: white !important;
}

@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
@import url('unified-header.css');

/*html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}*/

h1:focus {
  outline: none;
}

a, .btn-link {
  color: #0071c1;
}

.btn-primary {
  color: #fff;
  background-color: #1b6ec2;
  border-color: #1861ac;
}

/*.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}*/

/* Removed global .form-control:focus to avoid forcing a global blue focus ring on all inputs.
   If per-component input focus styling is desired, add scoped rules in the component's .razor.css,
   for example:
     .hscode-search-input .form-control:focus { box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; }
*/

.content {
  padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
  outline: 1px solid #26b050;
}

.invalid {
  outline: 1px solid red;
}

.validation-message {
  color: red;
}

/* duplicate #blazor-error-ui removed — enterprise definition above is used */

.blazor-error-boundary {
  background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHZpZXdCb3g9IjAgMCA1NiA0OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjUgNi41TDIwLjUgMTIuNUwyNy41IDYuNSIgc3Ryb2tlPSIjMUMyNUVEIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik0yMC41IDEyLjVMMTMuNSAxOC41TDIwLjUgMjQuNSIgc3Ryb2tlPSIjMUMyNUVEIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik0yNyA9SDE5QzEyLjkyNDUgOSA4IDEzLjkyNDUgOCAyMFYzN0M4IDQzLjA3NTUgMTIuOTI0NSA0OCAxOGA0OEgzN0M0My4wNzU1IDQ4IDQ4IDQzLjA3NTUgNDggMzdWMjBDNDggMTMuOTI0NSA0My4wNzU1IDkgMzcgOUgzNSIgc3Ryb2tlPSIjMUMyNUVEIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=) no-repeat 1rem/1.8rem, #b32121;
  padding: 1rem 1rem 1rem 3.7rem;
  color: white;
}

  .blazor-error-boundary::after {
    content: "An error has occurred."
  }

.loading-progress {
  position: relative;
  display: block;
  width: 8rem;
  height: 8rem;
  margin: 20vh auto 1rem auto;
}

  .loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
  }

    .loading-progress circle:last-child {
      stroke: #1b6ec2;
      stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
      transition: stroke-dasharray 0.05s ease-in-out;
    }

.loading-progress-text {
  position: absolute;
  text-align: center;
  font-weight: bold;
  inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

  .loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
  }

code {
  color: #c02d76;
}

/* 自定义样式 */
.page-header-light {
  background: #f8f9fa;
  border-radius: 0.375rem;
  border: 1px solid rgba(0, 0, 0, 0.125);
  box-shadow: none;
}

.page-icon-sm {
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(13, 110, 253, 0.1);
  border: 1px solid rgba(13, 110, 253, 0.2);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

  .page-icon-sm i {
    font-size: 1.25rem;
    color: var(--bs-primary);
  }

.page-icon-lg {
  width: 3.5rem;
  height: 3.5rem;
  background: rgba(13, 110, 253, 0.1);
  border: 1px solid rgba(13, 110, 253, 0.2);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

  .page-icon-lg i {
    font-size: 1.5rem;
    color: var(--bs-primary);
  }

.page-title-sm {
  font-weight: 600;
  color: var(--bs-body-color);
}

.page-title {
  font-weight: 600;
  color: var(--bs-body-color);
}

.stat-card-compact {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: none;
  transition: all 0.2s ease-in-out;
  display: flex;
  align-items: center;
}

.dxbl-checkbox {
  --dxbl-checkbox-check-element-size: 1.05rem;
}
.dxbl-grid {
  --dxbl-grid-header-font-weight: 500;
  --dxbl-grid-header-color: #333333;
  --dxbl-grid-font-size: 0.875rem;
  --dxbl-grid-color:#666666;
}

/* === DevExpress 报表预览/设计器全屏布局 === */
.report-preview-container > div,
.report-designer-container > div {
  width: 100% !important;
  height: 100% !important;
}
