/* Pyrk admin wide-page patch
   Makes Routes, Attendance and Dashboard use the same enterprise width as Members/Photos. */

.admin-wide-page {
  width: 100%;
  max-width: min(1680px, calc(100vw - 40px));
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(18px, 2vw, 34px);
  padding-right: clamp(18px, 2vw, 34px);
}

.admin-wide-page .page-hero,
.admin-wide-page .panel,
.admin-wide-page .stat,
.admin-wide-page .card {
  border-radius: 28px;
}

.admin-wide-page .section-head {
  align-items: flex-start;
}

/* Dashboard */
.dashboard-admin-page .dashboard-hero {
  min-height: 190px;
}

.dashboard-admin-page .compact-stats,
.dashboard-admin-page .grid.four {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
}

.dashboard-admin-page .admin-dashboard-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(380px, .75fr);
  gap: 24px;
}

.dashboard-admin-page .dashboard-card-large,
.dashboard-admin-page .quick-actions-panel {
  min-height: 460px;
}

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

.dashboard-admin-page > .grid.two {
  grid-template-columns: minmax(0, 1.3fr) minmax(420px, .7fr);
  gap: 24px;
}

.dashboard-admin-page .table-wrap table {
  min-width: 760px;
}

/* Routes */
.route-admin-page .route-library-panel {
  overflow: hidden;
}

.route-admin-page .route-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.route-admin-page .route-editor-panel {
  padding: clamp(22px, 2vw, 32px);
}

.route-admin-page .route-builder-grid {
  grid-template-columns: minmax(460px, 560px) minmax(0, 1fr);
  gap: 26px;
}

.route-admin-page .map-canvas {
  min-height: 620px;
  height: 66vh;
  max-height: 760px;
}

.route-admin-page .route-points-list {
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.route-admin-page .route-point-row {
  grid-template-columns: minmax(90px, auto) minmax(180px, 1fr) minmax(140px, 170px) auto auto;
}

.route-admin-page .codebox {
  min-height: 210px;
  max-height: 330px;
}

/* Attendance */
.attendance-admin-page .attendance-grid {
  grid-template-columns: minmax(430px, 540px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.attendance-admin-page .qr-reader {
  width: 100%;
  max-width: none;
  min-height: 360px;
}

.attendance-admin-page .attendees-panel {
  min-width: 0;
}

.attendance-admin-page .attendees-panel .table-wrap {
  max-height: 70vh;
  border: 1px solid var(--line, #e6e9f0);
  border-radius: 22px;
  background: #fff;
}

.attendance-admin-page .attendees-panel table {
  min-width: 1180px;
}

.attendance-admin-page .attendees-panel thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
}

@media (max-width: 1180px) {
  .admin-wide-page {
    max-width: 100%;
    padding-left: 18px;
    padding-right: 18px;
  }

  .dashboard-admin-page .admin-dashboard-grid,
  .dashboard-admin-page > .grid.two,
  .route-admin-page .route-builder-grid,
  .attendance-admin-page .attendance-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-admin-page .compact-stats,
  .dashboard-admin-page .grid.four,
  .dashboard-admin-page .quick-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .route-admin-page .map-canvas {
    height: 520px;
  }
}

@media (max-width: 680px) {
  .admin-wide-page {
    padding-left: 14px;
    padding-right: 14px;
  }

  .dashboard-admin-page .compact-stats,
  .dashboard-admin-page .grid.four,
  .dashboard-admin-page .quick-actions-grid,
  .route-admin-page .route-card-grid {
    grid-template-columns: 1fr;
  }

  .route-admin-page .map-canvas,
  .attendance-admin-page .qr-reader {
    min-height: 380px;
    height: 420px;
  }
}
