:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --ink: #08152f;
  --muted: #627086;
  --line: #dfe5ef;
  --navy: #071535;
  --navy-soft: #102247;
  --red: #d8202a;
  --orange: #f36d24;
  --peach: #f2b381;
  --accent: #d8202a;
  --accent-strong: #a91520;
  --blue: #071535;
  --yellow: #f2b381;
  --shadow: 0 12px 34px rgba(7, 21, 53, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 21, 53, 0.92);
}

.login-overlay:not(.active) {
  display: none;
}

.login-box {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
  background: #fff;
  border-radius: 8px;
  padding: 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.login-logo,
.login-box > img {
  width: 58px;
  height: 58px;
  max-width: 58px;
  max-height: 58px;
  border-radius: 50%;
  object-fit: cover;
  justify-self: center;
  display: block;
}

.login-box h2 {
  margin: 0;
  text-align: center;
  font-size: 30px;
}

.login-box .eyebrow {
  text-align: center;
}

.login-box label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.login-hint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.login-hint-grid div {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
  color: var(--ink);
  padding: 14px;
}

.login-hint-grid strong,
.login-hint-grid span {
  display: block;
}

.login-hint-grid strong {
  color: var(--navy);
  font-size: 16px;
}

.login-hint-grid span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.login-box input,
.login-box select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.login-box button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--navy);
  color: #f8fafc;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  max-width: 64px;
  max-height: 64px;
  object-fit: cover;
  flex: 0 0 64px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.05;
}

.brand p,
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.sidebar .brand p {
  color: #b6c4cf;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.nav-tab {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d9e4ec;
  text-align: left;
  padding: 0 14px;
  cursor: pointer;
}

.nav-tab.active,
.nav-tab:hover {
  background: var(--navy-soft);
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--red);
}

.sidebar-panel {
  display: grid;
  gap: 8px;
}

.label {
  color: #b6c4cf;
  font-size: 12px;
  text-transform: uppercase;
}

.sidebar input,
.sidebar select {
  width: 100%;
  border: 1px solid #344567;
  color: #fff;
  background: #050d23;
  border-radius: 8px;
  padding: 11px 12px;
}

.access-panel small {
  color: #b6c4cf;
  font-size: 12px;
  font-weight: 800;
}

.access-panel strong {
  color: #fff;
  font-size: 14px;
}

.access-panel button {
  min-height: 38px;
  border: 1px solid #344567;
  border-radius: 8px;
  background: #102247;
  color: #fff;
  cursor: pointer;
}

.access-panel small.unlocked {
  color: #8ff0ba;
}

.access-panel small.warning {
  color: #ffd39e;
}

.scanner-panel strong {
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
}

.scanner-panel small {
  color: #b6c4cf;
  font-size: 12px;
  line-height: 1.35;
}

.scan-notice {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 44px));
  border-radius: 8px;
  padding: 14px 16px;
  background: #071535;
  color: #fff;
  border: 1px solid #344567;
  box-shadow: 0 18px 50px rgba(7, 21, 53, 0.28);
  font-weight: 900;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.scan-notice.active {
  opacity: 1;
  transform: translateY(0);
}

.scan-notice.clickable {
  cursor: pointer;
  pointer-events: auto;
}

.scan-notice.clickable:hover {
  transform: translateY(-2px);
}

.scan-notice strong,
.scan-notice span,
.scan-notice em {
  display: block;
}

.scan-notice span {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  opacity: 0.88;
}

.scan-notice em {
  margin-top: 10px;
  font-size: 12px;
  font-style: normal;
  text-decoration: underline;
  opacity: 0.95;
}

.scan-notice.good {
  background: #06391f;
  border-color: #29a766;
}

.scan-notice.bad {
  background: #4b0b13;
  border-color: #d8202a;
}

.scan-notice.warning {
  background: #51320c;
  border-color: #f2b381;
}

