/* ===== Admin only ===== */

/* Region selection modal */
#regionModal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
}
#regionModal .box {
  background: #fff; padding: 20px; border-radius: 8px;
  max-width: 400px; width: 90%;
}
#regionModal ul { list-style: none; padding: 0; margin: 0; }
#regionModal li { margin: 10px 0; }
#regionModal a {
  display: block; padding: 10px 15px; background: #007BFF; color: #fff;
  border-radius: 4px; text-align: center; text-decoration: none;
}
#regionModal a:hover { background: #0056b3; }

/* Toolbar */
.toolbar { display:flex; gap:.75rem; align-items:center; flex-wrap:wrap; margin-bottom:1rem; }

/* Utilities */
.index-btn { margin-left: auto; }
.index-form, .index-form-2, .index-form-3,
.seasons-form, .seasons-form-2, .seasons-form-3,
.login-btn { display: inline; }

.key { color: var(--muted, #666); }
.badge-cell span { display: inline-block; }
.badge-wrap { margin-left: .5rem; }

/* Page specifics */
.logs table { background: #fff; } /* keep local table bg */

.actions { margin-top: 1rem; display: flex; gap: .5rem; } /* request details */
.request-div { display:flex; gap:.5rem; margin-top:.5rem; }

.table { width: 100%; border-collapse: collapse; }          /* seasons detail */
.table th, .table td { padding:.6rem; border-bottom:1px solid #eee; text-align:left; }
.form-inline { display:flex; gap:.5rem; flex-wrap:wrap; }
.season-detail-h3 { margin-top: 1rem; }

/* Theming parity stripe bound to vars */
:root {
  --admin-leftbar-color: var(--leftbar-color, #0a66c2);
  --admin-leftbar-width: var(--leftbar-width, 6px);
}

/* ===== Admin index: filters (single source of truth) ===== */
/* Apply to both legacy .filter-row and current .filters */
.filter-row,
.filters{
  display:flex;
  align-items:flex-end;     /* bottom align all controls */
  gap:.75rem;
  flex-wrap:wrap;
}

/* Labels wrap their control vertically, with no extra margins */
.filter-row label,
.filters label{
  display:flex;
  flex-direction:column;
  margin:0;
}

/* Normalize control heights and padding */
.filter-row select,
.filter-row input[type="text"],
.filter-row .btn,
.filters select,
.filters input[type="text"],
.filters .btn{
  height:38px;
  padding:.45rem .75rem;
  line-height:1;
}

/* Kill stray margins on the action button so it aligns */
.filter-row .btn,
.filters .btn{
  margin:0;
}

/* Search field width and behavior */
.filter-row input[name="q"],
.filters input[name="q"]{
  flex:1 1 650px;   /* allow grow/shrink; 650px base */
  max-width:50%;
  padding:.45rem .75rem; /* keep height normalised */
}

@media (max-width:760px){
  .filter-row input[name="q"],
  .filters input[name="q"]{
    flex:1 1 100%;
    max-width:100%;
  }
}

/* Admin requests dashboard: genuine touch horizontal scrolling on narrow screens. */
.admin-requests-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.admin-requests-table-scroll:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand, #0a66c2) 25%, transparent);
  outline-offset: 2px;
}

.admin-requests-table-scroll .admin-table {
  width: 100%;
  min-width: 680px;
  margin: 0;
}

.admin-requests-table-scroll .admin-table th,
.admin-requests-table-scroll .admin-table td {
  white-space: nowrap;
}

.admin-requests-table-scroll .admin-table th:first-child,
.admin-requests-table-scroll .admin-table td:first-child {
  max-width: 65px;
  white-space: normal;
}

.admin-requests-table-scroll .admin-table th:last-child,
.admin-requests-table-scroll .admin-table td:last-child {
  width: 1%;
}

@media (max-width: 760px) {
  .admin-requests-table-scroll {
    margin-top: .75rem;
  }

  .admin-requests-table-scroll .admin-table {
    min-width: 720px;
  }
}
/* Column targets */
/* Narrow round number field; column hooks for styling */
.table .col-roundnum input[name="round_number"] { width: 6ch; }
.table .col-roundname input[name="round_name"] { max-width: 32rem; width: min(40vw, 32rem); }
.table .col-rounddate input[name="round_date"] { width: 16ch; }
/* Optional: align action buttons tightly */
.table .col-roundactions .btn { white-space: nowrap; }
/* v8.7 Superadmin regional access indicator */
.msg.superadmin-access {
  border-left: 4px solid #0a66c2;
  background: #eef6ff;
}

/* Pending administrator invitations */
.admin-invite-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.admin-invite-table-wrap table {
  min-width: 900px;
}
.admin-invite-status {
  display: inline-block;
  padding: .25rem .55rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
}
.admin-invite-status.is-pending {
  background: #fff4cc;
  border: 1px solid #9a6700;
  color: #5f4300;
}
.admin-invite-status.is-expired {
  background: #ffe5e5;
  border: 1px solid #991b1b;
  color: #7f1d1d;
}


/* Administrator evidence upload */
.admin-evidence-upload {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px dashed #c8d0da;
  border-radius: 8px;
  background: #f8fafc;
}
.admin-evidence-upload label {
  display: block;
  margin-bottom: .4rem;
  font-weight: 700;
}
.admin-evidence-upload input[type="file"] {
  display: block;
  width: 100%;
  margin-bottom: .5rem;
}
.admin-evidence-upload .btn {
  margin-top: .75rem;
}
.admin-evidence-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.admin-evidence-table-wrap table {
  min-width: 760px;
}
