


.kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  align-items: stretch;
}
.kpi-row .kpi-cell {
  flex: 1 1 150px;
  min-width: 140px;
  display: flex;
}
.kpi-row .kpi-cell > .card {
  flex: 1;
  height: 100%;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}


.kpi-row .kpi-cell.clickable { cursor: pointer; }
.kpi-row .kpi-cell.clickable:hover .card { border-color: var(--brand); }
.kpi-row .kpi-cell.kpi-active .card {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(31, 122, 95, .2);
}


.linkish {
  color: var(--brand);
  cursor: pointer;
  text-decoration: underline dotted;
}
.linkish:hover { text-decoration: underline solid; }


#view .row:has(#orders-currency) .field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin: 0;
}
#view .row:has(#orders-currency) .field > span {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}
#view .row:has(#orders-currency) select,
#view .row:has(#orders-currency) .btn {
  height: 32px;
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
}


#modal-host .table-wrap table th,
#modal-host .table-wrap table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


#view .table-wrap table th,
#view .table-wrap table td {
  overflow: hidden;
}


.cell-clip {
  display: inline-block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.cell-clip.wide { max-width: 260px; }
.cell-clip.narrow { max-width: 140px; }


.ord-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.42;
  max-height: calc(1.42em * 2);
}


.okv .v { min-width: 0; }
.okv-item { min-width: 0; }




.nav-burger { display: none; }
@media (max-width: 900px) {
  .nav-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: var(--ctl-h); height: var(--ctl-h); padding: 0; margin-right: 6px; font-size: 17px;
  }
}