.admin-pin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.admin-pin-row button {
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.main {
  padding: 24px;
  min-width: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.view-header h2 {
  margin: 3px 0 0;
  font-size: 28px;
}

.header-actions,
.toolbar,
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}

.is-hidden {
  display: none !important;
}

.primary-inline,
.ghost-inline {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 13px;
  font-weight: 900;
  cursor: pointer;
}

.primary-inline {
  background: var(--red);
  color: #fff;
}

.ghost-inline {
  background: #eef2f7;
  color: var(--ink);
}

.danger-inline {
  color: var(--accent-strong);
}

.admin-help-text {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.primary-btn,
.ghost-btn,
.checkout-btn,
.icon-btn,
.entry-form button,
.product-form button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  min-height: 42px;
  padding: 0 16px;
}

.primary-btn,
.checkout-btn,
.entry-form button,
.product-form button {
  background: var(--red);
  color: #fff;
  font-weight: 700;
}

.primary-btn:hover,
.checkout-btn:hover,
.entry-form button:hover,
.product-form button:hover {
  background: var(--accent-strong);
}

.ghost-btn,
.icon-btn {
  background: #eef2f7;
  color: var(--ink);
}

.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
}

.pos-operations {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 18px;
  margin-top: 18px;
}

.product-area,
.cart-panel,
.data-section,
.cash-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.product-area,
.cart-panel,
.data-section {
  padding: 16px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  min-height: 38px;
  padding: 0 12px;
  cursor: pointer;
}

.segmented button.active {
  background: #fff1ea;
  border-color: #f5b18d;
  color: var(--accent-strong);
  font-weight: 700;
}

.toolbar input {
  width: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

#categoryTabs {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  align-items: stretch;
}

#categoryTabs .category-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  padding: 8px 10px;
  text-align: left;
  white-space: normal;
}

#categoryTabs .category-tab span {
  overflow-wrap: anywhere;
  font-weight: 800;
  line-height: 1.1;
}

#categoryTabs .category-tab small {
  flex: 0 0 auto;
  min-width: 26px;
  border-radius: 999px;
  padding: 3px 7px;
  background: #f3f5f8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

#categoryTabs .category-tab.active small {
  background: #ffffff;
  color: var(--accent-strong);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.product-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  min-height: 118px;
  padding: 12px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.product-thumb {
  width: 100%;
  height: 86px;
  object-fit: cover;
  border-radius: 7px;
  background: #f1f4f8;
}

.placeholder-thumb,
.product-avatar {
  display: grid;
  place-items: center;
  color: var(--red);
  font-weight: 800;
  background: #fff1ea;
}

.product-avatar {
  color: #ffffff;
  letter-spacing: 0;
  position: relative;
  overflow: hidden;
}

