body,
html {
  height: 100%;
  margin: 0;
  overflow-x: hidden;
}

* {
  outline: none !important;
}

:root {
  --mdc-theme-primary: #3f51b5;
  --mdc-theme-secondary: #566a7f;
}

.layout-menu {
  width: 250px;
  height: 100%;
  user-select: none;
}

.layout-page {
  display: block;
}

.menu-vertical {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mdc-drawer__content {
  overflow: hidden auto;
  display: flex;
  flex-direction: column;
}

.menu-inner {
  padding-top: 16px;
  flex-grow: 1;
  overflow-y: auto;
}

/* Menu item styling */
.menu-inner > .menu-item {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: block;
}

/* Menu link - base styling */
.menu-link {
  display: flex;
  align-items: center;
  width: 80%;
  padding: 10px 16px;
  color: var(--mdc-theme-secondary) !important;
  font-size: 16px;
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.menu-link .menu-icon {
  flex-shrink: 0;
  margin-right: 12px;
  font-size: 22px;
}

.menu-link span {
  flex: 1;
}

.active > .menu-link {
  font-weight: bold;
  color: var(--mdc-theme-primary) !important;
  background-color: rgba(63, 81, 181, 0.1);
  border-radius: 4px;
}

/* Menu divider */
.menu-divider {
  border: 0;
  border-top: 1px solid #e0e0e0;
  margin: 8px 16px;
  width: auto;
}

/* Submenu container */
.menu-sub {
  display: none;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
}

.menu-vertical .menu-divider {
  width: 80%;
}

.menu-vertical .menu-sub .menu-link {
  padding-left: 30px;
}

.menu-vertical .menu-sub .menu-icon {
  margin-right: 10px;
}

.menu-item.open > .menu-sub {
  display: flex;
}

/* Submenu items */
.menu-sub .menu-item {
  width: 100%;
}

.menu-sub .menu-link {
  padding: 8px 16px 8px 50px;
  font-size: 14px;
}

.menu-sub .menu-icon {
  font-size: 20px;
  margin-right: 10px;
}

/* Menu toggle (collapsible group headers) */
.menu-toggle {
  position: relative;
  font-weight: 500;
}

.menu-toggle::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  width: 6px;
  height: 6px;
  border: 1.5px solid var(--mdc-theme-secondary);
  border-bottom: 0;
  border-left: 0;
  transform: translateY(-50%) rotate(45deg);
  transition: transform 0.2s ease;
}

.menu-item.open > .menu-toggle::after {
  transform: translateY(-50%) rotate(135deg);
}

/* Hover states */
.menu-link:hover {
  background-color: rgba(63, 81, 181, 0.08);
  border-radius: 4px;
}

/* Active state for parent groups */
.menu-item.active > .menu-toggle {
  color: var(--mdc-theme-primary) !important;
}

.custom-dialog .mdc-dialog__surface {
  width: 400px;
  max-height: 70vh;
  max-width: none;
  max-height: none;
}
.custom-dialog .mdc-dialog__surface.big {
  width: 1000px;
  height: 800px;
  max-height: 70vh;
  max-width: 80vw;
}

.form-group {
  margin: 30px 0px 0px 0px;
}

form .inputHolder {
  margin: 10px 0px 0px 0px;

}

.mdc-text-field-container {
  margin: 20px 20px 20px 0px;
}

.mdc-text-field--outlined {
  height: 40px;
  width: 150px;
}

#selectedControls p {
  color: white;
  flex-grow: 1;
  margin: 0;
  padding: 10px;
}

#selectedControls div {
  background-color: rgb(104, 104, 104);
  display: flex;
  align-items: center;
  border-radius: 5px;
  margin-bottom: 5px;
}

#selectedControls div button {
  color: white;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
}

#standardsContainer button {
  min-width: 100%;
  background-color: rgb(104, 104, 104);
  align-items: center;
  text-align: left;
  border-radius: 5px;
  margin-bottom: 5px;
  color: white;
  border: none;
  cursor: pointer;
  padding: 10px;

}

#standardsContainer button:hover {
  background-color: rgb(90, 90, 90);
}

.dt-button {
  color: var(--mdc-protected-button-label-text-color, var(--mdc-theme-on-secondary, #fff)) !important;
  background-color: var(--mdc-protected-button-container-color, var(--mdc-theme-secondary, #6200ee)) !important;
  border: none !important;
  border-radius: 4px !important;
}

.mdc-list-item__text {
  user-select: none;
}
.mdc-list-item__text * {
  pointer-events:none;
}

.slidecontainer {
  width: 100%; /* Width of the outside container */
}

/* The slider itself */
.slider-color {
  -webkit-appearance: none;
  width: 100%;
  height: 15px;
  border-radius: 5px;
  background: #d3d3d3;
  outline: none;
  opacity:0.7;
  -webkit-transition: opacity .15s ease-in-out;
  transition: opacity .15s ease-in-out;
}
.slider-color:hover {
  opacity:1;
}
.slider-color::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--mdc-theme-primary);
  cursor: pointer;
}
.slider-color::-moz-range-thumb {
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 50%;
  background: var(--mdc-theme-primary);
  cursor: pointer;
}

.tox-promotion {
  display: none !important;
}

#tenant_select {
  background: none;
  border: none;
  color: white;
  width: 100%;
}
#tenant_select option {
  color: black;
}

