/* ===== Page & Form Wrapper ===== */
.mu-form,
.entity-form {
  font-family: "Segoe UI", Tahoma, sans-serif;
  background-color: #f0f2f5;
  padding: 40px 20px;
  box-sizing: border-box;
}

/* ===== Form Container (Card) ===== */
.mu-form .entity-form form,
.entity-form form {
  max-width: 960px;
  margin: auto;
  background: #fff;
  padding: 30px 40px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* ===== Headings ===== */
.entity-form h1,
.entity-form h2 {
  text-align: center;
  color: #003771;
  font-size: 28px;
  margin-bottom: 30px;
}

/* ===== Fieldsets & Legends ===== */
.entity-form fieldset {
  border: none;
  margin-bottom: 40px;
}

.entity-form legend {
  font-size: 20px;
  font-weight: 600;
  color: #003771;
  margin-bottom: 20px;
  border-bottom: 2px solid #cce0f0;
  padding-bottom: 5px;
  width: 100%;
}

/* ===== Labels ===== */
.entity-form .control-label {
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
  font-size: 15px;
  color: #333;
}

/* ===== Remove background from field labels ===== */
.entity-form label,
.entity-form .field-label,
.entity-form .control-label {
  background: none !important;
  background-color: transparent !important;
}

/* Required indicator */
.entity-form .control-label.required::after {
  content: " *";
  color: red;
  font-weight: bold;
}

/* ===== Form Groups ===== */
.entity-form .form-group {
  margin-bottom: 20px;
}

/* ===== Inputs / Selects / Textareas ===== */
.entity-form .form-control,
.entity-form select,
.entity-form textarea {
  font-size: 15px;
  border-radius: 6px;
  border: 1px solid #ccc;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: #fff;
  box-sizing: border-box;
}

/* Disabled */
.entity-form .form-control:disabled,
.entity-form select:disabled,
.entity-form textarea:disabled {
  background-color: #f0f0f0 !important;
  color: #999 !important;
  cursor: not-allowed;
  opacity: 1;
  border-color: #ccc;
}

/* Focus */
.entity-form .form-control:focus,
.entity-form select:focus,
.entity-form textarea:focus {
  border-color: #006778;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 85, 165, 0.15);
}

/* ===== Validation ===== */
.entity-form .has-error .form-control,
.entity-form .has-error select,
.entity-form .has-error textarea {
  border-color: #d8000c;
  background-color: #fff6f6;
}

.entity-form .validation-message,
.entity-form .help-block {
  font-size: 14px;
  color: #d8000c;
  margin-top: 5px;
}

/* ===== Checkbox & Radio Styling ===== */
.entity-form .checkbox,
.entity-form .radio {
  margin-top: 10px;
}

.entity-form input[type="checkbox"],
.entity-form input[type="radio"] {
  margin-right: 8px;
}

/* ===== Actions / Buttons ===== */
.entity-form .actions {
  text-align: center;
  margin-top: 30px;
}

/* Primary action button */
.entity-form .actions .btn-primary {
  background-color: #003771;
  color: #fff;
  padding: 12px 28px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin: 10px;
  transition: background-color 0.2s, transform 0.1s;
}

/* Hover */
.entity-form .actions .btn-primary:hover {
  background-color: #0055a5;
  transform: translateY(-1px);
}

/* Active */
.entity-form .actions .btn-primary:active {
  transform: translateY(0);
}

/* Focus */
.entity-form .actions .btn-primary:focus-visible {
  outline: 3px solid rgba(0, 85, 165, 0.35);
  outline-offset: 2px;
}

/* ===== Secondary Buttons ===== */
.entity-form .actions .btn-default,
.entity-form .actions .btn-secondary {
  background-color: #e0e0e0;
  color: #333;
  padding: 12px 28px;
  font-size: 16px;
  border-radius: 6px;
  border: none;
}

/* ===== Lookup Field Action Buttons ===== */
.entity-form .clearlookupfield,
.entity-form .launchentitylookup {
  border: 1px solid #ccd6e0;
  color: #003771;
  border-radius: 6px;
  margin-left: 6px;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .entity-form form {
    padding: 20px;
  }

  .entity-form .actions .btn-primary,
  .entity-form .actions .btn-secondary {
    width: 100%;
  }
}

/* ===== Accessibility Utilities ===== */
.visually-hidden {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  .entity-form .form-control,
  .entity-form .actions .btn-primary {
    transition: none;
  }
}

/* Arrow indicators on h2 */
h2.tab-title {
  cursor: pointer;
  position: relative;
  user-select: none;
  margin-bottom: 5px;
}

h2.tab-title::after {
  content: "▲"; /* expanded by default */
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s;
}

h2.tab-title.collapsed::after {
  content: "▼"; /* collapsed */
}

/* Content divs */
div[data-name^="tab_"] {
  overflow: hidden;
  transition: height 0.4s ease, padding 0.4s ease;
  padding: 10px;
}

/* HERE */
/* ===== Subgrid container ===== */
.entity-form .view-grid {
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  border: 1px solid #e5e7eb;
}

/* ===== Table ===== */
.entity-form .view-grid table {
  background: transparent;
  margin-bottom: 0;
}

.entity-form .view-grid thead th {
  background: #f9fafb;
  color: #374151; /* neutral dark gray */
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
}

/* ===== Rows ===== */
.entity-form .view-grid tbody tr {
  background: #fff;
  transition: background-color 0.15s ease;
}

.entity-form .view-grid tbody tr:hover {
  background-color: #f9fbfd;
}

.entity-form .view-grid td {
  vertical-align: middle;
}

/* ===== Links ===== */
.entity-form .view-grid a.details-link {
  color: #003771;
  font-weight: 500;
  text-decoration: none;
}

.entity-form .view-grid a.details-link:hover {
  text-decoration: underline;
}

/* ===== Required column ===== */
.entity-form .view-grid td[data-attribute="mu_required"] {
  font-weight: 600;
}

/* ===== Action dropdown button ===== */
.entity-form .view-grid .action .btn {
  background-color: #f0f2f5;
  border: 1px solid #cfd6dd;
  color: #003771;
}

.entity-form .view-grid .action .btn:hover {
  background-color: #e6eef7;
}

/* ===== Dropdown menu ===== */
.entity-form .view-grid .dropdown-menu {
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}


/* NEW */
/* ===== TAB HEADERS (Power Pages) ===== */
h2.tab-title {
  background: #003771;
  color: #ffffff;
  padding: 14px 18px;
  margin-top: 22px;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #002d5a;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

/* Hover effect */
h2.tab-title:hover {
  background: #006778;
  border-color: #005b6a;
}

/* Expanded tab header styling */
h2.tab-title:not(.collapsed) {
  background: #006778; /* turquoise accent */
  border-color: #005260;
  position: relative;
}

/* Arrow alignment fix */
h2.tab-title::after {
  font-size: 16px;
}

/* ===== TAB CONTENT AREA ===== */
div[data-name^="tab_"] {
  border: 1px solid #e1e7ee;
  border-radius: 0 0 8px 8px;
  background: #ffffff;
  margin-top: -5px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  padding: 20px;
}

/* Collapsed = no padding */
div[data-name^="tab_"].collapsed {
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

/* Description */
/* Simple, subtle field description */
.entity-form .description,
.entity-form .description.above {
  margin: 4px 0 8px 0;
  font-size: 13px;
  font-style: italic;
  color: #555; /* neutral, unobtrusive */
}