/* ============================================================
   DinkBook design system
   Palette: court green + pickle lime on warm chalk
   Type: Plus Jakarta Sans · scale 12/14/16/20/24/32 · 8px grid
   ============================================================ */

:root {
  /* brand */
  --green: #1f3a2e;
  --green-soft: #2c5243;
  --ink: #17211b;
  --lime: #b5e048;
  --lime-dark: #93bd2f;
  --lime-tint: #f2f9dd;
  --coral: #e8734a;
  --coral-tint: #fdeee7;

  /* neutrals */
  --bg: #f7f6f1;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --text: #1b211d;
  --text-2: #5c6660;
  --text-3: #98a19b;
  --border: #e7e5da;
  --border-strong: #d5d3c6;

  /* status */
  --ok-text: #166534;
  --ok-bg: #dcfce7;
  --warn-text: #92600a;
  --warn-bg: #fdf0d2;
  --bad-text: #b91c1c;
  --bad-bg: #fee2e2;
  --mute-text: #57534e;
  --mute-bg: #eceae3;

  /* type scale */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 20px;
  --fs-xl: 24px;
  --fs-2xl: 32px;

  /* layout */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --sidebar-w: 236px;
  --shadow: 0 1px 2px rgba(23, 33, 27, 0.05);
  --shadow-lg: 0 8px 24px rgba(23, 33, 27, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Plus Jakarta Sans",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

h1 {
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h2 {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

h3 {
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.35;
}

h4 {
  font-size: var(--fs-sm);
  font-weight: 600;
}

p,
li {
  font-size: var(--fs-sm);
  color: var(--text-2);
}

small {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

/* ---------- base controls ---------- */

button {
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.08s ease;
}

button:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--text-3);
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  width: 100%;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 58, 46, 0.12);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  accent-color: var(--green);
}

input[type="file"] {
  padding: 8px;
  background: var(--surface-2);
}

label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  margin: var(--space-2) 0 6px;
}

label:first-child {
  margin-top: 0;
}

/* ============================================================
   App shell
   ============================================================ */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.container {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-3) 96px;
}

/* ---------- sidebar (owner & admin) ---------- */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--green);
  color: #e8efe8;
  display: flex;
  flex-direction: column;
  padding: var(--space-2);
  position: sticky;
  top: 0;
  height: 100vh;
}

body.role-player .sidebar {
  display: none;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 18px;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--lime);
  color: var(--green);
  font-weight: 700;
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo .logo-word {
  font-weight: 700;
  font-size: var(--fs-md);
  color: #ffffff;
  letter-spacing: -0.02em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #c3d0c6;
  font-weight: 600;
  font-size: var(--fs-sm);
}

.side-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #ffffff;
}

.side-btn.active {
  background: var(--lime);
  color: var(--green);
}

.side-btn svg {
  flex-shrink: 0;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 8px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-facility {
  font-size: var(--fs-xs);
  color: #9fb0a3;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 12px var(--space-3);
}

.logo {
  display: flex;
  align-items: center;
  gap: 1px;
}

.logo-word {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.03em;
  color: var(--green);
}

.logo-book-icon {
  margin-left: 4px;
  flex-shrink: 0;
}

body.role-owner .topbar .logo .logo-word,
body.role-admin .topbar .logo .logo-word,
body.role-owner .topbar .logo .logo-book-icon,
body.role-admin .topbar .logo .logo-book-icon {
  display: none;
}

.role-label {
  margin-left: 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-2);
  background: var(--mute-bg);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

body.role-owner .role-label,
body.role-admin .role-label {
  margin-left: 0;
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-btn {
  background: transparent;
  border: none;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text-2);
  padding: 8px 14px;
  border-radius: 999px;
}

.nav-btn:hover:not(:disabled) {
  background: var(--mute-bg);
  border: none;
  color: var(--text);
}

.nav-btn.active {
  background: var(--green);
  color: #ffffff;
}

.right-menu {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.account-wrapper {
  position: relative;
}

.bell-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  padding: 0;
}

.bell-badge {
  position: absolute;
  top: 0;
  right: -2px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
}

.profile-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  padding: 0;
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 60;
}

.account-menu.show {
  display: block;
}

