/* =========================================================
   A2TDEV focused repair: Project Requests page tight rail
   Purpose: undo the loose full-viewport regression while keeping
   services-family width consistency and mobile request cards intact.
   ========================================================= */
:root {
  --a2t-requests-rail: 1240px;
  --a2t-requests-gutter: 32px;
}

/* Keep this page inside the same centered rail as Services. */
body:has(.a2t-requests-page) .x-content {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: clip !important;
}

.a2t-page-shell.a2t-client-portal-shell.a2t-requests-page,
.a2t-requests-page {
  width: min(var(--a2t-requests-rail), calc(100vw - (var(--a2t-requests-gutter) * 2))) !important;
  max-width: var(--a2t-requests-rail) !important;
  margin-inline: auto !important;
  padding: 54px 0 84px !important;
  overflow: visible !important;
  background: transparent !important;
  box-sizing: border-box !important;
}

.a2t-requests-page .a2t-client-portal-layout,
.a2t-requests-page .a2t-requests-layout,
.a2t-client-portal-shell.a2t-requests-page .a2t-client-portal-layout {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
  align-items: start !important;
}

.a2t-requests-page .a2t-client-dashboard-main,
.a2t-requests-page .a2t-requests-main {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* The requests index should not show an inner breadcrumb chain. */
.a2t-requests-page .a2t-dashboard-breadcrumb {
  display: none !important;
}

/* Compact, contained hero instead of a full-width loose banner. */
.a2t-requests-page .a2t-requests-brief {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 24px !important;
  padding: clamp(24px, 3vw, 34px) !important;
  border: 1px solid rgba(224, 231, 241, .95) !important;
  border-radius: 30px !important;
  background:
    radial-gradient(circle at 92% 16%, rgba(53, 103, 255, .12), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 100%) !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .06) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 20px !important;
  align-items: start !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.a2t-requests-page .a2t-requests-brief h1 {
  max-width: 720px !important;
  margin: 10px 0 10px !important;
  font-size: clamp(40px, 4.4vw, 64px) !important;
  line-height: .95 !important;
  letter-spacing: -.075em !important;
  font-weight: 950 !important;
}

.a2t-requests-page .a2t-requests-brief p {
  max-width: 650px !important;
  margin: 0 !important;
  color: var(--a2t-muted, #53647d) !important;
  font-size: 16px !important;
  line-height: 1.55 !important;
  font-weight: 650 !important;
}

.a2t-requests-page .a2t-requests-brief-actions {
  align-self: start !important;
  display: inline-flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: max-content !important;
}

.a2t-requests-page .a2t-requests-notification,
.a2t-requests-page .a2t-requests-start {
  min-height: 48px !important;
  border-radius: 18px !important;
  font-size: 14px !important;
  font-weight: 950 !important;
}

.a2t-requests-page .a2t-requests-start {
  padding-inline: 22px !important;
  background: #07111f !important;
  color: #fff !important;
}

.a2t-requests-page .a2t-requests-brief-strip {
  grid-column: 1 / -1 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  padding-top: 6px !important;
}

.a2t-requests-page .a2t-requests-brief-strip span {
  min-height: 36px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .82) !important;
  border: 1px solid #dde7f5 !important;
}

/* Tight dashboard metrics — not huge page-spanning boxes. */
.a2t-requests-page .a2t-dashboard-stats {
  width: 100% !important;
  margin: 0 0 24px !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px !important;
  align-items: stretch !important;
}

.a2t-requests-page .a2t-stat-card {
  min-height: 164px !important;
  padding: 22px !important;
  border-radius: 24px !important;
  border: 1px solid #e4eaf3 !important;
  background: #fff !important;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .045) !important;
}

.a2t-requests-page .a2t-stat-card strong {
  font-size: clamp(32px, 3.2vw, 44px) !important;
  line-height: 1 !important;
  letter-spacing: -.05em !important;
}

.a2t-requests-page .a2t-stat-icon {
  width: 52px !important;
  height: 52px !important;
  border-radius: 16px !important;
}

/* Projects section should look like a contained workspace card. */
.a2t-requests-page .a2t-section-block#projects,
.a2t-requests-page #projects.a2t-section-block {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: clamp(24px, 3vw, 34px) !important;
  border: 1px solid #e4eaf3 !important;
  border-radius: 28px !important;
  background: #fff !important;
  box-shadow: 0 22px 62px rgba(15, 23, 42, .045) !important;
  overflow: visible !important;
}

.a2t-requests-page .a2t-dashboard-hero.compact {
  display: flex !important;
  justify-content: space-between !important;
  gap: 16px !important;
  margin: 0 0 20px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.a2t-requests-page .a2t-section-heading {
  margin: 0 0 8px !important;
  font-size: clamp(32px, 3.8vw, 52px) !important;
  line-height: 1 !important;
  letter-spacing: -.07em !important;
}

.a2t-requests-page .a2t-project-toolbar {
  display: grid !important;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr) !important;
  gap: 14px !important;
  align-items: start !important;
  margin-bottom: 20px !important;
}

.a2t-requests-page .a2t-project-search {
  min-height: 56px !important;
  border-radius: 18px !important;
}

.a2t-requests-page .a2t-project-filters {
  display: flex !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}

.a2t-requests-page .a2t-project-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow: visible !important;
}

.a2t-requests-page .a2t-project-table {
  width: 100% !important;
  table-layout: fixed !important;
}

.a2t-requests-page .a2t-project-table th,
.a2t-requests-page .a2t-project-table td {
  overflow-wrap: anywhere !important;
}

