/* Enterprise Health Dashboard */

.enterprise-dashboard-page {
  background: #f5f5f5;
  padding: 12px 16px;
  overflow-y: auto;
}

.dashboard-filter-bar {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 0;
  margin-bottom: 0;
}

/* Filter rows */
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
}

.filter-row1 {
  height: 58px;
}

.filter-row2 {
  height: 44px;
  padding-bottom: 8px;
  justify-content: flex-end;
}

.filter-row2 .btn {
  min-width: 60px;
}

.filter-label {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.filter-date-range {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0 10px;
  height: 34px;
  background: #fff;
}

.filter-date-range input {
  border: none;
  outline: none;
  width: 90px;
  font-size: 13px;
  background: transparent;
  padding: 0;
  margin: 0;
  height: auto;
  box-shadow: none;
}

.date-sep {
  color: #999;
  font-size: 13px;
}

.filter-select {
  border: 1px solid #ccc;
  border-radius: 6px;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  min-width: 120px;
}

.filter-select-wrap {
  min-width: 150px;
}

.filter-select-wrap select {
  border: 1px solid #ccc;
  border-radius: 6px;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  width: 100%;
}

.filter-spacer {
  flex: 1;
}

/* Action bar */
.dashboard-action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  min-height: 42px;
  background: #dbeafe;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 10px;
  box-sizing: border-box;
}

.dashboard-action-bar .btn {
  background-color: #006dcc;
  border-color: #006dcc;
  color: #fff;
  border-radius: 6px;
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
  line-height: 34px;
}

/* Dashboard body */
.enterprise-dashboard-page .dashboard-body {
  background: #f9f9f9;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.enterprise-dashboard-page .widget-empty {
  padding: 40px;
  text-align: center;
  color: #999;
}

/* Section headers */
.enterprise-dashboard-page .section-header {
  display: flex;
  align-items: center;
  height: 28px;
}

.enterprise-dashboard-page .section-title {
  font-size: 16px;
  font-weight: 600;
  color: #0a0a0a;
}

/* Mid row: employee distribution + risk management side by side */
.enterprise-dashboard-page .mid-row {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: stretch;
}

/* Employee Distribution */
.enterprise-dashboard-page .demo-section {
  width: 380px;
  min-width: 380px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.enterprise-dashboard-page .demo-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.enterprise-dashboard-page .demo-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 16px;
  box-sizing: border-box;
}

.enterprise-dashboard-page .demo-card-left {
  width: 180px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.enterprise-dashboard-page .demo-card-label {
  font-size: 14px;
  font-weight: 700;
  color: #010101;
}

.enterprise-dashboard-page .demo-card-value {
  font-size: 32px;
  font-weight: normal;
  color: #0a0a0a;
  line-height: 1.2;
}

.enterprise-dashboard-page .demo-card-divider {
  width: 1px;
  align-self: stretch;
  background: #ccc;
  flex-shrink: 0;
}

.enterprise-dashboard-page .demo-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 1;
}

.enterprise-dashboard-page .demo-detail-text {
  font-size: 13px;
  font-weight: 500;
  color: #3b82f6;
}

.enterprise-dashboard-page .demo-divider {
  height: 1px;
  background: #e5e5e5;
  width: 100%;
}

/* Risk Management */
.enterprise-dashboard-page .risk-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.enterprise-dashboard-page .risk-header {
  justify-content: space-between;
}

.enterprise-dashboard-page .risk-unit {
  font-size: 13px;
  font-weight: normal;
  color: #000;
}

.enterprise-dashboard-page .risk-body {
  display: flex;
  flex-direction: row;
  gap: 12px;
  background: #fff;
}

.enterprise-dashboard-page .risk-summary-col {
  width: 132px;
  min-width: 132px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-sizing: border-box;
}

.enterprise-dashboard-page .risk-summary-label {
  font-size: 14px;
  font-weight: 700;
  color: #000;
}

.enterprise-dashboard-page .risk-summary-value {
  font-size: 32px;
  font-weight: normal;
  color: #0a0a0a;
  line-height: 1.2;
}

.enterprise-dashboard-page .risk-cards-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 12px;
  min-width: 0;
}

.enterprise-dashboard-page .risk-cards-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
}