.product-avatar span {
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.product-avatar small {
  position: absolute;
  right: 8px;
  bottom: 8px;
  border-radius: 999px;
  padding: 4px 7px;
  background: #ffffff;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.admin-thumb.product-avatar span {
  font-size: 10px;
}

.admin-thumb.product-avatar small {
  display: none;
}

.avatar-web {
  background: linear-gradient(135deg, #071535 0%, #d8202a 100%);
}

.avatar-membership {
  background: linear-gradient(135deg, #071535 0%, #f36d24 100%);
}

.avatar-training {
  background: linear-gradient(135deg, #d8202a 0%, #071535 100%);
}

.avatar-private {
  background: linear-gradient(135deg, #30405f 0%, #d8202a 100%);
}

.avatar-rfc {
  background: linear-gradient(135deg, #111827 0%, #6d1822 100%);
}

.avatar-package {
  background: linear-gradient(135deg, #f36d24 0%, #d8202a 100%);
}

.avatar-recovery {
  background: linear-gradient(135deg, #17633a 0%, #071535 100%);
}

.avatar-room {
  background: linear-gradient(135deg, #1f4e79 0%, #f2b381 100%);
}

.avatar-shop {
  background: linear-gradient(135deg, #071535 0%, #4b6584 100%);
}

.avatar-other {
  background: linear-gradient(135deg, #627086 0%, #071535 100%);
}

.product-btn:hover {
  border-color: var(--orange);
  box-shadow: 0 8px 18px rgba(216, 32, 42, 0.14);
}

.product-btn strong {
  font-size: 15px;
}

.product-btn span {
  color: var(--muted);
  font-size: 13px;
}

.product-btn .product-avatar span {
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.product-btn b {
  color: var(--red);
  font-size: 20px;
}

.cart-panel {
  display: flex;
  flex-direction: column;
  min-height: 650px;
}

.panel-title h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.cart-items {
  display: grid;
  gap: 8px;
  min-height: 170px;
  align-content: start;
}

.empty-state {
  color: var(--muted);
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

.cart-line small {
  color: var(--muted);
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-controls button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
}

.line-editor {
  display: grid;
  grid-template-columns: 0.7fr 1fr 1fr;
  gap: 8px;
}

.line-editor label {
  font-size: 11px;
}

.line-editor input {
  min-width: 0;
  padding: 8px;
}

.cart-controls,
.cash-inputs,
.entry-form,
.product-form {
  display: grid;
  gap: 10px;
}

.entry-form {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
}

.entry-form label {
  min-width: 0;
}

.entry-form .wide-field {
  grid-column: span 2;
}

.entry-form button {
  width: 100%;
}

.cart-controls {
  grid-template-columns: repeat(2, 1fr);
  margin: 16px 0;
}

.cart-controls label:nth-child(3) {
  grid-column: 1 / -1;
}

.sale-member-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
  background: #fafbfc;
}

.sale-member-panel.needs-member {
  border-color: #f5b18d;
  background: #fff7f2;
}

.compact-title h3 {
  margin-bottom: 0;
  font-size: 15px;
}

.quick-member-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 8px;
}

.quick-member-row button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  min-height: 42px;
  padding: 0 14px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}

.sale-member-panel small {
  color: var(--muted);
}

.package-assignment-list {
  display: grid;
  gap: 10px;
}

.package-assignment-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.85fr) minmax(180px, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.package-assignment-row > div:first-child {
  display: grid;
  align-content: center;
  gap: 3px;
}

.package-assignment-row > div:first-child span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compact-quick-member {
  grid-column: 1 / -1;
  grid-template-columns: 1fr 1fr 1fr auto;
}

.package-sale-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.calculated-price {
  display: grid;
  gap: 4px;
  border: 1px solid #f5b18d;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff1ea;
}

.calculated-price span {
  color: var(--muted);
  font-size: 12px;
}

.calculated-price strong {
  color: var(--accent-strong);
  font-size: 17px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

.totals {
  display: grid;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.grand {
  font-size: 20px;
  color: var(--ink);
}

.profit {
  color: var(--accent-strong);
}

.checkout-btn {
  width: 100%;
  margin-top: 16px;
  min-height: 58px;
  font-size: 18px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.metric[data-report-detail] {
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.metric[data-report-detail]:hover,
.metric.active {
  border-color: #f5b18d;
  background: #fff7f2;
}

.metric[data-report-detail]:hover {
  transform: translateY(-1px);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.closing-grid,
.reports-layout,
.dashboard-layout,
.members-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-layout {
  align-items: start;
}

.dashboard-summary {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.task-list {
  display: grid;
  gap: 8px;
}

.task-item {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fafbfc;
  text-align: left;
}

.task-item strong {
  color: var(--accent-strong);
}

.task-item span {
  color: var(--muted);
  font-size: 13px;
}

.report-detail-panel {
  margin-bottom: 18px;
}

.members-layout {
  grid-template-columns: 1fr;
}

.members-layout.profile-open {
  grid-template-columns: 1fr;
  align-items: start;
}

.members-layout.profile-open .member-profile,
.members-layout.profile-open .member-package-panel {
  grid-column: 1 / -1;
  min-width: 0;
}

.members-layout.profile-open .member-profile.active,
.members-layout.profile-open .member-package-panel.active {
  grid-column: 1 / -1;
}

.closing-grid .summary-strip,
#reportsView .summary-strip {
  grid-column: 1 / -1;
}

.opening-section {
  grid-column: 1 / -1;
}

.balance-form,
.report-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.balance-form button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  min-height: 42px;
  padding: 0 16px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
}

.balance-total {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #fff1ea;
  color: var(--accent-strong);
  font-weight: 800;
}

.balance-table {
  margin-top: 14px;
}

.report-controls {
  grid-template-columns: auto minmax(220px, 340px) auto;
  justify-content: space-between;
  margin-bottom: 18px;
}

.report-controls input {
  min-height: 42px;
}

.report-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.report-table {
  overflow: auto;
}

.rfc-payable-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.rfc-payable-strip div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.rfc-payable-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.rfc-payable-strip strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 1.15rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.entry-form,
.product-form,
.staff-user-form,
.pos-cost-form,
.pos-movement-form {
  grid-template-columns: 1.4fr 1fr 1fr 0.8fr auto;
  margin-bottom: 14px;
}

.staff-user-form {
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.staff-user-form.active {
  display: grid;
}

.permission-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
}

.permission-grid label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--ink);
  font-size: 13px;
}

.pos-cost-form,
.pos-movement-form {
  display: grid;
  gap: 10px;
  grid-template-columns: 0.85fr 1.4fr 1fr;
  align-items: end;
}

#costForm.entry-form,
#movementForm.entry-form {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
}

#costForm.entry-form .wide-field,
#movementForm.entry-form .wide-field {
  grid-column: 1 / -1;
}

.pos-cost-form label:nth-of-type(4),
.pos-cost-form label:nth-of-type(5) {
  grid-column: span 1;
}

.pos-cost-form button,
.pos-movement-form button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  min-height: 42px;
  padding: 0 16px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  width: 100%;
}

.pos-movement-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pos-summary {
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  margin-bottom: 14px;
}

.movement-form {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.cash-inputs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.members-layout .member-profile {
  scroll-margin-top: 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.management-nav,
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.management-nav button,
.admin-nav button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
}

.management-nav button.active,
.admin-nav button.active {
  background: #fff1ea;
  border-color: #f5b18d;
  color: var(--accent-strong);
  font-weight: 800;
}

.management-page {
  display: none;
}

.management-page.active {
  display: block;
  grid-column: 1 / -1;
}

.members-layout .member-profile.profile-focus,
.product-admin.profile-focus {
  border-color: #f5b18d;
  box-shadow: 0 0 0 3px rgba(245, 177, 141, 0.35), var(--shadow);
}

.member-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.management-section {
  grid-column: 1 / -1;
}

.management-form,
.membership-plan-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.schedule-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.membership-plan-form {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.membership-editor {
  display: none;
}

.membership-editor.active {
  display: grid;
}

.membership-form-summary {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
}

.membership-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.membership-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.management-form button,
.membership-plan-form button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  min-height: 42px;
  padding: 0 16px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
}

.checkbox-panel {
  grid-column: span 2;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fafbfc;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}

.access-select-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fafbfc;
}

.access-scroll-list {
  display: grid;
  gap: 6px;
  height: 300px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.access-scroll-list label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
}

.access-scroll-list label:hover {
  background: #fafbfc;
}

.access-scroll-list input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.access-scroll-list span {
  font-weight: 700;
}

.access-select-panel small {
  color: var(--muted);
  font-size: 12px;
}

.member-details-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.member-details-form .notes-field {
  grid-column: 1 / -1;
}

.member-details-form textarea {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  resize: vertical;
  font: inherit;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
}

.member-form button,
.member-details-form button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  min-height: 42px;
  padding: 0 16px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
}

.member-details-form .ghost-inline {
  background: #eef2f7;
  color: var(--ink);
}

.profile-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.member-avatar {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
}

.profile-header h3 {
  margin: 3px 0 5px;
  font-size: 24px;
}

.profile-header span,
.door-card span,
.option-card span {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.good {
  background: #e7f7ee;
  color: #17633a;
}

.status-pill.bad {
  background: #fde8ea;
  color: var(--accent-strong);
}

.door-card {
  display: grid;
  gap: 5px;
  background: #fff1ea;
  border: 1px solid #f5b18d;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

.member-notes {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
  background: #fafbfc;
}

.member-notes span {
  color: var(--muted);
  font-size: 13px;
  white-space: pre-wrap;
}

.member-contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.member-contact-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fafbfc;
}

.member-contact-grid span {
  color: var(--muted);
  font-size: 12px;
}

.member-contact-grid strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.credit-summary-card {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) minmax(240px, 1fr);
  gap: 12px;
  border: 1px solid #b7e3c7;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
  background: #f1fff6;
}

.credit-summary-card h3 {
  margin: 2px 0 6px;
  color: #147a45;
}

.credit-summary-card span {
  color: var(--muted);
  font-size: 13px;
}

.credit-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.credit-mini-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid #cbeed7;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.credit-mini-grid strong {
  color: var(--navy);
}

.subheading {
  margin: 18px 0 10px;
  font-size: 16px;
}

.muted-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stock-admin-section {
  grid-column: 1 / -1;
}

.stock-movement-form {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.7fr 0.8fr 1.3fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.stock-movement-form button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  min-height: 42px;
  padding: 0 16px;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
}

.mini-input {
  width: 72px;
  min-height: 34px;
  padding: 6px 8px;
  margin-right: 6px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.option-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fafbfc;
}

.product-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 18px;
}

.stock-fields {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fafbfc;
}

.stock-fields span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.admin-page {
  display: none;
}

.admin-page.active,
.product-admin,
.product-list-section {
  grid-column: 1 / -1;
}

.admin-page.active {
  display: block;
}

.category-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.category-form button,
.table-action {
  border: 0;
  border-radius: 7px;
  min-height: 34px;
  padding: 0 10px;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
}

.category-form button {
  min-height: 42px;
  background: var(--red);
  font-weight: 700;
}

.category-form .ghost-inline {
  background: #eef2f7;
  color: var(--ink);
}

.table-action + .table-action {
  margin-left: 6px;
}

.table-action.danger {
  background: #f3e5e7;
  color: var(--accent-strong);
}

.member-name-link {
  border: 0;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  font-weight: 800;
  padding: 0;
  text-align: left;
}

.member-name-link:hover,
.member-name-link.selected {
  color: var(--accent-strong);
  text-decoration: underline;
}

.member-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
}

.member-card {
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  cursor: pointer;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 7px;
  text-align: center;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.member-card:hover,
.member-card.selected {
  border-color: #f5b18d;
  box-shadow: 0 10px 24px rgba(7, 21, 53, 0.1);
  transform: translateY(-1px);
}

.member-card-photo {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff1ea;
  color: var(--accent-strong);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.member-card-name {
  font-weight: 900;
  line-height: 1.15;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.member-card-package,
.member-card-valid {
  max-width: 100%;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.member-card-package {
  color: var(--navy);
  font-weight: 800;
}

#memberTable tbody tr {
  cursor: pointer;
}

#membershipPlanTable tbody tr,
#trainerTable tbody tr,
#catalogTable tbody tr {
  cursor: pointer;
}

#memberTable tbody tr:hover {
  background: #fafbfc;
}

#membershipPlanTable tbody tr:hover,
#trainerTable tbody tr:hover,
#catalogTable tbody tr:hover {
  background: #fafbfc;
}

#memberTable tbody tr:has(.member-name-link.selected) {
  background: #fff7f2;
}

#scheduleCalendar {
  margin-bottom: 16px;
}

.schedule-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.calendar-day {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fafbfc;
}

.calendar-day > strong {
  font-size: 15px;
}

.calendar-day > span,
.calendar-day > em {
  color: var(--muted);
  font-size: 12px;
}

.week-label {
  margin: 14px 0 10px;
  color: var(--navy);
  font-weight: 900;
}

.repeat-days {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fafbfc;
}

.repeat-days strong {
  margin-right: 4px;
}

.repeat-days label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.activity-chip {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  color: #fff;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.activity-chip.selected,
.private-booking.selected {
  outline: 3px solid rgba(216, 32, 42, 0.35);
  box-shadow: 0 0 0 1px #fff inset;
}

.schedule-detail-card,
.availability-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
  background: #fff;
}

.schedule-detail-card h3,
.availability-card h3 {
  margin: 2px 0 4px;
}

.schedule-detail-card span,
.availability-card span {
  color: var(--muted);
}

.schedule-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.schedule-detail-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fafbfc;
}

.schedule-detail-grid span {
  font-size: 12px;
}

.activity-chip span {
  font-weight: 800;
}

.activity-chip small {
  color: rgba(255, 255, 255, 0.86);
}

.activity-muay-thai {
  background: #1f4e79;
}

.activity-mma {
  background: #d8202a;
}

.activity-bjj {
  background: #30405f;
}

.activity-hyrox {
  background: #f36d24;
}

.activity-recovery {
  background: #0f766e;
}

.activity-water {
  background: #0284c7;
}

.activity-judo {
  background: #17633a;
}

.activity-yoga {
  background: #7c3aed;
}

.activity-fight {
  background: #071535;
}

.activity-other {
  background: #627086;
}

.qr-pass-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.qr-pass-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fafbfc;
}

.qr-pass-card.active {
  border-color: #29a766;
  background: #f1fff6;
}

.qr-pass-card.inactive {
  opacity: 0.68;
}

.qr-pass-card strong,
.qr-pass-card span,
.qr-pass-card small {
  display: block;
}

.qr-pass-card span {
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--navy);
  font-weight: 900;
}

