:root {
  --admin-navy: #082c50;
  --admin-blue: #075eae;
  --admin-blue-dark: #084c8d;
  --admin-border: #d8e1ea;
  --admin-muted: #4f6477;
  --admin-surface: #ffffff;
  --admin-page: #f4f7fa;
  --admin-radius: 10px;
  --admin-shadow: 0 4px 18px rgba(7, 40, 70, 0.08);
}

.portal-page {
  background: var(--admin-page);
}

.portal-main {
  min-height: 70vh;
  padding: 24px 18px 48px;
  background: linear-gradient(135deg, #f8fafc 0%, #edf3f8 100%);
}

.portal-shell {
  width: min(100%, 1180px);
  margin-inline: auto;
}

.portal-navigation-region {
  margin-bottom: 18px;
}

.portal-dashboard {
  display: grid;
  gap: 20px;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 6px 0 4px;
}

.dashboard-shield {
  display: grid;
  flex: 0 0 78px;
  place-items: center;
  width: 78px;
  height: 78px;
  color: #ffffff;
  background: linear-gradient(135deg, #0b69bc, #06437f);
  border-radius: 50%;
}

.dashboard-shield svg {
  width: 52px;
  height: 52px;
  fill: currentColor;
}

.dashboard-shield svg path:last-child {
  fill: var(--admin-blue);
}

.dashboard-eyebrow {
  margin: 0 0 3px;
  color: var(--admin-blue);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-hero h1 {
  margin: 0 0 4px;
  color: var(--admin-navy);
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  line-height: 1.08;
}

.dashboard-hero p:last-child {
  margin: 0;
  color: var(--admin-muted);
}

.dashboard-panel {
  overflow: hidden;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
}

.dashboard-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 18px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--admin-border);
}

.dashboard-panel-heading h2 {
  margin: 0;
  color: var(--admin-navy);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-panel-heading a {
  color: var(--admin-blue);
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-heading-button {
  border: 1px solid #0a5bb5;
  border-radius: 0.45rem;
  background: #ffffff;
  color: #0754a3;
  padding: 0.5rem 0.8rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-heading-button:hover,
.dashboard-heading-button:focus-visible {
  background: #eef6ff;
}

.quick-actions-editor {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #d7e1ec;
  border-radius: 0.65rem;
  background: #f8fbff;
}

.quick-actions-editor > p:first-child {
  margin: 0 0 0.85rem;
  color: #334a62;
}

.quick-actions-choices {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quick-actions-choices li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #d7e1ec;
  border-radius: 0.45rem;
  background: #ffffff;
}

.quick-actions-choices label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  cursor: pointer;
}

.quick-actions-choices input {
  width: 1.2rem;
  height: 1.2rem;
}

.quick-action-order-buttons {
  display: flex;
  gap: 0.35rem;
}

.quick-action-order-buttons button {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid #b8c9db;
  border-radius: 0.4rem;
  background: #ffffff;
  color: #083b66;
  font-size: 1.15rem;
  cursor: pointer;
}

.quick-action-order-buttons button:disabled {
  opacity: 0.35;
  cursor: default;
}

.quick-actions-editor-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1rem;
}

.quick-actions-editor-buttons button {
  min-height: 2.7rem;
  border: 1px solid #0a5bb5;
  border-radius: 0.45rem;
  background: #ffffff;
  color: #0754a3;
  padding: 0.55rem 0.85rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.quick-actions-editor-buttons .primary {
  background: #075bb5;
  color: #ffffff;
}

.quick-actions-message {
  margin: 0.75rem 0 0;
  color: #a22121;
  font-weight: 700;
}

.dashboard-icon {
  display: grid;
  place-items: center;
}

.dashboard-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attention-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 18px 16px 20px;
}

.attention-item {
  display: grid;
  justify-items: center;
  align-content: start;
  min-width: 0;
  padding: 0 14px;
  text-align: center;
  border-right: 1px solid var(--admin-border);
}

.attention-item:last-child {
  border-right: 0;
}

.attention-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 7px;
  border-radius: 50%;
}

.attention-count {
  margin-bottom: 4px;
  font-size: 1.9rem;
  line-height: 1;
}

.attention-item h3 {
  min-height: 38px;
  margin: 0 0 8px;
  color: #172334;
  font-size: 0.76rem;
  line-height: 1.3;
}

.attention-item a {
  color: var(--admin-blue);
  font-size: 0.72rem;
  font-weight: 800;
}

.attention-blue .attention-icon { color: #075eae; background: #e4f0fb; }
.attention-orange .attention-icon { color: #ee6400; background: #fff0e2; }
.attention-green .attention-icon { color: #14863b; background: #e2f4e8; }
.attention-purple .attention-icon { color: #7744a5; background: #f0e8f8; }
.attention-red .attention-icon { color: #d5222a; background: #fde8e9; }
.attention-blue .attention-count { color: #075eae; }
.attention-orange .attention-count { color: #ee6400; }
.attention-green .attention-count { color: #14863b; }
.attention-purple .attention-count { color: #7744a5; }
.attention-red .attention-count { color: #d5222a; }

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.quick-action {
  display: grid;
  grid-template-rows: 48px minmax(44px, auto) 36px;
  justify-items: center;
  align-items: center;
  min-width: 0;
  padding: 15px 14px 13px;
  color: var(--admin-navy);
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  text-align: center;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.quick-action:hover,
.quick-action:focus-visible {
  border-color: var(--admin-blue);
  box-shadow: 0 6px 16px rgba(7, 94, 174, 0.13);
  transform: translateY(-2px);
}

.quick-action-icon {
  color: var(--admin-blue);
}

.quick-action-icon svg {
  width: 38px;
  height: 38px;
}

.quick-action strong {
  font-size: 0.88rem;
  line-height: 1.25;
}

.quick-action-button {
  display: grid;
  place-items: center;
  width: 100%;
  height: 32px;
  color: #ffffff;
  background: linear-gradient(90deg, var(--admin-blue-dark), var(--admin-blue));
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 800;
}

.activity-head,
.activity-row {
  display: grid;
  grid-template-columns: 28px minmax(230px, 2.3fr) minmax(130px, 1fr) minmax(100px, 0.8fr) minmax(170px, 1.2fr);
  align-items: center;
  gap: 10px;
}

.activity-head {
  grid-template-columns: minmax(268px, 2.3fr) minmax(130px, 1fr) minmax(100px, 0.8fr) minmax(170px, 1.2fr);
  padding: 9px 16px 7px 54px;
  color: #43596e;
  background: #f4f7fa;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.activity-list {
  margin: 0;
  padding: 0 16px;
}

.activity-row {
  min-height: 48px;
  padding: 8px 0;
  border-bottom: 1px solid var(--admin-border);
  font-size: 0.74rem;
}

.activity-row:last-child {
  border-bottom: 0;
}

.activity-icon {
  width: 24px;
  height: 24px;
}

.activity-icon svg {
  width: 22px;
  height: 22px;
}

.activity-description {
  color: #172334;
}

.activity-type {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.65rem;
  white-space: nowrap;
}

.activity-blue { color: #075eae; background: #e4f0fb; }
.activity-green { color: #14863b; background: #e2f4e8; }
.activity-orange { color: #d65a00; background: #fff0e2; }
.activity-purple { color: #7744a5; background: #f0e8f8; }

.activity-row time {
  color: #263d52;
  white-space: nowrap;
}

.activity-view-all {
  display: block;
  margin: 14px 16px 16px;
  padding: 9px 14px;
  color: var(--admin-blue);
  border: 1px solid var(--admin-blue);
  border-radius: 5px;
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
}

.dashboard-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  color: var(--admin-muted);
  text-align: center;
}

.portal-account {
  margin-top: 20px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
}

.portal-account summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  padding: 16px 18px;
  color: var(--admin-navy);
  background: #ffffff;
  border-bottom: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.portal-account summary::-webkit-details-marker {
  display: none;
}

.portal-account summary::after {
  content: "+";
  display: grid;
  flex: 0 0 26px;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--admin-blue);
  background: #e8f2fb;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
}

.portal-account details[open] summary {
  border-bottom-color: var(--admin-border);
}

.portal-account details[open] summary::after {
  content: "\2212";
}

.portal-account .portal-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 18px;
}

.portal-account .portal-detail {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 14px 16px;
  color: #243b50;
  background: #f7fafc;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.portal-account .portal-detail strong {
  color: #536a7f;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.portal-account .auth-message {
  margin: 0 18px;
}

.portal-signout {
  min-height: 42px;
  margin: 0 18px 18px;
  padding: 9px 18px;
  color: #ffffff;
  background: var(--admin-blue);
  border: 0;
  border-radius: 6px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .attention-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 0;
  }

  .attention-item:nth-child(3) {
    border-right: 0;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-head {
    display: none;
  }

  .activity-row {
    grid-template-columns: 26px minmax(0, 1fr) auto;
  }

  .activity-type,
  .activity-user {
    display: none;
  }

  .portal-account .portal-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .portal-main {
    padding: 14px 12px 32px;
  }

  .dashboard-hero {
    align-items: flex-start;
    gap: 13px;
    padding: 6px 2px;
  }

  .dashboard-shield {
    flex-basis: 58px;
    width: 58px;
    height: 58px;
  }

  .dashboard-shield svg {
    width: 40px;
    height: 40px;
  }

  .dashboard-eyebrow {
    display: none;
  }

  .dashboard-hero h1 {
    font-size: 1.35rem;
  }

  .dashboard-hero p:last-child {
    font-size: 0.83rem;
    line-height: 1.35;
  }

  .dashboard-panel-heading {
    min-height: 52px;
    padding: 12px 14px;
  }

  .dashboard-panel-heading h2 {
    font-size: 0.82rem;
  }

  .dashboard-heading-button {
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
  }

  .quick-actions-editor {
    margin: 0.75rem;
    padding: 0.75rem;
  }

  .quick-actions-choices li {
    padding: 0.5rem;
  }

  .quick-actions-editor-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }

  .attention-grid {
    display: block;
    padding: 4px 12px 8px;
  }

  .attention-item {
    grid-template-columns: 32px minmax(0, 1fr) auto 12px;
    align-items: center;
    justify-items: start;
    min-height: 48px;
    padding: 7px 2px;
    border-right: 0;
    border-bottom: 1px solid var(--admin-border);
    text-align: left;
  }

  .attention-item:last-child {
    border-bottom: 0;
  }

  .attention-icon {
    width: 27px;
    height: 27px;
    margin: 0;
  }

  .attention-icon svg {
    width: 17px;
    height: 17px;
  }

  .attention-item h3 {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
    margin: 0;
    font-size: 0.69rem;
  }

  .attention-count {
    grid-column: 3;
    grid-row: 1;
    margin: 0;
    font-size: 0.8rem;
  }

  .attention-item a {
    grid-column: 4;
    grid-row: 1;
    width: 12px;
    overflow: hidden;
    color: transparent;
    font-size: 0;
  }

  .attention-item a::after {
    content: "›";
    color: var(--admin-blue);
    font-size: 1.1rem;
  }

  .quick-actions-grid {
    gap: 8px;
    padding: 10px;
  }

  .quick-action {
    grid-template-rows: 42px minmax(38px, auto);
    padding: 10px 7px;
  }

  .quick-action-icon svg {
    width: 31px;
    height: 31px;
  }

  .quick-action strong {
    font-size: 0.7rem;
  }

  .quick-action-button {
    display: none;
  }

  .activity-list {
    padding: 0 12px;
  }

  .activity-row {
    grid-template-columns: 25px minmax(0, 1fr) 58px;
    min-height: 54px;
    gap: 8px;
    font-size: 0.66rem;
  }

  .activity-row time {
    font-size: 0.59rem;
    text-align: right;
    white-space: normal;
  }

  .activity-view-all {
    margin: 12px;
  }

  .portal-account .portal-details {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 12px;
  }

  .portal-account summary {
    padding: 14px 16px;
  }

  .portal-account .portal-detail {
    padding: 12px 14px;
  }
}