.enterprise-dashboard-page .risk-card {
  flex: 1;
  background: #d0e7f6;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
  min-width: 0;
}

.enterprise-dashboard-page .risk-card-hrow {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  height: 42px;
}

.enterprise-dashboard-page .risk-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #000;
}

.enterprise-dashboard-page .risk-card-total {
  font-size: 22px;
  font-weight: normal;
  color: #0a0a0a;
}

.enterprise-dashboard-page .risk-card-detail {
  font-size: 12px;
}

.enterprise-dashboard-page .detail-text {
  color: #3b82f6;
  font-size: 12px;
  font-weight: normal;
}

/* Exam Abnormality */
.enterprise-dashboard-page .exam-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.enterprise-dashboard-page .exam-cards {
  display: flex;
  flex-direction: row;
  gap: 12px;
  background: #f7f7f7;
}

.enterprise-dashboard-page .exam-card {
  flex: 1;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  min-width: 0;
}

.enterprise-dashboard-page .exam-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #000;
}

.enterprise-dashboard-page .exam-card-percentage {
  font-size: 28px;
  font-weight: normal;
  color: #000;
  line-height: 1.2;
}

.enterprise-dashboard-page .exam-card-detail {
  font-size: 12px;
}

/* Settings Modal */
#dashboardSettingsModal {
  width: 640px;
  margin-left: -320px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

#dashboardSettingsModal .modal-header {
  min-height: 52px;
  background: #5b9bd5;
  border-bottom: 0;
  padding: 0 16px;
  color: #fff;
  display: flex;
  align-items: center;
}

#dashboardSettingsModal.ordering-mode .modal-header {
  background: #4472c4;
}

#dashboardSettingsModal .modal-header h3 {
  color: #fff;
  font-size: 18px;
  line-height: 52px;
  margin: 0;
  font-weight: 600;
}

#dashboardSettingsModal .modal-header .close {
  color: #fff;
  opacity: 0.9;
  text-shadow: none;
  margin-top: 16px;
}

#dashboardSettingsModal .modal-body {
  background: #f8f8f8;
  padding: 0;
  max-height: 520px;
  overflow-y: auto;
}

#dashboardSettingsModal.ordering-mode .modal-body {
  background: #fff;
}

#dashboardSettingsModal .modal-body > .nav-tabs {
  margin: 0;
  padding: 4px 8px;
  background: #f2f2f2;
  border-bottom: 1px solid #ccc;
  height: 40px;
  box-sizing: border-box;
}

#dashboardSettingsModal.ordering-mode .modal-body > .nav-tabs {
  padding: 0;
  background: #f5f5f5;
}

#dashboardSettingsModal .nav-tabs > li > a {
  border: 0;
  border-radius: 4px;
  color: #999;
  padding: 4px 16px;
  line-height: 20px;
}

#dashboardSettingsModal .nav-tabs > .active > a,
#dashboardSettingsModal .nav-tabs > .active > a:hover,
#dashboardSettingsModal .nav-tabs > .active > a:focus {
  background: #fff;
  border: 1px solid #ccc;
  border-bottom-color: #ccc;
  color: #333;
  font-weight: 500;
}

#dashboardSettingsModal.ordering-mode .nav-tabs > .active > a,
#dashboardSettingsModal.ordering-mode .nav-tabs > .active > a:hover,
#dashboardSettingsModal.ordering-mode .nav-tabs > .active > a:focus {
  color: #333;
  font-weight: 600;
}

/* Ordering tab padding */
#dashboardSettingsModal .modal-body > div[ng-show="settingsTab === 'ordering'"] {
  padding: 16px;
}

/* Settings Selection Tab */
.settings-selection-tab {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-section {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
}

.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
}

.settings-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.settings-section-hint {
  font-size: 12px;
  color: #e7000b;
}

.settings-section-divider {
  height: 1px;
  background: #e5e5e5;
  width: 100%;
}

/* Category bar for exam section */
.settings-category-bar {
  background: #4472c4;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  padding: 0 12px;
  height: 36px;
  line-height: 36px;
}

/* Select row */
.settings-select-row {
  padding: 8px 12px;
}

.settings-select-input {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  color: #999;
  background: #fff;
  box-sizing: border-box;
}