.account-menu-title {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-3);
  padding: 6px 10px 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-option {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.role-option:hover:not(:disabled) {
  background: var(--lime-tint);
  border: none;
}

/* ---------- bottom nav (player mobile) ---------- */

.bottom-nav {
  display: none;
}

/* ============================================================
   Shared components
   ============================================================ */

.page-header {
  margin-bottom: var(--space-3);
}

.page-header p {
  margin-top: 4px;
  max-width: 560px;
}

.small-label {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lime-dark);
  margin-bottom: 4px;
}

.section-heading {
  margin: var(--space-3) 0 var(--space-2);
}

.section-heading:first-child {
  margin-top: 0;
}

.section-heading p {
  margin-top: 2px;
}

.back-btn {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-weight: 600;
  padding: 4px 0;
  margin-bottom: var(--space-2);
}

.back-btn:hover:not(:disabled) {
  background: transparent;
  border: none;
  color: var(--green);
}

.save-btn {
  background: var(--green);
  color: #ffffff;
  border-color: var(--green);
  margin-top: var(--space-2);
  padding: 11px 20px;
}

.save-btn:hover:not(:disabled) {
  background: var(--green-soft);
  border-color: var(--green-soft);
}

.approve-btn {
  background: var(--ok-bg);
  color: var(--ok-text);
  border-color: transparent;
}

.approve-btn:hover:not(:disabled) {
  background: #c8f5d5;
  border-color: transparent;
}

.reject-btn {
  background: var(--bad-bg);
  color: var(--bad-text);
  border-color: transparent;
}

.reject-btn:hover:not(:disabled) {
  background: #fccaca;
  border-color: transparent;
}

.small-table-btn,
.mini-action-btn {
  font-size: var(--fs-xs);
  padding: 5px 10px;
}

.small-table-btn.danger {
  color: var(--bad-text);
  border-color: var(--bad-bg);
}

.empty-state {
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-3);
  margin: var(--space-3) 0;
}

.empty-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: var(--space-1);
}

.empty-state h2 {
  margin-bottom: 4px;
}

.empty-action-btn {
  margin-top: var(--space-2);
  background: var(--green);
  color: #ffffff;
  border-color: var(--green);
}

.empty-mini {
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--text-3);
  text-align: center;
}

/* ---------- cards ---------- */

.form-card,
.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow);
}

.form-card textarea {
  resize: vertical;
}

.file-note {
  display: block;
  margin-top: 6px;
}

/* ---------- KPI cards ---------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  box-shadow: var(--shadow);
}

.kpi-card span {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.kpi-card strong {
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  word-break: break-word;
}

.kpi-card.kpi-warning {
  background: var(--warn-bg);
  border-color: transparent;
}

.kpi-card.kpi-warning span,
.kpi-card.kpi-warning strong {
  color: var(--warn-text);
}

/* ---------- status pills ---------- */

.status-pill {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pill.pending,
.status-pill.waiting-list {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.status-pill.confirmed,
.status-pill.approved,
.status-pill.completed,
.status-pill.paid {
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid rgba(22, 101, 52, 0.14);
}

.status-pill.rejected,
.status-pill.not-paid,
.status-pill.expired-pending {
  background: var(--bad-bg);
  color: var(--bad-text);
  border: 1px solid rgba(185, 28, 28, 0.14);
}

.status-pill.cancelled {
  background: var(--mute-bg);
  color: var(--mute-text);
}

.paid-mark,
.payment-status-pill.paid {
  display: inline-block;
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid rgba(22, 101, 52, 0.14);
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 800;
  font-size: var(--fs-xs);
  line-height: 1.2;
  white-space: nowrap;
}

.not-paid-mark,
.payment-status-pill.not-paid {
  display: inline-block;
  background: var(--bad-bg);
  color: var(--bad-text);
  border: 1px solid rgba(185, 28, 28, 0.14);
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 800;
  font-size: var(--fs-xs);
  line-height: 1.2;
  white-space: nowrap;
}

.payment-status-pill {
  margin: 2px 0;
}

.payment-method-text,
.payment-amount-text {
  display: block;
  color: var(--text-2);
  font-size: var(--fs-xs);
  margin-top: 2px;
}

.payment-cell-paid {
  border-color: rgba(22, 101, 52, 0.22) !important;
  background: #f3fbf5 !important;
}

.payment-cell-not-paid {
  border-color: rgba(185, 28, 28, 0.26) !important;
  background: #fff7f7 !important;
}

.proof-link {
  color: var(--green);
  font-weight: 600;
}

.ref-code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.92em;
  font-weight: 700;
  background: var(--lime-tint);
  color: var(--green);
  border-radius: 6px;
  padding: 1px 7px;
  letter-spacing: 0.03em;
}

/* ---------- tables ---------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  min-width: 640px;
}

.data-table th {
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-2);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--surface-2);
}

.data-table td strong {
  color: var(--text);
}

.table-actions button {
  margin: 2px 4px 2px 0;
}

/* owner bookings list (grid rows) */

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-row {
  display: grid;
  grid-template-columns: 1fr 2.2fr 0.9fr 1.1fr;
  gap: var(--space-2);
  padding: var(--space-2);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-2);
  align-items: start;
}

