/* ============================================================================
   AutoHR - RPA / Personnel Action screens.
   Global stylesheet (linked from App.razor) built on the design tokens in
   app.css. Replaces the old scoped Components/Pages/Rpas.razor.css, whose
   hard-coded Material-blue rgba() values never matched the design system and
   broke in dark mode.
   ========================================================================== */

/* ---------- Page-level ---------- */
.rpa-form-wide {
  width: 100%;
  max-width: none;
}

/* ---------- RPA list workspace ---------- */
.rpa-list-panel {
  background: var(--hr-surface);
  border: 1px solid var(--hr-line);
  border-radius: var(--hr-radius);
  box-shadow: var(--hr-shadow-1);
  overflow: hidden;
}

.rpa-list-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hr-line);
  background: var(--hr-surface-2);
}

  .rpa-list-toolbar .rpa-toolbar-search {
    flex: 0 1 320px;
  }

  .rpa-list-toolbar .rpa-toolbar-filter {
    flex: 0 1 210px;
  }

  /* "Show closed" switch: keep it on one line and trim MudSwitch's default outer margin so it
     lines up with the dense search/status fields. */
  .rpa-list-toolbar .rpa-toolbar-closed {
    flex: 0 0 auto;
    white-space: nowrap;
  }

    .rpa-list-toolbar .rpa-toolbar-closed .mud-input-control,
    .rpa-list-toolbar .rpa-toolbar-closed .mud-switch {
      margin: 0;
    }

