:root {
  font-family: Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color: #25221e;
  background: #f8f7f4;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
}
button,input,select,textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
.hidden {
  display: none!important;
}
.muted {
  color: #6b7b84;
}
.small {
  font-size: .83rem;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 800;
  font-size: .7rem;
  color: #a62720;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -.04em;
}
.mark {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  background: #141313;
  border: 1px solid #b89854;
  box-shadow: 0 5px 18px #0003;
}
.brand-suffix { color: #b2a68e; font-weight: 550; }
.hero-logo { width: min(215px, 55%); aspect-ratio: 1; object-fit: cover; border-radius: 18px; margin: 0 0 28px; box-shadow: 0 15px 48px #0009; }
.login-story { position: relative; z-index: 1; }
.brand-name {
  font-size: 1.25rem;
}
.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(0,1fr);
  min-height: 100vh;
}
.sidebar {
  background: #171512;
  color: #eaf0f2;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  padding: 0 13px;
}
.sidebar .brand-name {
  color: white;
}
.side-label {
  font-size: .67rem;
  font-weight: 800;
  color: #88a0ad;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 0 16px;
  margin: 4px 0 10px;
}
.nav-list {
  display: grid;
  gap: 4px;
}
.nav-item {
  border: 0;
  background: transparent;
  color: #c1b9aa;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 11px;
  text-align: left;
  font-weight: 650;
  font-size: .92rem;
}
.nav-item:hover {
  color: white;
  background: #ffffff12;
}
.nav-item.active {
  background: #c9a65e;
  color: #211b11;
  box-shadow: 0 8px 20px #0002;
}
.nav-icon {
  font-size: 1.15rem;
  width: 21px;
  text-align: center;
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid #ffffff24;
  padding: 20px 12px 0;
}
.avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #ffffff25;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
}
.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-row strong {
  display: block;
  color: white;
  font-size: .89rem;
}
.user-row span {
  font-size: .75rem;
  color: #9eb0ba;
}
.signout {
  color: #bacbd2;
  border: 0;
  background: none;
  padding: 17px 0 0;
  text-align: left;
  font-size: .8rem;
}
.main {
  min-width: 0;
  padding: 30px clamp(20px,4vw,58px) 70px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 31px;
}
.breadcrumbs {
  color: #8b9aa2;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #27a47b;
  display: inline-block;
  margin-right: 7px;
}
.top-chip {
  border: 1px solid #dfe5e7;
  background: #fff;
  padding: 9px 13px;
  border-radius: 999px;
  color: #425760;
  font-size: .78rem;
  font-weight: 700;
}
.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.page-head h1 {
  font-size: clamp(1.8rem,3vw,2.55rem);
  line-height: 1.1;
  letter-spacing: -.045em;
  margin: 6px 0 8px;
}
.page-head p {
  color: #667882;
  margin: 0;
  max-width: 610px;
  line-height: 1.5;
}
.page-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.btn {
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 11px 17px;
  min-height: 43px;
  background: #201c17;
  color: white;
  font-weight: 750;
  font-size: .87rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.btn:hover {
  filter: brightness(1.1);
}
.btn.primary {
  background: #b88b36;
  color: #17130d;
}
.btn.secondary {
  background: #fff;
  border-color: #d9e1e4;
  color: #233842;
}
.btn.ghost {
  background: #eff3f4;
  color: #304550;
}
.btn.danger {
  background: #fff3ef;
  color: #bb4c38;
}
.btn.small {
  min-height: 34px;
  padding: 7px 11px;
  font-size: .77rem;
  border-radius: 9px;
}
.btn:disabled {
  opacity: .48;
  cursor: not-allowed;
}
.grid {
  display: grid;
  gap: 18px;
}
.grid.metrics {
  grid-template-columns: repeat(4,minmax(0,1fr));
}
.grid.metrics.superadmin-metrics { grid-template-columns: repeat(5,minmax(0,1fr)); }
.grid.two {
  grid-template-columns: minmax(0,1.5fr) minmax(300px,1fr);
}
.grid.equal {
  grid-template-columns: repeat(2,minmax(0,1fr));
}
.card {
  background: white;
  border: 1px solid #e0e7e9;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 2px 10px #17293605;
}
.card.flush {
  padding: 0;
}
.card h2,.card h3 {
  letter-spacing: -.025em;
}
.card h2 {
  font-size: 1.2rem;
  margin: 0 0 7px;
}
.card h3 {
  font-size: 1rem;
  margin: 0 0 12px;
}
.card p {
  line-height: 1.5;
}
.metric {
  padding: 21px 22px;
}
.metric .value {
  font-size: 2rem;
  font-weight: 850;
  letter-spacing: -.06em;
  margin: 11px 0 4px;
}
.metric .caption {
  font-size: .77rem;
  color: #75868d;
  font-weight: 700;
}
.metric .icon {
  width: 35px;
  height: 35px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #fbf3df;
  color: #9b6f1e;
  font-size: 1.1rem;
}
.accent-card {
  background: #211b15;
  color: white;
  border-color: #211b15;
  position: relative;
  overflow: hidden;
}
.accent-card:after {
  content: "";
  width: 210px;
  height: 210px;
  border: 1px solid #ffffff22;
  border-radius: 50%;
  position: absolute;
  right: -80px;
  top: -70px;
  box-shadow: 0 0 0 34px #ffffff06,0 0 0 68px #ffffff05;
}
.accent-card p {
  color: #b8c8d0;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 30px 0 15px;
}
.section-title h2 {
  font-size: 1.13rem;
  margin: 0;
  letter-spacing: -.025em;
}
.market-list,.list {
  display: grid;
  gap: 11px;
}
.market-row,.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 18px;
  border: 1px solid #e0e7e9;
  background: white;
  border-radius: 13px;
}
.market-row:hover,.list-row:hover {
  border-color: #b9c9ce;
}
.market-ident {
  display: flex;
  align-items: center;
  gap: 13px;
}
.market-symbol {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #f3f6f6;
  color: #a77b27;
  font-weight: 900;
}
.market-name,.list-title {
  font-weight: 800;
}
.market-sub,.list-sub {
  font-size: .78rem;
  color: #74858e;
  margin-top: 4px;
}
.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pill {
  font-size: .7rem;
  font-weight: 850;
  border-radius: 999px;
  padding: 7px 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.pill.running,.pill.active,.pill.approved,.pill.paid {
  background: #e4f6ef;
  color: #148063;
}
.pill.upcoming,.pill.pending,.pill.partial {
  background: #fff3db;
  color: #966007;
}
.pill.time_over,.pill.closed,.pill.inactive {
  background: #edf1f2;
  color: #677780;
}
.table-wrap {
  overflow: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
}
.table th {
  text-align: left;
  color: #74858e;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 800;
  background: #f8faf9;
}
.table td,.table th {
  padding: 13px 14px;
  border-bottom: 1px solid #e9eeee;
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table td strong {
  font-weight: 800;
}
.empty {
  padding: 42px;
  text-align: center;
  color: #75858d;
}
.empty strong {
  display: block;
  color: #29404a;
  margin-bottom: 7px;
  font-size: 1rem;
}
.field {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
}
.field label {
  font-size: .77rem;
  font-weight: 800;
  color: #52656e;
}
.field input,.field select,.field textarea,.search {
  border: 1px solid #dbe3e6;
  background: #fbfcfc;
  border-radius: 10px;
  min-height: 43px;
  padding: 10px 12px;
  width: 100%;
  outline: 0;
  color: #25221e;
}
.field textarea {
  min-height: 78px;
  resize: vertical;
}
.field input:focus,.field select:focus,.field textarea:focus,.search:focus {
  border-color: #b88b36;
  box-shadow: 0 0 0 3px #b88b3628;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 0 15px;
}
.form-grid.three {
  grid-template-columns: repeat(3,minmax(0,1fr));
}
.form-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.hint {
  color: #7d8c94;
  font-size: .78rem;
  line-height: 1.45;
}
.notice {
  padding: 13px 15px;
  border-radius: 11px;
  background: #eaf4f8;
  color: #315a6c;
  font-size: .83rem;
  line-height: 1.45;
}
.notice.warn {
  background: #fff3e9;
  color: #8b5c36;
}
.notice.error {
  background: #fff0eb;
  color: #ad4632;
}
.tabs {
  display: flex;
  gap: 5px;
  border-bottom: 1px solid #dfe6e8;
  margin: 0 0 18px;
  overflow: auto;
}
.tab {
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: #72848d;
  font-weight: 750;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.tab.active {
  color: #9b6f1e;
  border-color: #b88b36;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar .search {
  max-width: 300px;
}
.toolbar select {
  max-width: 180px;
}
.inline-select {
  border: 1px solid #dbe3e6;
  border-radius: 9px;
  background: white;
  padding: 8px 10px;
}
.total-bar {
  background: #172936;
  color: white;
  border-radius: 13px;
  padding: 17px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.total-bar strong {
  font-size: 1.55rem;
  letter-spacing: -.04em;
}
.receipt {
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  padding: 27px;
  border: 1px dashed #9aa9ad;
  box-shadow: 0 12px 30px #17293610;
}
.receipt-head {
  text-align: center;
  margin-bottom: 17px;
}
.receipt-head h2 {
  font-size: 1.45rem;
  margin: 8px 0;
}
.receipt table {
  width: 100%;
  border-collapse: collapse;
  font-family: ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size: .8rem;
}
.receipt th,.receipt td {
  text-align: left;
  padding: 7px 4px;
  border-bottom: 1px solid #ddd;
}
.receipt td:last-child,.receipt th:last-child {
  text-align: right;
}
.receipt-total {
  display: flex;
  justify-content: space-between;
  font-weight: 900;
  font-size: 1.15rem;
  padding: 17px 0;
  border-top: 2px solid #172936;
  margin-top: 5px;
}
.receipt-note {
  text-align: center;
  color: #7e8b90;
  font-size: .75rem;
  margin-top: 25px;
}
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-visual {
  background: radial-gradient(circle at 70% 35%, #40372b, #171512 60%);
  color: white;
  padding: clamp(30px,6vw,85px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-visual:after {
  content: "";
  position: absolute;
  width: 450px;
  height: 450px;
  border: 1px solid #ffffff18;
  border-radius: 50%;
  right: -130px;
  bottom: -190px;
  box-shadow: 0 0 0 72px #ffffff06,0 0 0 145px #ffffff04;
}
.login-visual .brand {
  position: relative;
  z-index: 1;
}
.login-visual h1 {
  font-size: clamp(3rem,5vw,5.8rem);
  line-height: 1.03;
  letter-spacing: -.07em;
  max-width: 590px;
  margin: 0 0 24px;
}
.login-visual p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #d2c7b4;
  max-width: 480px;
}
.login-foot {
  color: #91a6b0;
  font-size: .8rem;
}
.login-panel {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}
.login-card {
  width: min(420px,100%);
}
.login-card h2 {
  font-size: 2.2rem;
  letter-spacing: -.05em;
  margin: 8px 0;
}
.login-card>p {
  color: #74858e;
  line-height: 1.5;
  margin-bottom: 30px;
}
.login-card .btn {
  width: 100%;
  margin-top: 8px;
}
.login-card .field {
  margin-bottom: 18px;
}
.mini-brand {
  display: none;
}
.account-hint {
  border-top: 1px solid #e0e6e8;
  margin-top: 28px;
  padding-top: 20px;
  font-size: .79rem;
  color: #819098;
  line-height: 1.5;
}
#toast {
  position: fixed;
  right: 25px;
  bottom: 25px;
  background: #171512;
  color: white;
  border-radius: 11px;
  padding: 13px 18px;
  box-shadow: 0 15px 40px #17293630;
  font-weight: 700;
  font-size: .85rem;
  max-width: 360px;
  z-index: 100;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all .2s;
}
#toast.show {
  opacity: 1;
  transform: translateY(0);
}
#toast.error {
  background: #b64433;
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #ffffff65;
  border-top-color: white;
  border-radius: 50%;
  display: inline-block;
  animation: spin .8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading {
  padding: 60px;
  text-align: center;
  color: #778890;
}
.split-line {
  border: 0;
  border-top: 1px solid #e6ecee;
  margin: 18px 0;
}
.right {
  text-align: right;
}
.nowrap {
  white-space: nowrap;
}
.clickable {
  cursor: pointer;
}
.code {
  font-family: ui-monospace,SFMono-Regular,Menlo,monospace;
}
.intro-strip {
  border-radius: 13px;
  background: #fff4ef;
  padding: 17px 20px;
  color: #9d4f3b;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
  font-size: .85rem;
}
.login-visual .accent-word {
  color: #e2be70;
}
@media(max-width:1100px) {
  .grid.metrics {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .grid.metrics.superadmin-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid.two {
    grid-template-columns: 1fr;
  }
  .app-shell {
    grid-template-columns: 205px minmax(0,1fr);
  }
}
@media(max-width:720px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    height: auto;
    position: static;
    padding: 13px 16px;
    gap: 10px;
  }
  .sidebar .brand {
    padding: 0;
  }
  .sidebar .brand-name {
    font-size: 1rem;
  }
  .side-label,.sidebar-bottom {
    display: none;
  }
  .nav-list {
    display: flex;
    overflow: auto;
    gap: 4px;
  }
  .nav-item {
    padding: 9px 11px;
    font-size: .78rem;
    white-space: nowrap;
  }
  .nav-icon {
    display: none;
  }
  .main {
    padding: 20px 15px 65px;
  }
  .topbar {
    margin-bottom: 18px;
  }
  .page-head {
    align-items: start;
    flex-direction: column;
  }
  .grid.metrics,.grid.equal {
    grid-template-columns: 1fr 1fr;
  }
  .grid.metrics.superadmin-metrics { grid-template-columns: 1fr 1fr; }
  .form-grid,.form-grid.three {
    grid-template-columns: 1fr;
  }
  .market-row,.list-row {
    align-items: start;
    flex-direction: column;
  }
  .row-actions {
    width: 100%;
    justify-content: space-between;
  }
  .login-wrap {
    display: block;
  }
  .login-visual {
    min-height: 210px;
    padding: 30px;
  }
  .login-visual h1 {
    display: none;
  }
  .hero-logo { width: 95px; margin: 0 12px 0 0; float: left; border-radius: 10px; }
  .login-story { margin-top: 24px; }
  .login-visual p {
    margin: 0;
  }
  .login-foot {
    display: none;
  }
  .login-panel {
    padding: 35px 22px;
  }
  .mini-brand {
    display: flex;
    margin-bottom: 15px;
  }
  .toolbar .search {
    max-width: none;
  }
  .top-chip {
    display: none;
  }
}
@media(max-width:430px) {
  .grid.metrics,.grid.equal {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 18px;
  }
  .table td,.table th {
    padding: 10px 8px;
  }
  .receipt {
    padding: 15px;
  }
}
@media print {
  body {
    background: white;
  }
  .sidebar,.topbar,.page-head,.page-actions,.no-print,#toast,.receipt+.no-print {
    display: none!important;
  }
  .app-shell,.main {
    display: block;
    padding: 0;
  }
  .receipt {
    border: 0;
    box-shadow: none;
    max-width: none;
    padding: 0;
    margin: 0;
  }
  @page {
    size: 80mm auto;
    margin: 4mm;
  }
}
.top-signout {
  display: none;
  border: 1px solid #dbe3e6;
  background: white;
  color: #334852;
  border-radius: 9px;
  padding: 7px 10px;
  font-size: .76rem;
  font-weight: 750;
}
@media(max-width:720px) {
  .top-signout {
    display: inline-flex;
  }
}

/* Admin and Agent screens follow the supplied dark reference workspace. */
.ref-mobile-menu { display: none; }
.reference-shell { grid-template-columns: 290px minmax(0,1fr); background: #e4edf7; color: #35445b; }
.reference-shell .sidebar { background: #111923; padding: 14px 12px; gap: 18px; }
.reference-shell .sidebar .brand { padding: 3px 11px 13px; border-bottom: 1px solid #273340; }
.reference-shell .brand-name { font-size: .95rem; color: #f5f7fa; }
.reference-shell .brand-suffix { color: #f3943e; }
.reference-shell .mark { width: 36px; height: 36px; border-radius: 50%; }
.reference-shell .side-label { letter-spacing: 0; text-transform: none; color: #d9e0e9; font-size: .78rem; margin: 2px 0 10px; }
.reference-shell .nav-item { color: #e9eef5; padding: 11px 13px; border-radius: 4px; font-size: .92rem; }
.reference-shell .nav-item.active { color: #fff; background: #1c2a3d; box-shadow: none; }
.reference-shell .nav-icon { color: #f7953a; }
.reference-shell .nav-group summary { cursor: pointer; list-style: none; }
.reference-shell .nav-group summary::-webkit-details-marker { display: none; }
.reference-shell .nav-chevron { margin-left: auto; font-size: 1.2rem; }
.reference-shell .nav-group[open] .nav-chevron { transform: rotate(90deg); }
.reference-shell .nav-children { margin: 0 0 4px 29px; border-left: 1px solid #394451; padding-left: 7px; }
.reference-shell .nav-children .nav-item { padding: 8px 11px; font-size: .86rem; }
.reference-shell .sidebar-bottom { border-top-color: #34404d; }
.reference-shell .signout { color: #f7953a; }
.reference-shell .main { padding: 28px 28px 70px; }
.reference-shell.view-dashboard .topbar,.reference-shell.view-dashboard .page-head { display: none; }
.reference-shell.view-history .topbar,.reference-shell.view-history .page-head,
.reference-shell.view-cancel-history .topbar,.reference-shell.view-cancel-history .page-head,
.reference-shell.view-cutting .topbar,.reference-shell.view-cutting .page-head,
.reference-shell.view-board .topbar,.reference-shell.view-board .page-head,
.reference-shell.view-result .topbar,.reference-shell.view-result .page-head,
.reference-shell.view-win .topbar,.reference-shell.view-win .page-head,
.reference-shell.view-agent-report .topbar,.reference-shell.view-agent-report .page-head,
.reference-shell.view-points .topbar,.reference-shell.view-points .page-head { display: none; }
.reference-shell.view-markets .topbar,.reference-shell.view-markets .page-head,
.reference-shell.view-market-editor .topbar,.reference-shell.view-market-editor .page-head { display: none; }
.reference-shell.view-agents .topbar,.reference-shell.view-agents .page-head,
.reference-shell.view-agent-editor .topbar,.reference-shell.view-agent-editor .page-head { display: none; }
.reference-shell.view-rates .topbar,.reference-shell.view-rates .page-head { display: none; }
.reference-shell.view-villages .topbar,.reference-shell.view-villages .page-head,
.reference-shell.view-village-editor .topbar,.reference-shell.view-village-editor .page-head,
.reference-shell.view-village-hisab .topbar,.reference-shell.view-village-hisab .page-head { display: none; }
.ref-market-list { display: grid; grid-template-columns: 1fr; gap: 15px; }
.ref-market-card { background: #111923; border-radius: 4px; padding: 18px 23px 22px; box-shadow: 0 2px 4px #18253612; color: #f2f6f9; }
.ref-market-title { font-size: 1rem; font-weight: 800; padding-bottom: 13px; border-bottom: 1px solid #34404d; }
.ref-market-title span { font-size: .91rem; margin-left: 3px; }
.ref-market-result { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 0 13px; border-bottom: 1px solid #34404d; }
.ref-market-result strong { color: #ef9140; font-size: .88rem; letter-spacing: .02em; }
.ref-market-result .is-closed { color: #a72432; font-size: .78rem; font-weight: 750; }
.ref-market-result .is-running { color: #43b98d; font-size: .78rem; font-weight: 750; }
.ref-market-actions { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 12px; }
.ref-btn { min-height: 30px; border-radius: 3px; padding: 6px 12px; font-size: .79rem; font-weight: 750; box-shadow: none; }
.ref-orange { color: #101823; background: #f19640; }
.ref-red { color: #fff; background: #961b24; }
.ref-light { color: #111923; background: #e6edf6; }
.ref-agent-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #111923; color: white; padding: 10px 16px; margin: -28px -28px 18px; font-size: .82rem; font-weight: 750; }
.ref-point-badge { background: #f7953a; color: #111923; border-radius: 3px; padding: 7px 11px; }
.ref-draft { margin: 0 0 14px; padding: 10px; background: #fff3e7; border-radius: 4px; }
.ref-panel { background: #fff; border-radius: 4px; padding: 24px; margin-bottom: 15px; box-shadow: 0 1px 4px #14212f12; }
.ref-panel h2 { margin: 0 0 14px; color: #35445b; }
.ref-panel-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e6e8eb; padding-bottom: 11px; margin-bottom: 10px; }
.ref-panel-head h2,.ref-panel-head h3 { margin: 0; }
.ref-panel-head h3 { color: #bd322d; }
.ref-filter-grid { display: grid; grid-template-columns: repeat(3,minmax(130px,1fr)); gap: 10px 28px; align-items: end; border-bottom: 1px solid #e7e9ed; padding-bottom: 20px; margin-bottom: 12px; }
.ref-filter-grid .field { margin: 0; }
.ref-filter-grid label,.ref-win-form label { display: none; }
.ref-filter-grid input,.ref-filter-grid select,.ref-win-form input,.ref-win-form select { min-height: 38px; border-radius: 3px; }
.ref-purple { color: #fff; background: #7848ef; border-radius: 3px; min-height: 38px; }
.ref-dark { color: #fff; background: #111923; }
.ref-table { border-collapse: collapse; width: 100%; color: #4a556c; font-size: .88rem; }
.ref-table th { text-align: left; border-bottom: 1px solid #cbd1d9; padding: 9px 5px; }
.ref-table td { padding: 9px 5px; border-bottom: 1px solid #dde1e6; }
.ref-table tbody tr:nth-child(odd) { background: #f3f4f7; }
.ref-empty-row { text-align: center; color: #7e8591; font-size: .78rem; }
.ref-pagination { text-align: right; font-size: .8rem; padding: 12px 4px; }
.ref-result-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 720px; margin: 25px auto; }
.ref-wide { min-width: 240px; display: block; margin: 16px auto 0; }
.ref-points-current { border-top: 1px solid #e7e9ed; padding-top: 15px; }
.ref-list-search { display: flex; gap: 10px; align-items: end; margin-bottom: 14px; }
.ref-list-search .field { min-width: 220px; max-width: 400px; margin: 0; }
.ref-list-search label { display: none; }
.ref-assignment-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.ref-assignment-list label { padding: 7px; border: 1px solid #e4e8ed; border-radius: 4px; }
.ref-list-actions { display: flex; align-items: end; gap: 18px; }
.ref-list-actions .field { margin: 0; }
.ref-list-actions .field label { display: none; }
.ref-list-actions input { min-width: 240px; }
.ref-check { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.ref-hisab-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.ref-hisab-head h2 { margin-right: auto; }
.ref-hisab-head .field { margin: 0; }
.ref-cutting .ref-table td { width: 50%; }
.ref-cutting-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; color: #687386; }
.ref-cutting-summary strong { color: #172234; font-size: 1.05rem; }
.ref-win-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ref-win-form .field:nth-child(3),.ref-win-form .field:nth-child(4),.ref-win-actions { grid-column: 1 / -1; }
.ref-win-actions { display: flex; justify-content: space-around; gap: 8px; padding: 11px; }
.ref-win-actions .btn { min-width: 80px; }
.ref-win-section { margin-top: 15px; }
.ref-win-section h2 { margin: 0; padding: 10px; text-align: center; background: #f48a2e; }
.ref-win-section .ref-win-actions { background: #f48a2e; padding: 5px; }
.ref-points-banner { background: #a0001c; color: white; border-radius: 4px; padding: 18px; margin-bottom: 16px; }
.ref-points-banner strong { font-size: 1.1rem; }
.ref-dark-panel { background: #111923; color: #f2f4f7; border-radius: 4px; padding: 17px; margin-bottom: 15px; }
.ref-dark-panel h2,.ref-dark-panel h3 { color: #f3f5f9; margin: 0 0 15px; }
.ref-dark-panel .ref-table { color: #f2f4f7; }
.ref-dark-panel .ref-table tbody tr:nth-child(odd) { background: #172333; }
.ref-dark-panel > div { display: flex; justify-content: space-between; border-top: 1px solid #3d4856; padding: 8px 2px; }
.ref-dark-panel .field { max-width: 180px; }
.ref-board-section { padding: 10px; }
.ref-board-head { background: #a01d26; color: white; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px; }
.ref-board-head h3 { margin: 0; font-size: 1.15rem; }
.ref-board-head > div { display: flex; gap: 4px; }
.ref-board-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; padding: 11px 6px; }
.ref-board-tile { background: #f29745; color: #533a25; min-height: 48px; display: grid; place-items: center; font-size: .85rem; }
.ref-board-tile.highlight { background: #fffbb9; }
.ref-board-tile strong,.ref-board-tile span { display: block; }
.ref-board-total { border-top: 1px solid #e4e8ee; text-align: right; padding: 9px; font-size: 1.15rem; font-weight: 800; }
.ref-board-empty { color: #7b8490; font-size: .85rem; }
.ref-card-sequence-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-top: 16px; }
.ref-card-sequence { overflow: hidden; border: 1px solid #e5e8ee; border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(20,28,40,.06); }
.ref-card-sequence > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; color: #fff; background: linear-gradient(110deg,#981c2a,#c4323d); }
.ref-card-sequence h2 { margin: 3px 0 0; color: inherit; font-size: 1.1rem; }
.ref-card-ank { color: #ffe1b9; font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ref-sequence-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 7px; padding: 14px; }
.ref-sequence-number { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; border: 1px solid #f1c38f; border-radius: 8px; color: #553b28; background: #fff3e4; }
.ref-sequence-number small { color: #9b744d; font-size: .62rem; line-height: 1; }
.ref-sequence-number strong { font-size: .92rem; letter-spacing: .03em; }
.ref-card-sequence > footer { padding: 0 15px 13px; color: #77808d; font-size: .78rem; }
.ref-rate-panel h2 { color: #ec9140; }
.ref-rate-select { display: flex; align-items: end; gap: 12px; margin-bottom: 14px; }
.ref-rate-select .field { flex: 1; display: grid; grid-template-columns: 1fr 1fr; align-items: center; margin: 0; }
.ref-rate-row { border-top: 1px solid #e7e9ed; padding: 13px 0; }
.ref-rate-row .field { display: grid; grid-template-columns: 1fr 1fr; align-items: center; margin: 0; }
.ref-rate-row input { min-height: 38px; }
.ref-payment-filter,.ref-report-filter { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ref-payment-filter .field,.ref-report-filter .field { min-width: 180px; margin: 0; }
.ref-payment-filter .field:nth-child(2),.ref-report-filter .field:nth-child(2) { flex: 1; }
.ref-payment-summary { border-collapse: collapse; min-width: min(100%,440px); color: #4a556c; }
.ref-payment-summary th,.ref-payment-summary td { padding: 8px 12px; border-bottom: 1px solid #dde1e6; text-align: left; }
.ref-report-tabs { display: flex; gap: 8px; border-top: 1px solid #e6e8eb; padding-top: 13px; }
.ref-report-market-list { display: grid; gap: 12px; }
.ref-report-market { margin: 0; }
.ref-report-market h2 { border-bottom: 1px solid #e6e8eb; padding-bottom: 10px; }
.ref-report-blocks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.ref-report-block { border: 1px solid #dfe3e9; border-radius: 4px; overflow: hidden; }
.ref-report-block h3 { margin: 0; padding: 10px 12px; background: #111923; color: #fff; font-size: .95rem; }
.ref-report-stats { display: flex; justify-content: space-between; gap: 10px; padding: 14px 12px; color: #4a556c; }
.ref-report-stats strong { color: #961b24; }
@media (max-width: 720px) {
  .reference-shell { display: block; }
  .reference-shell .sidebar { position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; width: min(82vw,320px); height: 100dvh; transform: translateX(-105%); transition: transform .2s ease; overflow: auto; display: flex; }
  .reference-shell .sidebar.open { transform: translateX(0); }
  .reference-shell .main { padding: 0 10px 50px; }
  .reference-shell .topbar { margin: 0 -10px 14px; padding: 12px 12px 12px 50px; background: #111923; color: white; }
  .reference-shell .topbar .breadcrumbs { color: white; }
  .reference-shell .page-head { margin: 8px 0 15px; }
  .ref-mobile-menu { display: block; position: fixed; z-index: 21; top: 9px; left: 11px; background: #111923; color: #f7953a; border: 0; font-size: 1.4rem; line-height: 1; padding: 7px; }
  .reference-shell.view-dashboard .ref-mobile-menu { top: 5px; }
  .ref-agent-strip { margin: 0 -10px 8px; padding: 10px 10px 10px 50px; }
  .ref-market-card { padding: 14px 16px 17px; }
  .ref-panel { padding: 15px; }
  .ref-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .ref-result-inputs { grid-template-columns: 1fr 1fr; }
  .ref-board-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ref-card-sequence-list { grid-template-columns: 1fr; gap: 12px; }
  .ref-sequence-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; padding: 10px; }
  .ref-sequence-number { min-height: 44px; }
  .ref-assignment-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ref-rate-select .field,.ref-rate-row .field { grid-template-columns: 1fr; }
  .ref-report-blocks { grid-template-columns: 1fr; }
}

/* Shared page navigation and responsive finish for the Admin and Agent workspace. */
.route-backbar {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  margin: 0 0 16px;
  color: #64748b;
  font-size: .82rem;
  font-weight: 650;
}
.route-back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #d5dce6;
  border-radius: 11px;
  background: #fff;
  color: #172234;
  font-weight: 750;
  box-shadow: 0 2px 8px #1420330a;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.route-back-button:hover { border-color: #f0a34c; box-shadow: 0 5px 14px #14203312; transform: translateY(-1px); }
.reference-shell { background: #edf1f6; color: #263449; }
.reference-shell .sidebar { padding: 18px 14px; }
.reference-shell .nav-item { border-radius: 11px; transition: background .16s ease, color .16s ease; }
.reference-shell .nav-children { border-color: #3a4655; }
.reference-shell .nav-children .nav-item { border-radius: 9px; }
.reference-shell .nav-item:hover { background: #ffffff14; }
.reference-shell .nav-item.active { background: #24344a; box-shadow: inset 3px 0 #f3943e; }
.reference-shell .main { min-width: 0; padding: 28px clamp(18px,3.4vw,46px) 70px; }
.ref-panel { border: 1px solid #e2e7ee; border-radius: 16px; padding: clamp(18px,2vw,26px); box-shadow: 0 5px 20px #1d2d420a; }
.ref-market-card { border-radius: 14px; padding: 20px 24px; box-shadow: 0 8px 24px #17253614; }
.ref-market-actions { gap: 8px; }
.ref-btn,.ref-purple { min-height: 38px; border-radius: 9px; padding: 8px 14px; transition: transform .15s ease, filter .15s ease, box-shadow .15s ease; }
.ref-btn:hover,.ref-purple:hover { filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 4px 11px #14203318; }
.ref-orange { background: #f39a45; }
.ref-red { background: #a32935; }
.ref-light { background: #eef2f7; }
.ref-purple { background: #7150d7; }
.ref-panel-head { gap: 16px; padding-bottom: 14px; margin-bottom: 16px; border-color: #e6eaf0; }
.ref-panel-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.ref-table { color: #34445a; }
.ref-table th { padding: 12px 10px; color: #637189; font-size: .75rem; letter-spacing: .045em; text-transform: uppercase; }
.ref-table td { padding: 12px 10px; vertical-align: middle; }
.ref-table tbody tr:nth-child(odd) { background: #f7f9fc; }
.ref-table tbody tr:hover { background: #f1f5fb; }
.ref-list-search { flex-wrap: wrap; margin-bottom: 20px; }
.ref-list-search .field { flex: 1 1 190px; }
.ref-agent-settings { margin: 18px 0; padding: 16px; border: 1px solid #e2e7ee; border-radius: 13px; background: #f9fbfd; }
.ref-agent-settings > summary { color: #263449; font-weight: 800; cursor: pointer; }
.agent-compensation-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.agent-compensation-grid .field { margin: 0; }
.partner-compensation .field { margin: 0; }
.ref-agent-setting-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0 16px; margin-top: 16px; }
.ref-agent-setting-grid .field { margin: 0 0 12px; }
.ref-check { margin: 0 0 12px; padding: 10px 11px; border: 1px solid #e4e9f0; border-radius: 9px; background: #fff; font-size: .82rem; line-height: 1.35; }
.ref-check input,.gm-switch input { accent-color: #e58b35; }
.ref-assignment-list { gap: 9px; }
.ref-assignment-list label { padding: 10px; border-radius: 9px; background: white; }
.ref-rate-select { align-items: end; }
.ref-game-table { min-width: 790px; }
.ref-game-table th:not(:first-child),.ref-game-table td:not(:first-child) { text-align: center; }
.ref-game-table td:first-child { min-width: 180px; }
.gm-switch { display: inline-flex; position: relative; width: 38px; height: 22px; vertical-align: middle; }
.gm-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.gm-switch span { position: absolute; inset: 0; border-radius: 99px; background: #cbd3df; transition: background .16s ease; cursor: pointer; }
.gm-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #16223533; transition: transform .16s ease; }
.gm-switch input:checked + span { background: #e78e3c; }
.gm-switch input:checked + span::after { transform: translateX(16px); }
.gm-switch input:focus-visible + span { outline: 3px solid #e78e3c55; outline-offset: 2px; }
.table-wrap { border-radius: 10px; }
.field input,.field select,.field textarea { border-radius: 10px; }
@media (max-width: 900px) {
  .agent-compensation-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ref-agent-setting-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .reference-shell .main { padding: 0 12px 58px; }
  .reference-shell .ref-mobile-menu { top: 8px; left: 9px; width: 37px; height: 37px; border-radius: 10px; }
  .reference-shell .route-backbar { min-height: 54px; margin: 0 -12px 11px; padding: 7px 10px 7px 53px; background: #f8fafc; border-bottom: 1px solid #e2e7ee; }
  .reference-shell .route-backbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .route-back-button { min-height: 36px; padding: 0 11px; }
  .reference-shell .ref-agent-strip { border-radius: 0 0 12px 12px; }
  .ref-panel { padding: 16px; border-radius: 13px; }
  .ref-panel-head { align-items: flex-start; flex-direction: column; }
  .ref-panel-actions { width: 100%; justify-content: flex-start; }
  .ref-list-search { align-items: stretch; }
  .ref-list-search .field { min-width: min(100%,220px); }
  .agent-compensation-grid { grid-template-columns: 1fr; }
  .ref-agent-setting-grid { grid-template-columns: 1fr; }
  .ref-assignment-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ref-rate-select { align-items: stretch; }
  .ref-game-table { min-width: 730px; }
}
@media (max-width: 420px) {
  .reference-shell .main { padding-left: 9px; padding-right: 9px; }
  .reference-shell .route-backbar { margin-right: -9px; margin-left: -9px; padding-left: 51px; }
  .ref-assignment-list { grid-template-columns: 1fr; }
  .ref-panel-actions .ref-btn { flex: 1; }
}

/* Agent screens follow the supplied 26 October recording. */
.agent-shell { background:#dce6f1; }
.agent-shell .page-head,.agent-shell .brand,.agent-shell .topbar .breadcrumbs { display:none; }
.agent-shell .main { padding:0 22px 30px; }
.agent-shell.reference-shell .topbar { position:sticky; top:0; z-index:10; display:block; margin:0 -22px 12px; padding:16px 22px; background:#111923; border:0; border-radius:0; }
.agent-top-strip { display:flex; align-items:center; justify-content:space-between; gap:14px; color:#f4f6fa; font-size:13px; font-weight:650; }
.agent-top-strip .ref-point-badge { min-width:105px; padding:3px 12px; color:#111923; background:#ff8b26; border-radius:3px; font-size:12px; }
.agent-shell .sidebar { background:#101923; }
.agent-shell .side-label { display:block; margin:6px 0 24px; padding:0; text-transform:none; letter-spacing:0; }
.agent-identity { display:flex; gap:9px; align-items:center; color:#e8edf5; font-size:12px; }
.agent-identity img { width:35px; height:35px; border-radius:50%; object-fit:cover; }
.agent-identity span { overflow-wrap:anywhere; }
.agent-identity .agent-close { display:none; }
.agent-shell .nav-icon { color:#ff922f; }
.agent-shell .nav-list { display:grid; overflow:visible; }
.agent-shell .nav-icon { display:inline-flex; }
.agent-shell .nav-item[data-nav="printer"] .nav-icon { color:#8b51ff; }
.agent-shell .nav-item[data-nav="change-url"] .nav-icon { color:#8fa0b7; }
.agent-shell .nav-item { padding:15px 14px; font-weight:650; }
.agent-shell .sidebar-bottom .user-row { display:none; }
.agent-shell .sidebar-bottom { display:block; margin-top:auto; }
.agent-shell .signout { color:#f0f3f9; font-size:15px; padding:14px; }
.agent-shell .route-backbar { margin:0 0 10px; padding:0; background:none; border:0; min-height:36px; }
.agent-shell .route-backbar > span { display:none; }
.agent-shell .route-back-button { min-height:30px; padding:3px 11px; border-radius:5px; background:#f8fbfd; font-size:12px; box-shadow:none; }
.agent-shell .ref-market-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.agent-shell .ref-market-card { margin:0; border-radius:4px; padding:15px; box-shadow:none; background:#111923; }
.agent-shell .ref-market-title { display:flex; flex-wrap:wrap; gap:5px; justify-content:flex-start; font-size:15px; }
.agent-shell .ref-market-title span { color:#f0f3f6; font-size:13px; }
.agent-shell .ref-market-result { padding:14px 0; margin:8px 0 10px; border-top:1px solid #344151; border-bottom:1px solid #344151; }
.agent-shell .ref-market-result strong { color:#ed984c; font-size:15px; }
.agent-shell .ref-market-result span { font-size:11px; }
.agent-shell .ref-market-result .is-running { color:#9be0c8; }
.agent-shell .ref-market-result .is-closed { color:#e08b97; }
.agent-shell .ref-market-actions { justify-content:flex-start; gap:5px; }
.agent-shell .ref-btn,.agent-shell .ref-purple { min-height:32px; padding:7px 13px; border-radius:3px; box-shadow:none; font-size:12px; font-weight:550; }
.agent-shell .ref-red { background:#a00026; color:#fff; }
.agent-shell .ref-orange { background:#fc8526; color:#fff; }
.agent-shell .ref-purple { background:#792cf4; color:#fff; }
.agent-shell .ref-dark { background:#111923; color:#fff; }
.agent-shell .ref-panel { border:0; border-radius:4px; box-shadow:none; padding:15px; }
.agent-shell h2 { font-size:20px; }
.agent-shell .field input,.agent-shell .field select { border-radius:3px; min-height:36px; padding:7px 10px; font-size:12px; background:white; }
.agent-shell .field label { font-size:12px; }
.agent-shell .ref-table { width:100%; min-width:0; font-size:12px; }
.agent-shell .ref-table th { padding:8px 5px; font-size:11px; text-transform:none; letter-spacing:0; color:inherit; }
.agent-shell .ref-table td { padding:8px 5px; font-size:11px; overflow-wrap:anywhere; }
.agent-shell .table-wrap { border-radius:0; }
.agent-shell .ref-pagination { align-items:center; margin-top:15px; }
.agent-shell .ref-page { border:0; background:none; font-size:12px; color:#495465; }
.agent-shell .ref-page:disabled { color:#9aa2ae; }
.agent-history-filter .field label,.agent-win .field label { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden; }
.agent-shell .ref-win-section .ref-win-actions,.agent-shell .ref-win-section h2 { background:#fc8526; color:#273345; }
.agent-shell .ref-win-section .ref-win-actions .btn { min-width:65px; padding:6px 9px; }
.agent-shell .ref-win-form .ref-win-actions { padding:0; justify-content:stretch; }
.agent-shell .ref-win-form .ref-win-actions .btn { flex:1; }
.agent-shell .ref-win-form .field { margin:0; }
.agent-shell .ref-win-form { gap:10px; }
.win-bazaar-name { display:block; margin-top:3px; color:var(--muted,#65756e); font-size:11px; line-height:1.2; }
.agent-shell .ref-win-section { margin-top:15px; }
.agent-shell .ref-dark-panel { border-radius:4px; }
.agent-shell .ref-points-banner { background:#a00026; border-radius:4px; line-height:1.5; }
.agent-report-card form { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:22px; }
.agent-report-card h2 { color:#f8a359!important; font-size:14px; margin:0!important; }
.agent-report-card .field { margin:0; width:145px; }
.agent-report-card .field label { display:none; }
.agent-report-card form [type="submit"] { display:none; }
.agent-report-card .ref-table { color:#f6a663!important; }
.agent-report-card .ref-table tbody tr:nth-child(odd),.agent-report-card .ref-table tbody tr:hover { background:#17212d; }
.agent-report-card .table-wrap { border:0; }
.agent-final-hisab h3 { font-size:16px; }
.agent-final-hisab > div { display:grid; grid-template-columns:1fr 20px minmax(40px,1fr); gap:12px; font-size:13px; color:#ec9e62; }
.agent-final-hisab > div strong { font-weight:400; color:white; text-align:center; }
.agent-shell .notice { font-size:12px; }
.agent-sidebar-shade { display:none; }
.agent-sell-workspace { display:flex; flex-direction:column; min-height:calc(100dvh - 150px); background:#fff; }
.agent-sell-heading { display:flex; justify-content:space-between; align-items:center; gap:8px; margin:-2px 0 8px; background:#dce6f1; }
.agent-sell-heading h2 { margin:0; font-size:17px; }
.agent-sell-heading > div { display:flex; align-items:center; gap:5px; }
.agent-sell-heading input { width:85px; min-width:0; padding:5px; min-height:31px; border:1px solid #8c98a9; border-radius:3px; font-size:12px; }
.agent-entry-panel { padding:10px 6px; border-bottom:3px solid #60646b; }
.agent-entry-actions { display:flex; justify-content:flex-end; gap:5px; margin-bottom:12px; }
.agent-game-selects { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; margin-bottom:12px; }
.agent-game-selects select,.agent-entry-inputs select { min-width:0; width:100%; min-height:36px; padding:5px; font-size:12px; border:1px solid #d4d9e0; background:#f0f1f2; border-radius:3px; }
.agent-entry-inputs { display:grid; grid-template-columns:1fr 1.3fr 1fr .75fr; gap:5px; }
.agent-entry-inputs input { width:100%; min-width:0; border:1px solid #e0e2e6; border-radius:3px; padding:6px; font-size:13px; }
.agent-entry-inputs [type="submit"] { grid-column:4; }
.agent-shell .agent-entry-inputs .btn { padding:5px; }
.agent-entry-hint { margin:5px 0 0; font-size:11px; color:#737f90; }
.agent-draft-panel { flex:1; padding:8px 6px 25px; }
.agent-countdown { text-align:center; font-size:14px; font-weight:650; color:#bd3554; margin:0 0 14px; }
.agent-entry-table { width:100%; min-width:0; color:#263449; font-size:12px; }
.agent-entry-table th,.agent-entry-table td { padding:8px 5px; border:1px solid #d9dde3; }
.agent-draft-total { margin:12px 0; text-align:right; font-weight:750; }
.agent-sell-footer { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; position:sticky; bottom:0; background:#fff; padding:5px; border-top:1px solid #e2e7ec; z-index:5; }
.agent-check .form-actions { justify-content:center; }
.workflow-dialog { width:min(92vw,580px); max-height:85dvh; padding:22px; border:1px solid #e1e5ed; border-radius:12px; box-shadow:0 12px 80px #0005; color:#263449; }
.workflow-dialog::backdrop { background:#10192399; }
.workflow-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px; }
.workflow-dialog-head h2 { margin:0; font-size:19px; }
.agent-game-picker { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.agent-game-picker section { display:grid; gap:6px; align-content:start; }
.agent-tools { display:grid; gap:10px; }
.scan-image-label { display:grid; gap:8px; margin-bottom:18px; padding:12px; border:1px dashed #adb7c6; border-radius:7px; }
#paste-entries-form textarea { width:100%; margin-bottom:14px; font-family:monospace; }
#maakali-print-output { display:none; }
@media (min-width:1100px) {
  .agent-shell .ref-market-list { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .agent-sell-workspace { max-width:900px; margin:auto; }
}
@media (max-width:720px) {
  .agent-shell .main { padding:0 10px 18px; }
  .agent-shell.reference-shell .topbar { margin:0 -10px 8px; padding:13px 10px 13px 45px; }
  .agent-shell .ref-mobile-menu { top:5px; left:6px; width:32px; height:32px; padding:5px; border-radius:0; font-size:21px; }
  .agent-top-strip { gap:10px; font-size:11px; }
  .agent-top-strip .ref-point-badge { min-width:85px; padding:2px 6px; font-size:10px; }
  .agent-shell .sidebar { z-index:32; width:min(82vw,330px); padding:34px 14px; }
  .agent-identity .agent-close { display:block; padding:0; color:#f89532; background:transparent; font-size:24px; margin-left:auto; }
  .agent-shell:has(.sidebar.open) .agent-sidebar-shade { display:block; position:fixed; inset:0; width:100%; height:100dvh; z-index:30; border:0; background:#10192366; }
  .agent-shell .ref-market-list { grid-template-columns:1fr; gap:13px; }
  .agent-shell .ref-market-card { padding:14px 15px; }
  .agent-shell .ref-market-title { font-size:14px; }
  .agent-shell .ref-market-title span { font-size:12px; }
  .agent-shell .route-backbar { margin:0 0 7px; padding:0; }
  .agent-sell-heading .ref-btn { padding:6px 8px; font-size:11px; }
  .agent-sell-heading input { width:75px; font-size:11px; }
  .agent-sell-heading h2 { font-size:16px; }
  .agent-sell-workspace { min-height:calc(100dvh - 110px); }
  .agent-shell.view-sell .main { padding-bottom:0; }
  .agent-entry-inputs input { font-size:16px; }
  .agent-shell .ref-win-section .ref-win-actions .btn { min-width:55px; }
  .agent-shell .ref-panel { padding:13px; }
}
@media print {
  .agent-shell .topbar,.agent-shell .route-backbar,.agent-shell .agent-sell-footer,.workflow-dialog { display:none!important; }
  body.printing-win #app,body.printing-win #toast { display:none!important; }
  body.printing-win #maakali-print-output { display:block!important; color:#000; padding:0; }
  #maakali-print-output table { border-collapse:collapse; width:100%; font-size:11pt; }
  #maakali-print-output td,#maakali-print-output th { border:1px solid #777; padding:5px; text-align:left; }
  .win-print-bill { break-after:auto; }
  .win-print-bill:last-child { break-after:auto; }
}
.receipt-writer,.receipt-check { text-align:center; font-weight:650; margin:15px 0; }
@media (min-width:1000px) {
  .agent-shell .ref-table th,.agent-shell .ref-table td { font-size:13px; padding:11px 9px; }
  .agent-top-strip { font-size:14px; }
  .agent-shell .ref-market-title { font-size:16px; }
  .agent-shell .ref-market-title span { font-size:14px; }
  .agent-report-card h2 { font-size:16px; }
}
.agent-shell .agent-entry-inputs button[type="submit"] { min-height:32px; border-radius:3px; font-size:12px; font-weight:550; }

/* Maakali visual system: pine, sage, warm ivory and restrained brass. */
:root {
  --mk-ink:#20352f;
  --mk-pine:#183f36;
  --mk-pine-deep:#12332d;
  --mk-leaf:#397568;
  --mk-sage:#e6eee8;
  --mk-paper:#f5f4ed;
  --mk-surface:#fffefa;
  --mk-line:#dfe5dc;
  --mk-muted:#718078;
  --mk-brass:#c4a05e;
  --mk-rose:#a9564e;
  color:var(--mk-ink);
  background:var(--mk-paper);
}
body { color:var(--mk-ink); background:var(--mk-paper); }
.app-shell { background:var(--mk-paper); grid-template-columns:258px minmax(0,1fr); }
.sidebar { background:var(--mk-pine-deep); color:#edf4ee; padding:26px 16px; gap:24px; }
.reference-shell .sidebar { height:100dvh; min-height:0; overflow-y:auto; background:var(--mk-pine-deep); }
.reference-shell .sidebar>.brand,.reference-shell .sidebar>nav,.reference-shell .sidebar-bottom { flex-shrink:0; }
.reference-shell .sidebar-bottom { display:block; color:#edf4ee; background:var(--mk-pine-deep); }
.reference-shell .nav-list { display:grid; overflow:visible; flex-shrink:0; }
.reference-shell .nav-icon { display:inline-flex; color:#d6bd7d; }
.reference-shell .sidebar-bottom strong,.reference-shell .sidebar-bottom span { color:#edf4ee; }
.reference-shell .nav-item.active { background:#28574b; color:#fffefa; box-shadow:inset 3px 0 var(--mk-brass); }
.sidebar .brand { padding:0 10px; gap:11px; }
.sidebar .brand-name { color:#fffdf5; }
.mark { border-color:#c7a96a; box-shadow:0 4px 14px #081d1838; }
.side-label { color:#a8b9a9; letter-spacing:.08em; }
.nav-list { gap:6px; }
.nav-item { color:#d2ddd3; border-radius:12px; padding:12px 13px; font-weight:620; }
.nav-item:hover { background:#ffffff12; color:#fffefa; }
.nav-item.active { background:#28574b; color:#fffefa; box-shadow:inset 3px 0 var(--mk-brass); }
.nav-item.active .nav-icon { color:#e3c681; }
.sidebar-bottom { border-color:#ffffff20; }
.avatar { background:#c5a563; color:var(--mk-pine-deep); }
.main { padding:26px clamp(18px,3.2vw,48px) 64px; }
.topbar { padding:11px 14px; margin-bottom:26px; border:1px solid var(--mk-line); border-radius:14px; background:#fffefa; box-shadow:0 5px 18px #1c382a08; }
.breadcrumbs { color:#77867d; letter-spacing:.07em; }
.top-chip { border-color:#e2e8df; background:#f8f8f2; color:#426058; }
.page-head { margin-bottom:22px; }
.eyebrow { color:#997b42; letter-spacing:.12em; }
.page-head h1 { color:var(--mk-ink); }
.page-head p,.muted { color:var(--mk-muted); }
.btn { border-radius:11px; font-weight:680; }
.btn.primary,.ref-dark { background:var(--mk-pine); color:#fffefa; }
.btn.secondary,.ref-light { background:#f0f4ef; border-color:#d8e3da; color:var(--mk-pine); }
.btn.ghost { background:#e7eee8; color:var(--mk-pine); }
.btn.danger,.ref-red { background:#a9564e; color:#fffefa; }
.btn.primary:hover,.ref-dark:hover,.ref-purple:hover { background:#275d50; }
.card,.ref-panel { background:var(--mk-surface); border-color:var(--mk-line); border-radius:17px; box-shadow:0 8px 24px #253e3009; }
.card h2,.card h3,.ref-panel h2 { color:var(--mk-ink); }
.metric .icon { background:#e8efe8; color:var(--mk-leaf); }
.accent-card { background:var(--mk-pine); border-color:var(--mk-pine); }
.field input,.field select,.field textarea { border-color:#d8e1d8; border-radius:10px; background:#fffefa; color:var(--mk-ink); }
.field input:focus,.field select:focus,.field textarea:focus { outline:3px solid #39756828; border-color:var(--mk-leaf); }
.table-wrap { border:1px solid var(--mk-line); border-radius:13px; overflow:auto; }
.table th,.ref-table th { color:#66796f; }
.table tbody tr:nth-child(odd),.ref-table tbody tr:nth-child(odd) { background:#f6f7f1; }
.ref-table tbody tr:hover { background:#edf3ed; }
.ref-market-list { grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr)); gap:17px; }
.ref-market-card { color:var(--mk-ink); background:var(--mk-surface); border:1px solid var(--mk-line); border-radius:17px; padding:20px; box-shadow:0 8px 24px #253e3009; }
.ref-market-title { border-color:var(--mk-line); color:var(--mk-ink); }
.ref-market-title span { color:#718078; }
.ref-market-result { border-color:var(--mk-line); }
.ref-market-result strong { color:var(--mk-leaf); }
.ref-market-result .is-running { color:#34725b; }
.ref-market-result .is-closed { color:var(--mk-rose); }
.ref-market-actions { gap:7px; }
.ref-btn,.ref-purple { min-height:38px; border-radius:10px; padding:8px 13px; font-weight:650; }
.ref-orange { background:var(--mk-brass); color:#1e3029; }
.ref-red { background:var(--mk-rose); color:#fffefa; }
.ref-light { background:#eaf0e9; color:var(--mk-pine); }
.ref-purple { background:var(--mk-leaf); color:white; }
.ref-dark { background:var(--mk-pine); color:#fffefa; }
.ref-panel-head { border-color:var(--mk-line); }
.ref-panel-head h3 { color:var(--mk-leaf); }
.ref-filter-grid { border-color:var(--mk-line); gap:12px 18px; }
.ref-table { color:#354b43; }
.ref-table th { border-color:#d8e1d8; }
.ref-table td { border-color:#e4e9e1; }
.ref-assignment-list label,.ref-check { border-color:var(--mk-line); border-radius:10px; background:#fbfcf8; }
.ref-agent-settings { border-color:var(--mk-line); background:#f7f8f2; }
.ref-agent-settings>summary { color:var(--mk-ink); }
.ref-check input,.gm-switch input { accent-color:var(--mk-leaf); }
.ref-points-banner { background:var(--mk-pine); border-radius:15px; }
.ref-dark-panel { background:#e9f0e9; color:var(--mk-ink); border:1px solid var(--mk-line); border-radius:15px; }
.ref-dark-panel h2,.ref-dark-panel h3 { color:var(--mk-pine); }
.ref-dark-panel .ref-table { color:var(--mk-ink); }
.ref-dark-panel .ref-table tbody tr:nth-child(odd) { background:#f6f8f2; }
.ref-dark-panel>div { border-color:#d3dfd5; }
.ref-board-head,.ref-report-block h3 { background:var(--mk-pine); color:#fffefa; }
.ref-board-tile { background:#e6eee7; color:#24473d; border-radius:9px; }
.ref-board-tile small { display:block; margin-top:2px; color:#718078; font-size:10px; font-weight:600; }
.ref-board-count { align-self:center; color:var(--mk-muted); font-size:12px; white-space:nowrap; }
.ref-board-total { border-color:var(--mk-line); }
.ref-win-section h2,.ref-win-section .ref-win-actions { background:#e8efe8; color:var(--mk-pine); }
.ref-report-block { border-color:var(--mk-line); border-radius:12px; }
.ref-report-stats strong { color:var(--mk-leaf); }
.ref-card-sequence>header { background:linear-gradient(115deg,#183f36,#397568); }
.ref-sequence-number { border-color:#d9e3d7; background:#f2f5ee; color:#294b40; }
.ref-sequence-number small { color:#78877b; }

/* Agent workspace gets an airy single-surface layout instead of dark blocks. */
.agent-shell { background:var(--mk-paper); }
.agent-shell .sidebar { background:var(--mk-pine-deep); }
.agent-shell.reference-shell .topbar { background:var(--mk-pine); border-radius:0 0 16px 16px; box-shadow:0 7px 18px #183f3618; }
.agent-top-strip { color:#fffefa; }
.agent-top-strip .ref-point-badge { color:var(--mk-pine-deep); background:#e3c681; border-radius:999px; padding:6px 13px; }
.agent-shell .nav-icon { color:#d6bd7d; }
.agent-shell .nav-item { padding:12px 13px; border-radius:12px; }
.agent-shell .nav-item.active { background:#28574b; }
.agent-shell .ref-market-list { grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); gap:16px; }
.agent-shell .ref-market-card { background:var(--mk-surface); color:var(--mk-ink); border:1px solid var(--mk-line); border-radius:17px; padding:18px; box-shadow:0 8px 24px #253e3009; }
.agent-shell .ref-market-title { border-color:var(--mk-line); color:var(--mk-ink); }
.agent-shell .ref-market-title span { color:var(--mk-muted); }
.agent-shell .ref-market-result { border-color:var(--mk-line); }
.agent-shell .ref-market-result strong { color:var(--mk-leaf); }
.agent-shell .ref-market-actions { gap:7px; }
.agent-shell .ref-btn,.agent-shell .ref-purple { min-height:37px; border-radius:10px; font-size:12px; }
.agent-shell .ref-red { background:var(--mk-rose); }
.agent-shell .ref-orange { background:var(--mk-brass); color:#1e3029; }
.agent-shell .ref-purple { background:var(--mk-leaf); }
.agent-shell .ref-dark { background:var(--mk-pine); }
.agent-shell .ref-panel { border:1px solid var(--mk-line); border-radius:16px; box-shadow:0 7px 20px #253e3008; padding:18px; }
.agent-shell .field input,.agent-shell .field select { border-radius:10px; min-height:41px; font-size:14px; }
.agent-shell .ref-table tbody tr:nth-child(odd) { background:#f6f7f1; }
.agent-shell .ref-table tbody tr:hover { background:#edf3ed; }
.agent-shell .ref-win-section .ref-win-actions,.agent-shell .ref-win-section h2 { background:#e8efe8; color:var(--mk-pine); }
.agent-shell .ref-dark-panel { background:#e9f0e9; border:1px solid var(--mk-line); border-radius:15px; }
.agent-shell .ref-dark-panel h2,.agent-shell .ref-dark-panel h3 { color:var(--mk-pine); }
.agent-shell .ref-dark-panel>div { color:#42665a; border-color:#d3dfd5; }
.agent-shell .ref-dark-panel>div strong { color:var(--mk-ink); }
.agent-shell .sidebar { min-height:100dvh; background:var(--mk-pine-deep)!important; color:#edf4ee; }
.agent-shell .sidebar-bottom { min-height:104px; padding:16px 10px 10px; background:var(--mk-pine-deep); color:#edf4ee; border-top:1px solid #ffffff24; }
.agent-shell .sidebar-bottom strong,.agent-shell .sidebar-bottom span,.agent-shell .sidebar-bottom .signout { color:#edf4ee!important; }
.agent-shell .ref-points-banner { background:var(--mk-pine); border-radius:15px; }
.agent-report-card h2 { color:var(--mk-pine)!important; }
.agent-report-card .ref-table { color:var(--mk-ink)!important; }
.agent-report-card .ref-table tbody tr:nth-child(odd) { background:#f6f7f1; }
.agent-report-card .ref-table tbody tr:hover { background:#edf3ed; }
.agent-report-card form [type="submit"] { display:inline-flex; }
.agent-report-card .field label { display:block; color:var(--mk-muted); }
.agent-sell-workspace { max-width:980px; margin:0 auto; min-height:calc(100dvh - 145px); border:1px solid var(--mk-line); border-radius:18px; background:var(--mk-surface); box-shadow:0 9px 28px #253e300b; overflow:hidden; }
.agent-sell-heading { margin:0; padding:15px 18px; background:#f0f4ee; border-bottom:1px solid var(--mk-line); }
.agent-sell-heading h2 { color:var(--mk-pine); }
.agent-sell-heading input { min-height:37px; border:1px solid #d7e0d6; border-radius:9px; }
.agent-entry-panel { padding:16px 18px 14px; background:#fbfcf8; border-bottom:1px solid var(--mk-line); }
.agent-game-selects { grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.agent-game-selects select:only-child { grid-column:1/-1; }
.agent-game-selects select,.agent-entry-inputs select { min-height:42px; border-color:#d8e1d8; border-radius:10px; background:#fffefa; }
.agent-entry-inputs { grid-template-columns:.8fr 1.35fr 1fr auto auto; gap:8px; }
.agent-entry-inputs input { min-height:42px; border-color:#d8e1d8; border-radius:10px; }
.agent-number-field { display:flex; align-items:stretch; gap:5px; min-width:0; }
.agent-number-field input { flex:1; min-width:0; width:0; }
.agent-shell .agent-separator-button { flex:0 0 38px; padding:4px; font-size:24px; font-weight:750; }
.agent-separator-button[hidden] { display:none!important; }
.financial-confirm-overlay { position:fixed; inset:0; z-index:1000; display:flex; padding:16px; overflow:auto; background:#102b26a6; }
.financial-confirm-card { margin:auto; width:min(100%,420px); padding:22px; border:1px solid var(--mk-line); border-radius:18px; background:var(--mk-surface); color:var(--mk-ink); box-shadow:0 18px 60px #081e2750; }
.financial-confirm-card h2 { margin:0 0 10px; font-size:20px; }
.financial-confirm-card p { color:var(--mk-muted); margin-bottom:18px; }
.financial-confirm-card input { font-size:18px; }
.financial-confirm-card .form-actions { margin-bottom:0; flex-wrap:wrap; }
.financial-confirm-card .btn { flex:1; min-height:44px; }
.agent-entry-inputs [type="submit"] { grid-column:auto; }
.agent-draft-panel { padding:16px 18px 28px; }
.agent-entry-table th,.agent-entry-table td { border-color:#dfe5dc; }
.agent-draft-total { color:var(--mk-pine); }
.agent-sell-footer { gap:8px; padding:10px 14px; background:#fffefa; border-color:var(--mk-line); }
.agent-countdown { color:var(--mk-leaf); }
.agent-shell .route-back-button { min-height:36px; border-radius:10px; background:#e8efe8; color:var(--mk-pine); }
.workflow-dialog { border-color:var(--mk-line); border-radius:16px; color:var(--mk-ink); }
.workflow-dialog::backdrop { background:#142d2780; }
.login-wrap { background:var(--mk-paper); }
.login-visual { background:linear-gradient(145deg,#12332d,#28574b); }
.login-visual .accent-word { color:#ddc17e; }
.login-panel { background:#f7f6f0; }
.login-card { border-color:var(--mk-line); border-radius:20px; box-shadow:0 16px 44px #1a372c10; }
.login-card .btn { background:var(--mk-pine); color:#fffefa; }
@media (max-width:720px) {
  .reference-shell:not(.agent-shell) .topbar { display:flex; position:sticky; top:0; z-index:12; min-height:56px; margin:0 -10px 14px; padding:10px 12px 10px 55px; background:var(--mk-pine); color:#fffefa; border:0; border-radius:0 0 14px 14px; }
  .reference-shell:not(.agent-shell) .topbar .breadcrumbs { color:#edf4ee; font-size:11px; }
  .reference-shell:not(.agent-shell) .topbar .top-chip { display:none; }
  .reference-shell:not(.agent-shell) .topbar .top-signout { color:#edf4ee; background:#ffffff16; padding:7px 10px; }
  .ref-mobile-menu { background:var(--mk-pine); color:#e3c681; border-radius:9px; }
  .reference-shell .ref-market-title { flex-wrap:wrap; overflow-wrap:anywhere; gap:6px; }
  .reference-shell .ref-market-title span { flex-basis:100%; white-space:normal; }
  .agent-shell .main { padding:0 10px 18px; }
  .agent-shell.reference-shell .topbar { margin:0 -10px 12px; padding:14px 12px 14px 48px; border-radius:0 0 14px 14px; }
  .agent-shell .ref-market-list { grid-template-columns:1fr; }
  .agent-game-selects { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .agent-entry-inputs { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .agent-entry-inputs [type="submit"] { grid-column:2; }
  .agent-entry-panel { padding:12px; }
  .agent-sell-heading { flex-wrap:wrap; padding:12px; }
  .agent-sell-heading>div { flex-wrap:wrap; }
  .agent-sell-footer { padding:8px; }
  .agent-shell .sidebar { height:100dvh; }
  .agent-shell .sidebar-bottom { margin-top:auto; }
  .ref-board-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
  .ref-board-tile { min-height:48px; padding:7px 4px; }
  .ref-board-tile strong { font-size:12px; }
  .ref-board-tile span { font-size:12px; }
}

.agent-menu-button { display:none; }
.agent-device-phone { display:none; }
input,select,textarea { scroll-margin-block:90px; }
.ref-rate-panel { overflow:visible; }
.ref-rate-panel form { padding-bottom:24px; }
.ref-rate-panel input { touch-action:pan-y; }
@media (max-width:720px) {
  html { scroll-padding-block:80px; }
  .reference-shell:not(.agent-shell) .topbar { padding:8px 12px; gap:10px; }
  .reference-shell .topbar .ref-mobile-menu { position:static; flex:0 0 40px; width:40px; height:40px; padding:8px; margin:0; }
  .reference-shell .topbar .breadcrumbs { flex:1; min-width:0; overflow-wrap:anywhere; }
  .agent-shell.reference-shell .topbar { padding:8px 10px; min-height:60px; }
  .agent-top-strip { display:grid; grid-template-columns:40px minmax(0,1fr) auto auto; gap:8px; min-height:44px; }
  .agent-menu-button { display:grid; place-items:center; width:40px; height:40px; padding:0; border:0; border-radius:10px; color:#e3c681; background:#ffffff12; font-size:24px; line-height:1; }
  .agent-bill-number { overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
  .agent-top-strip .ref-point-badge { min-width:0; white-space:nowrap; padding:7px 10px; }
  .agent-total { white-space:nowrap; }
  .reference-shell.view-agents .table-wrap { overflow:visible; border:0; }
  .view-agents .ref-table,.view-agents .ref-table tbody { display:block; width:100%; min-width:0; }
  .view-agents .ref-table thead { display:none; }
  .view-agents .agent-device-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:0 14px; margin:0 0 16px; padding:16px; border:1px solid var(--mk-line); border-radius:16px; background:#fffefa; box-shadow:0 4px 16px #16372b08; }
  .view-agents .agent-device-row td { display:block; min-width:0; padding:10px 0; overflow-wrap:anywhere; font-size:13px; border-bottom:1px solid var(--mk-line); }
  .view-agents .agent-device-row td::before { content:attr(data-label); display:block; margin-bottom:5px; font-size:11px; font-weight:700; color:var(--mk-leaf); }
  .view-agents .agent-device-name { grid-column:1 / -1; padding-top:0!important; }
  .view-agents .agent-device-name strong { display:block; margin-bottom:5px; color:var(--mk-pine); font-size:17px; }
  .view-agents .agent-device-phone { display:block; margin-top:5px; color:var(--mk-leaf); font-size:13px; }
  .view-agents .agent-device-row .agent-device-mobile { display:none; }
  .view-agents .agent-device-actions { grid-column:1 / -1; display:flex!important; flex-wrap:wrap; gap:8px; padding-bottom:0!important; border-bottom:0!important; }
  .view-agents .agent-device-actions::before { display:none!important; }
  .view-agents .agent-device-actions .btn { flex:1; min-height:42px; padding:9px; }
  .view-agent-rates .main,.view-rates .main { padding-bottom:max(80px,env(safe-area-inset-bottom)); }
  .ref-rate-row input { font-size:16px; }
  .ref-rate-panel form { padding-bottom:64px; }
  .ref-rate-row { padding:14px 0; }
}
@media (max-width:380px) {
  .agent-top-strip { gap:5px; font-size:10px; }
  .agent-top-strip .ref-point-badge { padding:6px 7px; }
}

@media print {
  .financial-confirm-overlay { display:none!important; }
  @page { size: 58mm auto; margin: 0; }
  html,body,#app,.app-shell,.main { width:58mm!important; min-width:0!important; margin:0!important; padding:0!important; }
  .receipt { width:58mm; max-width:58mm; padding:0; margin:0; font-size:8pt; break-inside:avoid; }
  .receipt-head { margin-bottom:1mm; }
  .receipt-head h2 { margin:1.5mm 0; font-size:11pt; }
  .receipt table { width:100%; table-layout:fixed; font-size:7pt; }
  .receipt th,.receipt td { padding:1mm .4mm; overflow-wrap:anywhere; }
  .receipt-total { padding:1mm 0; font-size:9pt; }
  .receipt-note { margin-top:1mm; font-size:6pt; }
}

/* A winning report is a full page table; receipt paper sizing applies only to slips. */
@page win-report { size:A4; margin:12mm; }
@media print {
  html.printing-win { width:auto!important; min-width:0!important; margin:0!important; padding:0!important; }
  body.printing-win,body.printing-win #maakali-print-output {
    width:auto!important; min-width:0!important; max-width:none!important;
  }
  body.printing-win { page:win-report; }
  body.printing-win #maakali-print-output { page:win-report; font:10pt Arial,sans-serif; }
  body.printing-win #maakali-print-output table { table-layout:auto; width:100%; font-size:9pt; }
  body.printing-win #maakali-print-output th,body.printing-win #maakali-print-output td {
    padding:5px 4px; overflow-wrap:anywhere; vertical-align:top;
  }
  body.printing-win #maakali-print-output thead { display:table-header-group; }
  body.printing-win #maakali-print-output tr { break-inside:avoid; }
}

.agent-history .ref-table tbody tr.history-winning-row,
.agent-history .ref-table tbody tr.history-winning-row:hover {
  background:#bcefe0; color:#174137;
}
.agent-history .ref-table tbody tr.history-winning-row td { border-color:#87d7c2; }
.ref-dark-panel .ref-table thead th,.agent-hisab-market .ref-table thead th {
  font-weight:800;
}
.ref-win-section h2,.ref-report-block .ref-table thead th {
  font-weight:800;
}
.agent-shell .agent-report-card,.agent-shell .agent-final-hisab {
  background:#111923; border-color:#263747;
}
.agent-shell .agent-report-card h2,.agent-shell .agent-final-hisab h3 {
  color:#f6a663!important; font-weight:800;
}
.agent-shell .agent-report-card .ref-table { color:#f6a663!important; font-weight:700; }
.agent-shell .agent-report-card .ref-table tbody tr:nth-child(odd),
.agent-shell .agent-report-card .ref-table tbody tr:hover { background:#17212d; }
.agent-shell .agent-final-hisab > div { color:#ec9e62; border-color:#3d4856; }
.agent-shell .agent-final-hisab > div > span:first-child {
  color:#ec9e62; font-weight:800;
}
.agent-shell .agent-final-hisab > div strong { color:#fff; }
@media (max-width:720px) {
  .view-village-hisab .ref-hisab-head { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
  .view-village-hisab .ref-hisab-head h2 { grid-column:1 / -1; margin:0; overflow-wrap:anywhere; }
  .view-village-hisab .ref-hisab-head .field { min-width:0; max-width:none; }
  .view-village-hisab .ref-hisab-head .btn { align-self:end; }
  .view-village-hisab .ref-dark-panel > .table-wrap {
    display:block; overflow-x:visible; width:100%; max-width:100%;
    padding:0; min-width:0;
  }
  .view-village-hisab .ref-table { width:100%; min-width:0; table-layout:fixed; font-size:10px; }
  .view-village-hisab .ref-table th,.view-village-hisab .ref-table td {
    padding:7px 2px; font-size:10px; letter-spacing:0; overflow-wrap:anywhere;
  }
  .view-village-hisab .ref-table th:first-child,.view-village-hisab .ref-table td:first-child { width:25%; }
  .view-village-hisab .ref-table th:not(:first-child),.view-village-hisab .ref-table td:not(:first-child) { width:15%; text-align:right; }
}
@page win-receipt { size:58mm auto; margin:2mm; }
@media print {
  body.printing-win-receipts, body.printing-win-receipts #maakali-print-output { page:win-receipt; }
  body.printing-win-receipts #maakali-print-output { font:9pt Arial,sans-serif; }
  body.printing-win-receipts #maakali-print-output > h2,
  body.printing-win-receipts #maakali-print-output > p { display:none; }
  body.printing-win-receipts .win-print-bill { margin:0 0 4mm; break-inside:avoid; }
  body.printing-win-receipts .win-print-bill h3,
  body.printing-win-receipts .win-print-caption { text-align:center; margin:1mm 0; font-weight:bold; }
  body.printing-win-receipts #maakali-print-output table { table-layout:fixed; width:100%; font-size:8pt; }
  body.printing-win-receipts #maakali-print-output th,
  body.printing-win-receipts #maakali-print-output td { border:1px solid #000; padding:2px; overflow-wrap:anywhere; }
  body.printing-win-receipts #maakali-print-output th:first-child { width:22%; }
  body.printing-win-receipts #maakali-print-output th:last-child { width:20%; }
}
