/* ABAVA Volleyball — Admin Panel Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #0a0e1a;
  --navy-mid:   #111827;
  --navy-light: #1c2540;
  --gold:       #f5c518;
  --white:      #f0f2f7;
  --white-dim:  #9aa3b8;
  --green:      #22c55e;
  --red:        #ef4444;
  --border:     rgba(255,255,255,0.08);
}

body { font-family: 'DM Sans', system-ui, sans-serif; background: var(--navy); color: var(--white); min-height: 100vh; }

/* ── Login ── */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
}
.login-box {
  background: var(--navy-light); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px; width: 100%; max-width: 440px;
  display: flex; flex-direction: column; gap: 20px; text-align: center;
}
.login-logo { font-size: 3rem; }
.login-box h1 { font-size: 1.8rem; color: var(--gold); }
.login-box p { color: var(--white-dim); font-size: 0.9rem; }

/* ── Layout ── */
#admin-body { display: flex; flex-direction: row; flex: 1; min-height: 100vh; }
#admin-app {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  align-items: flex-start;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}
.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--navy-mid);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo { font-size: 1rem; font-weight: 700; color: var(--gold); padding: 8px 12px 16px; }
.admin-tab-btn {
  background: none; border: none; color: var(--white-dim); cursor: pointer;
  padding: clamp(8px, 1.5vw, 12px) clamp(8px, 1.5vw, 16px); border-radius: 8px; text-align: left; font-size: clamp(0.68rem, 1.2vw, 0.82rem);
  transition: background 0.15s, color 0.15s; width: 100%;
}
.admin-tab-btn:hover { background: var(--navy-light); color: var(--white); }
.admin-tab-btn.active { background: var(--gold); color: var(--navy); font-weight: 700; }
.admin-sub-btn {
  background: none; border: none; color: var(--white-dim); cursor: pointer;
  padding: 6px 10px 6px 28px; border-radius: 6px; text-align: left; font-size: 0.8rem;
  transition: background 0.15s, color 0.15s; width: 100%; display: block;
}
.admin-sub-btn:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.admin-sub-btn.active { color: var(--gold); font-weight: 600; background: rgba(245,197,24,0.08); }
.sidebar-footer {
  margin-top: auto; display: flex; flex-direction: column;
  gap: 8px; padding-top: 16px; border-top: 1px solid var(--border);
}

.admin-main {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  overflow-x: hidden;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  min-height: 100vh;
}
.admin-tab h2 { font-size: 1.6rem; color: var(--gold); margin-bottom: 24px; }
.admin-panel-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-panel-header h2 { margin: 0; font-size: 1.6rem; color: var(--gold); }

/* ── Cards ── */
.admin-card {
  background: linear-gradient(145deg, #1c2540, #141b30); border: 1px solid var(--border);
  border-radius: 16px; padding: clamp(14px, 2.5vw, 28px); margin-bottom: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.admin-card h3 {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--white-dim); margin-bottom: 16px;
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* .league-panel — no per-panel width needed; .admin-main handles 1400px cap */

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: clamp(120px, 20vw, 200px); }
.form-group label { font-size: clamp(0.85rem, 1.5vw, 0.95rem); color: var(--white-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.form-group small { font-size: 0.75rem; color: var(--white-dim); opacity: 0.7; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.score-field { max-width: 90px; }
.score-sep { font-size: 1.4rem; color: var(--white-dim); padding-bottom: 8px; }

input[type="text"], input[type="number"], input[type="password"],
input[type="email"], input[type="date"], input[type="file"], select, textarea {
  background: var(--navy);
  border: 1px solid var(--border);
  color: var(--white);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; min-height: 100px; }

/* ── Date input calendar icon — make visible on dark background ── */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.8);
  opacity: 0.7;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: opacity 0.15s;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background: rgba(245, 197, 24, 0.15);
}
.hint { font-size: 0.82rem; color: var(--white-dim); text-align: center; margin: 8px 0; }

/* ── Buttons ── */
.btn-primary {
  background: var(--gold); color: var(--navy); border: none;
  padding: 10px 20px; border-radius: 8px; font-weight: 700;
  cursor: pointer; white-space: nowrap; font-size: 0.9rem;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; }
.btn-secondary {
  background: var(--navy-light); color: var(--white); border: 1px solid var(--border);
  padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 0.88rem;
  transition: border-color 0.15s; text-decoration: none; display: inline-block;
}
.btn-secondary:hover { border-color: var(--gold); }
.btn-danger {
  background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.3);
  padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 0.88rem;
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; padding: 14px; }

/* ── Rows ── */
.admin-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border); gap: 8px; flex-wrap: wrap;
}
.admin-row:last-child { border-bottom: none; }
.admin-row span { font-size: 0.9rem; color: var(--white); }
.admin-row small { color: var(--white-dim); }
.admin-photo-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}

