:root {
  /* Clean white professional palette */
  --page: #ffffff;
  --panel: #f6f7f9;
  --surface: #ffffff;
  --ink: #1f2328;
  --ink2: #656d76;
  --border: #e4e7eb;

  --nav: #ffffff;
  --nav-text: #3a3f45;
  --nav-active-bg: #fef0e5;
  --nav-active: #d9640a;

  --accent: #e8730c;
  --accent-dark: #c85e00;
  --accent-soft: #fef0e5;

  --ok: #1a7a3c;
  --ok-bg: #e6f4ea;
  --ok-tint: #f8fcf9;
  --ok-tint-hover: #f1f8f3;
  --muted: #7a828b;
  --danger: #b3261e;
  --danger-bg: #fce8e6;

  --owner: #b45309;
  --owner-bg: #fef3e2;
  --employee: #6d28d9;
  --employee-bg: #f1ebfd;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 999px;

  --sidebar-width: 260px;
  --shadow-sm: 0 2px 8px rgba(31, 35, 40, 0.06);
  --shadow-md: 0 12px 32px rgba(31, 35, 40, 0.12);
  --shadow-lg: 0 24px 60px rgba(31, 35, 40, 0.18);

  --gradient-brand: radial-gradient(circle at 25% 15%, #e8730c 0%, #c33a1a 55%, #a01e1e 100%);

  --font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

.material-symbols-outlined,
.mi {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  font-weight: 600;
  color: var(--ink);
}

.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--panel);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--nav);
  color: var(--nav-text);
  border-right: 1px solid var(--border);
  box-shadow: 1px 0 0 rgba(31, 35, 40, 0.02), 6px 0 24px -10px rgba(31, 35, 40, 0.14);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  transform: translateX(0);
  transition: transform 0.2s ease;
  z-index: 20;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 72px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo .material-symbols-outlined {
  font-size: 22px;
}

.sidebar-brand-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.sidebar-brand-text span {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink2);
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav li a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  padding: 0 14px;
  color: var(--nav-text);
  font-size: 15px;
  font-weight: 500;
  border-radius: 12px;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav li a .material-symbols-outlined {
  font-size: 22px;
}

.sidebar-nav li a .material-symbols-outlined {
  color: var(--ink2);
}

.sidebar-nav li a:hover {
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
}

.sidebar-nav li.active a {
  background: var(--nav-active-bg);
  color: var(--nav-active);
  font-weight: 600;
}

/* Active item: a short accent bar on the left edge of the pill. */
.sidebar-nav li.active a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  bottom: 11px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--nav-active);
}

.sidebar-nav li.active a .material-symbols-outlined {
  color: var(--nav-active);
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

/* Mobile toggle */
.sidebar-toggle {
  display: none;
}

.topbar {
  display: none;
}

/* Main content */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  padding: var(--space-lg);
}

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

.page-header h1 {
  margin: 0 0 var(--space-xs) 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-header p {
  margin: 0;
  color: var(--ink2);
  font-size: 15px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink2);
  margin-bottom: var(--space-sm);
}

.breadcrumb a {
  color: var(--ink2);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb .material-symbols-outlined {
  font-size: 16px;
}

.id-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

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

.card h2 {
  font-size: 18px;
  margin-top: 0;
}

.card-section-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.card-section-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-section-icon .material-symbols-outlined {
  font-size: 20px;
}

.card-section-header h2 {
  margin: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon .material-symbols-outlined {
  font-size: 26px;
}

.stat-icon-families { background: var(--accent-soft); color: var(--accent); }
.stat-icon-payments { background: var(--employee-bg); color: var(--employee); }
.stat-icon-events { background: var(--owner-bg); color: var(--owner); }
.stat-icon-checkins { background: var(--ok-bg); color: var(--ok); }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  color: var(--ink2);
  margin-top: 2px;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

table.data-table th,
table.data-table td {
  text-align: left;
  padding: 16px var(--space-md);
  border-bottom: 1px solid var(--border);
}

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

table.data-table tbody tr.clickable-row {
  cursor: pointer;
}

/* Paid rows: a barely-there tint plus a thin green accent on the left edge. */
table.data-table tbody tr.row-paid {
  background: var(--ok-tint);
}

table.data-table tbody tr.row-paid > td:first-child {
  box-shadow: inset 3px 0 0 var(--ok);
}

table.data-table tbody tr.row-paid:hover {
  background: var(--ok-tint-hover);
}

table.data-table th {
  color: var(--ink2);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.name-cell {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state {
  color: var(--ink2);
  font-size: 14px;
  padding: var(--space-lg) 0;
  text-align: center;
}

.empty-state .material-symbols-outlined {
  display: block;
  margin: 0 auto var(--space-sm);
  font-size: 32px;
  color: var(--border);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
}

.badge-active { background: var(--ok-bg); color: var(--ok); }
.badge-inactive { background: var(--panel); color: var(--ink2); border: 1px solid var(--border); }
.badge-owner { background: var(--owner-bg); color: var(--owner); }
.badge-employee { background: var(--employee-bg); color: var(--employee); }
.badge-current { background: var(--ok-bg); color: var(--ok); }
.badge-neutral { background: var(--panel); color: var(--ink2); }

.badge-paid {
  background: var(--ok-bg);
  color: var(--ok);
  font-weight: 600;
  font-size: 12.5px;
  padding: 3px 10px 3px 8px;
}

.badge-paid .mi {
  font-size: 15px;
  font-variation-settings: "FILL" 0, "wght" 700, "GRAD" 0, "opsz" 20;
}

.badge-notpaid {
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 12.5px;
  padding: 2px 10px;
  border: 1px solid var(--border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn .material-symbols-outlined {
  font-size: 20px;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(232, 115, 12, 0.28);
}

.btn-primary:hover {
  background: var(--accent-dark);
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(232, 115, 12, 0.34);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--panel);
  text-decoration: none;
}

.btn-lg {
  padding: 15px 28px;
  font-size: 16px;
  border-radius: var(--radius-sm);
}

/* Login page — full split-screen */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--page);
}

.login-split {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.login-brand-panel {
  position: relative;
  flex: 1 1 46%;
  max-width: 620px;
  background: var(--gradient-brand);
  color: #ffffff;
  padding: var(--space-2xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-xl);
  overflow: hidden;
}

.login-brand-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.login-brand-circle.c1 { width: 320px; height: 320px; top: -100px; right: -100px; }
.login-brand-circle.c2 { width: 220px; height: 220px; bottom: -80px; left: -60px; background: rgba(255, 255, 255, 0.06); }
.login-brand-circle.c3 { width: 140px; height: 140px; bottom: 15%; right: 8%; background: rgba(255, 255, 255, 0.07); }

.login-brand-content {
  position: relative;
  z-index: 1;
}

.login-brand-logo {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
  backdrop-filter: blur(4px);
}

.login-brand-logo .material-symbols-outlined {
  font-size: 34px;
}

.login-brand-content h1 {
  color: #ffffff;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--space-sm);
  letter-spacing: -0.01em;
}

.login-brand-tagline {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 var(--space-xl);
  max-width: 420px;
}

.login-feature-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.login-feature-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-feature-icon .material-symbols-outlined {
  font-size: 22px;
}

.login-feature-text {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}

.login-form-panel {
  flex: 1 1 54%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: var(--surface);
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-eyebrow {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 4px;
}

.login-card h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 var(--space-xs) 0;
  letter-spacing: -0.01em;
}

.login-subtitle {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink2);
  font-size: 14px;
  margin-bottom: var(--space-xl);
}

.login-subtitle .material-symbols-outlined {
  font-size: 18px;
}

.login-card form {
  text-align: left;
}

.login-card label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: var(--space-xs);
}

.input-group {
  position: relative;
  margin-bottom: var(--space-lg);
}

.input-group .material-symbols-outlined {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink2);
  font-size: 22px;
}

.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  height: 60px;
  padding: 0 18px 0 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font-family);
  background: var(--surface);
  color: var(--ink);
}

.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.login-card .btn-primary {
  width: 100%;
  justify-content: center;
  height: 56px;
  font-size: 16px;
  margin-top: var(--space-sm);
  border: none;
}

.login-errors {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--danger-bg);
  color: var(--danger);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: var(--space-md);
  text-align: left;
}

.login-footer {
  margin-top: var(--space-xl);
  text-align: center;
  font-size: 13px;
  color: var(--ink2);
}

@media (max-width: 900px) {
  .login-brand-panel {
    display: none;
  }

  .login-form-panel {
    flex: 1 1 100%;
  }
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink2);
  margin-bottom: 4px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font-family);
  background: var(--surface);
  color: var(--ink);
}

.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font-family);
  background: var(--surface);
  color: var(--ink);
  min-height: 110px;
}

/* Icon-inside-field wrapper, usable anywhere in the app */
.icon-field {
  position: relative;
}

.icon-field .field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink2);
  font-size: 20px;
  pointer-events: none;
}