.drawer-host { position: fixed; inset: 0; z-index: 60; }
.drawer-mask { position: absolute; inset: 0; background: var(--rail)99; }
.drawer-panel {
  position: absolute; left: 0; top: 0; bottom: 0; width: 264px;
  background: var(--rail); color: #d9e2ef; padding: 18px 14px;
  display: flex; flex-direction: column; overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0, 0, 0, .35);
}
.drawer-who { font-size: 13px; color: #9fb0cc; margin-bottom: 16px; }
.drawer-panel a {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px;
  color: #d9e2ef; text-decoration: none; font-size: 14px; margin-bottom: 2px;
}
.drawer-panel a.on { background: var(--brand); color: #fff; font-weight: 600; }
.drawer-spacer { flex: 1; }
.drawer-switches { border-top: 1px solid #ffffff14; padding-top: 10px; margin-top: 12px; }
.drawer-swrow {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; font-size: 14px;
}
.drawer-sw {
  width: 46px; height: 26px; border-radius: 999px; background: #3a445c;
  position: relative; flex: 0 0 auto; cursor: pointer;
}
.drawer-sw i {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: left .18s;
}
.drawer-sw.on { background: var(--brand); }
.drawer-sw.on i { left: 23px; }
.drawer-seg { display: flex; border: 1px solid #ffffff26; border-radius: 9px; overflow: hidden; }
.drawer-seg span { padding: 4px 12px; font-size: 12.5px; cursor: pointer; }
.drawer-seg span.on { background: var(--brand); color: #fff; }

.drawer-logout {
  width: 100%; margin-top: 12px; padding: 11px 10px;
  border-radius: 10px; border: 1px solid #ffffff2e; background: transparent;
  color: var(--brand-400); font: inherit; font-size: 14px; cursor: pointer;
}
.drawer-logout:hover { background: #ffffff12; border-color: #ff7a7a66; }


.drawer-panel {
  width: 288px;
  padding: calc(12px + var(--sat)) calc(12px + var(--sar)) calc(14px + var(--sab)) calc(12px + var(--sal));
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.drawer-head { display: flex; align-items: center; gap: 9px; padding: 2px 4px 10px; }
.drawer-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 13px;
}
.drawer-head-txt { display: grid; gap: 1px; min-width: 0; }
.drawer-head-txt strong { font-size: 14px; }
.drawer-head .drawer-who {
  margin: 0; font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drawer-x {
  width: 30px; height: 30px; margin-left: auto; flex: none; cursor: pointer;
  border-radius: 9px; border: 1px solid #ffffff26; background: transparent;
  color: #d9e2ef; font: inherit; font-size: 14px;
}
.drawer-grp { font-size: 11.5px; color: #7d8fa8; letter-spacing: .4px; padding: 9px 10px 3px; }
.drawer-grp.last { margin-top: 5px; border-top: 1px solid #ffffff1a; padding-top: 11px; }
.drawer-panel a .di { width: 18px; text-align: center; opacity: .9; }
.drawer-panel a:active { background: #ffffff12; }
.drawer-panel a[href="#/agent"]:not(.on) { color: var(--brand-400); font-weight: 600; }

.drawer-tap { cursor: pointer; }
.drawer-tap:active { background: #ffffff0f; border-radius: 9px; }
.drawer-pill {
  font-size: 12.5px; padding: 3px 10px; border-radius: 999px;
  background: #f5a52422; border: 1px solid #f5a52466; color: #f7c46c;
}
.drawer-pill.live { background: rgba(31, 122, 95, .13); border-color: rgba(31, 122, 95, .4); color: var(--brand-400); }


@media (max-width: 900px) {
  #page-sub { display: none; }
  #autorefresh-toggle, #lang-toggle, #mode-toggle, #night-toggle { display: none; }
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar-left h2 { font-size: 16px; }
}


.mob-list { display: flex; flex-direction: column; gap: 10px; }
.mob-order {
  background: #fff; border: 1px solid #e7e9ee; border-radius: 12px;
  padding: 12px 13px; cursor: pointer;
}
.mob-order .no { font-weight: 600; font-size: 15px; }
.mob-order-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mob-order .amt { font-weight: 650; font-size: 15px; white-space: nowrap; }
.mob-order .time { font-size: 12.5px; color: #6b7280; margin-top: 3px; }

.mob-order .mob-order-title {
  font-size: 13px; color: #3b4453; margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mob-order .pay {
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: 12.5px; color: #3b4453;
}
.mob-order .pill {
  background: #eef2ff; color: #3551a8; border-radius: 6px; padding: 2px 7px; font-size: 11.5px;
}
body.mads-dark .mob-order { background: #171d2b; border-color: #242c3e; }
body.mads-dark .mob-order .no { color: #e6eaf2; }
body.mads-dark .mob-order .amt { color: #e6eaf2; }
body.mads-dark .mob-order .time,
body.mads-dark .mob-order .pay,
body.mads-dark .mob-order .mob-order-title { color: #8b95a8; }
body.mads-dark .mob-order .pill { background: #1d2740; color: #8fb0ff; }


@media (max-width: 900px) {

  #modal-host { padding: 0; }
  #modal-host .modal {
    width: 100%; max-width: 100%; height: 100%; max-height: 100%;
    border-radius: 0; margin: 0;
  }
}



.th-sort { cursor: pointer; user-select: none; white-space: nowrap; display: inline-block; }
.th-sort:hover { color: var(--brand); }
.sortmark { font-size: 10px; color: var(--brand); }


.collist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 52vh;
  overflow-y: auto;
}
.colrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #ffffff0a;
  cursor: grab;
}
.colrow.dragging { opacity: .45; cursor: grabbing; }
.colrow.dragover {
  background: rgba(31, 122, 95, .13);
  box-shadow: inset 0 2px 0 var(--brand);
}
.colrow-grip {
  color: var(--text-faint);
  font-size: 14px;
  line-height: 1;
  user-select: none;
}
.colrow-name { flex: 1; }
.colrow:hover { background: #ffffff14; }
.colrow-name {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13.5px;
}
.colrow-move { display: flex; gap: 4px; }


.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}


.otl-body { min-width: 0; }


.okv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px 18px;
}
.okv .k {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 2px;
}
.okv .v {
  font-size: 13.5px;
  word-break: break-word;
}


.oship {
  border: 1px solid #ffffff14;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.oship:last-child { margin-bottom: 0; }


.otl { margin-top: 10px; }
.otl-item {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 10px;
  padding: 7px 0;
  position: relative;
}
.otl-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 24px;
  bottom: -6px;
  width: 1px;
  background: #ffffff1f;
}
.otl-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-top: 4px;
  background: #8b95a5;
  z-index: 1;
}
.otl-dot.ok { background: #2fbf71; }
.otl-dot.info { background: var(--brand); }
.otl-dot.warn { background: #e0a33a; }
.otl-dot.danger { background: var(--brand); }
.otl-desc { font-size: 13.5px; }
.otl-meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.otl-latest {
  font-size: 11px;
  color: var(--text-faint);
  align-self: start;
  margin-top: 3px;
}


@media (prefers-color-scheme: light) {
  .oship { border-color: #00000014; }
  .otl-item:not(:last-child)::after { background: #0000001f; }
}


.mob-chiprow { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.mob-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  background: var(--card-solid); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 13px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
}
.mob-chip.on { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.mob-chip-caret { font-size: 11px; color: var(--text-faint); }

.mob-big { display: grid; gap: 4px; }
.mob-lbl { font-size: 12.5px; color: var(--text-dim); }
.mob-val { font-size: 26px; font-weight: 700; letter-spacing: .3px; }
.mob-sub { font-size: 12.5px; color: var(--text-faint); }

.mob-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mob-mini { padding: 11px; }
.mob-mini-val { font-size: 17px; font-weight: 700; margin-top: 3px; }


.mob-kvlist { display: flex; flex-direction: column; }
.mob-kv {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px;
}
.mob-kv:last-child { border-bottom: none; }
.mob-kv-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mob-kv-r { color: var(--text-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }


@media (max-width: 900px) {
  #view .chart { height: 190px; }
}


.sheet-host { position: fixed; inset: 0; z-index: 90; }
.sheet-mask { position: absolute; inset: 0; background: var(--rail)99; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--card-solid); color: var(--text);
  border-radius: 16px 16px 0 0;
  padding: 14px 0 max(10px, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px #0000004d;
  max-height: 70vh; overflow-y: auto;
}
.sheet-title { text-align: center; font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.sheet-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 13px 20px; font-size: 14.5px; cursor: pointer;
}
.sheet-row:hover { background: #ffffff0a; }
.sheet-row em { font-style: normal; color: var(--text-faint); font-size: 12.5px; }
.sheet-row.on { color: var(--brand); font-weight: 600; }
.sheet-tick { color: var(--brand); font-weight: 600; }
.sheet-sep { height: 1px; background: var(--line-soft); margin: 6px 0; }
.sheet-cancel { text-align: center; padding: 12px 0; font-size: 14.5px; color: var(--text-dim); cursor: pointer; }


.mob-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; margin-bottom: 10px;
}
.mob-iconbtn {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card-solid);
  color: var(--text); font-size: 16px; line-height: 1; cursor: pointer;
}
.mob-iconbtn.on { border-color: var(--brand); color: var(--brand); }

.mob-toolbar > .input { flex: 1 1 auto; min-width: 0; }
.mob-filternote {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px;
}


.btn-icon {
  width: var(--ctl-h); height: var(--ctl-h); padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
}



.load-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-bottom:14px}
.load-cell{background:var(--bg-soft);border:1px solid var(--line-soft);border-radius:10px;padding:10px 12px}
.load-val{font-size:18px;font-weight:650;letter-spacing:.3px;margin:2px 0}
.load-val.warn{color:#b7781b}
.sp-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; align-items: start; }
.sp-listwrap { padding: 10px; }
.sp-list { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.sp-item {
  border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px;
  cursor: pointer; background: var(--card-solid);
}
.sp-item:hover { border-color: var(--brand); }
.sp-item.on { border-color: var(--brand); background: var(--brand-soft); }
.sp-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sp-item-top strong { font-size: 13.5px; }
.sp-item-subject {
  font-size: 12.8px; margin-top: 5px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sp-item-preview {
  font-size: 12px; color: var(--text-faint); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.sp-item-foot { display: flex; align-items: center; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.sp-chip {
  font-size: 11px; padding: 1px 7px; border-radius: 6px;
  background: var(--bg-soft); color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.sp-chip.gray { background: transparent; border: 1px solid var(--line); }

.sp-detail { display: grid; gap: 14px; min-width: 0; }
.sp-thread { display: flex; flex-direction: column; gap: 10px; }
.sp-msg {
  border-radius: 10px; padding: 11px 13px; border: 1px solid var(--line-soft);
  max-width: 92%;
}
.sp-msg.in { background: var(--bg-soft); }
.sp-msg.out { background: var(--brand)10; border-color: var(--brand)55; margin-left: auto; }
.sp-msg-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12.5px; }
.sp-msg-body { font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
body.mads-dark .sp-msg.in { background: #1b2437; }
body.mads-dark .sp-msg.out { background: #16233d; border-color: var(--brand)55; }

@media (max-width: 900px) {
  .sp-grid { grid-template-columns: minmax(0, 1fr); }
  .sp-list { max-height: none; }
  .sp-msg { max-width: 100%; }
}


@media (max-width: 900px) {

  .tz-btn { min-width: 0; }
  .tz-btn .tz-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kpi-row { gap: 8px; }
  .kpi-row .kpi-cell { flex: 1 1 0; min-width: 0; }
  .kpi-row .kpi-cell > .card { padding: 11px; min-height: 82px; }
  .kpi-row .kpi .value { font-size: 17px; }
  .kpi-row .kpi .label { font-size: 12px; }
  .kpi-row .kpi .sub { font-size: 10.5px; line-height: 1.35; }
}