.qr-pass-card small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.3;
}

.qr-visual {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  padding: 4px;
  border: 2px solid var(--navy);
  background: #fff;
}

.qr-image {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.private-trainer-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.trainer-day-calendar {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.trainer-calendar-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.trainer-calendar-header span {
  color: var(--muted);
  font-size: 13px;
}

.trainer-calendar-grid {
  display: grid;
  grid-template-columns: 72px repeat(var(--trainer-count), minmax(150px, 1fr));
  gap: 1px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.trainer-time-head,
.trainer-head,
.trainer-time,
.trainer-slot {
  min-height: 48px;
  background: #fff;
}

.trainer-time-head,
.trainer-head {
  position: sticky;
  top: 0;
  z-index: 1;
}

.trainer-time-head,
.trainer-time {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.trainer-head {
  display: grid;
  gap: 2px;
  align-content: center;
  padding: 8px;
}

.trainer-head span {
  color: var(--muted);
  font-size: 11px;
}

.trainer-slot {
  display: grid;
  gap: 3px;
  align-content: center;
  border: 0;
  padding: 8px;
  text-align: left;
  cursor: pointer;
}

.trainer-slot-stack {
  display: grid;
  gap: 4px;
  background: #fff;
}

.trainer-slot small {
  font-size: 11px;
  line-height: 1.2;
  opacity: 0.86;
}

.trainer-slot.free {
  color: #147a45;
  background: #f0fff6;
}

.trainer-slot.booked {
  color: #fff;
}

.trainer-slot.booked.paid {
  background: #147a45;
}

.trainer-slot.booked.unpaid {
  background: #b51c28;
}

.trainer-slot.selected {
  outline: 3px solid rgba(216, 32, 42, 0.35);
  outline-offset: -3px;
}

.trainer-availability-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.trainer-availability-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.trainer-availability-controls input,
.trainer-availability-controls select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}

.availability-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.available-trainer {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fafbfc;
  text-align: left;
  cursor: pointer;
}

#scheduleTable {
  display: none;
}

.trainer-column {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fafbfc;
}

.trainer-column > strong,
.trainer-column > small {
  display: block;
}

.trainer-column > small,
.empty-column {
  color: var(--muted);
  font-size: 12px;
}

.private-booking {
  display: grid;
  gap: 4px;
  border: 0;
  border-radius: 8px;
  padding: 10px;
  text-align: left;
  color: #fff;
  cursor: pointer;
}

.private-booking.paid {
  background: #147a45;
}

.private-booking.unpaid {
  background: #b51c28;
}

.private-booking span,
.private-booking small {
  font-size: 12px;
  opacity: 0.9;
}

.attendance-panel {
  margin-bottom: 16px;
}

.attendance-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.attendance-card h3 {
  margin: 2px 0 4px;
}

.attendance-card span {
  color: var(--muted);
}

.attendance-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
}

.product-image-preview,
.member-photo-preview {
  min-height: 104px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fafbfc;
}

.product-image-preview img,
.member-photo-preview img {
  width: 100%;
  height: 126px;
  object-fit: cover;
  border-radius: 7px;
}

.image-upload input {
  padding: 8px;
}

.compact {
  margin-top: 16px;
}

.receipt {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }

  .receipt,
  .receipt * {
    visibility: visible;
  }

  .receipt {
    display: block;
    position: absolute;
    inset: 0 auto auto 0;
    width: 72mm;
    padding: 8mm;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    color: #000;
    background: #fff;
  }
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .nav-tabs {
    grid-template-columns: repeat(6, 1fr);
  }

  .pos-layout,
  .pos-operations,
  .closing-grid,
  .reports-layout,
  .dashboard-layout,
  .admin-layout,
  .members-layout,
  .members-layout.profile-open {
    grid-template-columns: 1fr;
  }

  .members-layout.profile-open .member-list-panel,
  .members-layout.profile-open .member-profile,
  .members-layout.profile-open .member-package-panel {
    grid-column: auto;
    position: static;
  }

  .product-admin,
  .product-list-section {
    grid-column: auto;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .entry-form,
  .pos-cost-form,
  .product-form,
  .staff-user-form,
  .stock-movement-form,
  .stock-fields,
  .balance-form,
  .report-controls,
  .member-form,
  .management-form,
  .membership-plan-form,
  .membership-form-summary,
  .membership-access-grid,
  .member-details-form,
  .package-sale-fields,
  .quick-member-row,
  .member-contact-grid,
  .credit-summary-card,
  .credit-mini-grid,
  .package-assignment-row,
  .checkbox-grid,
  .trainer-availability-controls,
  .option-grid {
    grid-template-columns: 1fr;
  }

  .report-export-actions {
    justify-content: stretch;
  }

  .report-export-actions button {
    flex: 1 1 140px;
  }

  .checkbox-panel {
    grid-column: auto;
  }

  .membership-form-actions {
    justify-content: stretch;
  }

  .membership-form-actions button {
    flex: 1 1 180px;
  }
}

@media (max-width: 899px) {
  .members-layout.profile-open {
    grid-template-columns: 1fr;
  }

  .members-layout.profile-open .member-list-panel,
  .members-layout.profile-open .member-list-panel.active,
  .members-layout.profile-open .member-profile,
  .members-layout.profile-open .member-profile.active,
  .members-layout.profile-open .member-package-panel,
  .members-layout.profile-open .member-package-panel.active {
    grid-column: auto;
    position: static;
  }
}