.icon-field input,
.icon-field select,
.icon-field textarea {
  padding-left: 48px;
}

.icon-field.icon-top .field-icon {
  top: 18px;
  transform: none;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23656d76' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-card {
  max-width: 600px;
}

.form-with-preview {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.form-with-preview .preview-col {
  position: sticky;
  top: var(--space-lg);
}

@media (max-width: 900px) {
  .form-with-preview {
    grid-template-columns: 1fr;
  }

  .form-with-preview .preview-col {
    position: static;
  }
}

.amount-field input {
  height: 60px;
  font-size: 26px;
  font-weight: 700;
  color: var(--accent-dark);
}

/* Toggle buttons (Cash / Check radios styled as a segmented control) */
.toggle-group {
  display: flex;
  gap: var(--space-sm);
}

.toggle-option {
  position: relative;
  flex: 1;
}

.toggle-option input[type="radio"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.toggle-option label {
  display: flex;
  height: 56px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink2);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.toggle-option input[type="radio"]:checked + label {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.toggle-option input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Switch toggle (e.g. "Record payment now") */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--panel);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-lg);
}

.switch-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.switch-sublabel {
  font-size: 13px;
  color: var(--ink2);
  margin-top: 2px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 30px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease;
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.switch input:checked + .switch-slider {
  background: var(--accent);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

/* Membership type picker (selectable cards) */
.type-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.type-card {
  position: relative;
}

.type-card input[type="radio"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  z-index: 1;
  cursor: pointer;
}

.type-card label {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-lg);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.type-card-radio-dot {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #ffffff;
}

.type-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.type-card-icon .material-symbols-outlined {
  font-size: 24px;
}

.type-card.owner .type-card-icon { background: var(--owner-bg); color: var(--owner); }
.type-card.employee .type-card-icon { background: var(--employee-bg); color: var(--employee); }

.type-card-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.type-card-sub {
  font-size: 13px;
  color: var(--ink2);
}

.type-card-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 4px;
}

.type-card input[type="radio"]:checked + label {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(232, 115, 12, 0.12);
}

.type-card input[type="radio"]:checked + label .type-card-radio-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 4px #ffffff;
}

/* Live membership card preview */
.membership-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--gradient-brand);
  color: #ffffff;
  padding: var(--space-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.membership-card::before {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  top: -70px;
  right: -70px;
}

.membership-card-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.membership-card-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.membership-card-logo .material-symbols-outlined {
  font-size: 20px;
}

.membership-card-org {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.9);
}

.membership-card-type {
  position: relative;
  z-index: 1;
  display: inline-flex;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

.membership-card-name {
  position: relative;
  z-index: 1;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  min-height: 28px;
  word-break: break-word;
}

.membership-card-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.membership-card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2px;
}

.membership-card-value {
  font-size: 14px;
  font-weight: 600;
}

.membership-card-amount {
  font-size: 26px;
  font-weight: 700;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.form-errors {
  background: var(--danger-bg);
  color: var(--danger);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: var(--space-md);
}

.help-text {
  font-size: 12px;
  color: var(--ink2);
  margin-top: 4px;
}

.readonly-field {
  padding: 10px 12px;
  background: var(--panel);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink2);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid transparent;
}

.btn-danger:hover {
  background: var(--danger);
  color: #ffffff;
  text-decoration: none;
}

/* Search + filter chips */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-md);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-box input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-family: var(--font-family);
  background: var(--surface);
  color: var(--ink);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-box .material-symbols-outlined {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink2);
  font-size: 18px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink2);
}

.chip:hover {
  text-decoration: none;
  background: var(--panel);
}

.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Family detail */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.detail-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
}

.info-item .info-label {
  font-size: 12px;
  color: var(--ink2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.info-item .info-value {
  font-size: 15px;
  color: var(--ink);
}

.notes-box {
  white-space: pre-wrap;
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  font-size: 14px;
  color: var(--ink);
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink2);
  margin: var(--space-md) 0;
}

.total-row #total-display {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-dark);
}

/* Receipt */
.receipt-page {
  max-width: 520px;
  margin: 0 auto;
}

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

.receipt-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.receipt-logo .material-symbols-outlined {
  font-size: 28px;
}

.receipt-title {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.receipt-title h1 {
  font-size: 21px;
  margin: 0 0 4px;
}

.receipt-title p {
  margin: 0;
  color: var(--ink2);
  font-size: 14px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 15px;
}

.receipt-row.total {
  font-weight: 700;
  font-size: 19px;
  border-bottom: none;
  border-top: 2px solid var(--ink);
  margin-top: 8px;
  padding-top: 14px;
  color: var(--accent-dark);
}

.receipt-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

@media print {
  .sidebar, .topbar, .page-header, .receipt-actions, .no-print {
    display: none !important;
  }

  .main {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  body {
    background: #ffffff;
  }

  .receipt-card {
    border: none;
    box-shadow: none;
  }

  .receipt-logo,
  .receipt-row.total {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  @page {
    size: A4;
    margin: 20mm;
  }
}

/* Mobile */
@media (max-width: 720px) {
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--nav);
    border-bottom: 1px solid var(--border);
    color: var(--ink);
    padding: var(--space-sm) var(--space-md);
    position: sticky;
    top: 0;
    z-index: 30;
  }

  .topbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    font-size: 15px;
    color: var(--ink);
  }

  .topbar-brand .material-symbols-outlined {
    color: var(--accent);
  }

  .sidebar-toggle {
    display: inline-flex;
    background: none;
    border: none;
    color: var(--ink);
    cursor: pointer;
    padding: var(--space-xs);
  }

  .sidebar-toggle .material-symbols-outlined {
    font-size: 26px;
  }

  .sidebar {
    transform: translateX(-100%);
    top: 52px;
    box-shadow: var(--shadow-md);
  }

  #sidebar-open:checked ~ .sidebar {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
    padding: var(--space-md);
  }

  .type-picker {
    grid-template-columns: 1fr;
  }

  .page-header.detail-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   Hand-built premium form system (login, add/edit member,
   collect membership, record event payment)
   ============================================================ */