/* Checklist rows */
.settings-checklist {
  overflow-y: auto;
}

.settings-checklist.risk-checklist {
  max-height: none;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
}

.settings-row-alt {
  background: #fafafa;
}

/* Custom checkbox squares */
.settings-checkbox {
  position: relative;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 1px solid #aaa;
  border-radius: 3px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-checkbox.checked {
  background: #4db6ac;
  border-color: #4db6ac;
}

.settings-checkbox.disabled {
  opacity: 0.7;
}

.settings-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.settings-row-name {
  font-size: 13px;
  color: #333;
  min-width: 230px;
  flex-shrink: 0;
}

.settings-row-desc {
  font-size: 13px;
  color: #333;
}

/* Unchecked row text color */
.settings-checkbox:not(.checked) ~ .settings-row-name,
.settings-checkbox:not(.checked) ~ .settings-row-desc {
  color: #555;
}

#dashboardSettingsModal .exam-checklist {
  max-height: 140px;
}

.sortable-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sortable-item {
  padding: 8px 12px;
  margin-bottom: 4px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  cursor: grab;
}

.sortable-item:active {
  cursor: grabbing;
}

.sortable-item i {
  margin-right: 8px;
  color: #999;
}

.sortable-fixed {
  background: #fafafa;
  cursor: default;
  opacity: 0.7;
}

#dashboardSettingsModal .modal-footer {
  height: 56px;
  box-sizing: border-box;
  border-top: 1px solid #e5e5e5;
  padding: 8px 16px;
  background: #fff;
}

#dashboardSettingsModal.ordering-mode .modal-footer {
  height: 60px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

#dashboardSettingsModal .modal-footer .btn {
  min-width: 82px;
  border-radius: 4px;
}

#dashboardSettingsModal .modal-footer .btn-primary {
  background: #5b9bd5;
  border-color: #5b9bd5;
}

#dashboardSettingsModal.ordering-mode .modal-footer .btn-primary {
  background: #4472c4;
  border-color: #4472c4;
}

/* Responsive */
@media (max-width: 767px) {
  .enterprise-dashboard-page {
    padding: 10px;
  }

  .enterprise-dashboard-page .mid-row {
    flex-direction: column;
  }

  .enterprise-dashboard-page .demo-section {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .enterprise-dashboard-page .risk-body {
    flex-direction: column;
  }

  .enterprise-dashboard-page .risk-summary-col {
    width: 100%;
    min-width: 0;
  }

  .enterprise-dashboard-page .risk-cards-row {
    flex-direction: column;
  }

  .enterprise-dashboard-page .exam-cards {
    flex-direction: column;
  }

  #dashboardSettingsModal {
    width: auto;
    margin-left: 0;
    left: 10px;
    right: 10px;
  }
}

/* Filter row2 buttons */
.filter-row2 .btn-primary {
  background-color: #006dcc;
  border-color: #006dcc;
  color: #fff;
  border-radius: 6px;
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
  line-height: 34px;
}

/* Print header - hidden on screen, visible on print */
.dashboard-print-header {
  display: none;
}

/* Print styles */
@media print {
  /* Show print header */
  .dashboard-print-header {
    display: block !important;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ccc;
  }

  /* Hide non-printable elements */
  .dashboard-filter-bar,
  .dashboard-action-bar,
  #dashboardSettingsModal,
  .bs-docs-sidebar,
  .navbar,
  #menuArea,
  #loader,
  #progress {
    display: none !important;
  }

  /* Page layout - full width without sidebar */
  .enterprise-dashboard-page {
    background: #fff;
    padding: 0;
    width: 100% !important;
    margin: 0 !important;
  }

  .container-fluid.wrapper {
    padding: 0 !important;
    margin: 0 !important;
  }

  .mainView_F_nonav {
    margin-left: 0 !important;
    width: 100% !important;
    float: none !important;
  }

  .footer {
    display: none !important;
  }

  .demo-card,
  .risk-card,
  .exam-card,
  .risk-summary-col {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #ccc;
  }

  .risk-card {
    background: #d0e7f6 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Print title */
  .enterprise-dashboard-page::before {
    content: '';
    display: block;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
  }
}
