.dashboard-header {
  min-height: 94px;
  padding: 16px clamp(18px, 3.5vw, 54px);
  background:
    radial-gradient(circle at 12% 0%, rgba(215, 154, 59, .12), transparent 24rem),
    linear-gradient(100deg, rgba(42, 16, 55, .98), rgba(24, 12, 31, .98));
}

.dashboard-branding {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.dashboard-branding .brand-logo {
  width: 148px;
  margin: 0;
}

.dashboard-title-copy {
  min-width: 0;
}

.dashboard-title-copy .eyebrow {
  margin-bottom: 5px;
  color: rgba(240, 187, 103, .84);
}

.dashboard-header h1 {
  font-size: clamp(1.85rem, 3vw, 2.65rem);
  line-height: .98;
}

.dashboard-subtitle {
  margin: 7px 0 0;
  color: rgba(247, 234, 217, .64);
  font: 500 .82rem/1.4 ui-sans-serif, system-ui, sans-serif;
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-actions .button {
  min-height: 40px;
  padding-inline: 15px;
}

.dashboard-content {
  width: min(100%, 1640px);
  padding-top: 24px;
}

.summary-grid {
  gap: 12px;
  margin-bottom: 18px;
}

.summary-grid article {
  position: relative;
  min-height: 102px;
  overflow: hidden;
  padding: 18px 20px;
  border-color: rgba(215, 154, 59, .24);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(34, 25, 21, .96), rgba(19, 15, 13, .98));
  box-shadow: 0 12px 34px rgba(0, 0, 0, .18);
}

.summary-grid article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: rgba(240, 187, 103, .72);
}

.summary-grid article[data-summary-kind="progress"]::before { background: rgba(137, 132, 230, .82); }
.summary-grid article[data-summary-kind="completed"]::before { background: rgba(100, 201, 139, .82); }
.summary-grid article[data-summary-kind="revenue"]::before { background: rgba(89, 174, 218, .82); }

.summary-grid span {
  color: rgba(247, 234, 217, .58);
  font-size: .78rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.summary-grid strong {
  margin-top: 10px;
  font-size: 1.8rem;
}

body .capacity-panel {
  margin-bottom: 18px;
  border-color: rgba(215, 154, 59, .24);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(31, 23, 20, .96), rgba(18, 14, 12, .98));
  box-shadow: 0 14px 36px rgba(0, 0, 0, .16);
}

body .capacity-heading {
  padding: 18px 20px;
}

body .capacity-heading h2 {
  font-size: 1.25rem;
}

body .capacity-grid article {
  min-height: 86px;
  padding: 15px 18px;
}

body .capacity-grid strong {
  font-size: 1.45rem;
}

.dashboard-content > .customer-access-panel {
  margin-bottom: 18px;
  border-color: rgba(89, 174, 218, .26);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(24, 26, 31, .94), rgba(17, 15, 16, .98));
  box-shadow: 0 14px 36px rgba(0, 0, 0, .16);
}

.orders-panel {
  border-color: rgba(215, 154, 59, .24);
  border-radius: 18px;
  background: rgba(17, 13, 12, .98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .22);
}

.orders-workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(215, 154, 59, .18);
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent);
}

.orders-workspace-heading .eyebrow {
  margin-bottom: 5px;
}

.orders-workspace-heading h2 {
  margin: 0;
  font-size: 1.45rem;
}

.orders-workspace-heading p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  font: 500 .82rem/1.45 ui-sans-serif, system-ui, sans-serif;
}

.orders-sort-summary {
  flex: 0 0 auto;
  border: 1px solid rgba(89, 174, 218, .32);
  border-radius: 999px;
  padding: 7px 11px;
  color: #b9ddf1;
  background: rgba(63, 137, 176, .1);
  font: 800 .76rem/1.2 ui-sans-serif, system-ui, sans-serif;
  white-space: nowrap;
}

.filters {
  grid-template-columns: minmax(260px, 1.6fr) minmax(145px, .65fr) minmax(170px, .8fr) minmax(155px, .7fr) auto auto;
  gap: 10px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, .012);
}

.filters label > span {
  font-size: .76rem;
}

.filters input,
.filters select {
  min-height: 44px;
  border-color: rgba(215, 154, 59, .3);
  background: rgba(9, 7, 6, .72);
}