/* icon-in-field inputs */
.f{margin-bottom:18px}
.f label,.lbl{display:block;font-size:13.5px;font-weight:600;color:#5b636c;margin-bottom:9px}
.lbl .req{color:#b3261e}
.inp{display:flex;align-items:center;gap:12px;border:1.5px solid #e3e6ea;border-radius:12px;padding:0 16px;background:#fcfcfd}
.inp:focus-within{border-color:#e8730c;background:#fff;box-shadow:0 0 0 4px #fef0e5}
.inp .mi{font-size:22px;color:#9aa0a6}
.inp input,.inp select,.inp textarea{border:0;background:transparent;flex:1;height:52px;font-size:16px;font-family:inherit;color:#1a1d21;outline:0}
.inp.area{align-items:flex-start;padding-top:14px}
.inp.area textarea{height:88px;resize:vertical}
.inp.amt input{height:60px;font-size:26px;font-weight:800;color:#c85e00}
.hint{font-size:12.5px;color:#5b636c;margin-top:6px}

/* type picker cards */
.types{display:flex;flex-direction:column;gap:12px;margin-bottom:22px}
.typecard{border:2px solid #e3e6ea;border-radius:14px;padding:16px 18px;display:flex;align-items:center;gap:15px;cursor:pointer}
.typecard:hover{border-color:#d5b48c;background:#fffdf9}
.typecard.on{border-color:#e8730c;background:#fef0e5}
.typecard .ti{width:48px;height:48px;border-radius:13px;display:flex;align-items:center;justify-content:center;flex:none}
.typecard .ti .mi{font-size:26px}
.typecard .tt{flex:1}.typecard .tt b{font-size:16px;font-weight:700;display:block}.typecard .tt span{font-size:13px;color:#5b636c}
.typecard .price{font-size:21px;font-weight:800}
.typecard input[type=radio]{width:22px;height:22px;accent-color:#e8730c}

/* segmented toggle */
.seg{display:flex;border:1.5px solid #e3e6ea;border-radius:12px;overflow:hidden;width:100%}
.seg label{flex:1;height:50px;display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:500;cursor:pointer;background:#fff}
.seg label+label{border-left:1.5px solid #e3e6ea}
.seg input{display:none}
.seg input:checked+span{color:#c85e00}
.seg label.on,.seg input:checked~label{background:#fef0e5}
.seg .mi{font-size:21px}

/* cards */
.card{background:#fff;border:1px solid #e3e6ea;border-radius:18px;padding:26px 24px;box-shadow:0 2px 8px rgba(0,0,0,.03);margin-bottom:20px}
.card h2{font-size:17px;font-weight:700;display:flex;align-items:center;gap:11px;margin-bottom:5px}
.card h2 .ci{width:34px;height:34px;border-radius:10px;background:#fef0e5;display:flex;align-items:center;justify-content:center}
.card h2 .ci .mi{font-size:21px;color:#e8730c}
.card .csub{font-size:13.5px;color:#5b636c;margin-bottom:20px}

/* live membership card */
.memcard{border-radius:18px;padding:24px;color:#fff;background:linear-gradient(135deg,#c33a1a,#a01e1e);box-shadow:0 14px 30px -14px rgba(160,30,30,.6)}
.memcard .mtop{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}
.memcard .mtype{font-size:12px;font-weight:700;background:rgba(255,255,255,.2);padding:6px 12px;border-radius:20px}
.memcard .mname{font-size:20px;font-weight:700;margin-bottom:6px}
.memcard .morg{font-size:12.5px;opacity:.85;margin-bottom:22px}
.memcard .mbot{display:flex;justify-content:space-between;align-items:flex-end}
.memcard .mamt{font-size:22px;font-weight:800}

/* big buttons */
.btn-lg{height:54px;padding:0 30px;border:0;border-radius:14px;font-size:16px;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;gap:10px}
.btn-lg.primary{background:#e8730c;color:#fff;box-shadow:0 10px 24px -10px rgba(232,115,12,.55)}
.btn-lg.ghost{background:#fff;border:1.5px solid #e3e6ea;color:#1a1d21}

/* LOGIN split */
.loginwrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:32px 20px;background:radial-gradient(900px 500px at 15% -10%,#fdebdc 0%,rgba(253,235,220,0) 60%),#f4f5f7}
.loginbox{display:grid;grid-template-columns:1fr 1fr;max-width:1000px;width:100%;min-height:580px;border-radius:24px;overflow:hidden;box-shadow:0 30px 70px -30px rgba(160,30,30,.4)}
.brandpanel{position:relative;overflow:hidden;background:radial-gradient(1000px 500px at 20% 0%,#e8730c,#c33a1a 55%,#a01e1e 100%);color:#fff;padding:60px 52px;display:flex;flex-direction:column}
.brandpanel::after{content:"";position:absolute;right:-120px;bottom:-120px;width:340px;height:340px;border-radius:50%;background:radial-gradient(circle,rgba(255,255,255,.12),rgba(255,255,255,0) 70%);pointer-events:none}
.brandpanel > *{position:relative;z-index:1}
.brandpanel .blogo{width:70px;height:70px;border-radius:18px;background:rgba(255,255,255,.18);display:flex;align-items:center;justify-content:center;margin-bottom:26px}
.brandpanel .blogo .mi{font-size:42px}
.loginbox .brandpanel h1{font-size:34px;font-weight:800;line-height:1.15;margin:0 0 16px;color:#fff;letter-spacing:-.015em;text-shadow:0 1px 2px rgba(80,10,10,.25)}
.loginbox .brandpanel p{font-size:16.5px;color:#fff;line-height:1.65;max-width:340px;margin:0;opacity:.95}
.bfeatures{margin-top:auto;padding-top:48px;display:flex;flex-direction:column;gap:18px}
.bfeat{display:flex;align-items:center;gap:14px;font-size:15px;font-weight:500;color:#fff}
.bfeat .fi{width:42px;height:42px;border-radius:12px;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.22);display:flex;align-items:center;justify-content:center;flex:none}
.bfeat .fi .mi{font-size:22px}
.formpanel{background:#fff;padding:60px 56px;display:flex;flex-direction:column;justify-content:center}
.formpanel h2{font-size:28px;font-weight:700;margin:0 0 30px;letter-spacing:-.01em}
.formpanel .lbl{font-size:14px;font-weight:600;color:#3a3f45;margin-bottom:8px}
.bigbtn{margin-top:6px;box-shadow:0 12px 24px -12px rgba(232,115,12,.65);transition:background .15s ease}
.bigbtn:hover{background:#c85e00}
.biginp{display:flex;align-items:center;gap:13px;border:2px solid #e3e6ea;border-radius:14px;padding:0 18px;background:#fcfcfd;margin-bottom:20px}
.biginp:focus-within{border-color:#e8730c;background:#fff;box-shadow:0 0 0 4px #fef0e5}
.biginp .mi{font-size:24px;color:#9aa0a6}
.biginp input{border:0;background:transparent;flex:1;height:58px;font-size:17px;font-family:inherit;outline:0}
.bigbtn{width:100%;height:58px;border:0;border-radius:14px;background:#e8730c;color:#fff;font-size:17px;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:10px}
@media(max-width:820px){.loginbox{grid-template-columns:1fr}.brandpanel{display:none}}

/* ============================================================
   Reports
   ============================================================ */
.report-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:20px}
.report-grid .card{margin-bottom:0}
.report-card{display:flex;flex-direction:column}
.report-card .csub{flex:1}
.report-card-actions,.report-filter-actions{display:flex;gap:10px;flex-wrap:wrap}
.report-card-actions .btn .mi,.report-filter-actions .btn .mi{font-size:20px}

.table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 -24px;padding:0 24px}
.report-table{font-size:14px}
.report-table th,.report-table td{padding:12px 14px;white-space:nowrap}
.report-table .num{text-align:right;font-variant-numeric:tabular-nums}
.report-table tfoot td{font-weight:700;background:#f6f7f9;border-top:2px solid #1f2328;border-bottom:0}

.stat-card-link{color:inherit}
.stat-card-link:hover{text-decoration:none;border-color:#e8730c}
.stat-icon-notpaid{background:var(--danger-bg);color:var(--danger)}

@media(max-width:720px){
  .report-grid{grid-template-columns:1fr}
  .table-scroll{margin:0 -16px;padding:0 16px}
}

.summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px;margin-bottom:20px}
.summary-card{background:#fff;border:1px solid #e3e6ea;border-radius:18px;padding:20px 22px;display:flex;align-items:center;gap:16px;box-shadow:0 2px 8px rgba(0,0,0,.03)}
.summary-icon{width:48px;height:48px;border-radius:14px;background:#fef0e5;color:#e8730c;display:flex;align-items:center;justify-content:center;flex:none}
.summary-icon .mi{font-size:26px}
.summary-value{font-size:26px;font-weight:700;color:#1a1d21;line-height:1.15;font-variant-numeric:tabular-nums}
.summary-label{font-size:13px;color:#5b636c;margin-top:2px}

.table-card{padding:8px 24px 16px}
.table-note{display:flex;align-items:center;gap:6px;font-size:12.5px;color:#5b636c;margin:12px 0 0}
.table-note .mi{font-size:16px}

/* Receipt row actions (Print / Edit / Void) */
.row-actions{display:flex;gap:6px;justify-content:flex-end;align-items:center}
.row-actions form{margin:0}
.act{display:inline-flex;align-items:center;gap:5px;height:34px;padding:0 12px;border-radius:10px;border:1px solid #e3e6ea;background:#fff;color:#1f2328;font:600 13px var(--font-family);cursor:pointer;white-space:nowrap}
.act .mi{font-size:18px;color:#5b636c}
.act:hover{background:#fef0e5;border-color:#e8730c;text-decoration:none}
.act:hover .mi{color:#e8730c}
.act-danger:hover{background:var(--danger-bg);border-color:var(--danger);color:var(--danger)}
.act-danger:hover .mi{color:var(--danger)}
.row-meta{font-size:12px;color:#8a9199;margin-top:3px;white-space:normal}
.badge-void{background:var(--danger-bg);color:var(--danger);font-size:11.5px;padding:3px 9px;margin-left:6px;text-transform:uppercase;letter-spacing:.04em}
table.data-table tbody tr.row-void td{color:#9aa0a6}
table.data-table tbody tr.row-void td:not(:first-child):not(:last-child){text-decoration:line-through}

/* Collect button on not-paid members */
.collect-cell{text-align:right;width:1%;white-space:nowrap}
.btn-collect{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px;border-radius:10px;background:#e8730c;color:#fff;font-size:13.5px;font-weight:600;box-shadow:0 6px 14px -8px rgba(232,115,12,.7)}
.btn-collect .mi{font-size:18px}
.btn-collect:hover{background:#c85e00;text-decoration:none}

/* Flash messages */
.flash{padding:14px 20px;font-weight:500}
.flash-success{background:#e6f4ea;border-color:#b7dfc2;color:#1a7a3c}
.flash-error{background:var(--danger-bg);border-color:#f3c3be;color:var(--danger)}

/* Receipt page extras */
.receipt-saved,.receipt-voided{display:flex;gap:14px;align-items:flex-start;border-radius:16px;padding:16px 20px;margin-bottom:16px}
.receipt-saved{background:#e6f4ea;color:#1a7a3c}
.receipt-voided{background:var(--danger-bg);color:var(--danger)}
.receipt-saved .mi,.receipt-voided .mi{font-size:28px}
.receipt-saved strong,.receipt-voided strong{display:block;font-size:16px}
.receipt-saved span,.receipt-voided span{font-size:14px}
.receipt-toolbar{display:flex;gap:10px;margin-bottom:18px}
.receipt-toolbar .btn-lg{flex:1;justify-content:center}
.receipt-print-btn{height:60px;font-size:17px}
.receipt-card{position:relative;overflow:hidden}
.receipt-thanks{text-align:center;color:#5b636c;font-size:13px;margin:22px 0 0}
.void-stamp{position:absolute;top:42%;left:50%;transform:translate(-50%,-50%) rotate(-18deg);font-size:88px;font-weight:800;letter-spacing:.12em;color:rgba(179,38,30,.16);border:6px solid rgba(179,38,30,.16);border-radius:18px;padding:0 24px;pointer-events:none}
@media print{
  .void-stamp{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .flash{display:none!important}
}
@media(max-width:720px){
  .summary-grid{grid-template-columns:1fr 1fr;gap:10px}
  .summary-card{padding:14px;gap:10px}
  .summary-icon{width:38px;height:38px;border-radius:11px}
  .summary-icon .mi{font-size:21px}
  .summary-value{font-size:19px}
  .table-card{padding:4px 16px 12px}
  .receipt-toolbar{flex-direction:column}
}

/* ============================================================
   Events + gate check-in
   ============================================================ */
.cell-strong{font-weight:600;color:#1f2328}
.event-avatar .mi{font-size:20px}
.badge-live{background:var(--ok-bg);color:var(--ok);font-weight:700}
.badge-upcoming{background:#e8f0fe;color:#1a56b8}
.badge-member{background:var(--owner-bg);color:var(--owner)}
.badge-guest{background:var(--employee-bg);color:var(--employee)}
.badge-waiting{background:#fff4d6;color:#8a5a00;font-size:12px}
.free-tag{color:var(--ok);font-weight:600}
h1 .badge{vertical-align:middle;margin-left:8px;font-size:13px}
table.data-table tbody tr.row-live{background:#f1faf3}
table.data-table tbody tr.row-live:hover{background:#e6f4ea}

.live-dot{display:inline-block;width:12px;height:12px;border-radius:50%;background:#1f9d4c;box-shadow:0 0 0 0 rgba(31,157,76,.6);animation:livepulse 1.6s infinite;flex:none}
.live-dot.small{width:8px;height:8px}
@keyframes livepulse{0%{box-shadow:0 0 0 0 rgba(31,157,76,.55)}70%{box-shadow:0 0 0 10px rgba(31,157,76,0)}100%{box-shadow:0 0 0 0 rgba(31,157,76,0)}}
@media (prefers-reduced-motion:reduce){.live-dot{animation:none}}
.live-banner{display:flex;align-items:center;gap:16px;padding:18px 22px;margin-bottom:16px;border-radius:18px;background:linear-gradient(135deg,#e6f4ea,#d4eedb);border:1px solid #b7dfc2;color:#14532d}
.live-banner:hover{text-decoration:none;box-shadow:0 10px 24px -14px rgba(26,122,60,.6)}
.live-text{flex:1}
.live-text strong{display:block;font-size:17px}
.live-text span{font-size:14px;color:#2f6b43}
.live-go{display:inline-flex;align-items:center;gap:6px;background:#1a7a3c;color:#fff;font-weight:600;font-size:14px;padding:10px 16px;border-radius:12px;white-space:nowrap}
.live-go .mi{font-size:18px}

/* People stepper */
.stepper{display:flex;align-items:stretch;border:1.5px solid #e3e6ea;border-radius:12px;overflow:hidden;background:#fff;height:54px}
.stepper input{width:100%;min-width:44px;border:0;text-align:center;font:700 20px var(--font-family);color:#1f2328;outline:0;-moz-appearance:textfield}
.stepper input::-webkit-inner-spin-button,.stepper input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.step-btn{flex:none;width:52px;border:0;background:#f6f7f9;color:#1f2328;cursor:pointer;display:flex;align-items:center;justify-content:center}
.step-btn:hover{background:#fef0e5;color:#c85e00}
.step-btn .mi{font-size:22px}
.stepper.small{height:44px;width:140px}
.stepper.small .step-btn{width:42px}
.stepper.small input{font-size:17px}

/* Gate counters */
.gate-counters{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}
.gate-counter{background:#fff;border:1px solid #e3e6ea;border-radius:18px;padding:18px 20px;box-shadow:0 2px 8px rgba(0,0,0,.03)}
.gate-counter.primary{background:var(--gradient-brand);border:0;color:#fff;box-shadow:0 14px 30px -16px rgba(160,30,30,.7)}
.gc-label{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:#5b636c}
.gc-label .mi{font-size:20px;color:#e8730c}
.gate-counter.primary .gc-label,.gate-counter.primary .gc-label .mi{color:rgba(255,255,255,.92)}
.gc-value{font-size:40px;font-weight:800;line-height:1.1;margin-top:6px;font-variant-numeric:tabular-nums;color:#1f2328}
.gate-counter.primary .gc-value{color:#fff;font-size:48px}
.gc-sub{font-size:12.5px;color:#5b636c;margin-top:2px;min-height:16px}

/* Gate search + results */
.gate-search{position:sticky;top:0;z-index:6;display:flex;align-items:center;gap:12px;background:#fff;border:2px solid #e3e6ea;border-radius:16px;padding:0 10px 0 18px;margin-bottom:16px;box-shadow:0 8px 20px -14px rgba(0,0,0,.25)}
.gate-search:focus-within{border-color:#e8730c;box-shadow:0 0 0 4px #fef0e5}
.gate-search > .mi{font-size:28px;color:#9aa0a6}
.gate-search input{flex:1;height:64px;border:0;outline:0;font:500 20px var(--font-family);background:transparent;color:#1f2328;min-width:0}
.gate-search input::-webkit-search-cancel-button{display:none}
.gate-clear{border:0;background:#f1f2f4;height:44px;padding:0 14px;gap:4px;border-radius:12px;font:600 14px var(--font-family);cursor:pointer;display:flex;align-items:center;justify-content:center;visibility:hidden}
.gate-results{display:flex;flex-direction:column;gap:10px;margin-bottom:16px}
.gate-results:empty{display:none}
.gate-card{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;background:#fff;border:1px solid #e3e6ea;border-radius:16px;padding:14px 16px}
.gate-card.is-in{background:var(--ok-tint);border-color:#e3efe6;box-shadow:inset 3px 0 0 var(--ok)}
.gate-card + .gate-card{margin-top:0}
#waiting-list .gate-card,#recent-list .recent-row{margin-top:10px}
.gate-who{display:flex;align-items:center;gap:12px;min-width:0;flex:1 1 240px}
.gate-who .cell-strong{font-size:16px}
.avatar.guest{background:var(--employee-bg);color:var(--employee)}
.avatar .mi{font-size:20px}
.gate-act{display:flex;align-items:center;gap:10px}
.btn-checkin{display:inline-flex;align-items:center;gap:8px;height:44px;padding:0 18px;border:0;border-radius:12px;background:#1a7a3c;color:#fff;font:700 15px var(--font-family);cursor:pointer;box-shadow:0 8px 18px -10px rgba(26,122,60,.8)}
.btn-checkin:hover{background:#156431}
.btn-checkin .mi{font-size:20px}
.gate-done{display:flex;align-items:center;gap:6px;color:var(--ok);font-weight:600;font-size:14px}
.gate-done .mi{font-size:20px}
.gate-unpaid{display:flex;flex-direction:column;gap:8px;align-items:flex-end}
.gate-unpaid-note{display:flex;align-items:center;gap:6px;background:#fff4d6;color:#8a5a00;font-size:13px;font-weight:600;padding:6px 12px;border-radius:10px}
.gate-unpaid-note .mi{font-size:18px}
.gate-unpaid-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.gate-new-guest{border-style:dashed;background:#fcfcfd}
.gate-idle{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.recent-row{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #eef0f2}
.recent-row .row-meta{margin:0 0 0 auto;white-space:nowrap}
.empty-state.compact{padding:12px 0;text-align:left}

/* Walk-in dialog */
.gate-dialog{border:0;border-radius:22px;padding:24px;width:min(560px,calc(100vw - 24px));max-height:calc(100vh - 32px);overflow:auto;box-shadow:0 30px 70px -20px rgba(0,0,0,.45)}
.gate-dialog::backdrop{background:rgba(20,22,26,.45)}
.dialog-head{display:flex;align-items:center;justify-content:space-between}
.dialog-head h2{margin:0}
.dialog-close{border:0;background:#f1f2f4;height:44px;padding:0 14px;gap:4px;border-radius:12px;font:600 14px var(--font-family);cursor:pointer;display:flex;align-items:center;justify-content:center}

/* Toast */
.toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,20px);opacity:0;pointer-events:none;z-index:50;max-width:calc(100vw - 32px);padding:14px 20px;border-radius:14px;font-weight:600;font-size:15px;color:#fff;background:#1f2328;box-shadow:0 14px 30px -10px rgba(0,0,0,.4);transition:opacity .2s,transform .2s}
.toast.show{opacity:1;transform:translate(-50%,0)}
.toast.ok{background:#1a7a3c}
.toast.err{background:#b3261e}

@media(max-width:900px){
  .gate-counters{grid-template-columns:1fr 1fr}
  .gate-idle{grid-template-columns:1fr}
}
@media(max-width:720px){
  .gc-value{font-size:30px}
  .gate-counter.primary .gc-value{font-size:36px}
  .gate-counter{padding:14px}
  .gate-search input{height:56px;font-size:18px}
  .gate-unpaid{align-items:stretch;width:100%}
  .gate-unpaid-actions{justify-content:flex-start}
  .gate-act{width:100%;justify-content:space-between}
  .live-banner{flex-wrap:wrap}
}

/* ============================================================
   Shared list toolbar + large, simple lists (iPhone friendly)
   ============================================================ */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.section-title{display:flex;align-items:center;gap:10px;font-size:20px;margin:28px 0 14px}
.section-title .mi{color:#e8730c}

.list-toolbar{background:#fff;border:1px solid #e3e6ea;border-radius:18px;padding:16px;margin-bottom:14px;box-shadow:0 2px 8px rgba(0,0,0,.03)}
.lt-row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.lt-spacer{flex:1}
.lt-search{flex:1 1 320px;display:flex;align-items:center;gap:12px;border:2px solid #e3e6ea;border-radius:14px;padding:0 16px;background:#fcfcfd;cursor:text}
.lt-search:focus-within{border-color:#e8730c;background:#fff;box-shadow:0 0 0 4px #fef0e5}
.lt-search .mi{font-size:26px;color:#9aa0a6}
.lt-search input{flex:1;min-width:0;height:56px;border:0;outline:0;background:transparent;font:500 18px var(--font-family);color:#1f2328}
.lt-actions{display:flex;gap:10px;flex-wrap:wrap}
.lt-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:56px;padding:0 20px;border-radius:14px;border:1.5px solid #e3e6ea;background:#fff;color:#1f2328;font:600 16px var(--font-family);cursor:pointer;white-space:nowrap}
.lt-btn .mi{font-size:22px}
.lt-btn:hover{background:#f6f7f9;text-decoration:none}
.lt-btn.primary{background:#e8730c;border-color:#e8730c;color:#fff;box-shadow:0 10px 22px -12px rgba(232,115,12,.7)}
.lt-btn.primary:hover{background:#c85e00}
.lt-btn.disabled{opacity:.4;cursor:default}
.lt-filters{display:flex;flex-wrap:wrap;gap:12px 14px;align-items:flex-end;margin-top:14px}
.lt-field{flex:1 1 180px;max-width:260px}
.lt-field[hidden]{display:none}
.lt-field label{display:block;font-size:14px;font-weight:600;color:#5b636c;margin-bottom:6px}
.lt-control{display:flex;align-items:center;gap:8px;border:1.5px solid #e3e6ea;border-radius:12px;padding:0 12px;background:#fff}
.lt-control:focus-within{border-color:#e8730c;box-shadow:0 0 0 3px #fef0e5}
.lt-control .mi{font-size:20px;color:#9aa0a6}
.lt-control select,.lt-control input{flex:1;min-width:0;height:50px;border:0;outline:0;background:transparent;font:500 16px var(--font-family);color:#1f2328;cursor:pointer}
.lt-buttons{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.lt-quick,.lt-clear{display:inline-flex;align-items:center;gap:8px;height:50px;padding:0 16px;border-radius:12px;font:600 15px var(--font-family);white-space:nowrap}
.lt-quick{border:1.5px solid #f3c9a3;background:#fff8f1;color:#b4530a}
.lt-quick.on{background:#e8730c;border-color:#e8730c;color:#fff}
.lt-quick:hover,.lt-clear:hover{text-decoration:none;filter:brightness(.97)}
.lt-clear{border:1.5px solid #e3e6ea;background:#f6f7f9;color:#1f2328}
.lt-quick .mi,.lt-clear .mi{font-size:20px}
.lt-status{display:flex;flex-wrap:wrap;gap:6px 16px;align-items:center;justify-content:space-between;font-size:15px;color:#5b636c;margin:0 4px 12px}
.lt-count strong{color:#1f2328}
.lt-filterline{display:inline-flex;align-items:center;gap:6px}
.lt-filterline .mi{font-size:18px}
body.lt-loading [data-swap="list-results"]{opacity:.55;transition:opacity .15s}

.list-table{font-size:16px}
.list-table th,.list-table td{padding:14px 14px;white-space:nowrap}
.list-table td .row-meta{font-size:13.5px}
.list-table .num{text-align:right;font-variant-numeric:tabular-nums}
.list-table tfoot td{font-weight:700;background:#f6f7f9;border-top:2px solid #1f2328;border-bottom:0}
.list-table .badge .mi{font-size:15px}
th.sortable{padding:0!important}
th.sortable a{display:flex;align-items:center;gap:4px;padding:14px;color:inherit;min-height:48px}
th.sortable.num a{justify-content:flex-end}
th.sortable a:hover{color:#c85e00;text-decoration:none}
.sort-icon{font-size:17px!important;color:#e8730c}
.sort-icon.idle{color:#c3c7cc}
.actions-cell{text-align:right;width:1%}
.act{height:44px;padding:0 14px;font-size:14.5px;border-radius:12px}
.act-primary{background:#e8730c;border-color:#e8730c;color:#fff}
.act-primary .mi{color:#fff}
.act-primary:hover{background:#c85e00;border-color:#c85e00;color:#fff}
.act-primary:hover .mi{color:#fff}

.pager{display:flex;align-items:center;justify-content:center;gap:14px;margin:4px 0 24px;flex-wrap:wrap}
.pager-info{font-size:16px;font-weight:600;color:#1f2328}

/* Reports index */
.report-card-main{color:inherit}
.report-card-main:hover{text-decoration:none}
.report-card-main:hover h2{color:#c85e00}
.report-card-actions{display:flex;gap:8px;flex-wrap:wrap}

/* Receipt page: fix a mistake */
.receipt-fix{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;margin:-4px 0 16px;color:#5b636c;font-size:14px}
.receipt-fix form{margin:0}

/* Dashboard */
.quick-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:20px}
.qa{display:flex;align-items:center;justify-content:center;gap:10px;height:64px;padding:0 16px;border-radius:16px;border:1.5px solid #e3e6ea;background:#fff;color:#1f2328;font:700 16px var(--font-family);text-align:center}
.qa .mi{font-size:24px;color:#e8730c}
.qa:hover{text-decoration:none;border-color:#e8730c;background:#fffaf5}
.qa.primary{background:#e8730c;border-color:#e8730c;color:#fff;box-shadow:0 12px 24px -14px rgba(232,115,12,.8)}
.qa.primary .mi{color:#fff}
.qa.primary:hover{background:#c85e00}
.dash-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px}
.dash-card{display:flex;flex-direction:column;gap:4px;background:#fff;border:1px solid #e3e6ea;border-radius:20px;padding:22px;color:#1f2328;box-shadow:0 2px 8px rgba(0,0,0,.03);transition:box-shadow .15s,transform .15s}
.dash-card:hover{text-decoration:none;box-shadow:0 14px 30px -18px rgba(0,0,0,.35);transform:translateY(-1px)}
.dash-icon{width:52px;height:52px;border-radius:14px;background:#fef0e5;color:#e8730c;display:flex;align-items:center;justify-content:center;margin-bottom:8px}
.dash-icon .mi{font-size:28px}
.dash-card.ok .dash-icon{background:var(--ok-bg);color:var(--ok)}
.dash-card.warn .dash-icon{background:#fff4d6;color:#8a5a00}
.dash-value{font-size:36px;font-weight:800;line-height:1.1;font-variant-numeric:tabular-nums}
.dash-label{font-size:16px;font-weight:600;color:#5b636c}
.dash-go{display:inline-flex;align-items:center;gap:4px;margin-top:10px;font-size:14.5px;font-weight:600;color:#c85e00}
.dash-go .mi{font-size:18px}
.dash-two{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.dash-two .card{margin-bottom:0}
.next-event{display:flex;flex-direction:column;gap:16px}
.next-event-name{font-size:22px;font-weight:700}
.next-event-when{font-size:16px;color:#5b636c;margin-top:4px}
.next-event-actions{display:flex;gap:10px;flex-wrap:wrap}
.recent-receipts{display:flex;flex-direction:column}
.recent-receipt{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 4px;border-bottom:1px solid #eef0f2;color:inherit;min-height:56px}
.recent-receipt:hover{text-decoration:none;background:#fafbfc}
.recent-amount{font-size:17px;font-weight:700;font-variant-numeric:tabular-nums}

/* Print pages (lists, reports, event summary) */
.print-body{background:#f4f5f7}
.print-toolbar{display:flex;gap:10px;justify-content:center;padding:16px}
.print-page{background:#fff;max-width:1100px;margin:0 auto 32px;padding:32px;border-radius:12px;box-shadow:0 10px 30px -20px rgba(0,0,0,.4)}
.print-portrait{max-width:760px}
.print-head{display:flex;align-items:center;gap:16px;border-bottom:3px solid #e8730c;padding-bottom:14px}
.print-logo{width:48px;height:48px;border-radius:12px;background:#e8730c;color:#fff;display:flex;align-items:center;justify-content:center;flex:none}
.print-logo .mi{font-size:28px}
.print-titles{flex:1}
.print-org{font-size:13px;font-weight:700;color:#c85e00;text-transform:uppercase;letter-spacing:.06em}
.print-head h1{margin:2px 0 0;font-size:24px}
.print-meta{font-size:12.5px;color:#5b636c;text-align:right}
.print-filters{font-size:13px;color:#3a3f45;margin:12px 0 16px}
.print-summary{display:flex;flex-wrap:wrap;gap:8px 24px;margin-bottom:16px;font-size:13px}
.print-summary div{display:flex;gap:8px;align-items:baseline}
.print-summary span{color:#5b636c}
.print-table{width:100%;border-collapse:collapse;font-size:12px}
.print-table th{background:#b4530a;color:#fff;text-align:left;padding:7px 8px;font-weight:700}
.print-table td{padding:6px 8px;border-bottom:1px solid #e3e6ea}
.print-table tbody tr:nth-child(even) td{background:#f7f8fa}
.print-table .num{text-align:right;font-variant-numeric:tabular-nums}
.print-table tfoot td{font-weight:700;border-top:2px solid #1f2328;border-bottom:0;background:#fef0e5}
.print-empty{color:#5b636c;font-style:italic}
.es-event h2{font-size:26px;margin:18px 0 4px}
.es-event p{margin:0 0 18px;color:#3a3f45}
.es-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:22px}
.es-box{border:1.5px solid #e3e6ea;border-radius:12px;padding:14px}
.es-box span{display:block;font-size:12.5px;color:#5b636c;font-weight:600}
.es-box strong{display:block;font-size:30px;margin-top:4px}
.es-box em{display:block;font-style:normal;font-size:12px;color:#5b636c}
.es-money h3{margin:0 0 8px}
.es-money .print-table{font-size:15px}
.es-note{font-size:12px;color:#5b636c}
.es-sign{display:grid;grid-template-columns:1fr 1fr;gap:40px;margin-top:56px}
.es-sign div{border-top:1.5px solid #1f2328;padding-top:6px;font-size:12.5px;color:#5b636c}

@media print{
  .print-body{background:#fff}
  .print-page{box-shadow:none;border-radius:0;margin:0;padding:0;max-width:none}
  .print-head,.print-table th,.print-table tbody tr:nth-child(even) td,.print-table tfoot td,.print-logo{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .print-table thead{display:table-header-group}
  .print-table tr{page-break-inside:avoid}
  .list-toolbar,.lt-status,.pager{display:none!important}
}

@media(max-width:1100px){
  .dash-cards{grid-template-columns:1fr 1fr}
  .quick-actions{grid-template-columns:1fr 1fr}
}
@media(max-width:900px){
  .dash-two{grid-template-columns:1fr}
  .es-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:720px){
  .list-toolbar{padding:12px;border-radius:16px}
  .lt-search{flex-basis:100%}
  .lt-actions{width:100%}
  .lt-actions .lt-btn{flex:1}
  .lt-field{max-width:none;flex:1 1 calc(50% - 7px)}
  .lt-buttons{width:100%}
  .lt-quick,.lt-clear{flex:1;justify-content:center}
  .dash-value{font-size:30px}
  .dash-card{padding:16px}
  .qa{height:58px;font-size:15px}
  .print-page{padding:16px}
}
@media print{
  @page wide{size:A4 landscape;margin:12mm}
  .print-page:not(.print-portrait){page:wide}
}
.sidebar-toggle{align-items:center;gap:6px;font:600 15px var(--font-family)}

/* ============================================================
   Gate: empty-state guide, big result rows, live checked-in list
   ============================================================ */
.gate-help{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding:28px 20px;margin-bottom:16px;border:2px dashed #f3c9a3;border-radius:18px;background:#fffaf5;color:#3a3f45}
.gate-help[hidden]{display:none}
.gate-help > .mi{font-size:44px;color:#e8730c}
.gate-help p{margin:0;font-size:19px;line-height:1.5}
.gate-help-walkin{display:inline-flex;align-items:center;gap:6px;height:48px;padding:0 16px;margin-left:4px;border:0;border-radius:12px;background:#e8730c;color:#fff;font:700 17px var(--font-family);cursor:pointer;vertical-align:middle}
.gate-help-walkin .mi{font-size:22px}

.avatar.big{width:52px;height:52px;font-size:18px}
.gate-name{font-size:19px;font-weight:700;color:#1f2328;line-height:1.25}
.gate-badges{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin-top:5px}
.gate-badges .row-meta{margin:0;font-size:14.5px}
.gate-badges .badge{font-size:13.5px}
.badge-mem-paid{background:var(--ok-bg);color:var(--ok);font-weight:600}
.badge-mem-unpaid{background:#fdf1f0;color:var(--danger);font-weight:600}
.gate-card{padding:16px 18px;gap:16px}
.gate-results .gate-card{min-height:84px}
.gate-act .stepper{width:170px;height:56px}
.gate-act .stepper .step-btn{width:54px}
.btn-checkin.big{height:56px;padding:0 22px;font-size:18px;border-radius:14px}
.btn-checkin.big .mi{font-size:24px}
.btn-gate-choice{display:inline-flex;align-items:center;gap:8px;height:52px;padding:0 18px;border-radius:14px;border:2px solid #e3e6ea;background:#fff;color:#1f2328;font:700 16px var(--font-family);cursor:pointer;white-space:nowrap}
.btn-gate-choice .mi{font-size:22px;color:#e8730c}
.btn-gate-choice:hover{border-color:#e8730c;background:#fffaf5;text-decoration:none}
.gate-nomatch{display:flex;align-items:center;gap:8px;font-size:17px;color:#5b636c;margin:4px 4px 0}
.gate-nomatch .mi{font-size:24px}

.gate-live h2,.gate-waiting h2{font-size:20px}
.gate-live-count{font-weight:600;color:#5b636c;font-size:16px}
.gate-waiting[hidden]{display:none}
.live-row{display:flex;align-items:center;gap:14px;padding:14px 0;border-bottom:1px solid #eef0f2}
.live-row:last-child{border-bottom:0}
.live-who{flex:1;min-width:0}
.live-people,.live-time{display:inline-flex;align-items:center;gap:4px;font-size:15px;color:#3a3f45;font-weight:600}
.live-time{color:#5b636c;font-weight:500}
.live-people .mi,.live-time .mi{font-size:18px}
.live-money{font-size:15px;font-weight:700;color:#1f2328}
.free-tag{font-size:15px}
.btn-undo{display:inline-flex;align-items:center;gap:6px;height:50px;padding:0 18px;border-radius:14px;border:2px solid #e3e6ea;background:#fff;color:#1f2328;font:700 16px var(--font-family);cursor:pointer;flex:none}
.btn-undo .mi{font-size:22px;color:#5b636c}
.btn-undo:hover{border-color:var(--danger);background:var(--danger-bg);color:var(--danger)}
.btn-undo:hover .mi{color:var(--danger)}

@media(max-width:720px){
  .gate-help p{font-size:17px}
  .gate-act{flex-wrap:wrap}
  .gate-act .stepper{flex:1;width:auto}
  .btn-checkin.big{flex:1;justify-content:center}
  .gate-unpaid-actions{width:100%}
  .btn-gate-choice{flex:1;justify-content:center}
  .live-row{flex-wrap:wrap}
  .btn-undo{margin-left:66px}
}

/* ============================================================
   Settings
   ============================================================ */
.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:start}
.settings-grid .card{margin-bottom:0}
.settings-card h2{font-size:20px}
.settings-card .csub{font-size:15px}
.settings-divider{height:1px;background:#eef0f2;margin:22px 0}
.settings-sub{font-size:16px;margin:24px 0 8px;color:#3a3f45}
.btn-lg.wide{width:100%;justify-content:center}
.hint-error{color:#b3261e;font-weight:600}
.inp.inp-error{border-color:#b3261e}
.current-year{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;margin-bottom:18px;border-radius:14px;background:var(--ok-tint);border:1px solid #e3efe6;box-shadow:inset 3px 0 0 var(--ok)}
.current-year-label{font-size:24px;font-weight:800;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.current-year-label .badge .mi{font-size:16px}
.current-year-dates{font-size:15px;color:#3a3f45;margin-top:4px}
.past-years{display:flex;flex-direction:column}
.past-year{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid #eef0f2}
.past-year:last-child{border-bottom:0}

.method-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:64px;padding:8px 0;border-bottom:1px solid #eef0f2;cursor:pointer}
.method-row:last-of-type{border-bottom:0}
.method-name{display:flex;align-items:center;gap:12px;font-size:18px;font-weight:700}
.method-name .mi{font-size:26px;color:#e8730c}
.method-toggle{display:flex;align-items:center;gap:12px}
.method-state{font-size:14px;font-weight:700;color:#8a9199;min-width:28px;text-align:right}
.method-state.on{color:var(--ok)}
.method-row .switch{width:60px;height:36px}
.method-row .switch-slider::before{width:30px;height:30px}
.method-row .switch input:checked + .switch-slider::before{transform:translateX(24px)}

.data-actions{display:flex;flex-direction:column;gap:12px}
.data-action{display:flex;align-items:center;gap:16px;width:100%;min-height:72px;padding:12px 18px;border:1.5px solid #e3e6ea;border-radius:16px;background:#fff;color:#1f2328;text-align:left;font-family:var(--font-family);cursor:pointer}
.data-action:hover{border-color:#e8730c;background:#fffaf5;text-decoration:none}
.data-action > .mi{font-size:30px;color:#e8730c;flex:none}
.data-action strong{display:block;font-size:17px}
.data-action em{display:block;font-style:normal;font-size:14px;color:#5b636c;margin-top:2px}

.restore-row{display:flex;align-items:center;gap:14px;padding:14px 0;border-bottom:1px solid #eef0f2}
.restore-row:last-child{border-bottom:0}
.restore-row form{margin:0}
.btn-restore{display:inline-flex;align-items:center;gap:8px;height:52px;padding:0 20px;border:0;border-radius:14px;background:#e8730c;color:#fff;font:700 16px var(--font-family);cursor:pointer;box-shadow:0 10px 22px -12px rgba(232,115,12,.7)}
.btn-restore .mi{font-size:22px}
.btn-restore:hover{background:#c85e00}

/* receipts: phone + signature */
.receipt-phone{display:inline-flex;align-items:center;gap:4px;font-weight:600}
.receipt-phone .mi{font-size:16px}
.receipt-sign{margin-top:36px;display:flex;flex-direction:column;align-items:flex-end}
.receipt-sign-line{width:220px;border-top:1.5px solid #1f2328}
.receipt-sign-label{font-size:13px;color:#3a3f45;margin-top:6px}

@media(max-width:1000px){
  .settings-grid{grid-template-columns:1fr}
}
@media(max-width:720px){
  .restore-row{flex-wrap:wrap}
  .restore-row form{width:100%}
  .btn-restore{width:100%;justify-content:center}
  .current-year-label{font-size:21px}
}

/* ============================================================
   Membership types: badge palette (first two keep Owner / Employee colours)
   ============================================================ */
.badge-type-0,.ti.badge-type-0{background:var(--owner-bg);color:var(--owner)}
.badge-type-1,.ti.badge-type-1{background:var(--employee-bg);color:var(--employee)}
.badge-type-2,.ti.badge-type-2{background:#e3f1fb;color:#0b5c8f}
.badge-type-3,.ti.badge-type-3{background:#e6f4f1;color:#0f6b5c}
.badge-type-4,.ti.badge-type-4{background:#fce8f1;color:#a4235f}
.badge-type-5,.ti.badge-type-5{background:#eef0f3;color:#3a4552}

.type-list{display:flex;flex-direction:column;margin-bottom:18px}
.type-row{display:flex;align-items:center;gap:14px;padding:14px 0;border-bottom:1px solid #eef0f2}
.type-row:last-of-type{border-bottom:0}
.type-row .badge{min-width:96px;justify-content:center}
.type-info{flex:1;min-width:0}
.type-amount{font-size:18px;font-weight:700;font-variant-numeric:tabular-nums}
.type-row.is-off .badge{opacity:.55}
.type-row.is-off .type-amount{color:#8a9199}
.type-row .row-actions form{margin:0}
@media(max-width:720px){
  .type-row{flex-wrap:wrap}
  .type-row .row-actions{width:100%;justify-content:flex-start}
}

.login-user{display:flex;align-items:center;gap:12px;padding:14px 16px;margin-bottom:18px;border-radius:14px;background:var(--panel);border:1px solid var(--border)}

/* ============================================================
   Top bar: page title left, account pill pinned right
   ============================================================ */
.appbar{position:sticky;top:0;z-index:15;display:flex;align-items:center;justify-content:space-between;gap:16px;height:68px;margin:calc(-1 * var(--space-lg)) calc(-1 * var(--space-lg)) var(--space-lg);padding:0 var(--space-lg);background:rgba(255,255,255,.86);-webkit-backdrop-filter:saturate(180%) blur(12px);backdrop-filter:saturate(180%) blur(12px);border-bottom:1px solid var(--border)}
.appbar-title{display:flex;align-items:center;gap:12px;min-width:0;font-size:18px;font-weight:700;color:var(--ink);letter-spacing:-.01em}
.appbar-title > span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.appbar-icon{width:36px;height:36px;border-radius:10px;flex:none;display:flex;align-items:center;justify-content:center;background:var(--accent-soft);color:var(--accent)}
.appbar-icon .mi{font-size:21px}

/* Account pill + dropdown card */
.user-menu{position:relative;flex:none}
.user-menu > summary{list-style:none}
.user-menu > summary::-webkit-details-marker{display:none}
.user-pill{display:flex;align-items:center;gap:10px;height:50px;padding:0 12px 0 6px;border-radius:999px;border:1px solid var(--border);background:#fff;cursor:pointer;user-select:none;-webkit-user-select:none;box-shadow:0 1px 2px rgba(31,35,40,.04),0 4px 14px -8px rgba(31,35,40,.18);transition:border-color .15s ease,box-shadow .15s ease}
.user-pill:hover{border-color:#f1cfb0;box-shadow:0 6px 18px -8px rgba(232,115,12,.35)}
.user-menu[open] .user-pill{border-color:var(--accent);box-shadow:0 0 0 4px var(--accent-soft)}
.user-pill:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.user-avatar{width:38px;height:38px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#f08a24 0%,#d4451a 55%,#a01e1e 100%);color:#fff;font-size:14px;font-weight:700;letter-spacing:.03em;box-shadow:inset 0 0 0 2px rgba(255,255,255,.35)}
.user-avatar.lg{width:46px;height:46px;font-size:16px}
.user-pill-text{display:flex;flex-direction:column;line-height:1.2;text-align:left}
.user-pill-name{font-size:14.5px;font-weight:600;color:var(--ink);white-space:nowrap}
.user-pill-role{font-size:12px;color:var(--ink2);white-space:nowrap}
.user-pill-caret{font-size:20px;color:var(--ink2);transition:transform .15s ease}
.user-menu[open] .user-pill-caret{transform:rotate(180deg)}

.user-dropdown{position:absolute;right:0;top:calc(100% + 10px);z-index:60;width:290px;background:#fff;border:1px solid var(--border);border-radius:18px;box-shadow:0 24px 48px -16px rgba(31,35,40,.28),0 2px 6px rgba(31,35,40,.05);overflow:hidden;animation:user-drop .14s ease-out}
@keyframes user-drop{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.user-dropdown-head{display:flex;align-items:center;gap:12px;padding:18px 18px 16px;background:linear-gradient(180deg,#fff8f1 0%,#fff 100%);border-bottom:1px solid #f0f1f3}
.user-dropdown-who{min-width:0}
.user-dropdown-name{font-size:15.5px;font-weight:700;color:var(--ink)}
.user-dropdown-sub{font-size:12.5px;color:var(--ink2);margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.user-dropdown-items{padding:8px}
.user-dropdown-foot{margin:0;padding:8px;border-top:1px solid #f0f1f3}
.user-dropdown-item{display:flex;align-items:center;gap:12px;width:100%;height:44px;padding:0 12px;border:0;border-radius:10px;background:none;color:var(--ink);font:500 14.5px var(--font-family);text-align:left;cursor:pointer}
.user-dropdown-item .mi{font-size:20px;color:var(--ink2)}
.user-dropdown-item:hover,.user-dropdown-item:focus-visible{background:var(--panel);text-decoration:none;outline:0}
.user-dropdown-item:hover .mi{color:var(--accent)}
.user-dropdown-item.danger,.user-dropdown-item.danger .mi{color:var(--danger)}
.user-dropdown-item.danger:hover{background:var(--danger-bg)}
.user-dropdown-item.danger:hover .mi{color:var(--danger)}

@media(max-width:720px){
  .appbar{display:none}
  .topbar{height:60px}
  .topbar .user-pill{height:42px;padding:0 6px 0 3px;gap:4px;box-shadow:none}
  .topbar .user-pill-text{display:none}
  .topbar .user-avatar{width:34px;height:34px;font-size:13px}
  .topbar .user-dropdown{position:fixed;top:68px;right:12px;left:auto;width:min(310px,calc(100vw - 24px))}
  .topbar-title{flex:1;min-width:0;padding:0 8px;font-size:16px;font-weight:700;color:var(--ink);text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .sidebar{top:60px}
}
@media print{.appbar,.user-menu{display:none!important}}

/* ============================================================
   Sign-in + password reset pages
   ============================================================ */
.formpanel-brand{display:none;align-items:center;gap:10px;font-weight:700;font-size:17px;color:var(--accent);margin-bottom:24px}
.formpanel-brand .mi{font-size:28px}
.auth-sub{font-size:15.5px;line-height:1.55;color:var(--ink2);margin:-16px 0 24px}
.auth-msg{display:flex;align-items:center;gap:8px;font-size:14.5px;font-weight:600;margin:-12px 0 20px}
.auth-msg.error{color:var(--danger)}
.auth-msg .mi{font-size:20px}
.auth-link{display:inline-flex;align-items:center;justify-content:center;gap:6px;align-self:center;margin-top:18px;padding:8px 12px;border-radius:10px;font-size:15px;font-weight:600;color:var(--accent-dark)}
.auth-link:hover{background:var(--accent-soft);text-decoration:none}
.auth-link .mi{font-size:18px}
.auth-icon{width:64px;height:64px;border-radius:18px;display:flex;align-items:center;justify-content:center;background:var(--ok-bg);color:var(--ok);margin-bottom:20px}
.auth-icon.warn{background:var(--danger-bg);color:var(--danger)}
.auth-icon .mi{font-size:36px}
a.bigbtn{text-decoration:none}
a.bigbtn:hover{background:var(--accent-dark)}
.formpanel .lbl{display:block}
@media(max-width:820px){
  .formpanel{padding:36px 24px}
  .formpanel-brand{display:flex}
  .loginbox{min-height:0}
}


/* ============================================================
   Stat cards: values always stay inside the card
   ============================================================ */
.summary-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr))}
.summary-card{min-width:0;overflow:hidden}
.summary-text{flex:1;min-width:0}
.summary-value,.dash-value,.progress-v{display:block;max-width:100%;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:clip}
.summary-label{overflow-wrap:anywhere}
.dash-cards{grid-template-columns:repeat(4,minmax(0,1fr))}
.dash-card{min-width:0;overflow:hidden}
@media(max-width:1100px){.dash-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){
  .summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:380px){
  .summary-grid,.dash-cards{grid-template-columns:minmax(0,1fr)}
}

/* ============================================================
   Membership progress (dashboard + Collections report)
   ============================================================ */
.progress-card{margin-bottom:12px}
.progress-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.progress-head h2{margin:0}
.progress-line{font-size:17px;color:#3a3f45;margin:14px 0 12px;line-height:1.5}
.progress-line strong{color:var(--ink)}
.progress-line .dot{color:#b0b6bd;margin:0 4px}
.progress-bar{height:12px;border-radius:999px;background:#eef0f2;overflow:hidden}
.progress-bar span{display:block;height:100%;min-width:4px;border-radius:inherit;background:linear-gradient(90deg,#2a9152,#1a7a3c)}
.progress-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:16px}
.progress-stats > div{min-width:0;padding:12px 14px;border:1px solid var(--border);border-radius:14px;background:#fcfcfd}
.progress-k{display:block;font-size:13px;color:#5b636c}
.progress-v{font-size:22px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums;margin-top:2px}
.progress-v.ok{color:var(--ok)}
.progress-v.warn{color:#8a5a00}
.progress-links{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 20px}
.report-detail-progress{margin-top:4px}
@media(max-width:720px){
  .progress-actions,.progress-actions .btn-lg{width:100%;justify-content:center}
  .progress-stats{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .progress-stats > div:first-child{grid-column:1 / -1}
  .progress-line{font-size:15.5px}
}

.print-note{font-size:13px;font-weight:600;color:#8a3d05;margin:0 0 14px;padding:8px 12px;border-left:3px solid #e8730c;background:#fff8f1}
@media print{.print-note{-webkit-print-color-adjust:exact;print-color-adjust:exact}}

/* ============================================================
   Community logo (sidebar, dashboard bar, receipts, prints, login)
   ============================================================ */
.logo-img{display:block;width:100%;height:100%;object-fit:contain}
.sidebar-logo.has-img,.appbar-icon.has-img,.receipt-logo.has-img,.print-logo.has-img{background:#fff;border:1px solid var(--border);padding:3px;overflow:hidden}
.appbar-icon.has-img{width:40px;height:40px;border-radius:11px}
.receipt-logo.has-img{padding:4px}
.brandpanel .blogo.has-img{background:#fff;padding:8px;overflow:hidden;box-shadow:0 10px 24px -12px rgba(0,0,0,.35)}
.brandpanel .blogo.has-img img{width:100%;height:100%;object-fit:contain;display:block}

.logo-current{display:flex;align-items:center;gap:16px;padding:14px 16px;margin-bottom:16px;border:1px solid var(--border);border-radius:14px;background:var(--panel)}
.logo-preview{width:72px;height:72px;flex:none;border-radius:16px;background:#fff;border:1px solid var(--border);display:flex;align-items:center;justify-content:center;overflow:hidden;padding:6px}
.logo-preview img{width:100%;height:100%;object-fit:contain}
.logo-preview.empty{background:var(--accent);border-color:var(--accent);color:#fff}
.logo-preview.empty .mi{font-size:36px}
.logo-drop{position:relative;display:flex;align-items:center;gap:14px;min-height:72px;padding:12px 18px;border:2px dashed #f0c9a6;border-radius:16px;background:#fffaf5;cursor:pointer}
.logo-drop:hover,.logo-drop:focus-within{border-color:var(--accent);background:#fff4ea}
.logo-drop.has-error{border-color:var(--danger)}
.logo-drop > .mi{font-size:30px;color:var(--accent);flex:none}
.logo-drop-text{min-width:0}
.logo-drop-text strong{display:block;font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.logo-drop-text em{display:block;font-style:normal;font-size:13.5px;color:#5b636c;margin-top:2px}
/* The real file input covers the drop zone, so a tap anywhere opens the picker (iOS/Android too). */
.logo-drop input[type=file]{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
#logo .form-actions{margin-top:14px}
.logo-remove{margin-top:10px;color:var(--danger)}
.logo-remove .mi{color:var(--danger)}
.method-row.is-disabled{cursor:not-allowed;opacity:.55}
.cell-phone a{color:var(--ink);font-weight:500;white-space:nowrap}
.muted{color:#9aa0a6}

/* ============================================================
   Phones: wide tables become one card per row (label: value)
   ============================================================ */
@media (max-width:720px){
  .table-card:has(.stack-table){padding:4px 12px 12px;background:transparent;border:0;box-shadow:none}
  .table-scroll:has(.stack-table){overflow:visible;margin:0;padding:0}
  table.stack-table,.stack-table tbody,.stack-table tfoot,.stack-table tr,.stack-table td{display:block;width:100%}
  .stack-table thead{display:none}
  .stack-table tbody tr,.stack-table tfoot tr{position:relative;display:flex;flex-direction:column;margin:0 0 12px;padding:6px 16px 8px;background:#fff;border:1px solid var(--border);border-radius:16px;box-shadow:0 2px 8px rgba(31,35,40,.04)}
  .stack-table tbody tr:hover{background:#fff}
  .stack-table td{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:40px;padding:8px 0!important;border-bottom:1px solid #f0f1f3;text-align:right!important;white-space:normal!important;font-size:15px}
  .stack-table td::before{content:attr(data-label);flex:none;max-width:45%;text-align:left;font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:#7a828b}
  .stack-table td:last-child{border-bottom:0}
  .stack-table td.actions-cell{order:99}
  .stack-table td > *{min-width:0}
  /* Card title: the name (or first) column, full width, no label */
  .stack-table td.cell-head{order:-1;display:block;text-align:left!important;padding:10px 0 12px!important;font-size:16px}
  .stack-table td.cell-head::before{display:none}
  .stack-table td.cell-head .cell-strong{font-size:16.5px}
  /* Actions: a row of buttons at the bottom of the card */
  .stack-table td.actions-cell{display:block;padding:12px 0 6px!important;width:100%}
  .stack-table td.actions-cell::before{display:none}
  .stack-table td.actions-cell:empty,.stack-table td.actions-cell:not(:has(*)){display:none}
  .stack-table .row-actions{justify-content:flex-start;flex-wrap:wrap;gap:8px}
  .stack-table .row-actions .act,.stack-table .row-actions form{flex:1 1 auto}
  .stack-table .row-actions .act{justify-content:center;height:42px}
  /* Totals card */
  .stack-table tfoot tr{background:var(--panel);border-color:#d9dde2}
  .stack-table tfoot td{border-top:0!important;background:transparent!important;font-weight:700}
  .stack-table tfoot td:empty{display:none}
  /* Status accents move from the first cell to the card edge */
  table.stack-table tbody tr.row-paid{box-shadow:inset 3px 0 0 var(--ok),0 2px 8px rgba(31,35,40,.04);border-color:#dfeee4}
  table.data-table.stack-table tbody tr.row-paid > td:first-child{box-shadow:none}
  .stack-table tbody tr.row-void{opacity:.75}
  .stack-table tbody tr.row-void td{text-decoration:none!important}
  .stack-table td.cell-id{font-variant-numeric:tabular-nums;color:#5b636c}
}
