/*
 * Reseller access policy pages.
 * Every rule is scoped under .reseller-access — this file is linked globally.
 */

.reseller-access .rap-empty {
  margin-bottom: 20px;
}

/* Badges always pair colour with an icon and a text label */
.reseller-access .rap-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 18px;
  border: 1px solid transparent;
  background-color: #eeeeee;
  color: #333333;
  white-space: nowrap;
}

.reseller-access .rap-badge i {
  margin-right: 4px;
}

.reseller-access .rap-badge-grant {
  background-color: #e3f2fd;
  border-color: #bbdefb;
  color: #0d47a1;
}

.reseller-access .rap-badge-self {
  background-color: #ede7f6;
  border-color: #d1c4e9;
  color: #4527a0;
}

.reseller-access .rap-status-pending {
  background-color: #fff8e1;
  border-color: #ffe082;
  color: #7f5f00;
}

.reseller-access .rap-status-approved {
  background-color: #e8f5e9;
  border-color: #c8e6c9;
  color: #1b5e20;
}

.reseller-access .rap-status-rejected,
.reseller-access .rap-status-revoked {
  background-color: #ffebee;
  border-color: #ffcdd2;
  color: #b71c1c;
}

.reseller-access .rap-status-unknown {
  background-color: #eceff1;
  border-color: #cfd8dc;
  color: #37474f;
}

/* Action groups in the capability picker. With every group open the list was ~3,900px tall,
   so each group is a closed <details> and the summary carries the name and the live count. */
.reseller-access details.reseller-access-capability-category {
  margin-top: 8px;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
}

.reseller-access details.reseller-access-capability-category > summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
}

.reseller-access .reseller-access-capability-selector {
  margin-bottom: 18px;
}

.reseller-access details.reseller-access-capability-category > summary:before {
  display: inline-block;
  flex: 0 0 12px;
  width: 12px;
  font-family: FontAwesome;
  content: "\f105";
  color: #2a6fb0;
  transition: transform 0.15s;
}

.reseller-access details.reseller-access-capability-category[open] > summary:before {
  transform: rotate(90deg);
}

.reseller-access details.reseller-access-capability-category > summary:focus-visible {
  outline: 2px solid #2a6fb0;
  outline-offset: -2px;
  border-radius: 8px;
}

.reseller-access .rap-capability-group-name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  font-size: 15px;
  color: #2c3e50;
}

.reseller-access .rap-capability-group-count {
  flex: 0 0 auto;
  font-size: 13px;
  color: #5b6b7d;
  white-space: nowrap;
}

.reseller-access details.reseller-access-capability-category[open] > summary {
  border-bottom: 1px solid #e3e8ef;
}

.reseller-access details.reseller-access-capability-category > .reseller-access-capability,
.reseller-access details.reseller-access-capability-category > .reseller-access-capability-baseline {
  padding: 0 14px 0 36px;
}

.reseller-access details.reseller-access-capability-category > .reseller-access-capability:first-of-type {
  margin-top: 10px;
}

.reseller-access details.reseller-access-capability-category > :last-child {
  padding-bottom: 10px;
}

/* dl-horizontal caps dt at 160px and ellipsises the overflow, which clipped labels like
   "Requested capabilities". Wider, and allowed to wrap rather than truncate. This build turns
   the list horizontal at 1000px, so the override rides the same breakpoint and leaves the
   stacked narrow layout untouched. */
@media (min-width: 1000px) {
  .reseller-access .dl-horizontal > dt {
    width: 220px;
    white-space: normal;
    text-overflow: clip;
  }

  .reseller-access .dl-horizontal > dd {
    margin-left: 240px;
  }
}

.reseller-access .rap-decision-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}

.reseller-access .rap-decision-bar-hint {
  flex: 1 1 260px;
  margin: 0;
  color: #5d6d7e;
}

.reseller-access .rap-duration-preview {
  margin-top: 6px;
}

/* Profile: requests that wait, what the reseller can do now, Activity */
.reseller-access .rap-limits-hint {
  margin: -6px 0 14px;
  font-size: 13px;
}

.reseller-access .rap-section {
  margin-bottom: 26px;
}

.reseller-access .rap-section-title {
  margin: 0 0 10px;
}

.reseller-access .rap-count {
  display: inline-block;
  padding: 0 8px;
  margin-left: 6px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 20px;
  vertical-align: 3px;
  background-color: #e3f2fd;
  color: #0d47a1;
}

.reseller-access .rap-empty-line {
  color: #5d6d7e;
  margin: 4px 0 12px;
}

.reseller-access .rap-list,
.reseller-access .rap-activity {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  background-color: #ffffff;
}

.reseller-access .rap-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid #eef2f6;
}

.reseller-access .rap-row:first-child {
  border-top: 0;
}

.reseller-access .rap-row-main {
  flex: 1 1 auto;
  min-width: 0;
}