.table-row:last-child {
  border-bottom: none;
}

.table-row.table-head {
  background: var(--surface-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  padding: 10px var(--space-2);
}

.table-row > span:first-child {
  font-weight: 600;
  color: var(--text);
}

.owner-booking-row-highlight {
  background: var(--lime-tint);
  transition: background 0.4s ease;
}

/* ---------- event type pill ---------- */

.event-type-pill {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  background: var(--green);
  color: var(--lime);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 6px;
}

/* ---------- payment info card ---------- */

.payment-info-card {
  background: var(--lime-tint);
  border: 1px solid #dcecb1;
  border-radius: var(--radius);
  padding: var(--space-2);
  margin: var(--space-1) 0;
}

.payment-info-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: var(--fs-sm);
}

.payment-info-card p {
  font-size: var(--fs-sm);
  margin: 2px 0;
}

.payment-qr-img {
  width: 150px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: var(--space-1) 0;
  background: #fff;
}

.ref-code-line {
  margin-top: var(--space-1);
}

.payment-warning {
  color: var(--bad-text);
  font-weight: 600;
}

/* ---------- toasts ---------- */

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 440px);
}

.toast {
  background: var(--ink);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: var(--radius);
  padding: 12px 18px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  max-width: 100%;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-left: 4px solid var(--lime);
}

.toast-error {
  background: var(--bad-text);
  border-left: 4px solid #fff;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1023px) {
  .app-shell {
    flex-direction: column;
  }

  /* Owner/admin menu: a compact grid that shows every item at one
     glance (no horizontal scrolling) and scrolls away with the page
     so it never covers the content. */
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    display: block;
    padding: 8px 10px;
  }

  .sidebar-logo {
    padding: 0 0 6px;
  }

  .sidebar-logo .logo-word {
    display: none;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  /* Groups flatten out: their children join the grid directly. The
     .sidebar-nav prefix raises specificity so these beat the desktop
     `.side-submenu { display: none }` rule regardless of source order. */
  .sidebar-nav .side-group,
  .sidebar-nav .side-submenu {
    display: contents;
  }

  .sidebar-nav .side-group-toggle {
    display: none;
  }

  .side-btn {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 2px;
    white-space: normal;
    text-align: center;
    min-width: 0;
  }

  .side-btn span {
    font-size: 10px;
    line-height: 1.15;
    overflow: hidden;
  }

  .sidebar-foot {
    display: none;
  }

  body.role-owner .topbar,
  body.role-admin .topbar {
    position: static;
  }
}

@media (max-width: 640px) {
  .container {
    padding: var(--space-2) var(--space-2) 96px;
  }

  .topbar {
    padding: 10px var(--space-2);
  }

  body.role-player .topbar .nav {
    display: none;
  }

  h1 {
    font-size: var(--fs-lg);
  }

  .table-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .table-row.table-head {
    display: none;
  }

  body.role-player .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }

  .bottom-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: transparent;
    border: none;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    padding: 6px 4px;
    border-radius: var(--radius-sm);
  }

  .bottom-nav-btn:hover:not(:disabled) {
    background: transparent;
    border: none;
  }

  .bottom-nav-btn.active {
    color: var(--green);
  }
}

/* ============================================================
   Auth, profiles, and platform admin additions
   ============================================================ */

.auth-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: var(--space-4);
}

.terms-check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 4px;
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
}

.terms-check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--green);
}

.terms-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--green);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
}