/* ── Badges ── */
.badge-active { background: rgba(34,197,94,0.15); color: var(--green); border-radius: 4px; padding: 2px 8px; font-size: 0.75rem; }
.badge-draft  { background: rgba(245,197,24,0.15); color: var(--gold);  border-radius: 4px; padding: 2px 8px; font-size: 0.75rem; }
.no-data { color: var(--white-dim); font-size: 0.9rem; font-style: italic; padding: 8px 0; }

/* ── Toast ── */
.toast {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  padding: 12px 24px; border-radius: 8px; font-weight: 600; font-size: 0.9rem;
}
.toast-success { background: var(--green); color: #000; }
.toast-error   { background: var(--red);   color: #fff; }

/* ── Analytics stat boxes ── */
.admin-stat-box {
  background: var(--navy-mid);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.admin-stat-box-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
}
.admin-stat-box-label {
  font-size: 0.72rem;
  color: var(--white-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* Sidebar collapses to top bar on small screens */
/* ── Mobile hamburger bar ─────────────────────────────────────── */
.admin-mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: var(--navy-mid);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
}
.admin-mobile-bar .mobile-logo {
  font-size: 1rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.05em;
}
.admin-hamburger {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--white);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
}
.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 299;
}
.admin-sidebar-overlay.open { display: block; }


.league-sub-pill {
  background: var(--navy-light);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--white-dim);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.league-sub-pill:hover { border-color: rgba(245,197,24,0.4); color: var(--white); }
.league-sub-pill.active { background: var(--gold); color: var(--navy); border-color: var(--gold); font-weight: 700; }



/* ── Sidebar groups ───────────────────────────────────────────── */
.sidebar-group { display: flex; flex-direction: column; }
.sidebar-group-btn {
  background: none; border: none; color: var(--white-dim); cursor: pointer;
  padding: 8px 12px; border-radius: 8px; text-align: left; font-size: 0.88rem;
  font-weight: 600; width: 100%; transition: background 0.15s, color 0.15s;
  display: flex; justify-content: space-between; align-items: center;
}
.sidebar-group-btn:hover { background: var(--navy-light); color: var(--white); }
.sidebar-group-body { display: flex; flex-direction: column; gap: 1px; }

/* ── League sidebar accordion ─────────────────────────────────── */
.league-section { display: flex; flex-direction: column; }
.league-section-btn {
  background: none; border: none; color: var(--white-dim); cursor: pointer;
  padding: 8px 12px; border-radius: 8px; text-align: left; font-size: 0.88rem;
  font-weight: 600; width: 100%; transition: background 0.15s, color 0.15s;
  display: flex; justify-content: space-between; align-items: center;
}
.league-section-btn:hover { background: var(--navy-light); color: var(--white); }
.league-section-btn.active { color: var(--gold); }
.league-section-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 4px;
}
.group-arrow { font-size: 0.7rem; transition: transform 0.2s; }
.group-arrow.open { transform: rotate(90deg); }

@media (max-width: 768px) {
  /* Show hamburger bar */
  .admin-mobile-bar { display: flex; }

  /* App stacks vertically on mobile */
  #admin-app { flex-direction: column; }

  /* Sidebar: hidden off-screen, slides in as full drawer matching desktop style */
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 260px;
    height: 100vh;
    z-index: 300;
    transition: left 0.25s ease;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    flex-direction: column;
  }
  .admin-sidebar.mobile-open { left: 0; }

  /* Main content takes full width */
  .admin-main {
    width: 100%;
    padding: 12px 14px;
    min-width: 0;
  }

  /* Forms */
  .form-row { flex-direction: column; }
  .form-group { width: 100%; min-width: unset; }
  #r-sets-container { overflow-x: auto; }
  #r-home-sets, #r-away-sets { flex-wrap: nowrap; min-width: max-content; }
  .admin-card { padding: 16px 14px; }
  .standings-table th, .standings-table td { font-size: 0.8rem; padding: 6px 4px; }

  /* People form: stack photo/bio columns on mobile */
  .people-photo-bio-row { flex-direction: column !important; }
  /* People form row 1: allow wrapping on mobile */
  .people-row1 { flex-wrap: wrap !important; }
  .people-row1 .form-group { flex: 1 1 100% !important; width: 100% !important; min-width: 0 !important; }

  /* Sub-nav pills wrap onto multiple lines */
  #league-sub-nav {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .league-sub-pill {
    font-size: 0.75rem;
    padding: 4px 10px;
  }
}

