:root {
  --paper: #f5f7fb;
  --ink: #142542;
  --edge: #dce4f1;
  --accent: #2557cc;
  --pn-navy: #102845;
  --pn-solid: #2557cc;
  --pn-blue-soft: #e8f0ff;
}
body { background: var(--paper); color: var(--ink); }
:where(button, input, select, summary, a):focus-visible {
  outline: 2px solid #275dc9;
  outline-offset: 3px;
}
header {
  background: #fff;
  border-color: var(--edge);
}
.bar .brand { margin-right: auto; }
.bar .topGuide { min-height: 44px; }
.bar #noticeBell { background: #eef3fb; color: var(--pn-solid); }
.bar #noticeBell sup { background: #a12a39; }
.navstrip {
  background: var(--pn-navy);
  gap: 6px;
}
.navstrip button { color: #dfebfa; }
.navstrip button:hover { background: #1d3b63; color: white; }
.navstrip .on, .navstrip .on:hover {
  background: #e5eeff;
  color: #1c4593;
}
.icon-more {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='5' cy='12' r='1.55'/%3E%3Ccircle cx='12' cy='12' r='1.55'/%3E%3Ccircle cx='19' cy='12' r='1.55'/%3E%3C/svg%3E");
}
.todayhead { border-radius: 20px; }
.shiftcard { border-color: var(--edge); }
.shiftcard:hover, .producttile:hover { border-color: #93b0e2; background: #f6f9ff; }
:is(.shiftcard,.producttile,.more-tile):active { transform: translateY(1px); }

#sheet:has(.more-grid) { max-width: 430px; }
.more-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 6px 0 4px;
}
.more-tile {
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 8px;
  min-width: 0;
  border: 1px solid #d9e4f5;
  border-radius: 16px;
  background: #f6f9ff;
  font-size: .87rem;
  line-height: 1.22;
}
.more-tile:hover, .more-tile[aria-current] { background: #e8f0ff; border-color: #91afe5; }
.more-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--pn-blue-soft);
  color: #234f9e;
}
.more-icon .navicon { width: 24px; height: 24px; }
.tile-shop .more-icon { background: #e5edf9; color: #264a83; }
.tile-personal .more-icon { background: #f4ebdc; color: #795524; }

.session-screen { max-width: 1060px; margin: auto; }
.session-screen .back { min-height: 44px; color: var(--pn-solid); margin-bottom: 9px; }
.session-screen .sessionhead {
  background: linear-gradient(135deg, #102745 12%, #244675 100%);
  border-radius: 20px;
  padding: clamp(16px, 3vw, 28px);
  margin: 0 0 16px;
}
.sessiontitle { align-items: center; }
.session-screen .sessiontitle h1 { margin: 5px 0 0; letter-spacing: -.055em; }
.session-screen .sessiontitle small { color: #d8e6fa; }
.session-screen .sessionmenu {
  min-height: 44px;
  flex: none;
  background: #f1f6ff1a;
  border-color: #f1f6ff66;
}
.session-metrics {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px;
  margin: 17px 0 0;
}
.session-metrics > div {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  background: #ffffff12;
  border: 1px solid #ffffff24;
  border-radius: 11px;
  padding: 8px 10px;
}
.session-metrics dt { color: #dbe8fc; font-size: .76rem; font-weight: 550; }
.session-metrics dd { margin: 0; font-size: 1.13rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.session-screen .tabs {
  margin: 0 0 16px;
  gap: 4px;
  padding: 4px;
  background: #eaf0fa;
  border: 1px solid #dbe5f5;
  border-radius: 13px;
}
.session-screen .tabs button {
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #405777;
}
.session-screen .tabs .on {
  background: white;
  box-shadow: 0 1px 4px #18365a20;
  color: var(--pn-solid);
}
.session-players {
  padding: clamp(10px, 2vw, 20px);
  border: 1px solid var(--edge);
  border-radius: 18px;
  background: #fff;
}
.session-players .section { margin: 0 0 10px; gap: 7px; }
.session-players .section h2 { margin: 0; }
.session-players .section .lite { min-height: 44px; white-space: nowrap; }
.session-players .search { margin-bottom: 12px; }
.session-screen .rows { gap: 8px; }
.session-screen .rostercard {
  gap: 6px;
  padding: 9px 10px;
  background: #fcfdff;
  min-width: 0;
}
.session-screen .rostercard[data-sex="Nữ"], .session-screen .playercard[data-sex="Nữ"] { background: #eef6fc; }
.session-screen .rostercard .name {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  align-items: center;
  min-height: 44px;
}
.session-screen .rostercard .name > strong { overflow-wrap: anywhere; }
.session-screen .rostercard .name > small { grid-row: 2; }
.session-screen .rostercard .playstats { grid-area: 1 / 2 / 3 / 3; margin: 0; }
.session-screen .rostercard .rowactions {
  width: 100%;
  max-width: none;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 5px;
}
.session-screen .rowactions button {
  min-height: 44px;
  max-width: 100%;
  white-space: normal;
}
.session-screen .playercard {
  min-height: 60px;
  border-color: var(--edge);
  box-shadow: none;
}
.session-screen .playercard[aria-pressed="true"] {
  border-color: var(--pn-solid);
  background: #e8f1ff;
  box-shadow: inset 0 0 0 1px var(--pn-solid);
}
.session-screen .choice { background: #e7effd; color: var(--pn-solid); }
.session-screen .playercard[aria-pressed="true"] .choice { background: var(--pn-solid); color: white; }
.session-screen .playstats { font-variant-numeric: tabular-nums; white-space: nowrap; }
.session-screen .playstats b, .session-screen .waittime { font-size: .77rem; }
.session-screen .waittime.overdue { background: #fde7e8; color: #99232e; }
#dock .primary { background: var(--pn-solid); color: white; }
#dock .primary:disabled { background: #e9eef6; color: #4f607b; }

.balancecard { background: linear-gradient(130deg,#112745,#284a7a); }
.flowlayout .fundbar { background: #e9eff8; }
.fundbar .on { background: var(--pn-navy); }
.kpis > div, .directory .periodbar { background: #eff4fb; }
.directory .dirhead { background: #eaf1fb; }
.directory .dirrow:hover { background: #e6effc; }
.producttile { min-width: 0; }
.pageheading { border-color: var(--edge); }

#guideDialog {
  box-sizing: border-box;
  width: min(680px, calc(100% - 28px));
  max-width: 680px;
  max-height: min(82dvh,780px);
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: 20px;
  background: #fff;
}
.guide-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--edge);
  background: #fff;
}
.guide-toolbar .sheethead { padding: 0; margin: 0 0 8px; border: 0; }
#guideClose { width: 44px; height: 44px; padding: 0; font-size: 1.35rem; }
.guide-toolbar label { margin: 0 0 6px; }
.guide-topics { padding: 10px 18px 18px; }
#guideDialog details { padding: 0; margin: 0 0 8px; border-color: var(--edge); }
#guideDialog summary {
  min-height: 44px;
  padding: 13px 12px;
  background: #f0f5fc;
  color: #254877;
  border-radius: 8px;
}
.guide-content { padding: 12px; }
.guide-content dl { margin: 0; }
.guide-content dl > div { padding: 10px 0; border-top: 1px solid var(--edge); }
.guide-content dt { font-weight: 750; }
.guide-content dd { margin: 4px 0 0; color: #405675; line-height: 1.5; }
.guide-path { color: #466182; font-size: .87rem; margin: 0 0 12px; }

@media (max-width:760px) {
  .phoneMenu {
    gap: 3px;
    background: #fff;
    border-color: var(--edge);
    box-shadow: 0 -4px 18px #1934510d;
  }
  .phoneMenu button { min-width: 0; min-height: 48px; padding: 5px 2px; font-size: clamp(.71rem, 2.9vw, .82rem); }
  .phoneMenu .on { background: var(--pn-blue-soft); color: #214a9c; }
  #sheet:has(.more-grid)[open] {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
  .more-grid { max-width: 440px; margin: auto; }
  .session-screen .section h2 { font-size: 1.17rem; }
  .session-screen .sessionhead { padding: 14px; }
  .session-screen .sessiontitle h1 { font-size: clamp(1.32rem, 6vw, 2rem); }
  .session-screen .queue .playstats { gap: 4px; }
  .session-screen .queue .playercard { grid-template-columns: auto minmax(0,1fr) auto; }
  .session-screen .queue .playerinfo { min-width: 0; overflow-wrap: anywhere; }
  body:has(.session-screen #dock .primary) #dock {
    background: #fff;
    border-color: var(--edge);
    box-shadow: 0 -4px 18px #19345113;
  }
  .session-screen #dock button { min-height: 48px; }
}
@media (max-width:370px) {
  .session-screen .sessionmenu { padding-inline: 7px; font-size: .77rem; }
  .session-screen .queue .choice { width: 26px; height: 26px; }
  .more-tile { gap: 5px; font-size: .8rem; }
  .more-icon { width: 36px; height: 36px; }
}

.session-screen .sessionhead { color: white; }
.manage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}
.manage-grid .manage-group { margin: 0; padding: 14px; }
.manage-group h2 { font-size: 1.05rem; margin: 0 0 8px; }
.manage-tile {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 60px;
  padding: 8px;
  border-color: transparent;
  background: transparent;
  text-align: left;
}
.manage-tile:hover { border-color: #d3e1f4; background: #f3f7fd; }
.manage-tile b, .manage-tile small { display: block; }
.manage-tile small { margin-top: 3px; font-weight: 500; }
.manage-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--pn-blue-soft);
  color: var(--pn-solid);
  border-radius: 10px;
}
.manage-staff .manage-icon { background: #e5edf9; color: #264a83; }
.manage-payments .manage-icon { background: #f4ebdc; color: #795524; }
@media (max-width: 620px) {
  .manage-grid { grid-template-columns: 1fr; }
}

@media (max-width:760px) {
  .bar { gap: 6px; padding-inline: 12px; flex-wrap: nowrap; }
  .bar .brandlogo { flex: none; width: 34px; height: 34px; }
  .bar .brand { flex: 1; font-size: .9rem; line-height: 1.15; }
  .bar .brand small { display: none; }
  .bar .topGuide { flex: none; }
  .bar #account { flex: none; }
  .session-screen .tabs button { white-space: nowrap; padding-inline: 6px; }
  .session-screen #dock button:first-child:not(.primary) { flex: 0 0 auto; }
  .session-screen #dock .primary { flex: 1; padding-inline: 9px; }
}
@media (max-width:370px) {
  .session-screen .queue .playercard {
    display: grid;
    grid-template-columns: auto minmax(0,1fr);
    row-gap: 4px;
    padding: 8px;
    text-align: left;
  }
  .session-screen .queue .choice { grid-row: span 2; }
  .session-screen .queue .playstats { grid-column: 2; justify-content: start; }
  .session-screen .queue .playerinfo small { white-space: normal; }
  .session-metrics > div { padding-inline: 7px; }
}

@media (min-width:761px) {
  #sheet:has(.more-tile:only-child) { max-width: 286px; }
  .more-grid:has(.more-tile:only-child) {
    grid-template-columns: minmax(0, 114px);
    justify-content: center;
  }
}

@media (min-width: 920px) {
  body:has(.navstrip) main {
    width: calc(100% - 200px);
    max-width: none;
    margin: 0 0 0 200px;
    padding-inline: max(28px, calc((100vw - 1700px) / 2));
  }
  .report-toolbar { display: flex; gap: 16px; align-items: start; }
  .report-toolbar > .panel { flex: 1; min-width: 0; }
  .report-toolbar > .pageactions { flex: none; margin-top: 0; }
  .report-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
  .report-columns > .panel { margin: 0; }
}
.brandlogo { border-radius: 8px; }
.customer-qr-card {
  display: grid;
  place-items: center;
  min-width: 0;
  gap: 8px;
  background: #f0f5fc;
  color: #102845;
  text-align: center;
  border-radius: 14px;
  padding: 14px;
}
.customer-qr-card strong { font-size: 1.18rem; overflow-wrap: anywhere; }
.customer-qr-card canvas { width: min(210px,100%); height: auto; image-rendering: pixelated; }
.qr-camera {
  max-height: 44dvh;
  border-radius: 14px;
  overflow: hidden;
  background: #102845;
}
.qr-camera video { display: block; width: 100%; max-height: 44dvh; object-fit: contain; }
.qr-file-button {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 8px 12px;
  margin: 0;
  border: 1px solid #cdd9ed;
  border-radius: 10px;
  cursor: pointer;
}
.qr-file-button input { position: absolute; inset: 0; opacity: 0; width: 100%; margin: 0; cursor: pointer; }
.qr-file-button:focus-within { outline: 2px solid #2557cc; }
.qr-customer-row,.account-venue {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--edge);
}
.qr-customer-row small,.account-venue small,.account-hero small { display: block; margin-top: 4px; }
.customer-qr-footer { position: sticky; bottom: 0; background: white; padding-block: 8px; }
#openCustomerQr { width: 100%; margin-bottom: 4px; color: #234f9e; background: #eef4ff; }
#sheet:has(.account-panel) { width: min(560px,100%); max-width: none; }
.account-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  color: #102845;
  background: #eef4fe;
  border-radius: 14px;
}
.account-hero > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.account-hero .face { width: 48px; height: 48px; }
.account-hero .lite { flex: none; }
.account-setting {
  display: grid;
  align-items: center;
  grid-template-columns: 22px minmax(0,1fr) 10px;
  gap: 12px;
  width: 100%;
  min-height: 47px;
  text-align: left;
  margin: 0 !important;
  border-width: 0 0 1px;
  border-radius: 0;
}
.account-current { color: #234f9e; font-size: .85rem; }
.account-logout { color: #99232e; }
@media (max-width: 650px) {
  #sheet:has(.account-panel)[open] { width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
}

.first-feature-guide {
  margin: 8px 0 14px;
  padding: 12px 14px;
  background: #f0f5fe;
  border: 1px solid #d3e2fa;
  border-radius: 12px;
  line-height: 1.45;
}
.first-feature-guide summary { color: #214a9c; cursor: pointer; font-weight: 700; }
.first-feature-guide li { margin: 5px 0; }
.first-feature-guide ol { margin: 8px 0; padding-left: 20px; }
.first-feature-guide .pageactions { margin: 8px 0 0; }

.venue-welcome { max-width: 880px; margin: 24px auto; }
.venue-welcome-head { display: flex; align-items: center; gap: 14px; background: transparent; border: 0; margin-bottom: 18px; }
.venue-welcome-head img { width: 64px; height: 64px; border-radius: 14px; }
.venue-welcome-head h1 { margin: 0 0 4px; font-size: clamp(1.45rem,4vw,2.25rem); }
.venue-welcome-head p,.venue-choice p { margin: 0 0 12px; color: #415675; }
.venue-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.venue-choice { min-width: 0; padding: 20px; border: 1px solid #dce4f1; background: white; border-radius: 16px; }
.venue-choice h2 { margin: 0 0 8px; font-size: 1.2rem; }
.venue-choice .primary { min-height: 44px; }
.venue-choice #inviteSummary:not(:empty) { padding: 10px; margin-bottom: 10px; background: #e8f0ff; border-radius: 8px; }
#sheet:has(.venue-welcome) { width: min(780px,100%); max-width: none; }
.venue-setup { max-width: 650px; }
.venue-setup-steps { display: flex; gap: 16px; padding-left: 25px; font-size: .87rem; color: #4a5a75; }
.venue-setup-steps [aria-current] { color: #2155c4; font-weight: 750; }
.venue-quick-guide li { margin: 8px 0; }
@media (max-width:620px) {
  .venue-choice-grid { grid-template-columns: 1fr; gap: 12px; }
  .venue-welcome { margin: 8px auto; }
  .venue-choice { padding: 14px; }
}

.qr-customer-row { display: grid; gap: 9px; align-items: stretch; }
.qr-slot-header,.qr-slot-quantity,.qr-slot-quantity > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.qr-slot-quantity button { min-width: 44px; min-height: 44px; padding: 0; }
.qr-slot-quantity output { min-width: 2ch; text-align: center; font-weight: 750; }
.qr-customer-row label { margin: 0; }
.qr-capacity-warning { color: #99232e; font-weight: 650; }