.orders-status {
  min-height: 34px;
  padding: 9px 18px 7px;
  border-bottom: 1px solid rgba(215, 154, 59, .12);
}

.orders-status.is-success { color: var(--success); }

.table-scroll {
  max-height: min(66vh, 780px);
  overflow: auto;
  scrollbar-width: thin;
}

table {
  min-width: 1120px;
  table-layout: fixed;
}

thead {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #17110f;
  box-shadow: 0 1px 0 rgba(215, 154, 59, .22);
}

th {
  padding: 0;
  color: rgba(247, 234, 217, .56);
  background: #17110f;
}

th:nth-child(1) { width: 170px; }
th:nth-child(2) { width: 210px; }
th:nth-child(3) { width: 150px; }
th:nth-child(4) { width: 90px; }
th:nth-child(5) { width: 120px; }
th:nth-child(6) { width: 100px; }
th:nth-child(7) { width: 150px; }
th:nth-child(8) { width: 100px; padding: 0 14px; }

.table-sort-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  border: 0;
  padding: 11px 14px;
  color: inherit;
  background: transparent;
  font: 800 .72rem/1.2 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .075em;
  text-align: left;
  text-transform: uppercase;
}

.table-sort-button:hover {
  color: var(--ink);
  background: rgba(215, 154, 59, .055);
}

.table-sort-button.is-active {
  color: var(--gold-light);
  background: rgba(215, 154, 59, .07);
}

.table-sort-indicator {
  color: rgba(247, 234, 217, .42);
  font-size: .9rem;
  letter-spacing: 0;
}

.table-sort-button.is-active .table-sort-indicator { color: var(--gold-light); }

td {
  padding: 14px;
  border-top-color: rgba(215, 154, 59, .11);
  font-size: .84rem;
}

tbody tr {
  background: rgba(255, 255, 255, .006);
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, .014);
}

tbody tr:hover {
  background: rgba(215, 154, 59, .06);
}

.order-link {
  color: #f2bd70;
  text-decoration: none;
}

.order-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.cell-primary {
  overflow-wrap: anywhere;
  font-size: .86rem;
}

.cell-secondary {
  overflow-wrap: anywhere;
  color: rgba(247, 234, 217, .48);
  font-size: .75rem;
}

.stage-tags {
  gap: 5px;
}

.status-pill {
  min-height: 26px;
  padding: 4px 9px;
  font-size: .7rem;
}

.order-action-icons {
  justify-content: flex-start;
}

.pagination {
  padding: 13px 18px;
  background: rgba(255, 255, 255, .014);
}

.order-dialog {
  width: min(1240px, calc(100% - 40px));
  border-color: rgba(215, 154, 59, .34);
  border-radius: 20px;
  background: #100d0c;
  box-shadow: 0 48px 140px rgba(0, 0, 0, .76);
}

.dialog-header {
  padding: 17px 22px;
  background: rgba(24, 17, 15, .985);
}

.dialog-header h2 {
  font-size: 1.6rem;
}

.detail-layout {
  grid-template-columns: minmax(0, 1fr) 330px;
}

.detail-main,
.detail-sidebar {
  padding: 22px;
}

.detail-sidebar {
  background: rgba(255, 255, 255, .012);
}

.detail-heading {
  padding-bottom: 18px;
}

.detail-grid {
  margin: 18px 0;
  border-color: rgba(215, 154, 59, .2);
}

.reading-details > div {
  padding: 16px;
  border-color: rgba(215, 154, 59, .16);
  background: rgba(255, 255, 255, .012);
}

.status-editor,
.email-editor,
.follow-up-editor,
.refund-editor {
  padding: 14px;
  border: 1px solid rgba(215, 154, 59, .15);
  border-radius: 14px;
  background: rgba(255, 255, 255, .014);
}

.status-editor + .email-editor,
.email-editor + .follow-up-editor,
.follow-up-editor + .refund-editor,
.email-editor + .refund-editor {
  margin-top: 12px;
}

.activity {
  margin-top: 18px;
  padding-top: 18px;
}