/* ── Sidebar section label ─────────────────────────────────── */
.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white-dim);
  padding: 10px 12px 4px;
  opacity: 0.7;
}
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

/* ── Reschedule match rows ─────────────────────────────────── */
.rs-match-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.rs-match-row:hover { border-color: rgba(245,197,24,0.3); }
.rs-match-row.selected { border-color: var(--gold); background: rgba(245,197,24,0.04); }
.rs-match-info { flex: 1; }
.rs-match-teams { font-size: 0.88rem; font-weight: 500; color: var(--white); }
.rs-match-teams span { color: var(--white-dim); font-weight: 400; }
.rs-match-meta { font-size: 0.76rem; color: var(--white-dim); margin-top: 3px; }
.rs-inline-form {
  display: none;
  background: var(--navy-light);
  border: 1px solid rgba(245,197,24,0.25);
  border-radius: 8px;
  padding: 16px;
  margin: 2px 0 10px;
}
.rs-status-upcoming { background: rgba(59,130,246,0.15); color: #60a5fa; border-radius: 4px; padding: 2px 8px; font-size: 0.72rem; font-weight: 600; }
.rs-status-rescheduled { background: rgba(245,197,24,0.15); color: var(--gold); border-radius: 4px; padding: 2px 8px; font-size: 0.72rem; font-weight: 600; }
.rs-status-completed { background: rgba(34,197,94,0.15); color: var(--green); border-radius: 4px; padding: 2px 8px; font-size: 0.72rem; font-weight: 600; }
.rs-week-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--gold); padding: 10px 0 4px;
  border-top: 1px solid rgba(245,197,24,0.1); margin-top: 6px;
}
.rs-week-label:first-child { border-top: none; margin-top: 0; }

/* ══════════════════════════════════════════════════════════════
   Data Manager — design system
   ══════════════════════════════════════════════════════════════ */

/* Page header */
.dm-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.dm-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}
.dm-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(245,197,24,0.12);
  color: var(--gold);
  border: 1px solid rgba(245,197,24,0.25);
  border-radius: 20px;
  padding: 2px 10px;
  letter-spacing: 0.03em;
}

/* Step indicator */
.dm-steps {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 0;
}
.dm-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--white-dim);
}
.dm-step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
  color: var(--white-dim);
}
.dm-step-dot.active {
  background: rgba(245,197,24,0.15);
  border-color: var(--gold);
  color: var(--gold);
}
.dm-step-dot.done {
  background: rgba(34,197,94,0.15);
  border-color: var(--green);
  color: var(--green);
}
.dm-step-label { white-space: nowrap; }
.dm-step-line {
  flex: 1;
  min-width: 16px;
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 0 6px;
}

/* Two-column layout */
.dm-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 700px) {
  .dm-two-col { grid-template-columns: 1fr; }
}

/* Cards */
.dm-card {
  background: linear-gradient(145deg, #1c2540, #141b30);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.dm-card-title {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--white-dim);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Fields */
.dm-field-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.dm-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 130px;
}
.dm-label {
  font-size: clamp(0.85rem, 1.5vw, 0.95rem);
  color: var(--white-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dm-hint {
  font-size: 0.78rem;
  color: var(--white-dim);
  margin-top: 10px;
  opacity: 0.8;
}

/* Upload zone */
.dm-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border: 1.5px dashed rgba(255,255,255,0.18);
  border-radius: 8px;
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-top: 4px;
}
.dm-upload-zone:hover {
  border-color: rgba(245,197,24,0.5);
  background: rgba(245,197,24,0.03);
}
.dm-upload-icon {
  font-size: 1.8rem;
  color: var(--white-dim);
  line-height: 1;
}
.dm-upload-text {
  font-size: 0.84rem;
  color: var(--white-dim);
}
.dm-upload-hint {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
}

/* Buttons */
.dm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.88rem;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.15);
  background: var(--navy);
  color: var(--white);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
}
.dm-btn:hover { border-color: rgba(245,197,24,0.4); }
.dm-btn-success {
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.35);
  color: var(--green);
}
.dm-btn-success:hover { background: rgba(34,197,94,0.2); }
.dm-btn-danger {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
  color: var(--red);
}
.dm-btn-danger:hover { background: rgba(239,68,68,0.2); }

/* Stat boxes */
.dm-stat-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.dm-stat {
  flex: 1;
  min-width: 80px;
  background: var(--navy);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  text-align: center;
}
.dm-stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
}
.dm-stat-num.warn { color: var(--gold); }
.dm-stat-lbl {
  font-size: 0.7rem;
  color: var(--white-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
}

/* Preview table */
.dm-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.dm-preview-table th {
  text-align: left;
  padding: 6px 10px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--white-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.dm-preview-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--white);
}
.dm-preview-table tr:last-child td { border-bottom: none; }
.dm-preview-table tr:hover td { background: rgba(255,255,255,0.02); }