.rpa-list-panel .mud-table {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.rpa-row-number {
  font-weight: 650;
  color: var(--hr-primary-700);
  white-space: nowrap;
}

[data-theme="dark"] .rpa-row-number {
  color: #9cc3e5;
}

.rpa-row-sub {
  color: var(--hr-text-2);
  font-size: var(--hr-fs-xs);
  margin-top: 1px;
}

/* ---------- Create RPA sections ---------- */
.rpa-create-section {
  border: 1px solid var(--hr-line);
  border-radius: var(--hr-radius);
  background: var(--hr-surface);
  box-shadow: var(--hr-shadow-1);
  overflow: hidden;
}

.rpa-create-section-title {
  padding: 10px 14px;
  border-bottom: 1px solid var(--hr-line);
  font-weight: 650;
  color: var(--hr-primary-700);
  background: var(--hr-primary-050);
  font-size: var(--hr-fs-sm);
  letter-spacing: 0.2px;
}

[data-theme="dark"] .rpa-create-section-title {
  color: #9cc3e5;
}

.rpa-create-section-body {
  padding: 14px;
}

/* ---------- RPA detail header ---------- */
.rpa-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.rpa-hero-ico {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--hr-primary-050);
  color: var(--hr-primary-700);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

[data-theme="dark"] .rpa-hero-ico {
  color: #9cc3e5;
}

.rpa-hero-title {
  font-size: var(--hr-fs-xl);
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.rpa-hero-sub {
  color: var(--hr-text-2);
  font-size: var(--hr-fs-sm);
  margin-top: 2px;
}

.rpa-hero .actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.rpa-header-frame {
  border: 1px solid var(--hr-line);
  border-radius: var(--hr-radius);
  background: var(--hr-surface);
  box-shadow: var(--hr-shadow-1);
  overflow: hidden;
  /* Stretch to the full row height so both columns' backgrounds line up
     at the same bottom, regardless of how many rows each side has. */
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Ensure MudGrid items in the RPA header row expose their full height
   to the child frame — MudGrid's default row is align-items:stretch,
   but the MudItem inner div needs height:100% to hand that down. */
.mud-grid .mud-grid-item > .rpa-header-frame {
  min-height: 100%;
}

.rpa-header-title {
  font-size: 2.05rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.rpa-header-table {
  width: 100%;
  border-collapse: collapse;
}

  .rpa-header-table td {
    padding: 6px 0;
    vertical-align: top;
    border-bottom: 1px solid var(--hr-line);
    font-size: var(--hr-fs-sm);
  }

  .rpa-header-table tr:last-child td {
    border-bottom: none;
  }

.rpa-header-label {
  width: 40%;
  white-space: nowrap;
  font-weight: 600;
  padding-right: 12px;
  color: var(--hr-text-2);
  font-size: var(--hr-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rpa-header-value {
  width: 60%;
  font-weight: 550;
  color: var(--hr-text);
}

.rpa-status-banner {
  background: linear-gradient(90deg, var(--hr-primary-100), var(--hr-primary-050));
  border-bottom: 1px solid var(--hr-line);
  padding: 9px 14px;
  font-weight: 650;
  font-size: var(--hr-fs-sm);
  color: var(--hr-primary-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .rpa-status-banner {
  background: linear-gradient(90deg, #1d3a5c, #16283c);
  color: #9cc3e5;
}

.rpa-status-body {
  padding: 12px 14px 14px;
  /* Grow to fill remaining vertical space inside the frame so the
     bordered background reaches the same bottom on both columns. */
  flex: 1 1 auto;
}

.rpa-status-chip {
  min-width: 100%;
  text-align: center;
  font-weight: 700;
}

/* ---------- Position picker / selection ---------- */
.position-picker-table {
  overflow: auto;
}

.selected-position-banner {
  border-left-width: 4px;
}

.rpa-selected-row {
  outline: 2px solid var(--hr-primary-500);
  outline-offset: -2px;
}

  .rpa-selected-row > td {
    background: var(--hr-primary-050);
    font-weight: 600;
  }

.rpa-choice-row {
  min-height: 32px;
  padding: 2px 8px;
  border-radius: 8px;
}

.rpa-choice-row-disabled {
  opacity: 0.55;
}

/* ---------- Classification tabs / cards ---------- */
.classification-card,
.classification-tab-shell {
  border: 1px solid var(--hr-line);
  border-radius: var(--hr-radius);
  background: var(--hr-surface);
}

.classification-section {
  border: 1px solid var(--hr-line);
  border-radius: var(--hr-radius);
  background: var(--hr-surface);
}

.yes-no-toggle {
  display: flex;
  width: 100%;
  gap: 0;
}

  .yes-no-toggle .yes-no-button {
    flex: 1 1 0;
    min-width: 0;
    border-radius: 0;
  }

    .yes-no-toggle .yes-no-button:first-child {
      border-top-left-radius: 6px;
      border-bottom-left-radius: 6px;
    }

    .yes-no-toggle .yes-no-button:last-child {
      border-top-right-radius: 6px;
      border-bottom-right-radius: 6px;
    }

.classification-consider-table .mud-table-head {
  background: var(--hr-primary-700);
}

  .classification-consider-table .mud-table-head th {
    color: #fff;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    padding-top: 10px;
    padding-bottom: 10px;
    text-transform: none;
    letter-spacing: 0;
    font-size: var(--hr-fs-sm);
  }

.classification-consider-table .mud-table-body td {
  text-align: center;
  vertical-align: middle;
  padding-top: 12px;
  padding-bottom: 12px;
}

.classification-editor-card {
  background: var(--hr-surface);
}

/* ---------- Redirect summary panels ---------- */
.redirect-summary-grid {
  border: 1px solid var(--hr-line);
  border-radius: var(--hr-radius);
  background: var(--hr-surface);
}

.redirect-summary-table {
  width: 100%;
  border-collapse: collapse;
}

  .redirect-summary-table td {
    padding: 5px 8px;
    vertical-align: top;
    border-bottom: 1px solid var(--hr-line);
  }

  .redirect-summary-table tr:last-child td {
    border-bottom: none;
  }

  .redirect-summary-table td:first-child {
    width: 24%;
    white-space: nowrap;
    font-weight: 600;
    color: var(--hr-text-2);
  }

.redirect-panel-card {
  border: 1px solid var(--hr-line);
  border-radius: var(--hr-radius);
  background: var(--hr-surface);
  overflow: hidden;
}

.redirect-panel-title {
  padding: 9px 14px;
  background: linear-gradient(90deg, var(--hr-primary-100), var(--hr-primary-050));
  border-bottom: 1px solid var(--hr-line);
  font-weight: 650;
  font-size: var(--hr-fs-sm);
  color: var(--hr-primary-700);
}

[data-theme="dark"] .redirect-panel-title {
  background: linear-gradient(90deg, #1d3a5c, #16283c);
  color: #9cc3e5;
}

.redirect-panel-body {
  padding: 12px;
}

.redirect-summary-row {
  margin-top: 4px;
}

.redirect-inline-alert {
  padding-top: 8px;
  padding-bottom: 8px;
}

.redirect-summary-grid b {
  display: inline-block;
  margin-bottom: 2px;
}
