:root{
  color-scheme: light;
  --ink:#17202a;
  --muted:#66727f;
  --line:#d8dee5;
  --paper:#f4f6f8;
  --white:#fff;
  --accent:#1f6fb2;
  --accent-2:#157a5b;
  --dark:#111216;
  --panel:#17181d;
  --panel-line:#2a2d35;
  --panel-muted:#7d8aa0;
  --panel-ink:#d7dbe4;
  --panel-chip:#e9f9e8;
}
*{box-sizing:border-box}
body{
  margin:0;
  font:15px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif;
  color:var(--ink);
  background:var(--paper);
  letter-spacing:0;
}
header.topbar{
  min-height:88px;
  padding:18px 28px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  background:var(--white);
  border-bottom:1px solid var(--line);
}
h1,h2,p{margin:0}
h1{font-size:22px}
h2{font-size:16px}
.eyebrow{font-size:11px;font-weight:700;color:var(--accent);margin-bottom:4px;letter-spacing:0}
.muted{color:var(--muted)}
.header-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.nav-link{
  display:inline-flex;
  align-items:center;
  min-height:38px;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:6px;
  color:var(--ink);
  background:#fff;
  text-decoration:none;
}
.nav-link:hover{background:#f0f3f6}
button{
  font:inherit;
  border-radius:6px;
  border:1px solid #263442;
  background:#263442;
  color:#fff;
  padding:9px 12px;
  cursor:pointer;
}
button:hover{background:#101820}
button:disabled{opacity:.5;cursor:not-allowed}
.secondary{background:#fff;color:var(--ink);border-color:var(--line)}
.secondary:hover{background:#f0f3f6}
.compact{padding:6px 9px;font-size:13px}
.icon-button{
  width:36px;
  height:36px;
  padding:0;
  font-size:20px;
  line-height:1;
}
.status{
  display:inline-flex;
  align-items:center;
  gap:7px;
  color:var(--muted);
}
.status:before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:#9aa5af;
}
.status.online{color:var(--accent-2)}
.status.online:before{background:var(--accent-2)}
.dashboard{
  padding:20px 24px 28px;
  display:grid;
  gap:18px;
}
.summary-bar{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.metric{
  background:var(--white);
  border:1px solid var(--line);
  border-radius:8px;
  padding:14px 16px;
  display:grid;
  gap:4px;
}
.metric-label{
  color:var(--muted);
  font-size:12px;
}
.metric strong{
  font-size:22px;
  font-variant-numeric:tabular-nums;
}
.feed-section,.table-section,.search-panel{
  background:var(--white);
  border:1px solid var(--line);
  border-radius:8px;
  padding:18px;
}
.section-heading{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}
.feed{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:10px;
}
.feed-item{
  display:grid;
  grid-template-columns:160px 1fr;
  gap:16px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fbfcfd;
}
.feed-item time{
  color:var(--muted);
  font-variant-numeric:tabular-nums;
}
.feed-item code{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:3px;
}
.feed-item p{
  margin-top:4px;
  color:var(--muted);
  font-size:12px;
  word-break:break-all;
}
.table-wrap{
  position:relative;
  overflow:auto;
}
.grid{
  width:100%;
  min-width:1100px;
  border-collapse:collapse;
}
.grid th,.grid td{
  text-align:left;
  padding:11px 10px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
}
.grid th{
  position:sticky;
  top:0;
  background:var(--white);
  z-index:1;
  font-size:12px;
  color:var(--muted);
  font-weight:650;
}
.grid td{
  font-size:13px;
  word-break:break-word;
}
.mono{font-variant-numeric:tabular-nums}
.empty{
  padding:34px 12px;
  text-align:center;
  color:var(--muted);
}
label{font-weight:650;font-size:13px}
input,select{
  width:100%;
  padding:10px;
  border:1px solid #bac4cc;
  background:#fff;
  border-radius:6px;
  color:var(--ink);
  font:inherit;
}
.search-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  align-items:end;
}
.search-grid label{
  display:grid;
  gap:7px;
}
.form-actions{
  display:flex;
  align-items:center;
  gap:10px;
}
.table-tools{align-items:center}
.orders-grid{min-width:1280px}
.stacked{
  display:grid;
  gap:4px;
}
.inline-meta{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:6px 16px;
  color:var(--muted);
}
.badge{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  margin-right:5px;
  padding:2px 7px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--muted);
  background:#f7f9fb;
  font-size:12px;
}
.badge.active{
  border-color:#b9dbc9;
  color:#146747;
  background:#eef8f2;
}
.detail-dialog{
  width:min(760px,calc(100% - 32px));
  border:1px solid var(--line);
  border-radius:8px;
  padding:0;
  color:var(--ink);
  background:#fff;
}
.detail-dialog::backdrop{background:rgba(23,32,42,.42)}
.detail-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px 18px;
  border-bottom:1px solid var(--line);
}
.detail-list{
  display:grid;
  grid-template-columns:150px 1fr;
  gap:0;
  margin:0;
  padding:8px 18px 18px;
}
.detail-list dt,.detail-list dd{
  margin:0;
  padding:10px 0;
  border-bottom:1px solid #eef1f4;
}
.detail-list dt{
  color:var(--muted);
  font-weight:650;
}
.detail-list dd{word-break:break-word}
.login-page{
  display:grid;
  min-height:100vh;
  place-items:center;
  background:#17202a;
}
.login-panel{
  width:min(420px,calc(100% - 32px));
  padding:34px;
  background:#fff;
  border-top:4px solid var(--accent);
  border-radius:6px;
}
.brand-mark{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  background:#17202a;
  color:#fff;
  font-weight:800;
  margin-bottom:20px;
}
.login-panel form{
  display:grid;
  gap:10px;
  margin-top:26px;
}
.error{min-height:22px;color:#be3d32;margin:0}

.realtime-page{
  min-height:100vh;
  color:var(--panel-ink);
  background:var(--dark);
}
.realtime-top{
  min-height:38px;
  padding:8px 12px 0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:var(--dark);
}
.top-left,.top-actions{
  display:flex;
  align-items:center;
  gap:8px;
}
.top-left strong{
  min-width:28px;
  height:24px;
  display:grid;
  place-items:center;
  border-radius:999px;
  color:#1d7b3b;
  background:#e9f9e8;
  font-size:12px;
  font-variant-numeric:tabular-nums;
}
.square-button,.mini-square,.session-note{
  border:1px solid #2c3442;
  background:#262b34;
  color:#8fa0b9;
  display:grid;
  place-items:center;
  cursor:pointer;
}
.square-button{
  width:32px;
  height:32px;
  padding:0;
  border-radius:7px;
  font-size:16px;
}
.mini-square{
  width:31px;
  height:30px;
  padding:0;
  border-radius:7px;
}
.session-note{
  width:32px;
  height:30px;
  padding:0;
  border-radius:7px;
  background:#f1f4f7;
  color:#516078;
}
.square-button:hover,.mini-square:hover{background:#303744}
.ghost-link{
  min-height:32px;
  display:inline-flex;
  align-items:center;
  padding:0 11px;
  border:1px solid #2c3442;
  border-radius:7px;
  color:#9fb0c8;
  background:#17191f;
  text-decoration:none;
}
.ghost-link:hover{background:#222630}
.live-dot{
  display:inline-flex;
  align-items:center;
  gap:7px;
  color:#8390a4;
  font-size:13px;
}
.live-dot:before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:#6b7280;
}
.live-dot.online{color:#7fe295}
.live-dot.online:before{background:#12b561}
.session-stage{
  padding:0 5px 20px;
}
.session-list{
  display:grid;
  gap:8px;
}
.session-card{
  min-height:145px;
  padding:12px 14px 14px 22px;
  background:var(--panel);
  border-top:1px solid #222630;
  border-bottom:1px solid #0b0c0f;
  border-radius:0 0 6px 6px;
}
.session-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding-bottom:7px;
  border-bottom:1px solid var(--panel-line);
}
.session-tools{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}
.chip{
  min-height:30px;
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:5px 12px;
  border-radius:7px;
  font-weight:650;
  font-size:13px;
  white-space:nowrap;
}
.chip-green{
  color:#16733a;
  background:var(--panel-chip);
}
.chip-pale{
  color:#1f7d3d;
  background:#f1ffef;
}
.os-mark{
  width:11px;
  height:11px;
  display:inline-block;
  background:
    linear-gradient(90deg,transparent 45%,#16733a 45% 55%,transparent 55%),
    linear-gradient(0deg,transparent 45%,#16733a 45% 55%,transparent 55%),
    #16733a;
}
.session-fields{
  display:flex;
  align-items:flex-end;
  gap:12px;
  padding-top:5px;
  flex-wrap:wrap;
}
.session-field{
  display:grid;
  gap:3px;
}
.session-field span{
  color:#718096;
  font-size:11px;
}
.session-field strong{
  min-height:28px;
  display:flex;
  align-items:center;
  padding:3px 7px;
  border:1px solid #3b404a;
  border-radius:5px;
  color:#d8dde6;
  background:#1d1f25;
  font-size:14px;
  font-weight:500;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.field-wide strong{
  min-width:188px;
  justify-content:center;
}
.otp-field{
  min-width:74px;
}
.verify-button{
  min-height:28px;
  padding:2px 8px;
  border:1px solid #c17b00;
  border-radius:5px;
  color:#ffb02d;
  background:#271c09;
  font-size:13px;
  font-weight:650;
}
.session-meta{
  min-height:36px;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
  color:#d4d7de;
  font-size:14px;
}
.current-page{
  min-height:28px;
  display:inline-flex;
  align-items:center;
  padding:3px 8px;
  border-radius:6px;
  background:#3d3d3f;
  color:#f0f1f3;
  font-weight:700;
}
.divider{
  width:1px;
  height:16px;
  background:#b8beca;
  opacity:.8;
}
.country-flag{
  min-width:20px;
  min-height:14px;
  display:inline-grid;
  place-items:center;
  padding:1px 4px;
  border-radius:2px;
  background:#d71920;
  color:#fff;
  font-size:10px;
  font-weight:700;
}
.shopping,.count-badge{
  color:#00bd72;
}
.count-badge{
  margin-left:-5px;
}
.nav-popover{
  position:relative;
  display:inline-flex;
  align-items:center;
}
.meta-link{
  min-height:24px;
  padding:0;
  border:0;
  border-radius:0;
  color:#d4d7de;
  background:transparent;
  font-size:14px;
}
.meta-link:hover,.nav-popover:focus-within .meta-link,.nav-popover:hover .meta-link{
  color:#fff;
  background:transparent;
}
.meta-link em{
  color:#00bd72;
  font-style:normal;
}
.shopping-popover .meta-link{
  color:#00bd72;
}
.popover-panel{
  position:absolute;
  top:31px;
  left:50%;
  z-index:50;
  display:none;
  min-width:378px;
  padding:14px 24px;
  border-radius:5px;
  color:#e4e6ec;
  background:#4b4c54;
  box-shadow:0 16px 36px rgba(0,0,0,.38);
  transform:translateX(-50%);
}
.nav-popover:hover .popover-panel,.nav-popover:focus-within .popover-panel{
  display:block;
}
.popover-panel:before{
  content:"";
  position:absolute;
  top:-7px;
  left:50%;
  width:14px;
  height:14px;
  background:#4b4c54;
  transform:translateX(-50%) rotate(45deg);
}
.device-popover .popover-panel{
  left:24px;
  transform:none;
}
.device-popover .popover-panel:before{
  left:188px;
}
.address-popover .popover-panel{
  min-width:378px;
}
.card-popover .popover-panel{
  min-width:520px;
  padding:18px 24px;
}
.popover-row{
  display:grid;
  grid-template-columns:112px minmax(0,1fr);
  gap:8px;
  align-items:start;
  padding:6px 0;
}
.popover-row span{
  color:#f1f2f5;
  font-weight:700;
}
.popover-row strong{
  min-height:25px;
  display:flex;
  align-items:center;
  padding:2px 4px;
  color:#e4e6ec;
  font-weight:600;
  word-break:break-word;
}
.popover-row.highlight-row strong{
  border-radius:3px;
  background:#535b70;
}
.popover-row.wrap-row strong{
  white-space:normal;
}
.popover-empty{
  padding:10px 0;
  color:#cbd0dc;
}
.product-line{
  display:grid;
  grid-template-columns:minmax(160px,1fr) 70px 70px;
  gap:8px;
  padding:8px 0;
  border-top:1px solid rgba(255,255,255,.1);
}
.product-line strong,.product-line span{
  color:#e4e6ec;
}
.card-history{
  padding:12px 14px;
  border-left:3px solid #848b9a;
  border-radius:5px;
  background:#303139;
}
.card-history + .card-history{
  margin-top:12px;
}
.card-history.current-card{
  border-left-color:#747bff;
  background:#272947;
}
.card-history h3{
  margin:0 0 9px;
  color:#bbc2ff;
  font-size:12px;
}
.card-row{
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap;
}
.card-row span,.card-row strong,.card-row em{
  min-height:23px;
  display:inline-flex;
  align-items:center;
  padding:2px 8px;
  border-radius:6px;
  background:#3e414b;
  color:#f1f2f5;
  font-size:13px;
  font-style:normal;
  font-weight:650;
}
.card-row strong{
  color:#626dff;
  background:#2d315b;
  font-weight:500;
}
.card-row em{
  border:1px solid #d88b00;
  color:#f6c14b;
  background:#34240b;
}
.control-button{
  margin-left:auto;
  min-height:28px;
  padding:3px 10px;
  border:1px solid #3841a6;
  border-radius:5px;
  color:#6b78ff;
  background:#16172b;
  font-size:13px;
}
.session-empty{
  margin:22px;
  padding:38px 12px;
  border:1px dashed #333945;
  border-radius:7px;
  color:#8995a8;
  text-align:center;
  background:#15171c;
}
@media(max-width:900px){
  .summary-bar{grid-template-columns:1fr}
  .feed-item{grid-template-columns:1fr}
  .search-grid{grid-template-columns:1fr}
  .form-actions{justify-content:flex-start}
  .detail-list{grid-template-columns:1fr}
  .detail-list dt{border-bottom:0;padding-bottom:0}
  header.topbar{padding:16px}
  .dashboard{padding:16px}
  .realtime-top{align-items:flex-start}
  .session-card{padding:12px}
  .session-card-head{align-items:flex-start}
  .session-fields{align-items:stretch}
  .session-field strong{min-width:0}
  .field-wide strong{min-width:0}
  .control-button{margin-left:0}
  .popover-panel{
    position:fixed;
    top:auto;
    right:12px;
    bottom:12px;
    left:12px;
    min-width:0;
    max-height:70vh;
    overflow:auto;
    transform:none;
  }
  .popover-panel:before{display:none}
  .card-popover .popover-panel{min-width:0}
  .product-line{grid-template-columns:1fr}
}