.reseller-access .rap-row-title {
  font-weight: 600;
}

.reseller-access .rap-row-title .rap-badge {
  margin-right: 4px;
}

.reseller-access .rap-row-meta {
  font-size: 13px;
  color: #5d6d7e;
}

.reseller-access .rap-row-reason {
  display: inline-block;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.reseller-access .rap-row-actions {
  flex: 0 0 auto;
}

/* Native <details> toggles, with the browser marker swapped for the Font Awesome angle the
   rest of the page uses. */
.reseller-access details > summary {
  cursor: pointer;
  list-style: none;
}

.reseller-access details > summary::-webkit-details-marker {
  display: none;
}

.reseller-access details.rap-row-more {
  display: inline-block;
  vertical-align: top;
}

.reseller-access details.rap-row-more > summary:before,
.reseller-access details.rap-basic > summary:before {
  display: inline-block;
  width: 12px;
  font-family: FontAwesome;
  content: "\f105";
  transition: transform 0.15s;
}

.reseller-access details.rap-row-more[open] > summary:before,
.reseller-access details.rap-basic[open] > summary:before {
  transform: rotate(90deg);
}

.reseller-access details.rap-row-more ul,
.reseller-access .rap-basic-list {
  padding-left: 18px;
  margin: 6px 0 0;
  font-weight: normal;
}

.reseller-access details.rap-basic {
  margin-top: 8px;
  padding: 10px 14px;
  border: 1px solid #e3e8ef;
  border-top-style: dashed;
  border-radius: 8px;
}

.reseller-access .rap-basic-summary {
  font-weight: 600;
}

.reseller-access .rap-when-closed,
.reseller-access .rap-when-open {
  margin-left: 8px;
  font-weight: normal;
  color: #2a6fb0;
}

.reseller-access .rap-when-open,
.reseller-access details[open] > summary .rap-when-closed {
  display: none;
}

.reseller-access details[open] > summary .rap-when-open {
  display: inline;
}

.reseller-access .rap-activity-item + .rap-activity-item {
  border-top: 1px solid #eef2f6;
}

.reseller-access .rap-activity-head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 9px 14px;
}

.reseller-access .rap-activity-date {
  flex: 0 0 150px;
  color: #5d6d7e;
  font-size: 13px;
}

.reseller-access .rap-activity-label {
  font-weight: 600;
}

.reseller-access .rap-activity-actor {
  color: #5d6d7e;
}

.reseller-access .rap-activity-caret {
  margin-left: auto;
  transition: transform 0.15s;
}

.reseller-access .rap-activity-details[open] .rap-activity-caret {
  transform: rotate(90deg);
}

.reseller-access .rap-activity-body {
  padding: 0 14px 10px 176px;
  font-size: 13px;
  word-break: break-word;
}

.reseller-access .rap-activity-body a {
  margin-left: 8px;
}

.reseller-access .rap-revoke-list li {
  padding: 4px 0;
}

.reseller-access .rap-revoke-list .label {
  margin-left: 6px;
  vertical-align: 1px;
}

.reseller-access .rap-revoke-lead {
  font-weight: 600;
}

/* Two columns from the house sm breakpoint, which starts at 1000px in this build, not 768. */
@media (min-width: 1000px) {
  .reseller-access .rap-basic-list,
  .reseller-access details.rap-row-more ul {
    columns: 2;
    column-gap: 32px;
  }
}

/* Night theme — matches the house selector strategy in dashboard-smartolt-night.css */
html.smartolt-night body.smartolt-site .reseller-access .rap-badge {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
}

html.smartolt-night body.smartolt-site .reseller-access .rap-badge-grant {
  background-color: rgba(59, 130, 246, 0.22);
  border-color: rgba(147, 197, 253, 0.4);
  color: #bfdbfe;
}

html.smartolt-night body.smartolt-site .reseller-access .rap-badge-self {
  background-color: rgba(139, 92, 246, 0.22);
  border-color: rgba(196, 181, 253, 0.4);
  color: #ddd6fe;
}

html.smartolt-night body.smartolt-site .reseller-access .rap-status-pending {
  background-color: rgba(234, 179, 8, 0.22);
  border-color: rgba(253, 224, 71, 0.4);
  color: #fde68a;
}

html.smartolt-night body.smartolt-site .reseller-access .rap-status-approved {
  background-color: rgba(34, 197, 94, 0.22);
  border-color: rgba(134, 239, 172, 0.4);
  color: #bbf7d0;
}

html.smartolt-night body.smartolt-site .reseller-access .rap-status-rejected,
html.smartolt-night body.smartolt-site .reseller-access .rap-status-revoked {
  background-color: rgba(239, 68, 68, 0.22);
  border-color: rgba(252, 165, 165, 0.4);
  color: #fecaca;
}