.dataTable td:first-of-type {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above, .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above {
  -webkit-transform: translateY(-25px) scale(0.75);
  transform: translateY(-25px) scale(0.75);
}

/* Adviser (advice panel) styles moved from JS */
.advice-collapsible { overflow: hidden; transition: height 0.25s ease; }
.advice-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.advice-row + .advice-row { border-top: 1px solid rgba(0,0,0,0.05); }
.advice-text { flex: 1; }
.advice-achieved .advice-text { text-decoration: line-through; opacity: 0.75; }
.advice-icon { font-size: 22px; margin-right: 8px; vertical-align: middle; }
.advice-header-title { font-weight: 600; font-size: 16px; }
.advice-actions { display: flex; gap: 8px; align-items: center; }
.advice-expand-btn { border: none; background: transparent; cursor: pointer; padding: 6px; border-radius: 4px; }
.advice-expand-btn:hover { background: rgba(0,0,0,0.05); }

/* Alerts inspector: keep audit trail within sidebar width */
#alert_audit_section {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#alert_audit_section table {
  min-width: 720px; /* ensure scroll appears for many columns */
}
#alert_audit_section th,
#alert_audit_section td {
  white-space: nowrap; /* avoid wrapping long values; use horizontal scroll instead */
}

/* DLP template cards */
.template-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  outline: none;
}
.template-card:hover,
.template-card:focus {
  border-color: #94a3b8;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.template-card.selected {
  border-color: var(--mdc-theme-primary);
  box-shadow: 0 0 0 2px rgba(63,81,181,0.25);
  background-color: #eef2ff; /* light primary tint */
}
.template-card .meta-badge {
  display: inline-block;
  background: #f1f5f9;
  color: #334155;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 11px;
  margin-right: 4px;
}

/* Reusable stats panel */
.stats-kpis { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin-bottom: 12px; }
.stats-kpis .kpi { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; }
.stats-kpis .kpi-label { color: #64748b; font-size: 12px; }
.stats-kpis .kpi-value { font-weight: 600; font-size: 20px; color: #0f172a; }
.stats-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.stats-chart, .stats-table { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; }

/* Stats controls */
.stats-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
}
.stats-controls .controls-left { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stats-controls .controls-right { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stats-controls .control { display: flex; gap: 6px; align-items: center; font-size: 12px; color: #475569; }
.stats-controls input[type="date"] {
  height: 32px;
  padding: 2px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
}

/* Stats doughnuts row */
.stats-donuts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-top: 12px; }
@media (max-width: 900px) { .stats-donuts { grid-template-columns: 1fr; } }
.stats-donuts .donut-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
}
/* AG Grid explicit sizing/styles removed per request. */

/* Align card header content (e.g., CSV buttons on right) */
.card-header {
  line-height: 36px;
}

/* Action cells: avoid text/button collapsing or clipping */
.ag-theme-material .ag-cell.ag-actions-cell,
.ag-theme-material .ag-pinned-right-cols-container .ag-cell.ag-actions-cell {
  white-space: nowrap !important;
  overflow: visible !important;
}
.ag-theme-material .ag-cell.ag-actions-cell .ag-cell-wrapper {
  overflow: visible !important;
}
.ag-theme-material .ag-cell.ag-actions-cell .mdc-button {
  white-space: nowrap;
}

/* vis.js network graph tooltip styling */
.vis-tooltip {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  padding: 10px 12px !important;
  font-family: inherit !important;
  font-size: 13px !important;
  color: #334155 !important;
  line-height: 1.5 !important;
  white-space: pre-line !important;
}

/* Document Inspector - copy buttons */
.doc-inspector-copy {
  border: none;
  background: none;
  padding: 2px 4px;
  margin-left: 4px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.4;
  vertical-align: middle;
  transition: opacity 0.15s, background-color 0.15s, color 0.15s;
}
.doc-inspector-copy i { font-size: 14px; vertical-align: middle; }
.doc-inspector-copy:hover { opacity: 1; background: #e2e8f0; }
.doc-inspector-copy:active { opacity: 1; background: #cbd5e1; transform: scale(0.9); }
.doc-inspector-copy.copied { opacity: 1; color: #16a34a; }