@media (max-width: 1180px) {
  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .search-field {
    grid-column: span 2;
  }

  .filters .button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .dashboard-header {
    gap: 14px;
    padding: 14px 12px 16px;
  }

  .dashboard-branding {
    align-items: flex-start;
    gap: 12px;
  }

  .dashboard-branding .brand-logo {
    width: 112px;
  }

  .dashboard-title-copy .eyebrow {
    margin-top: 2px;
  }

  .dashboard-subtitle {
    max-width: 34ch;
  }

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

  .summary-grid article {
    min-height: 88px;
    padding: 14px 15px;
  }

  .summary-grid strong {
    font-size: 1.45rem;
  }

  .orders-workspace-heading {
    align-items: flex-start;
    flex-direction: column;
    padding: 17px 16px 14px;
  }

  .orders-sort-summary {
    white-space: normal;
  }

  .filters {
    grid-template-columns: 1fr;
    padding: 13px;
  }

  .search-field {
    grid-column: auto;
  }

  .sort-field {
    display: grid;
  }

  .table-scroll {
    max-height: none;
    overflow: visible;
  }

  table {
    min-width: 0;
    table-layout: auto;
  }

  thead {
    display: none;
  }

  tbody tr {
    padding: 13px;
    border-color: rgba(215, 154, 59, .18);
    background: rgba(255, 255, 255, .012);
  }

  td {
    grid-template-columns: minmax(82px, 96px) minmax(0, 1fr);
    gap: 8px;
    padding: 7px 0;
  }

  td::before {
    font-size: .69rem;
  }

  .order-action-icons {
    justify-content: flex-start;
  }

  .order-dialog {
    width: 100%;
    border-radius: 0;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 761px) {
  .dashboard-content {
    width: min(100%, 1760px);
    padding-inline: clamp(12px, 2vw, 28px);
  }

  .table-scroll {
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }
}

.reading-delivery-card{
  display:grid;
  gap:10px;
  padding:14px;
  border:1px solid rgba(215,154,59,.28);
  border-radius:14px;
  background:rgba(215,154,59,.055);
}
.reading-delivery-card .form-status{min-height:0;margin:0}
.reading-delivery-card .button{width:100%}

/* Engagement is independent of confirmed provider delivery. */
.email-engagement { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.email-engagement-badge { border: 1px solid rgba(247, 234, 217, .18); border-radius: 999px; padding: 5px 9px; color: var(--muted); font: 700 .74rem/1.4 ui-sans-serif, system-ui, sans-serif; }
.email-engagement-badge.is-recorded { border-color: rgba(133, 214, 163, .43); color: var(--success); background: rgba(133, 214, 163, .055); }
.email-tracking-note { margin: 12px 0; color: var(--muted); font: 500 .76rem/1.5 ui-sans-serif, system-ui, sans-serif; }
.email-history-link { display: inline-flex; margin: 4px 0 12px; color: var(--gold-light); font: 750 .82rem/1.4 ui-sans-serif, system-ui, sans-serif; text-decoration: none; }
.email-history-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* A paid order deliberately cancelled before late payment needs a human decision. */
.payment-reconciliation-pill { border-color: rgba(255, 190, 100, .75); color: #ffe1a4; background: rgba(191, 113, 26, .18); }
.payment-reconciliation-warning { margin: 15px 0; padding: 17px; border: 1px solid rgba(255,190,100,.65); border-radius: 14px; background: rgba(167,100,17,.15); }
.payment-reconciliation-warning > strong { color: #ffe1a4; font: 800 1rem/1.35 ui-sans-serif,system-ui,sans-serif; }
.payment-reconciliation-warning p { color: var(--ink); font: 500 .88rem/1.55 ui-sans-serif,system-ui,sans-serif; }
.payment-reconciliation-warning .button { margin: 8px 0; }

.payment-reconciliation-banner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; margin: 0 0 18px; padding: 16px 20px; border: 1px solid rgba(255,190,100,.65); border-radius: 17px; background: rgba(167,100,17,.18); }
.payment-reconciliation-banner strong { color: #ffe1a4; font: 800 1rem/1.3 ui-sans-serif,system-ui,sans-serif; }
.payment-reconciliation-banner p { margin: 6px 0 0; color: var(--ink); font: 500 .85rem/1.45 ui-sans-serif,system-ui,sans-serif; }

/* A hidden review banner must not be forced visible by its flex layout. */
.payment-reconciliation-banner[hidden], .payment-reconciliation-warning[hidden] { display: none; }

.multi-question-order-item { border: 1px solid rgba(215,154,59,.24); border-radius: 12px; padding: 12px; margin: 12px 0; }
.multi-question-order-item p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 7px 0; }
.multi-question-order-item small { color: var(--muted); display: block; margin-top: 8px; }
