/* app/static/css/style.css */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #111827;
  font-size: 15px;
  line-height: 1.5;
}

/* ── Navbar ── */
.navbar {
  background: linear-gradient(160deg, #00a05a 0%, #006638 100%);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.navbar-brand {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.navbar-brand:hover { opacity: 0.88; }
.navbar-crumbs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  overflow: hidden;
}
.navbar-sep { color: rgba(255,255,255,0.4); font-size: 1rem; }
.navbar-crumb {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.navbar-crumb:hover { color: #fff; }
.navbar-crumb-current {
  color: rgba(255,255,255,0.55);
  font-size: 0.88rem;
  white-space: nowrap;
}
.navbar-right { margin-left: auto; display: flex; gap: 0.75rem; }
.navbar-link {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
}
.navbar-link:hover { color: #fff; }

/* ── Page structure ── */
.page-content { padding: 0; }
.page-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.page-header h1 { margin: 0 0 0.2rem; font-size: 1.5rem; font-weight: 700; }
.page-meta { font-size: 0.83rem; color: #6b7280; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.section-header h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }

/* ── Cards ── */
.card {
  background: #fff;
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}
.card-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Team cards (teams list) */
.team-card {
  background: #fff;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.team-card:hover { border-color: #00864b; box-shadow: 0 2px 8px rgba(0,134,75,0.12); }
.team-card-icon { font-size: 1.6rem; flex-shrink: 0; }
.team-card-body { flex: 1; min-width: 0; }
.team-card-name { font-weight: 600; font-size: 1rem; }
.team-card-meta { font-size: 0.78rem; color: #6b7280; margin-top: 1px; }
.team-card-arrow { color: #9ca3af; font-size: 1.2rem; }

/* Game cards (team detail) */
.game-card {
  background: #fff;
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.game-card:hover { border-color: #00864b; box-shadow: 0 2px 8px rgba(0,134,75,0.12); }
.game-card-icon { font-size: 1.3rem; flex-shrink: 0; }
.game-card-body { flex: 1; min-width: 0; }
.game-card-title { font-weight: 600; font-size: 0.95rem; }
.game-card-meta { font-size: 0.78rem; color: #6b7280; margin-top: 1px; }
.game-card-arrow { color: #9ca3af; font-size: 1.2rem; }

/* Roster rows */
.roster-row {
  background: #fff;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.roster-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #d1fae5;
  color: #065f46;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.roster-name { flex: 1; font-weight: 500; }
.roster-actions { display: flex; gap: 0.4rem; }

/* Attendance list */
.attendance-list { display: flex; flex-direction: column; gap: 0.4rem; }
.attendance-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
}
.attendance-row:hover { background: #f0fdf4; }
.attendance-row input[type="checkbox"] {
  width: 17px; height: 17px;
  accent-color: #00864b;
  cursor: pointer;
  flex-shrink: 0;
}
.attendance-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.attendance-name { font-weight: 500; flex: 1; }
.attendance-late {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.attendance-late-label { font-size: 0.75rem; color: #888; white-space: nowrap; }
.attendance-late-input {
  width: 48px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 0.82rem;
  text-align: center;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #6b7280;
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.empty-state p { margin: 0 0 1rem; }

/* ── Buttons ── */
.btn-primary {
  padding: 0.45rem 1rem;
  background: #00864b;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.btn-primary:hover { background: #006b3c; }

.btn-secondary {
  padding: 0.45rem 1rem;
  background: #e5e7eb;
  color: #374151;
  border: none;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.btn-secondary:hover { background: #d1d5db; }

.btn-ghost {
  padding: 0.45rem 1rem;
  background: transparent;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.btn-ghost:hover { background: #f3f4f6; }

.btn-danger {
  padding: 0.45rem 1rem;
  background: #fee2e2;
  color: #991b1b;
  border: none;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.btn-danger:hover { background: #fecaca; }

.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }

.btn-link-danger {
  background: none;
  border: none;
  padding: 0;
  color: #b91c1c;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}
.btn-link-danger:hover { color: #7f1d1d; }

.late-badge {
  font-size: 0.7rem;
  color: #9a3412;
  background: #ffedd5;
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 4px;
  font-weight: 600;
}

.attendance-notice {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  color: #92400e;
  margin-bottom: 1rem;
}

/* Inline form (add player, etc.) */
.inline-form { display: flex; gap: 0.5rem; align-items: center; }
.form-input {
  flex: 1;
  padding: 0.45rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 0.88rem;
  outline: none;
}
.form-input:focus { border-color: #00864b; box-shadow: 0 0 0 2px rgba(0,134,75,0.15); }

/* ── Modal (shared) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.modal-box h3 { margin: 0 0 1.1rem; font-size: 1.05rem; font-weight: 700; }
.modal-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 0.85rem; }
.modal-field label { font-size: 0.78rem; font-weight: 500; color: #374151; }
.modal-field input,
.modal-field select {
  padding: 0.45rem 0.7rem;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 0.88rem;
  outline: none;
}
.modal-field input:focus,
.modal-field select:focus { border-color: #00864b; box-shadow: 0 0 0 2px rgba(0,134,75,0.15); }
.modal-row { display: flex; gap: 0.75rem; }
.modal-row .modal-field { flex: 1; }
.modal-actions { display: flex; align-items: center; gap: 0.5rem; margin-top: 1.25rem; }

.pos-picker-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 260px; overflow-y: auto; }
.picker-player-btn {
  width: 100%; padding: 0.6rem 0.9rem; text-align: left;
  background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 0.95rem; cursor: pointer;
}
.picker-player-btn:hover, .picker-player-btn:active { background: #dbeafe; border-color: #93c5fd; }

/* ── Legacy top-bar (kept for any old references) ── */
.top-bar { display: none; }

.layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem;
}

.edit-btn {
    max-width: 480px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: none;
    background: #1f6feb;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: block;
}

.edit-btn.editing {
    background: #d97706; /* orange-ish when in edit mode */
}

/* Slight visual hint when editing positions */
#field.editing {
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.7);
    cursor: crosshair;
}

.field-container {
    flex: 1;
}

/* FIELD BASE */
#field {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    aspect-ratio: 2 / 3;
    background: linear-gradient(#2e8b57, #228b22); /* grass */
    border: 4px solid white; /* outer touchline */
    border-radius: 12px;
    overflow: hidden;
}

/* MIDFIELD LINE */
#field::before {
    content: "";
    position: absolute;
    top: 30%;
    left: 0;
    width: 100%;
    height: 0;
    border-top: 3px solid #ffffff;
    opacity: 0.9;
}

/* CENTER CIRCLE */
#field::after {
    content: "";
    position: absolute;
    top: 30%;
    left: 50%;
    width: 30%;
    height: 16%;
    transform: translate(-50%, -50%);
    border: 3px solid #ffffff;
    border-radius: 50%;
    opacity: 0.9;
}

/* BOTTOM PENALTY BOX (18-yard box style) */
.penalty-box-bottom {
    position: absolute;
    width: 60%;           /* how wide the penalty area is */
    height: 20%;          /* how tall it is from goal line up */
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    border: 3px solid #ffffff;
    border-bottom: none;  /* bottom edge is the outer field line */
    opacity: 0.9;
}

/* PENALTY ARC (half circle) */
.penalty-arc-bottom {
    position: absolute;
    width: 20%;
    height: 5%;
    left: 50%;
    bottom: 17.5%;           /* ← was 18%, now centered on box top */
    transform: translateX(-50%);
    border: 3px solid #ffffff;
    border-bottom: none;     /* open toward goal */
    border-radius: 50%;
    clip-path: inset(0 0 50% 0); /* hides lower half */
    opacity: 0.9;
}

/* BOTTOM GOAL BOX (6-yard box style) */
.goal-box-bottom {
    position: absolute;
    width: 30%;           /* narrower than penalty box */
    height: 10%;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    border: 3px solid #ffffff;
    border-bottom: none;  /* shares the outer line as bottom */
    opacity: 0.9;
}

/* POSITION SPOTS (default circles user creates) */
.position-spot {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: rgba(0, 0, 0, 0.25);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    text-align: center;
    box-sizing: border-box;
    transform: translate(-50%, -50%);
    touch-action: none;
    z-index: 10;
    pointer-events: auto;
}

.position-spot .position-label {
  pointer-events: none;
}

.position-spot .position-pencil {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f97316; /* small orange circle */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  cursor: pointer;
}

/* hide delete X in normal mode */
#field .delete-btn {
  display: none;
}

/* show delete X only when Edit Positions is active */
#field.editing .delete-btn {
  display: block;
}

.position-spot .delete-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  background: #e11d48;    /* red-ish */
  color: white;
  cursor: pointer;
}

.position-editor.hidden {
  display: none;
}

.position-editor {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.position-editor-content {
  background: white;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

.position-editor-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
}


/* Bench */
.bench-container {
    max-width: 480px;
    margin: 0 auto 1rem;
    background: white;
    border-radius: 8px;
    padding: 0.5rem;
}

#bench {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bench-pill {
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
    background: #e0e7ff;
    font-size: 0.8rem;
}

/* ---- Global Layout ---- */
.container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
  font-family: system-ui, sans-serif;
}

h1, h2 {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

hr {
  margin: 1.5rem 0;
  border: none;
  border-top: 1px solid #ddd;
}

/* ---- Modern Button ---- */
button,
.button {
  background: #1d4ed8;
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s ease;
}

button:hover,
.button:hover {
  background: #1e40af;
}

/* ---- Inputs ---- */
input[type="text"],
input[type="date"] {
  border: 2px solid #ccc;
  padding: 0.5rem 0.65rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

input:focus {
  outline: none;
  border-color: #1d4ed8;
}

/* team edit modal */
.team-edit-modal-content {
  background: #ffffff;
  padding: 1rem 1.1rem 0.9rem;
  border-radius: 0.75rem;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.team-edit-modal-content h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.team-edit-modal-body label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.team-edit-modal-body input,
.team-edit-modal-body select {
  width: 100%;
  margin-top: 0.2rem;
  box-sizing: border-box;
}

.team-edit-row {
  display: flex;
  gap: 0.75rem;
}

.team-edit-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ---- Team Cards ---- */
.team-list {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.team-card {
  display: block;
  background: #f8fafc;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  font-weight: 500;
  color: #1e293b;
  text-decoration: none;
  transition: all 0.15s ease;
    cursor: pointer;
}

.team-card:hover {
  background: #e0f2fe;
  border-color: #0284c7;
  transform: translateY(-2px);
}


/* ---- Layout container ---- */
.container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---- Headings ---- */
h1, h2 {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

hr {
  margin: 1.5rem 0;
  border: none;
  border-top: 1px solid #e5e7eb;
}

/* ---- Modern Buttons ---- */
button,
.button {
  background: #1d4ed8;
  color: white;
  border: none;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s ease, transform 0.1s ease;
}

button:hover,
.button:hover {
  background: #1e40af;
  transform: translateY(-1px);
}

button.button-secondary {
  background: #e5e7eb;
  color: #111827;
}

button.button-secondary:hover {
  background: #d1d5db;
}

/* ---- Inputs ---- */
input[type="text"],
input[type="date"] {
  border: 2px solid #d1d5db;
  padding: 0.5rem 0.65rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  max-width: 100%;
  box-sizing: border-box;
}

input:focus {
  outline: none;
  border-color: #1d4ed8;
}

/* ---- Team List & Cards ---- */
.team-list {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.team-card {
  background: #f8fafc;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.9rem 0.9rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

/* header row with icon + name */
.team-card-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.team-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  font-size: 1.1rem;
}

.team-name-link {
  text-decoration: none;
  color: #111827;
  font-weight: 600;
  font-size: 0.98rem;
}

.team-name-link:hover {
  text-decoration: underline;
}

/* action row */
.team-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

/* card hover */
.team-card:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  transform: translateY(-2px);
}

/* ---- Mobile tweaks ---- */
@media (max-width: 640px) {
  .container {
    margin-top: 1.25rem;
  }

  .team-card-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  button,
  .button {
    width: auto;
    padding-inline: 0.85rem;
  }
}

button.button-danger {
  background: #dc2626;        /* red */
  color: #f9fafb;
}

button.button-danger:hover {
  background: #b91c1c;
}

/* ---- TEAM DETAIL PAGE ---- */

.team-page {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Hero section */
.team-hero {
  position: relative;
  background: radial-gradient(circle at top left, #111827 0, #020617 60%);
  color: #f9fafb;
  padding: 1.25rem 1rem 1.5rem;
  border-bottom-left-radius: 1.25rem;
  border-bottom-right-radius: 1.25rem;
  overflow: hidden;
}

.team-hero-inner {
  max-width: 900px;
  margin: 0 auto;
}

/* back + menu bar */
.team-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
}

.hero-icon-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(249, 250, 251, 0.2);
  background: rgba(15, 23, 42, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f9fafb;
  cursor: pointer;
}

/* name + artwork */
.team-hero-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.team-hero-art {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 2px solid rgba(248, 250, 252, 0.4);
  background: linear-gradient(135deg, #22c55e, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.team-hero-title {
  font-size: 1.4rem;
  font-weight: 600;
}

/* circular nav buttons */
.team-hero-nav {
  display: flex;
  gap: 1.25rem;
  margin-top: 1.2rem;
  overflow-x: auto;
}

.team-hero-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.8rem;
}

.team-hero-nav-circle {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* meta bar under hero */
.team-meta-wrapper {
  max-width: 900px;
  margin: 0.75rem auto 0;
  padding: 0 1rem;
}

.team-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.9rem;
  color: #111827;
}

.team-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.team-meta-item-icon {
  font-size: 1rem;
}

/* "Team is not shared" pill */
.team-share-pill {
  display: inline-flex;
  margin-top: 0.6rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.8rem;
}

/* big Create Game button */
.team-primary-cta-wrapper {
  max-width: 900px;
  margin: 1.3rem auto 0.5rem;
  padding: 0 1rem;
  text-align: center;
}

.team-primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2.8rem;
  border-radius: 999px;
  border: none;
  background: #111827;
  color: #f9fafb;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.4);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

.team-primary-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.5);
  background: #020617;
}

/* content sections */
.team-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* Game plan list */
.game-plans-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.5rem 0 0.5rem;
}

.game-plans-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.game-plan-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.game-plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f9fafb;
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
}

.game-plan-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.game-plan-icon {
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  border: 1px solid #d4d4d8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.game-plan-text-main {
  font-size: 0.95rem;
  font-weight: 500;
}

.game-plan-text-sub {
  font-size: 0.8rem;
  color: #6b7280;
}

.game-plan-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-button {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Roster & forms below */
.team-section {
  margin-top: 1.75rem;
}

.team-section h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

@media (max-width: 640px) {
  .team-hero {
    padding-top: 1rem;
  }
}

/* ═══════════════════════════════════════════════════
   GAME DETAIL — field tracker, bench, goals, stats
   ═══════════════════════════════════════════════════ */

/* ── Controls bar ── */
.controls-bar {
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.09);
  margin-bottom: 1rem;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
}

.ctrl-section {
  padding: 0.7rem 1.1rem;
  border-right: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.ctrl-section:last-child { border-right: none; }

.ctrl-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

/* Clock */
.ctrl-clock-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ctrl-clock-time {
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  min-width: 3.5ch;
  line-height: 1;
}
.ctrl-clock-btns { display: flex; gap: 4px; flex-wrap: wrap; }

/* Score (center, dominant) */
.ctrl-score {
  flex: 1;
  align-items: center;
  text-align: center;
  padding: 0.5rem 1.1rem;
  background: #fafafa;
}
.ctrl-score-board {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
}
.ctrl-score-num {
  font-size: 3rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  min-width: 1.4ch;
  text-align: center;
  letter-spacing: -0.03em;
}
.score-us   { color: #00864b; }
.score-them { color: #dc2626; }
.ctrl-score-sep { font-size: 2rem; color: #d1d5db; line-height: 1; }
.ctrl-score-btns { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }

/* Time left */
.ctrl-timeleft { align-items: center; min-width: 90px; }
.ctrl-timeleft-num {
  font-size: 1.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #dc2626;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* Clock buttons */
.btn-clock {
  padding: 0.28rem 0.6rem;
  border: none;
  border-radius: 7px;
  background: #00864b;
  color: white;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.btn-clock:hover { opacity: 0.85; }
.btn-clock-skip  { background: #7c3aed; }
.btn-clock-end   { background: #dc2626; }
.btn-clock-reset { background: #6b7280; }
.btn-clock.running { background: #dc2626; }

/* Goal buttons */
.btn-goal {
  padding: 0.32rem 0.8rem;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.btn-goal:hover { opacity: 0.85; }
.btn-goal-us   { background: #00864b; color: #fff; }
.btn-goal-them { background: #dc2626; color: #fff; }

/* ── Main layout ── */
.layout {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: flex-start;
}

/* ── Field ── */
.field-wrapper { flex-shrink: 0; }

#field {
  position: relative;
  width: 300px;
  aspect-ratio: 2 / 3;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0px, transparent 20px,
      rgba(0,0,0,0.04) 20px, rgba(0,0,0,0.04) 40px
    ),
    linear-gradient(175deg, #2da84d 0%, #1b6b32 100%);
  border: 3px solid rgba(255,255,255,0.9);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
#field::before {
  content: "";
  position: absolute;
  top: 30%; left: 0; width: 100%; height: 0;
  border-top: 2px solid rgba(255,255,255,0.7);
  pointer-events: none;
}
#field::after {
  content: "";
  position: absolute;
  top: 30%; left: 50%;
  width: 28%; height: 15%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  pointer-events: none;
}

.penalty-box-bottom, .penalty-arc-bottom, .goal-box-bottom { pointer-events: none; }
.penalty-box-bottom {
  position: absolute;
  width: 60%; height: 20%;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  border: 2px solid rgba(255,255,255,0.7);
  border-bottom: none;
}
.penalty-arc-bottom {
  position: absolute;
  width: 20%; height: 5%;
  left: 50%; bottom: 17.5%;
  transform: translateX(-50%);
  border: 2px solid rgba(255,255,255,0.7);
  border-bottom: none;
  border-radius: 50%;
  clip-path: inset(0 0 50% 0);
}
.goal-box-bottom {
  position: absolute;
  width: 30%; height: 10%;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  border: 2px solid rgba(255,255,255,0.7);
  border-bottom: none;
}

/* ── Position slots ── */
.pos-slot {
  position: absolute;
  width: 54px; height: 54px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px dashed rgba(255,255,255,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s;
}
.pos-slot:hover { border-color: rgba(255,255,255,0.75); }
.pos-slot.occupied { border-color: transparent; }
.pos-label {
  position: absolute;
  bottom: -17px;
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ── Player pills (on field) ── */
.player-pill {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: grab;
  user-select: none;
  border: 2.5px solid rgba(255,255,255,0.85);
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.35);
  line-height: 1.1;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.player-pill:hover  { transform: scale(1.08); box-shadow: 0 0 0 1.5px rgba(0,0,0,0.2), 0 6px 18px rgba(0,0,0,0.45); }
.player-pill:active { cursor: grabbing; transform: scale(1.04); }

.pill-pos {
  font-size: 0.46rem;
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-weight: 600;
}
.pill-name {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.pill-total {
  font-size: 0.46rem;
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-weight: 600;
}

/* ── Side panel ── */
.side-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

/* Panel cards */
.bench-container,
.playtime-container,
.goal-log-container {
  background: #fff;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.05);
}
.bench-container h2,
.playtime-container h2,
.goal-log-container h2 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
}

/* Bench */
#bench {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 36px;
  padding: 4px;
  border-radius: 8px;
  border: 2px dashed transparent;
  transition: border-color 0.15s;
}
#bench.drag-over { border-color: #00864b; background: #f0fdf4; }

.bench-pill {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #818cf8, #4f46e5);
  color: white;
  cursor: grab;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  box-shadow: 0 2px 6px rgba(79,70,229,0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.bench-pill:hover  { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(79,70,229,0.4); }
.bench-pill:active { cursor: grabbing; transform: scale(0.97); }
.bench-pill .pill-pos   { font-size: 0.45rem; opacity: 0.8; font-variant-numeric: tabular-nums; font-weight: 600; }
.bench-pill .pill-name  { font-size: 0.78rem; font-weight: 700; }
.bench-pill .pill-total { font-size: 0.45rem; opacity: 0.8; font-variant-numeric: tabular-nums; font-weight: 600; }
.bench-hint { font-size: 0.7rem; margin: 5px 0 0; color: #9ca3af; }

/* ── Play time table ── */
#playtime-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
#playtime-table th {
  text-align: left;
  font-size: 0.65rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 6px 5px;
  border-bottom: 2px solid #f3f4f6;
}
#playtime-table td { padding: 5px 6px; border-bottom: 1px solid #f3f4f6; }
#playtime-table tr:last-child td { border-bottom: none; }

#playtime-table tr.urgent { position: relative; }
#playtime-table tr.urgent td {
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 700;
}
#playtime-table tr.urgent td:first-child { border-left: 3px solid #dc2626; padding-left: 4px; }
#playtime-table tr.met-required td { background: #f0fdf4; }
#playtime-table tr.met-required td:first-child { border-left: 3px solid #00864b; padding-left: 4px; }
#playtime-table td.time-met   { color: #00864b; font-weight: 700; }
#playtime-table td.time-short { color: #b91c1c; }

.playtime-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.playtime-header h2 { margin: 0; }
.required-pct-label {
  font-size: 0.75rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 3px;
}
.required-pct-label input {
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  padding: 2px 4px;
  font-size: 0.75rem;
  text-align: center;
  width: 44px;
}

/* ── Goal log ── */
.goal-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.82rem;
}
.goal-row:last-child { border-bottom: none; }
.goal-team-badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}
.goal-us .goal-team-badge   { background: #d1fae5; color: #065f46; }
.goal-them .goal-team-badge { background: #fee2e2; color: #991b1b; }
.goal-undo {
  margin-left: auto;
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.72rem;
  padding: 2px 7px;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.goal-undo:hover { border-color: #dc2626; color: #dc2626; }

/* ── Picker list (position tap-to-assign) ── */
.pos-picker-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 280px; overflow-y: auto; }
.picker-player-btn {
  width: 100%; padding: 0.65rem 0.9rem; text-align: left;
  background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px;
  font-size: 0.95rem; font-weight: 500; cursor: pointer; color: #111;
  transition: background 0.1s, border-color 0.1s;
}
.picker-player-btn:hover, .picker-player-btn:active { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }

/* ── Lineup player list (stats page) ── */
.lineup-player-list {
  font-size: 0.88rem;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.5;
  margin-bottom: 0.4rem;
}

/* ── Long-press bench flash ── */
@keyframes bench-flash {
  0%   { transform: scale(1);    opacity: 1; }
  40%  { transform: scale(0.82); opacity: 0.6; }
  100% { transform: scale(1);    opacity: 1; }
}
.pill-benching { animation: bench-flash 0.3s ease; }

/* ── Utility ── */
.dim { color: #aaa; }
.btn-link {
  background: none; border: none; padding: 0;
  color: #00864b; font-size: inherit; cursor: pointer;
  font-family: inherit; text-decoration: underline;
  text-decoration-color: rgba(0,134,75,0.35);
}
.btn-link:hover { color: #006b3c; }
.btn-link-danger {
  background: none; border: none; padding: 0;
  color: #b91c1c; font-size: inherit; cursor: pointer;
  text-decoration: underline; font-family: inherit;
}
.btn-link-danger:hover { color: #7f1d1d; }

.late-badge {
  font-size: 0.68rem;
  color: #9a3412;
  background: #ffedd5;
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 4px;
  font-weight: 600;
}

/* ── Stats page ── */
.stats-page { max-width: 820px; margin: 0 auto; padding: 1rem; }
.stats-nav {
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1rem;
}
.stats-nav h2 { margin: 0; font-size: 1.05rem; flex: 1; }
.stats-nav select {
  padding: 0.35rem 0.5rem; border: 1px solid #e5e7eb;
  border-radius: 7px; font-size: 0.82rem;
}
.stat-section {
  background: #fff; border-radius: 12px; padding: 1rem;
  margin-bottom: 1rem; box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  border: 1px solid rgba(0,0,0,0.04);
}
.stat-section h3 { margin: 0 0 0.75rem; font-size: 0.9rem; }
.stat-section h3 small { font-weight: normal; color: #888; font-size: 0.78rem; }
.stat-hint { font-size: 0.72rem; color: #aaa; margin: 6px 0 0; }
.stat-section table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.stat-section th {
  text-align: left; font-size: 0.65rem; font-weight: 700; color: #9ca3af;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 6px; border-bottom: 2px solid #f3f4f6;
}
.stat-section td { padding: 5px 6px; border-bottom: 1px solid #f3f4f6; }
.stat-section tr:last-child td { border-bottom: none; }

.lineup-game { margin-bottom: 1.25rem; }
.lineup-game h4 {
  margin: 0 0 0.5rem; font-size: 0.82rem; color: #666;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.lineup-goal-card {
  border-left: 4px solid #e5e7eb; padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem; border-radius: 0 8px 8px 0; background: #fafafa;
}
.lineup-goal-card.goal-us   { border-color: #00864b; }
.lineup-goal-card.goal-them { border-color: #dc2626; }
.goal-header { font-size: 0.85rem; margin-bottom: 4px; }
.lineup-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.lineup-chip {
  font-size: 0.7rem; background: #e0e7ff; color: #3730a3;
  padding: 2px 7px; border-radius: 999px;
}
.defense-note { font-size: 0.72rem; color: #888; margin-top: 4px; }

/* ── Stat summary bar ── */
.stat-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.05);
  min-width: 90px;
  text-align: center;
  flex: 1;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.12s, box-shadow 0.12s;
}
a.stat-card:hover { border-color: #00864b; box-shadow: 0 2px 16px rgba(0,134,75,0.14); cursor: pointer; }
.stat-card-active { border-color: #00864b !important; box-shadow: 0 2px 16px rgba(0,134,75,0.18) !important; background: #f0fdf4 !important; }
.stat-card-active .stat-card-label { color: #00864b; }

/* ── Result games table ── */
.result-games-table { width: 100%; border-collapse: collapse; }
.result-games-table th, .result-games-table td { padding: 0.45rem 0.6rem; text-align: left; font-size: 0.88rem; border-bottom: 1px solid #f3f4f6; }
.result-games-table th { font-size: 0.75rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.04em; }
.result-games-table .score-cell { font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-card-num {
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #00864b;
  line-height: 1.1;
}
.stat-card-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 3px;
}

/* ── Formation grid ── */
.formation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-top: 0.5rem;
}
.formation-card {
  background: #fff;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.05);
}
.formation-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.formation-meta {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-bottom: 6px;
}
.formation-stats {
  display: flex;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
}
.formation-stat-for { color: #00864b; }
.formation-stat-against { color: #dc2626; }
.formation-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

/* ── Player stat cards (player_stats page) ── */
.player-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .controls-bar { flex-direction: column; border-radius: 12px; }
  .ctrl-section { border-right: none; border-bottom: 1px solid #f0f0f0; }
  .ctrl-section:last-child { border-bottom: none; }
  .ctrl-score { background: #fafafa; }
  .ctrl-score-num { font-size: 2.5rem; }
  .ctrl-clock-row { flex-wrap: wrap; }
}

@media (max-width: 620px) {
  .layout { flex-direction: column; }
  #field { width: 100%; max-width: 360px; margin: 0 auto; }
}

/* ── Auth pages ── */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 1rem;
}
.auth-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  padding: 2rem;
  width: 100%;
  max-width: 380px;
}
.auth-card h1 { margin: 0 0 1.25rem; font-size: 1.4rem; }
.auth-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

/* ── Admin page ── */
.admin-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
.admin-page h1 { margin: 0 0 1.25rem; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}
.admin-table th, .admin-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}
.admin-table th { background: #f8f9fa; font-weight: 600; color: #374151; }
.admin-table tr:last-child td { border-bottom: none; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-admin   { background: #dbeafe; color: #1d4ed8; }
.badge-active  { background: #dcfce7; color: #15803d; }
.badge-inactive { background: #f3f4f6; color: #6b7280; }

/* ── Navbar username ── */
.navbar .dim { color: rgba(255,255,255,0.65); }

/* ── Absent container ── */
.absent-container {
  background: #fff;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.absent-container h2 { margin: 0 0 0.5rem; font-size: 1rem; color: #6b7280; }
#absent {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 2rem;
}

/* ── Absent pill ── */
.absent-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.82rem;
  color: #6b7280;
  cursor: grab;
  user-select: none;
  white-space: nowrap;
}
.absent-pill:active { cursor: grabbing; }

/* ── Account page ── */
.account-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

/* ── Emulation banner ── */
.emulation-banner {
  background: #7c3aed;
  color: #fff;
  text-align: center;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.emulation-stop {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  padding: 0.15rem 0.65rem;
  text-decoration: none;
  font-size: 0.82rem;
  white-space: nowrap;
}
.emulation-stop:hover { background: rgba(255,255,255,0.35); }

/* ── Admin new-user banner ── */
.admin-new-user-banner {
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.admin-generated-password {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0 0.25rem;
  font-size: 1rem;
}
.admin-generated-password code {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  font-family: monospace;
}

/* ── Presence dot ── */
.presence-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.presence-online  { background: #16a34a; box-shadow: 0 0 0 2px #dcfce7; }
.presence-recent  { background: #d97706; box-shadow: 0 0 0 2px #fef3c7; }
.presence-offline { background: #d1d5db; }

/* ── Landing page ── */
.landing-hero {
  display: flex;
  align-items: center;
  gap: 2rem;
  max-width: 1000px;
  margin: 3rem auto 0;
  padding: 0 1.5rem 3rem;
}
.landing-hero-inner {
  flex: 1;
  min-width: 0;
}
.landing-badge {
  display: inline-block;
  background: #dcfce7;
  color: #15803d;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.landing-title {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 1rem;
  color: #111827;
  letter-spacing: -0.02em;
}
.landing-sub {
  font-size: 1.05rem;
  color: #4b5563;
  line-height: 1.65;
  margin: 0 0 1.75rem;
  max-width: 460px;
}
.landing-ctas {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.landing-btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 2rem;
  border-radius: 999px;
  background: #00864b;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(0,134,75,0.35);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.landing-btn-primary:hover {
  background: #006b3c;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(0,134,75,0.45);
}

/* Mini field preview */
.landing-field-preview {
  flex-shrink: 0;
  width: 220px;
}
.lf-field {
  position: relative;
  width: 220px;
  height: 310px;
  background: linear-gradient(175deg, #2da84d 0%, #1b6b32 100%);
  border-radius: 14px;
  border: 3px solid rgba(255,255,255,0.85);
  box-shadow: 0 8px 30px rgba(0,0,0,0.22);
  overflow: hidden;
}
.lf-midline {
  position: absolute;
  top: 50%; left: 0; width: 100%; height: 0;
  border-top: 2px solid rgba(255,255,255,0.5);
}
.lf-circle {
  position: absolute;
  top: 50%; left: 50%;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  transform: translate(-50%, -50%);
}
.lf-box {
  position: absolute;
  width: 55%; left: 22.5%;
  height: 20%;
  border: 2px solid rgba(255,255,255,0.55);
}
.lf-box-top    { top: 0; border-top: none; }
.lf-box-bottom { bottom: 0; border-bottom: none; }
.lf-pill {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
}

/* Features row */
.landing-features {
  display: flex;
  gap: 1.25rem;
  max-width: 1000px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
  flex-wrap: wrap;
}
.landing-feature-card {
  flex: 1;
  min-width: 220px;
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  border: 1px solid rgba(0,0,0,0.05);
}
.landing-feature-icon {
  font-size: 1.75rem;
  margin-bottom: 0.65rem;
}
.landing-feature-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}
.landing-feature-card p {
  margin: 0;
  font-size: 0.88rem;
  color: #6b7280;
  line-height: 1.6;
}

@media (max-width: 700px) {
  .landing-hero { flex-direction: column; margin-top: 2rem; }
  .landing-field-preview { display: none; }
  .landing-title { font-size: 2rem; }
}