.terms-box {
  margin-top: 10px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--mute-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: var(--fs-xs);
  line-height: 1.6;
}

.terms-box h3 {
  margin: 0 0 8px;
  font-size: var(--fs-sm);
}

.terms-box ol {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.auth-card {
  width: min(100%, 520px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-lg);
}

.wide-auth-card {
  width: min(100%, 820px);
}

.auth-card h1 {
  margin-bottom: 4px;
}

.auth-card p {
  margin-bottom: var(--space-2);
}

.google-btn {
  width: 100%;
  margin-top: var(--space-1);
  background: var(--surface);
  border-color: var(--border-strong);
}

.auth-switch-box,
.demo-login-box {
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

.auth-switch-box button,
.demo-login-box button {
  margin: 4px 4px 0 0;
}

.auth-two-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.profile-notice-box,
.subscription-mini-box {
  background: var(--lime-tint);
  border: 1px solid #dcecb1;
  border-radius: var(--radius);
  padding: var(--space-1) var(--space-2);
  margin-top: var(--space-1);
}

.profile-notice-box strong,
.profile-notice-box span,
.profile-notice-box small,
.subscription-mini-box strong {
  display: block;
}

.readonly-profile-input,
input[readonly] {
  background: var(--surface-2);
  color: var(--text-2);
}

.profile-admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow);
  margin-bottom: var(--space-3);
}

.owner-calendar-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.owner-calendar-controls select {
  width: auto;
  min-width: 180px;
}

.selected-court-banner {
  background: var(--lime-tint);
  border: 1px solid #dcecb1;
  color: var(--green);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: var(--space-2);
  font-size: var(--fs-sm);
}

.selected-court-banner span {
  color: var(--text-2);
  margin-left: 8px;
}

@media (max-width: 640px) {
  .auth-card {
    padding: var(--space-3);
  }

  .auth-two-col {
    grid-template-columns: 1fr;
  }

  .owner-calendar-controls,
  .owner-calendar-view-buttons {
    width: 100%;
  }

  .owner-calendar-controls select,
  .owner-calendar-controls button,
  .owner-calendar-view-buttons button {
    flex: 1;
  }
}

/* ---------- auth/account refinements ---------- */
.account-menu-user {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.account-menu-user strong,
.account-menu-user small {
  display: block;
}

.google-btn {
  width: 100%;
  margin-top: var(--space-1);
  background: #ffffff;
  border-color: var(--border-strong);
}

.auth-page {
  display: flex;
  justify-content: center;
}

.auth-card {
  width: min(100%, 460px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow);
}

.wide-auth-card {
  width: min(100%, 820px);
}

.auth-two-col,
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2);
}

.plan-card,
.plan-preview-box,
.subscription-access-card,
.subscription-mini-box,
.profile-notice-box,
.profile-admin-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2);
}