/* Tags */
.dm-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.dm-tag-green  { background: rgba(34,197,94,0.15);  color: #4ade80; }
.dm-tag-blue   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.dm-tag-amber  { background: rgba(245,197,24,0.15); color: var(--gold); }
.dm-tag-red    { background: rgba(239,68,68,0.15);  color: #f87171; }
.dm-tag-gray   { background: rgba(255,255,255,0.08);color: var(--white-dim); }

/* ── Calendar / standings tabs in admin ─────────────────────── */
.standings-tab {
  font-size: 0.82rem;
  font-family: var(--font-body, sans-serif);
  letter-spacing: 0.04em;
  padding: 8px 16px;
  cursor: pointer;
  color: var(--white-dim);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  margin-bottom: -1px;
}
.standings-tab:hover { color: var(--white); background: rgba(255,255,255,0.08); }
.standings-tab.active { color: var(--gold); border-bottom-color: var(--gold); background: rgba(245,197,24,0.08); border-color: rgba(245,197,24,0.2); border-bottom-color: var(--gold); }

.people-filter-btn {
  font-size: 0.78rem;
  font-family: var(--font-body, sans-serif);
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--white-dim, #9aa3b8);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-weight: 500;
}
.people-filter-btn:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.people-filter-btn.active { background: rgba(245,197,24,0.12); color: var(--gold, #f5c518); border-color: rgba(245,197,24,0.4); font-weight: 700; }

/* ── Letter Requests table — auto width, no stretch ─────── */
#lr-table {
  width: auto !important;
  min-width: 0 !important;
}
#lr-table th {
  padding: 8px 8px !important;
}

/* ── Letter Requests table scroll container ───────────────── */
.lr-table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  width: 100%;
}
@media (max-width: 768px) {
  /* Break out of admin-card padding so the scroll container is full-bleed */
  .lr-table-scroll {
    margin-left: -14px;
    margin-right: -14px;
    width: calc(100% + 28px);
    padding-left: 14px;
    padding-right: 14px;
  }
  /* Override the generic .admin-card table rule so the table itself
     is not also a scroll container — single container only */
  #tab-letter-requests .lr-table-scroll table {
    display: table;
    overflow-x: visible;
    -webkit-overflow-scrolling: unset;
    touch-action: unset;
    width: 100%;
    min-width: 860px;
  }
}
@media (max-width: 400px) {
  .lr-table-scroll {
    margin-left: -10px;
    margin-right: -10px;
    width: calc(100% + 20px);
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* ============================================================
   RESPONSIVE AUDIT FIXES — Admin panel (320px – 1920px)
   ============================================================ */

/* No horizontal page overflow, ever */
html, body { overflow-x: hidden; max-width: 100vw; }
img { max-width: 100%; height: auto; }
.admin-main, .admin-card { min-width: 0; }

/* Login screen fits a 320px viewport */
.login-box {
  width: min(380px, calc(100vw - 32px));
  box-sizing: border-box;
}

/* Wide content inside cards (tables, schedule builder) scrolls sideways */
@media (max-width: 768px) {
  .admin-card table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    width: 100%;
  }
  /* iOS zoom prevention: admin inputs are 0.9rem on desktop */
  input[type="text"], input[type="number"], input[type="password"],
  input[type="email"], input[type="date"], input[type="file"],
  select, textarea {
    font-size: 16px;
  }
  /* List rows wrap instead of pushing buttons off-screen */
  .admin-photo-row { flex-wrap: wrap; }
}

/* Touch targets on touch devices */
@media (pointer: coarse) {
  .btn-primary, .btn-secondary, .btn-danger, .btn-full {
    min-height: 44px;
  }
  .btn-sm { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
  .admin-nav-btn { min-height: 44px; }
}

/* 320px phones: tighter card padding, stacked forms */
@media (max-width: 400px) {
  .admin-card { padding: 14px 10px; }
  .admin-main { padding: 12px 10px; }
  .form-row { flex-direction: column; align-items: stretch; }
  .form-row > * { width: 100%; }
}

/* ── Wide viewport scaling (1920px+) ── */
@media (min-width: 1920px) {
  html { font-size: 18px; }
}

@media (min-width: 2560px) {
  html { font-size: 21px; }
}

/* Photo grid cell — reveal Edit/Del overlay on hover */
.lph-photo-cell .lph-cell-actions { opacity: 0; transition: opacity 0.15s; }
.lph-photo-cell:hover .lph-cell-actions { opacity: 1; }
