:root {
  --bg: #eef1f6; --surface: #ffffff; --surface-2: #f7f8fb; --navy: #0b1220;
  --navy-2: #111c30; --gold: #d59b2d; --gold-2: #f1c76a; --text: #182033;
  --muted: #758096; --border: #e2e6ee; --green: #11845b; --red: #c33a47;
  --orange: #c36f22; --shadow: 0 12px 30px rgba(17, 28, 48, .08); --radius: 18px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Noto Sans Thai", sans-serif; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.loading-overlay { position: fixed; inset: 0; z-index: 9999; display: grid; place-content: center; gap: 12px; text-align: center; color: white; background: rgba(11, 18, 32, .76); backdrop-filter: blur(6px); }
.spinner { width: 42px; height: 42px; margin: auto; border: 4px solid rgba(255,255,255,.25); border-top-color: var(--gold-2); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top right, #263958 0, #0b1220 42%, #070b13 100%); }
.login-card { width: min(430px, 100%); padding: 40px; border-radius: 28px; background: rgba(255,255,255,.98); box-shadow: 0 32px 80px rgba(0,0,0,.35); }
.brand-mark { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 22px; background: linear-gradient(145deg, var(--gold-2), var(--gold)); color: var(--navy); font-weight: 900; font-size: 25px; box-shadow: 0 12px 24px rgba(213,155,45,.3); }
.brand-mark.small { width: 43px; height: 43px; border-radius: 13px; font-size: 16px; flex: 0 0 auto; }
.eyebrow { margin: 0 0 5px; color: var(--gold); font-weight: 800; font-size: 11px; letter-spacing: .12em; }
h1 { margin: 16px 0 8px; font-size: 30px; }
h2, h3 { margin: 0; }
.login-subtitle, .muted { color: var(--muted); }
.form-stack { display: grid; gap: 18px; margin-top: 28px; }
.form-stack label, .form-field { display: grid; gap: 7px; font-weight: 700; font-size: 13px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 12px; outline: none; color: var(--text); background: white; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(213,155,45,.14); }
.form-error { min-height: 20px; color: var(--red); font-size: 13px; }
.btn { min-height: 42px; padding: 9px 16px; border: 0; border-radius: 12px; font-weight: 800; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #0a111d; background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 8px 18px rgba(213,155,45,.2); }
.btn-secondary { color: var(--text); background: #edf0f5; }
.btn-danger { color: white; background: var(--red); }
.btn-success { color: white; background: var(--green); }
.btn-block { width: 100%; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; color: white; background: linear-gradient(180deg, var(--navy-2), var(--navy)); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 24px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand span { color: #8995aa; font-size: 12px; margin-top: 2px; }
.nav-list { display: grid; gap: 8px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-radius: 12px; color: #aeb8c9; background: transparent; text-align: left; font-weight: 750; }
.nav-item span { width: 23px; font-size: 18px; text-align: center; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.09); }
.nav-item.active { box-shadow: inset 3px 0 var(--gold); }
.sidebar-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.09); }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--navy); background: var(--gold-2); font-weight: 900; }
.sidebar-user-text { min-width: 0; flex: 1; }
.sidebar-user-text strong, .sidebar-user-text span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-text span { color: #8f9bad; font-size: 12px; text-transform: uppercase; }
.icon-btn { border: 0; border-radius: 10px; padding: 9px; color: inherit; background: transparent; font-size: 18px; }
.icon-btn:hover { background: rgba(255,255,255,.1); }
.main-area { min-width: 0; }
.topbar { min-height: 82px; display: flex; align-items: center; gap: 15px; padding: 15px 28px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.92); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.topbar > div { flex: 1; }
.topbar h2 { font-size: 22px; }
.menu-btn { display: none; color: var(--text); }
.page-container { padding: 26px 28px 40px; }
.page { display: none; }
.page.active { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.metric-card .label { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric-card strong { display: block; margin-top: 8px; font-size: 28px; line-height: 1.1; }
.metric-card .hint { margin-top: 7px; color: var(--muted); font-size: 11px; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.panel.compact { padding: 12px; overflow: visible; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px; }
.list-stack { padding: 0 14px 14px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 7px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-main { min-width: 0; flex: 1; }
.list-main strong, .list-main span { display: block; }
.list-main span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.list-value { text-align: right; font-weight: 800; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar-spacer { flex: 1; }
.search-box { min-width: 260px; flex: 1; display: flex; align-items: center; gap: 8px; padding-left: 12px; border: 1px solid var(--border); border-radius: 12px; background: white; }
.search-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(213,155,45,.12); }
.search-box input { border: 0; box-shadow: none !important; padding-left: 0; }
.search-box.large { margin: 18px 0; }
.table-panel { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { color: var(--muted); background: var(--surface-2); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
td strong, td span.block { display: block; }
td small { color: var(--muted); }
.table-actions { display: flex; gap: 7px; justify-content: flex-end; }
.mini-btn { border: 0; border-radius: 8px; padding: 7px 9px; font-weight: 800; background: #edf0f5; }
.mini-btn.success { color: white; background: var(--green); }
.mini-btn.danger { color: white; background: var(--red); }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: #e9edf4; }
.badge.active, .badge.paid, .badge.fulfilled, .badge.completed { color: var(--green); background: #e1f5ec; }
.badge.pending, .badge.scheduled { color: var(--orange); background: #fff1dd; }
.badge.rejected, .badge.suspended, .badge.cancelled, .badge.inactive, .badge.used_up, .badge.expired { color: var(--red); background: #fde7e9; }
.empty-state { padding: 36px 20px; color: var(--muted); text-align: center; }
.checkin-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 20px; }
.checkin-search-panel, .checkin-action-panel { padding: 24px; min-height: 480px; }
.member-result-list { display: grid; gap: 10px; }
.member-result { width: 100%; padding: 13px; border: 1px solid var(--border); border-radius: 13px; text-align: left; background: white; }
.member-result:hover { border-color: var(--gold); background: #fffaf0; }
.membership-highlight { margin: 18px 0; padding: 15px; border: 1px solid #ead8af; border-radius: 14px; background: #fff9ec; }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.service-btn { padding: 20px 10px; border: 1px solid var(--border); border-radius: 15px; background: white; }
.service-btn strong, .service-btn span { display: block; }
.service-btn span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.service-btn:hover { border-color: var(--gold); background: #fffaf0; transform: translateY(-2px); }
.inline-field { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; }
.inline-field input { width: 145px; }
.report-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.report-summary > div { padding: 18px; border-radius: 15px; background: var(--navy); color: white; }
.report-summary span, .report-summary strong { display: block; }
.report-summary span { color: #9aa5b8; font-size: 12px; }
.report-summary strong { margin-top: 5px; font-size: 24px; color: var(--gold-2); }
#page-reports .panel { margin-bottom: 16px; }
.swal2-popup { border-radius: 20px !important; }
.swal-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; }
.swal-form label { display: grid; gap: 5px; font-size: 12px; font-weight: 800; }
.swal-form .full { grid-column: 1 / -1; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; text-align: left; }
.detail-card { padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.detail-card span, .detail-card strong { display: block; }
.detail-card span { color: var(--muted); font-size: 11px; }
.detail-section { margin-top: 18px; text-align: left; }
.detail-section h4 { margin: 0 0 8px; }
.detail-table { width: 100%; font-size: 12px; }
@media (max-width: 1100px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } .two-column, .checkin-layout { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -280px; z-index: 50; width: 260px; transition: left .22s ease; box-shadow: 20px 0 50px rgba(0,0,0,.28); }
  .sidebar.open { left: 0; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .page-container { padding: 18px 14px 30px; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .search-box { min-width: 100%; }
  .toolbar-spacer { display: none; }
  .service-grid { grid-template-columns: 1fr; }
  .report-summary { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .login-card { padding: 28px 22px; } .metric-grid { grid-template-columns: 1fr; } .swal-form, .detail-grid { grid-template-columns: 1fr; } .swal-form .full { grid-column: auto; } }


/* =========================================================
   MEMBER TABLE — รูปแบบเดียวกับตารางสมาชิกเดิม
   ========================================================= */

.members-wide-table {
  min-width: 2250px;
}

.members-wide-table th,
.members-wide-table td {
  padding: 11px 12px;
  vertical-align: middle;
}

.members-wide-table td:nth-child(5) {
  min-width: 175px;
  white-space: normal;
}

.members-wide-table td:nth-child(10) {
  min-width: 165px;
  white-space: normal;
}

.members-wide-table th:last-child,
.members-wide-table td:last-child {
  position: sticky;
  right: 0;
  background: white;
  box-shadow: -8px 0 12px rgba(15, 23, 42, 0.05);
  z-index: 2;
}

.members-wide-table th:last-child {
  background: var(--surface-2);
  z-index: 3;
}

.mono-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.badge.no_membership {
  color: #64748b;
  background: #eef2f7;
}

.badge.used_up {
  color: var(--red);
  background: #fde7e9;
}


/* =========================================================
   MEMBER PAGE V5 — 10 คอลัมน์ตามที่ใช้งานจริง
   ========================================================= */

.member-table-hint {
  padding: 13px 16px 0;
  color: var(--muted);
  font-size: 12px;
}

.members-simple-table {
  min-width: 1450px;
}

.members-simple-table th,
.members-simple-table td {
  vertical-align: middle;
}

.member-clickable-row {
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.member-clickable-row:hover {
  background: #fffaf0;
}

.member-no-link {
  color: #b7790b;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.point-value {
  font-size: 18px;
  color: #b7790b;
}

.member-summary-grid {
  margin-bottom: 12px;
}

.member-history-header {
  text-align: left;
}

.history-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 12px 0 18px;
}

.history-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--line);
}

.history-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  padding: 9px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.history-tab.active {
  color: #7a5000;
  background: #fff3cf;
  border-color: #efb82f;
}

.history-tab-panel {
  display: none;
  padding-top: 16px;
}

.history-tab-panel.active {
  display: block;
}

@media (max-width: 700px) {
  .history-actions {
    flex-direction: column;
  }

  .history-actions .btn {
    width: 100%;
  }
}


.dashboard-error-card {
  grid-column: 1 / -1;
  border: 1px solid #f2b8bd;
  background: #fff5f6;
}

.dashboard-error-card strong {
  color: #b42318;
}

.dashboard-error-card .hint {
  color: #7a271a;
  white-space: normal;
  overflow-wrap: anywhere;
}


/* =========================================================
   LOGIN REDESIGN V10
   Apple-like / Sukhumvit Set system font
   ========================================================= */

:root {
  --app-font:
    -apple-system,
    BlinkMacSystemFont,
    "Sukhumvit Set",
    "Thonburi",
    "SF Pro Text",
    "SF Pro Display",
    "Helvetica Neue",
    Arial,
    sans-serif;
}

html {
  font-family: var(--app-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea,
.swal2-popup,
.swal2-title,
.swal2-html-container,
.swal2-input,
.swal2-textarea,
.swal2-select {
  font-family: var(--app-font) !important;
}

.login-view {
  padding: 32px 20px;
  background:
    radial-gradient(
      circle at 78% 12%,
      rgba(52, 74, 112, 0.48) 0,
      rgba(17, 29, 49, 0.2) 27%,
      transparent 52%
    ),
    linear-gradient(
      145deg,
      #050a13 0%,
      #0a1322 52%,
      #15243d 100%
    );
}

.login-card {
  width: min(470px, 100%);
  padding: 46px 44px 42px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.985);
  box-shadow:
    0 36px 90px rgba(0, 0, 0, 0.38),
    0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 30px;
}

.login-logo-wrap {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 30px;
  background: #ffffff;
  box-shadow:
    0 16px 36px rgba(11, 18, 32, 0.12),
    0 0 0 1px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.login-logo {
  width: 88%;
  height: 88%;
  display: block;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.login-logo.brand-logo-ready {
  opacity: 1;
}

.login-eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.16em;
  color: #c88916;
}

.login-card h1 {
  margin: 0;
  text-align: center;
  color: #111b2f;
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.login-subtitle {
  margin: 16px 0 34px;
  text-align: center;
  color: #768198;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

.login-card .form-stack {
  gap: 22px;
}

.login-card label > span {
  margin-bottom: 9px;
  color: #172033;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.login-card input {
  min-height: 58px;
  padding: 0 18px;
  border: 1.5px solid #dce2eb;
  border-radius: 16px;
  background: #ffffff;
  color: #111827;
  font-size: 16px;
  font-weight: 500;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.login-card input::placeholder {
  color: #9aa3b2;
  font-weight: 500;
}

.login-card input:focus {
  border-color: #d49a25;
  background: #fffdfa;
  box-shadow:
    0 0 0 4px rgba(212, 154, 37, 0.13);
}

.login-card .btn-primary {
  min-height: 58px;
  margin-top: 6px;
  border-radius: 17px;
  background:
    linear-gradient(
      135deg,
      #f2c862 0%,
      #e2a326 100%
    );
  color: #111827;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.01em;
  box-shadow:
    0 12px 24px rgba(213, 155, 45, 0.22);
}

.login-card .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 15px 30px rgba(213, 155, 45, 0.28);
}

.login-card .form-error {
  margin: 16px 0 0;
  text-align: center;
  line-height: 1.45;
}

/* Sidebar logo */

.sidebar-brand {
  gap: 13px;
}

.sidebar-logo-wrap {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #ffffff;
  box-shadow:
    0 9px 22px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.sidebar-logo {
  width: 88%;
  height: 88%;
  display: block;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.sidebar-logo.brand-logo-ready {
  opacity: 1;
}

.sidebar-brand strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.sidebar-brand span {
  font-size: 11px;
  font-weight: 500;
}

/* หลีกเลี่ยงสไตล์ brand-mark เดิมรบกวนโลโก้ */

.login-card .brand-mark,
.sidebar-brand .brand-mark {
  display: none;
}

@media (max-width: 560px) {
  .login-view {
    padding: 20px 14px;
  }

  .login-card {
    padding: 36px 24px 32px;
    border-radius: 28px;
  }

  .login-logo-wrap {
    width: 96px;
    height: 96px;
    margin-bottom: 16px;
    border-radius: 26px;
  }

  .login-brand {
    margin-bottom: 24px;
  }

  .login-card h1 {
    font-size: 31px;
  }

  .login-subtitle {
    margin: 13px 0 28px;
    font-size: 15px;
  }
}


/* =========================================================
   DELETE MEMBER V11
   ========================================================= */

.delete-member-warning {
  text-align: left;
  color: #334155;
  line-height: 1.6;
}

.delete-member-warning p {
  margin: 0 0 12px;
}

.delete-member-warning .danger-text {
  color: #b42318;
  font-weight: 750;
}

.delete-confirm-label {
  display: block;
  margin-top: 16px;
  color: #172033;
  font-size: 14px;
  font-weight: 650;
}

.delete-confirm-label input,
.delete-confirm-label textarea {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid #d9e0ea;
  border-radius: 12px;
  font: inherit;
  font-weight: 500;
}

.delete-confirm-label input:focus,
.delete-confirm-label textarea:focus {
  border-color: #d04452;
  outline: none;
  box-shadow: 0 0 0 4px rgba(208, 68, 82, 0.12);
}

/* =========================================================
   OWNER PASSWORD OTP — R15
   ========================================================= */

.owner-password-security-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 16px;
  padding: 22px;
  overflow: visible;
}

.owner-password-security-copy {
  min-width: 0;
}

.owner-password-security-copy h4 {
  margin: 0;
  color: #172033;
  font-size: 20px;
}

.owner-password-security-copy p:not(.eyebrow) {
  margin: 8px 0 0;
  color: #66758e;
  font-size: 13px;
  line-height: 1.65;
}

.owner-password-security-copy p strong {
  color: #172033;
  overflow-wrap: anywhere;
}

.owner-password-security-copy small {
  display: block;
  margin-top: 7px;
  color: #8a96a8;
  font-size: 12px;
}

.owner-password-change-btn {
  min-width: 230px;
  flex: 0 0 auto;
}

.owner-password-confirmation {
  display: grid;
  gap: 8px;
  text-align: center;
}

.owner-password-confirmation p {
  margin: 0;
  color: #66758e;
}

.owner-password-confirmation strong {
  color: #172033;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.owner-password-confirmation small {
  color: #8a96a8;
}

.owner-password-otp-form {
  margin-top: 4px;
}

.owner-password-otp-note {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid #e8d4a4;
  border-radius: 13px;
  background: #fff9eb;
  text-align: center;
}

.owner-password-otp-note span {
  color: #7d8798;
  font-size: 12px;
}

.owner-password-otp-note strong {
  color: #172033;
  overflow-wrap: anywhere;
}

.owner-password-otp-form #owner-password-otp {
  text-align: center;
  font-size: 24px;
  font-weight: 850;
  letter-spacing: .32em;
}

.owner-password-rules {
  margin: 0;
  color: #768198;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
}

@media (max-width: 800px) {
  .owner-password-security-card {
    align-items: stretch;
    flex-direction: column;
  }

  .owner-password-change-btn {
    width: 100%;
    min-width: 0;
  }
}


/* ==========================================================
   Freelance Trainer Billing
   ========================================================== */
.member-trainer-badge{display:inline-flex;align-items:center;width:max-content;margin-top:5px;padding:4px 8px;border-radius:999px;background:#fff0c9;color:#8a5c00;font-size:9px;font-weight:900;white-space:nowrap}
.trainer-v3-panel{margin:16px 0;padding:16px;border:1px solid #ead9a6;border-radius:16px;background:#fffdf7;text-align:left}
.trainer-v3-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.trainer-v3-head h3{margin:2px 0 5px;color:#1b2940;font-size:17px}.trainer-v3-head span{color:#6f7d91;font-size:11px;line-height:1.55}.trainer-v3-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.trainer-v3-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0}.trainer-v3-summary>div{display:grid;gap:4px;padding:12px;border:1px solid #e7e1cf;border-radius:12px;background:#fff}.trainer-v3-summary span{color:#7a8798;font-size:10px;font-weight:800}.trainer-v3-summary strong{color:#17243c;font-size:15px}.trainer-v3-outstanding{color:#b83544!important}
.trainer-v3-details{margin-top:10px;border:1px solid #e7e2d5;border-radius:12px;background:#fff;overflow:hidden}.trainer-v3-details summary{padding:11px 13px;cursor:pointer;color:#2a3850;font-size:12px;font-weight:900;background:#faf8f2}.trainer-v3-details .table-wrap{padding:0 10px 10px}.trainer-v3-table{min-width:800px}.trainer-payment-pill{display:inline-flex;align-items:center;justify-content:center;min-height:25px;padding:0 9px;border-radius:999px;background:#fff0c8;color:#8e6000;font-size:9px;font-weight:900}.trainer-payment-pill.paid{background:#e5f8ef;color:#147a59}.trainer-payment-pill.voided{background:#edf0f5;color:#6d7888}
.trainer-v3-form{display:grid;gap:9px;text-align:left}.trainer-v3-form label{color:#25324a;font-size:12px;font-weight:850}.trainer-v3-form .swal2-input,.trainer-v3-form .swal2-textarea,.trainer-v3-form .swal2-select{width:100%;margin:0;box-sizing:border-box}.trainer-v3-form .swal2-select{height:46px;padding:0 12px;border:1px solid #d9d9d9;border-radius:4px;background:#fff;font:inherit}.trainer-v3-form-summary{display:grid;gap:4px;padding:12px 14px;border:1px solid #e3e7ed;border-radius:12px;background:#f7f9fc}.trainer-v3-form-summary strong,.trainer-v3-form-summary b{color:#17243c}.trainer-v3-form-summary span{color:#68778d;font-size:11px}.trainer-v3-preview{padding:11px 13px;border-radius:11px;background:#fff2c9;color:#7c5700;font-size:13px;font-weight:900}.trainer-v3-test-note,.trainer-v3-test-disclaimer{padding:10px 12px;border:1px dashed #dfc16d;border-radius:11px;background:#fff8df;color:#7f5b00;font-size:10px;line-height:1.55}.trainer-v3-test-disclaimer{margin-top:12px}
.trainer-report-table{min-width:1000px}.trainer-report-table .btn{min-height:32px;padding:6px 10px;font-size:10px}.trainer-report-stat-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:800px){.trainer-v3-head{display:grid}.trainer-v3-actions{justify-content:stretch}.trainer-v3-actions .btn{flex:1 1 100%}.trainer-v3-summary,.trainer-report-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}


/* =========================================================
   V3.3 TEST — Modern Admin Notification Center
   ========================================================= */
.topbar-actions {
  flex: 0 0 auto !important;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.order-notification-center {
  position: relative;
  display: inline-flex;
}

.order-notification-btn {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe5ed;
  border-radius: 13px;
  background: #fff;
  color: #27364d;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(28, 43, 65, .045);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.order-notification-btn:hover {
  border-color: #cfd7e3;
  background: #fbfcfe;
  box-shadow: 0 5px 16px rgba(28, 43, 65, .08);
  transform: translateY(-1px);
}
.order-notification-btn.has-unread {
  border-color: #dfbd66;
  background: #fffdf7;
}
.order-notification-btn:focus-visible {
  outline: 3px solid rgba(220, 161, 30, .18);
  outline-offset: 2px;
}
.order-notification-bell {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.order-notification-bell svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.order-notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #e3a91d;
  color: #1f2633;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(134, 91, 0, .16);
}

.order-notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 2400;
  width: min(380px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid #e1e6ee;
  border-radius: 16px;
  background: rgba(255,255,255,.985);
  box-shadow: 0 18px 46px rgba(22, 35, 56, .16);
  backdrop-filter: blur(12px);
  transform-origin: top right;
  animation: notification-panel-in .14s ease-out;
}
@keyframes notification-panel-in {
  from { opacity: 0; transform: translateY(-5px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.order-notification-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px 13px;
  border-bottom: 1px solid #edf0f4;
}
.order-notification-panel-head > div {
  display: grid;
  gap: 2px;
}
.order-notification-panel-head strong {
  color: #17243a;
  font-size: 14px;
  font-weight: 900;
}
.order-notification-panel-head small {
  color: #8a96a7;
  font-size: 9px;
  font-weight: 700;
}
.order-notification-mark-all {
  min-height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #916400;
  font: inherit;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}
.order-notification-mark-all:hover:not(:disabled) {
  background: #fff7e3;
}
.order-notification-mark-all:disabled {
  color: #aab2bd;
  cursor: default;
}

.order-notification-list {
  display: grid;
  max-height: 420px;
  overflow-y: auto;
  padding: 6px 8px;
  text-align: left;
}
.order-notification-row {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 9px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .14s ease;
}
.order-notification-row + .order-notification-row {
  border-top: 1px solid #f0f2f6;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.order-notification-row:hover {
  background: #f8fafc;
}
.order-notification-row.unread {
  background: #fffcf4;
}
.order-notification-row.unread:hover {
  background: #fff8e8;
}
.order-notification-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
}
.order-notification-icon.registration {
  background: #eaf8f0;
  color: #149560;
}
.order-notification-icon.renewal {
  background: #fff4d9;
  color: #d28d00;
}
.order-notification-icon svg,
.order-notification-empty-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.order-notification-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.order-notification-copy strong {
  color: #1c2a40;
  font-size: 11px;
  font-weight: 900;
}
.order-notification-copy b {
  overflow: hidden;
  color: #45546a;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-notification-copy small {
  overflow: hidden;
  color: #8a96a8;
  font-size: 9px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-notification-time {
  align-self: start;
  padding-top: 2px;
  color: #9aa4b2;
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}
.order-notification-empty {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 34px 18px;
  color: #8995a6;
  text-align: center;
}
.order-notification-empty-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 3px;
  border-radius: 13px;
  background: #f4f6f9;
  color: #7b8798;
}
.order-notification-empty strong {
  color: #566479;
  font-size: 11px;
}
.order-notification-empty small {
  max-width: 270px;
  color: #9aa4b2;
  font-size: 9px;
  line-height: 1.5;
}
.order-notification-panel-foot {
  padding: 10px 14px;
  border-top: 1px solid #edf0f4;
  background: #fbfcfd;
  color: #9aa4b2;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}
.line-order-toast-copy {
  display: grid;
  gap: 3px;
  text-align: left;
}
.line-order-toast-copy strong {
  color: #172033;
  font-size: 12px;
}
.line-order-toast-copy span,
.line-order-toast-copy small {
  color: #67758a;
  font-size: 10px;
  line-height: 1.4;
}
.modern-notification-toast {
  border: 1px solid #e5e9ef !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 30px rgba(25, 39, 59, .14) !important;
}

@media (max-width: 640px) {
  .topbar-actions { gap: 6px; }
  .order-notification-btn { width: 40px; height: 40px; }
  .order-notification-panel {
    position: fixed;
    top: 74px;
    right: 12px;
    left: 12px;
    width: auto;
  }
  .order-notification-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }
  .order-notification-time {
    grid-column: 2;
    padding-top: 0;
  }
}