.auth-switch-box {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

.plan-grid {
  margin-bottom: var(--space-3);
}

.plan-card {
  position: relative;
}

.plan-card.popular {
  border-color: var(--lime-dark);
  background: var(--lime-tint);
}

.plan-card strong {
  display: block;
  font-size: var(--fs-xl);
  color: var(--green);
  margin: 4px 0;
}

.plan-card strong small {
  font-size: var(--fs-xs);
  margin-left: 2px;
}

.plan-card ul {
  padding-left: 18px;
  margin-top: var(--space-1);
}

.popular-badge {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  background: var(--green);
  color: var(--lime);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 6px;
}

.status-pill.active {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.status-pill.past-due,
.status-pill.unassigned {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.google-btn {
  width: 100%;
  margin-top: 10px;
}
.account-menu-user {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.account-menu-user strong,
.account-menu-user small {
  display: block;
}
.admin-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.single-signup-card {
  grid-template-columns: 1fr;
}
.subscription-access-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow);
}
.subscription-access-card h2 {
  margin-bottom: 4px;
}

/* ============================================================
   Sidebar submenu (Settings & Details group)
   ============================================================ */

.side-group {
  display: flex;
  flex-direction: column;
}

.side-group-toggle {
  position: relative;
}

.side-chevron {
  margin-left: auto;
  transition: transform 0.15s ease;
}

.side-group.open .side-chevron {
  transform: rotate(180deg);
}

.side-group.has-active .side-group-toggle {
  color: #ffffff;
}

.side-submenu {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 4px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  margin-left: 18px;
}

.side-group.open .side-submenu {
  display: flex;
}

.side-sub-btn {
  padding: 8px 10px;
  font-size: 13px;
}

/* ============================================================
   Facility photo gallery with amenity ribbons
   ============================================================ */

.gallery-item {
  position: relative;
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  width: 132px;
  height: 96px;
  flex-shrink: 0;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-ribbon {
  position: absolute;
  left: 0;
  bottom: 8px;
  background: rgba(31, 58, 46, 0.92);
  color: var(--lime);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px 3px 8px;
  border-radius: 0 999px 999px 0;
  letter-spacing: 0.02em;
  max-width: 92%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   Announcements (24-hour notes from court owners)
   ============================================================ */

.announcement-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--lime-tint);
  border: 1px solid #dcecb1;
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  margin-bottom: var(--space-3);
}

.announcement-banner-icon {
  font-size: 22px;
  line-height: 1.2;
}

.announcement-banner strong {
  display: block;
  font-size: var(--fs-sm);
  color: var(--green);
}

.announcement-banner p {
  margin: 2px 0;
  color: var(--text);
  white-space: pre-line;
}

.announcement-snippet {
  background: var(--lime-tint);
  border-radius: var(--radius-sm);
  padding: 6px 10px !important;
  margin: 8px 16px !important;
  font-size: var(--fs-xs) !important;
  color: var(--green) !important;
  font-weight: 600;
}

/* ============================================================
   Notifications, badges, clickable KPI
   ============================================================ */

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.side-btn .nav-badge {
  margin-left: auto;
}

.kpi-clickable {
  cursor: pointer;
  text-align: left;
  font: inherit;
  border: none;
  transition:
    transform 0.08s ease,
    box-shadow 0.15s ease;
}

.kpi-clickable:hover {
  box-shadow: 0 0 0 2px var(--warn-text) inset;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.notification-item.unread {
  background: var(--lime-tint);
  border-color: #dcecb1;
}

.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  margin-top: 6px;
  flex-shrink: 0;
}

.notification-item.unread .notification-dot {
  background: var(--coral);
}

.notification-body p {
  margin: 0;
  color: var(--text);
}

.notification-body small {
  color: var(--text-3);
}

/* ============================================================
   Coming soon (directory)
   ============================================================ */

.coming-soon-badge {
  align-self: flex-start;
  margin: 12px 16px 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--warn-text);
  background: var(--warn-bg);
  border-radius: 999px;
  padding: 2px 10px;
}

.facility-card-coming-soon {
  opacity: 0.92;
}

.facility-image {
  position: relative;
}

.facility-image-ribbon {
  position: absolute;
  top: 10px;
  left: 0;
  background: var(--warn-text);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px 3px 10px;
  border-radius: 0 999px 999px 0;
  letter-spacing: 0.03em;
}

.facility-image-ribbon.open {
  background: var(--ok-text);
}

.facility-image-ribbon.closed {
  background: var(--mute-text);
}

/* ============================================================
   Highlighted open play notes
   ============================================================ */

.open-play-note-highlight {
  display: inline-block;
  background: #fff7d6;
  border-left: 3px solid var(--amber, #eab308);
  border-radius: 0 6px 6px 0;
  padding: 4px 10px;
  margin-top: 4px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #7a5a00;
  line-height: 1.4;
}

/* ============================================================
   Auth pages (login / signup)
   ============================================================ */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-primary-btn {
  width: 100%;
}

.google-g {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  color: #4285f4;
  font-weight: 700;
  margin-right: 6px;
  border: 1px solid var(--border);
}

.auth-switch-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.auth-switch-box strong {
  display: block;
}

.auth-switch-box p {
  margin: 2px 0 0;
  font-size: var(--fs-xs);
}

.auth-secondary-btn {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  white-space: nowrap;
  flex-shrink: 0;
}

.auth-secondary-btn:hover:not(:disabled) {
  background: var(--green-soft);
  border-color: var(--green-soft);
}


/* Grayed capacity input when unlimited is on */
.input-disabled-strong {
  background: var(--mute-bg) !important;
  color: var(--text-3) !important;
  font-style: italic;
  text-decoration: line-through;
}

.hint-muted {
  color: var(--warn-text) !important;
  font-weight: 600;
}