.a2t-requests-page .a2t-project-table th:nth-child(1),
.a2t-requests-page .a2t-project-table td:nth-child(1) { width: 30% !important; }
.a2t-requests-page .a2t-project-table th:nth-child(2),
.a2t-requests-page .a2t-project-table td:nth-child(2) { width: 18% !important; }
.a2t-requests-page .a2t-project-table th:nth-child(3),
.a2t-requests-page .a2t-project-table td:nth-child(3) { width: 20% !important; }
.a2t-requests-page .a2t-project-table th:nth-child(4),
.a2t-requests-page .a2t-project-table td:nth-child(4) { width: 12% !important; }
.a2t-requests-page .a2t-project-table th:nth-child(5),
.a2t-requests-page .a2t-project-table td:nth-child(5) { width: 10% !important; }
.a2t-requests-page .a2t-project-table th:nth-child(6),
.a2t-requests-page .a2t-project-table td:nth-child(6) { width: 10% !important; }

/* Dark mode parity */
html[data-theme='dark'] .a2t-requests-page,
body.dark-mode .a2t-requests-page,
body.dark .a2t-requests-page {
  color: #f8fafc !important;
}

html[data-theme='dark'] .a2t-requests-page .a2t-requests-brief,
body.dark-mode .a2t-requests-page .a2t-requests-brief,
body.dark .a2t-requests-page .a2t-requests-brief,
html[data-theme='dark'] .a2t-requests-page .a2t-stat-card,
body.dark-mode .a2t-requests-page .a2t-stat-card,
body.dark .a2t-requests-page .a2t-stat-card,
html[data-theme='dark'] .a2t-requests-page .a2t-section-block#projects,
body.dark-mode .a2t-requests-page .a2t-section-block#projects,
body.dark .a2t-requests-page .a2t-section-block#projects {
  background: #0b1220 !important;
  border-color: rgba(148, 163, 184, .2) !important;
  box-shadow: none !important;
}

html[data-theme='dark'] .a2t-requests-page .a2t-requests-brief p,
body.dark-mode .a2t-requests-page .a2t-requests-brief p,
body.dark .a2t-requests-page .a2t-requests-brief p,
html[data-theme='dark'] .a2t-requests-page .a2t-muted,
body.dark-mode .a2t-requests-page .a2t-muted,
body.dark .a2t-requests-page .a2t-muted {
  color: #a6b1c2 !important;
}

html[data-theme='dark'] .a2t-requests-page .a2t-requests-brief-strip span,
body.dark-mode .a2t-requests-page .a2t-requests-brief-strip span,
body.dark .a2t-requests-page .a2t-requests-brief-strip span {
  background: rgba(15, 23, 42, .8) !important;
  border-color: rgba(148, 163, 184, .2) !important;
  color: #cbd5e1 !important;
}

@media (max-width: 1180px) {
  .a2t-requests-page .a2t-dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .a2t-requests-page .a2t-project-toolbar {
    grid-template-columns: 1fr !important;
  }
  .a2t-requests-page .a2t-project-filters {
    justify-content: flex-start !important;
  }
}

@media (max-width: 760px) {
  :root {
    --a2t-requests-gutter: 16px;
  }

  .a2t-page-shell.a2t-client-portal-shell.a2t-requests-page,
  .a2t-requests-page {
    width: min(100%, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    padding: 22px 0 56px !important;
    margin-inline: auto !important;
    overflow: visible !important;
  }

  .a2t-requests-page .a2t-requests-brief {
    padding: 18px !important;
    border-radius: 24px !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
  }

  .a2t-requests-page .a2t-requests-brief h1 {
    font-size: clamp(34px, 11vw, 44px) !important;
    letter-spacing: -.07em !important;
  }

  .a2t-requests-page .a2t-requests-brief p {
    font-size: 14px !important;
  }

  .a2t-requests-page .a2t-requests-brief-actions {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .a2t-requests-page .a2t-requests-notification,
  .a2t-requests-page .a2t-requests-start {
    width: 100% !important;
    min-width: 0 !important;
    justify-content: center !important;
  }

  .a2t-requests-page .a2t-requests-brief-strip {
    gap: 8px !important;
  }

  .a2t-requests-page .a2t-dashboard-stats {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  .a2t-requests-page .a2t-stat-card {
    min-height: 124px !important;
    padding: 14px !important;
    border-radius: 20px !important;
  }

  .a2t-requests-page .a2t-stat-icon {
    width: 44px !important;
    height: 44px !important;
    border-radius: 14px !important;
  }

  .a2t-requests-page .a2t-stat-card strong {
    font-size: 30px !important;
  }

  .a2t-requests-page .a2t-section-block#projects,
  .a2t-requests-page #projects.a2t-section-block {
    padding: 16px !important;
    border-radius: 24px !important;
  }

  .a2t-requests-page .a2t-section-heading {
    font-size: clamp(28px, 9vw, 38px) !important;
  }

  .a2t-requests-page .a2t-project-toolbar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .a2t-requests-page .a2t-project-filters {
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    padding-bottom: 4px !important;
  }

  .a2t-requests-page .a2t-project-filters button {
    flex: 0 0 auto !important;
  }

  .a2t-requests-page .a2t-project-table-wrap {
    display: none !important;
  }

  .a2t-requests-page .a2t-project-mobile-cards {
    display: grid !important;
    gap: 12px !important;
  }
}

@media (max-width: 390px) {
  .a2t-page-shell.a2t-client-portal-shell.a2t-requests-page,
  .a2t-requests-page {
    width: min(100%, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
  }
  .a2t-requests-page .a2t-dashboard-stats {
    grid-template-columns: 1fr !important;
  }
}