html.smartolt-night body.smartolt-site .reseller-access .rap-status-unknown {
  background-color: rgba(148, 163, 184, 0.2);
  border-color: rgba(203, 213, 225, 0.35);
  color: #e2e8f0;
}

html.smartolt-night body.smartolt-site .reseller-access .rap-list,
html.smartolt-night body.smartolt-site .reseller-access .rap-activity,
html.smartolt-night body.smartolt-site .reseller-access details.rap-basic {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
}

html.smartolt-night body.smartolt-site .reseller-access .rap-row,
html.smartolt-night body.smartolt-site .reseller-access .rap-activity-item + .rap-activity-item {
  border-top-color: rgba(255, 255, 255, 0.08);
}

html.smartolt-night body.smartolt-site .reseller-access .rap-row-meta,
html.smartolt-night body.smartolt-site .reseller-access .rap-activity-date,
html.smartolt-night body.smartolt-site .reseller-access .rap-activity-actor,
html.smartolt-night body.smartolt-site .reseller-access .rap-empty-line {
  color: #9fb0c4;
}

html.smartolt-night body.smartolt-site .reseller-access .rap-row-title,
html.smartolt-night body.smartolt-site .reseller-access .rap-activity-label,
html.smartolt-night body.smartolt-site .reseller-access .rap-basic-summary,
html.smartolt-night body.smartolt-site .reseller-access .rap-activity-body {
  color: #e2e8f0;
}

html.smartolt-night body.smartolt-site .reseller-access .rap-count {
  background-color: rgba(59, 130, 246, 0.22);
  color: #bfdbfe;
}

html.smartolt-night body.smartolt-site .reseller-access details > summary:before,
html.smartolt-night body.smartolt-site .reseller-access .rap-when-closed,
html.smartolt-night body.smartolt-site .reseller-access .rap-when-open,
html.smartolt-night body.smartolt-site .reseller-access .rap-activity-caret {
  color: #93c5fd;
}

/* background-color only: the shorthand kills the text caret in night mode */
html.smartolt-night body.smartolt-site .reseller-access .form-control,
html.smartolt-night body.smartolt-site .reseller-access select.form-control,
html.smartolt-night body.smartolt-site .reseller-access textarea.form-control {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  caret-color: #e2e8f0;
}

html.smartolt-night body.smartolt-site .reseller-access .form-control:focus {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(147, 197, 253, 0.5);
  color: #f1f5f9;
}

html.smartolt-night body.smartolt-site .reseller-access details.reseller-access-capability-category {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
}

html.smartolt-night body.smartolt-site .reseller-access details.reseller-access-capability-category[open] > summary {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

html.smartolt-night body.smartolt-site .reseller-access .rap-capability-group-name {
  color: #f1f5f9;
}

html.smartolt-night body.smartolt-site .reseller-access .rap-capability-group-count {
  color: #9fb0c4;
}

html.smartolt-night body.smartolt-site .reseller-access .rap-decision-bar-hint {
  color: #cbd5e1;
}

html.smartolt-night body.smartolt-site .reseller-access .rap-revoke-list .label-default {
  background-color: rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
}

@media (max-width: 767px) {
  .reseller-access .rap-decision-bar .btn {
    flex: 1 1 auto;
  }

  .reseller-access details.reseller-access-capability-category > .reseller-access-capability,
  .reseller-access details.reseller-access-capability-category > .reseller-access-capability-baseline {
    padding-left: 24px;
  }

  /* Beside the count, long group names broke over three lines at 375px. */
  .reseller-access details.reseller-access-capability-category > summary {
    flex-wrap: wrap;
    row-gap: 2px;
  }

  .reseller-access details.reseller-access-capability-category > summary > span {
    flex-basis: calc(100% - 22px);
  }

  .reseller-access .rap-capability-group-count {
    margin-left: 22px;
  }

  .reseller-access .rap-row {
    flex-wrap: wrap;
  }

  .reseller-access .rap-row-actions {
    flex-basis: 100%;
    text-align: left;
  }

  .reseller-access .rap-row-reason {
    max-width: 100%;
  }

  /* Each Activity entry becomes a two-line card: the date alone, then what happened. Label and
     actor flow as one line of text, because as flex items a long actor took a third line and
     pushed the caret onto a fourth. */
  .reseller-access .rap-activity-head {
    display: block;
    position: relative;
    padding-right: 32px;
  }

  .reseller-access .rap-activity-date {
    display: block;
  }

  .reseller-access .rap-activity-label {
    margin-right: 6px;
  }

  .reseller-access .rap-activity-caret {
    position: absolute;
    top: 50%;
    right: 14px;
    margin-top: -7px;
  }

  .reseller-access .rap-activity-body {
    padding: 0 14px 10px;
  }
}

.reseller-access h3[id^="rap-"] {
  scroll-margin-top: 80px;
}
