:root {
  color-scheme: light;
  --blue-900: #00396f;
  --blue-850: #004c86;
  --blue-700: #00699f;
  --cyan-title: #0796ad;
  --panel-line: #7aa6de;
  --panel-head: #cfe4fb;
  --panel-head-2: #a9cdf4;
  --menu-head: #cbd4dc;
  --menu-line: #d7dfe6;
  --text: #002d55;
  --red: #f00000;
  --white: #fff;
  font-family: Tahoma, "SimSun", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 1120px;
  margin: 0;
  color: #111;
  background: #fff;
  font-size: 12px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

input,
select,
textarea {
  border: 1px solid #a9b9c8;
  min-height: 22px;
  padding: 1px 5px;
  background: #fff;
}

.login-screen {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 38% 42%, rgba(68, 150, 219, 0.25), transparent 18%),
    radial-gradient(circle at 45% 47%, transparent 0 17%, rgba(119, 176, 226, 0.12) 17.4% 18.2%, transparent 18.4%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 4px),
    linear-gradient(#004c86, #00396f 38%, #f5f5f5 38% 64%, #00396f 64%);
  overflow: hidden;
}

.module-tabs button,
.blue-button,
.gray-button,
.mini-button {
  border: 1px solid #4b7dad;
  background: linear-gradient(#f5faff, #c9d9ea);
  color: #003c72;
  font-weight: 700;
}

.login-band {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 360px minmax(260px, 1fr);
  align-items: center;
  min-height: 236px;
  margin-top: 282px;
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #d6d6d6;
  background: rgba(246, 246, 246, 0.96);
}

.login-brand {
  justify-self: end;
  padding-right: 34px;
  color: #dcecff;
  text-shadow: 0 1px 2px #003560;
}

.ipos-logo {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: #6fb0ef;
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -3px;
  text-shadow: 0 2px 6px rgba(0, 20, 50, 0.55);
}

.ipos-logo i {
  position: absolute;
  left: 4px;
  top: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f30021;
}

.ipos-logo.small {
  font-size: 44px;
  line-height: 1;
}

.login-brand h1 {
  display: inline-block;
  margin: 0 0 0 22px;
  color: #dcecff;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 0;
}

.login-brand p {
  margin: 0;
  color: #f2f8ff;
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

.login-card {
  justify-self: center;
  width: 330px;
  padding: 14px 0;
}

.auth-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 12px;
}

.auth-tabs button {
  min-width: 92px;
  min-height: 28px;
  border: 1px solid #1c70a2;
  background: linear-gradient(#e6f6ff, #b8d6ee);
  color: #004575;
  font-weight: 700;
}

.auth-tabs .active {
  color: #fff;
  background: linear-gradient(#008fb0, #005c8e);
}

.legacy-form {
  display: grid;
  gap: 9px;
}

.legacy-form label {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.legacy-form input {
  height: 26px;
  background: #ffffc8;
  font-size: 18px;
}

.register-form {
  gap: 7px;
}

.register-form input {
  font-size: 14px;
}

.auth-hints {
  display: flex;
  gap: 20px;
  margin-left: 70px;
}

.checkbox-line {
  display: inline-flex !important;
  grid-template-columns: none !important;
  gap: 3px;
  font-size: 12px !important;
  font-weight: 400 !important;
}

.checkbox-line input {
  width: 14px;
  height: 14px;
  min-height: 0;
}

.auth-actions {
  display: flex;
  gap: 14px;
  margin-left: 70px;
}

.blue-button,
.gray-button {
  min-width: 86px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 3px;
}

.blue-button {
  color: #fff;
  border-color: #0b5f93;
  background: linear-gradient(#0d8cc0, #005a98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.gray-button {
  color: #003c72;
}

.login-tip {
  margin: 0 0 0 70px;
  color: #37536a;
  line-height: 1.6;
}

.money-figure {
  position: relative;
  width: 210px;
  height: 190px;
}

.figure-head {
  position: absolute;
  left: 55px;
  top: 10px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #fff, #bfc5cb 70%);
  box-shadow: 0 14px 18px rgba(0, 0, 0, 0.2);
}

.figure-body {
  position: absolute;
  left: 42px;
  top: 78px;
  width: 92px;
  height: 88px;
  border-radius: 48% 48% 35% 35%;
  background: linear-gradient(#fefefe, #c8ced4);
}

.money-bag {
  position: absolute;
  left: 135px;
  top: 100px;
  display: grid;
  place-items: center;
  width: 60px;
  height: 78px;
  border-radius: 28px 28px 22px 22px;
  color: #7b5a20;
  background: #b9a46e;
  font-size: 30px;
  font-weight: 900;
}

.login-footer {
  margin-top: 12px;
  color: #eef6ff;
  text-align: center;
}

.ipos-shell {
  display: grid;
  grid-template-rows: 92px minmax(0, 1fr);
  min-height: 100dvh;
}

.topbar {
  display: grid;
  grid-template-columns: 360px 1fr 410px;
  align-items: end;
  gap: 12px;
  padding: 0 10px 10px;
  color: #fff;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, #003567, #00548d 50%, #004475);
}

.top-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.top-brand strong {
  font-size: 24px;
  font-weight: 500;
  white-space: nowrap;
}

.module-tabs {
  display: flex;
  gap: 3px;
  align-items: end;
}

.module-tabs button {
  min-width: 50px;
  height: 34px;
  border-radius: 2px;
}

.module-tabs .active {
  color: #fff;
  background: linear-gradient(#087a9a, #004a79);
}

.user-tools {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: #fff;
}

.user-tools b,
.user-tools .version {
  color: #fff600;
}

.tool-link {
  border: 0;
  color: #fff;
  background: transparent;
  text-decoration: underline;
}

.workbench {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 0;
}

.legacy-sidebar {
  overflow: auto;
  border-right: 10px solid #075d95;
  background: #f7f7f7;
}

.menu-group h2 {
  margin: 0;
  padding: 10px 11px;
  border-bottom: 1px solid #9aaab8;
  color: #00446b;
  background: linear-gradient(#edf1f5, var(--menu-head));
  font-size: 14px;
}

.menu-group button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 28px;
  border: 0;
  border-bottom: 1px solid var(--menu-line);
  padding: 0 9px;
  color: #001c2d;
  background: #fbfbfb;
  text-align: left;
}

.menu-group button:hover,
.menu-group button.active {
  color: #004a7a;
  background: #eef7ff;
  font-weight: 700;
}

.menu-group span {
  color: #3f899e;
  font-size: 18px;
}

.legacy-main {
  overflow: auto;
  padding: 0 8px 14px;
  background: #fff;
}

.tab-strip {
  height: 36px;
  border: 1px solid var(--panel-line);
  border-top: 0;
  background: #dbeafc;
}

.tab-strip span {
  display: inline-flex;
  align-items: center;
  height: 30px;
  margin: 4px 0 0 4px;
  border: 1px solid #8eb6e4;
  border-bottom: 0;
  padding: 0 16px;
  color: #004a78;
  background: #eef6ff;
}

.legacy-panel {
  min-width: 0;
  border: 1px solid var(--panel-line);
  background: #fff;
}

.panel-title,
.window-title {
  min-height: 25px;
  border-bottom: 1px solid var(--panel-line);
  padding: 4px 7px;
  color: #004b83;
  background: linear-gradient(var(--panel-head), var(--panel-head-2));
  font-size: 14px;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48%;
  gap: 0;
  min-height: 720px;
}

.dashboard-grid .legacy-panel {
  min-height: 300px;
}

.reminders {
  padding-bottom: 20px;
}

.reminders p {
  margin: 16px 12px;
  font-size: 14px;
}

.reminders em,
.red-number {
  color: var(--red);
  font-style: normal;
  font-weight: 700;
}

.legacy-table-wrap {
  overflow: auto;
}

.legacy-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.legacy-table th,
.legacy-table td {
  height: 28px;
  border: 1px solid var(--panel-line);
  padding: 4px 8px;
  text-align: center;
}

.legacy-table th {
  color: #004b83;
  background: linear-gradient(#f7f7f7, #dfdfdf);
  font-weight: 700;
}

.amount-cell {
  color: #002d55;
  font-weight: 700;
  text-align: right !important;
}

.cashier-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 345px;
  min-height: 710px;
  border: 1px solid #079bb3;
}

.sale-table-panel {
  border: 0;
  border-right: 1px solid #c5d2df;
}

.cashier-status {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 8px 12px;
  color: #111;
  font-size: 14px;
}

.cashier-status b {
  color: #0034cc;
  font-size: 20px;
}

.sale-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 130px;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e2e8ef;
  border-bottom: 1px solid #e2e8ef;
  background: #f8fbff;
}

.sale-form label,
.toolbar-row label,
.inline-form label {
  display: grid;
  gap: 4px;
  color: #003d70;
  font-weight: 700;
}

.sale-form .save-sale {
  align-self: end;
}

.cashier-side {
  display: grid;
  grid-template-rows: 1fr auto;
  background: #f5f5f5;
}

.cashier-totals {
  padding: 10px;
  font-size: 16px;
}

.cashier-totals textarea {
  width: 100%;
  height: 50px;
  resize: none;
}

.cashier-totals p {
  margin: 7px 0;
  font-weight: 700;
}

.cashier-totals strong {
  color: var(--red);
  font-size: 30px;
  font-weight: 400;
}

.ticket-count {
  text-align: right;
}

.ticket-count b,
.red-line {
  color: var(--red);
}

.keypad-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  background: #cfd6de;
}

.keypad-panel button {
  min-height: 48px;
  border: 2px solid #e6e6e6;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(#00a4ca, #005a9b);
  box-shadow: 0 0 0 1px #7f9aad;
  font-size: 16px;
  font-weight: 700;
}

.full-panel {
  margin-top: 8px;
  min-height: 640px;
}

.toolbar-row,
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid var(--panel-line);
  background: #eef6ff;
}

.mini-button {
  min-height: 22px;
  margin: 1px;
  padding: 0 7px;
}

.mini-button.danger {
  color: #9b0000;
}

.row-actions {
  white-space: nowrap;
}

.status {
  font-weight: 700;
}

.status.active {
  color: #007030;
}

.status.pending {
  color: #d96b00;
}

.status.rejected {
  color: #c00000;
}

.empty-line {
  padding: 24px;
  color: #667;
}

.tiny-refresh {
  margin-left: 6px;
  border: 1px solid #7aa6de;
  color: #00842a;
  background: #eaf7ea;
}

.legacy-dialog {
  width: 360px;
  border: 2px solid #079bb3;
  padding: 0;
}

.legacy-dialog::backdrop {
  background: rgba(0, 0, 0, 0.28);
}

.legacy-dialog form {
  display: grid;
  gap: 10px;
  padding: 0 16px 14px;
}

.dialog-title {
  margin: 0 -16px 8px;
  padding: 7px 10px;
  color: #fff;
  background: var(--cyan-title);
  font-size: 14px;
  font-weight: 700;
}

.legacy-dialog label {
  display: grid;
  gap: 4px;
  color: #003d70;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: 420px;
  border: 1px solid #004d7c;
  padding: 10px 14px;
  color: #fff;
  background: #005f94;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: #b10000;
}

@media (max-width: 900px) {
  body {
    min-width: 360px;
  }

  .login-screen {
    background: linear-gradient(#004c86, #00396f);
  }

  .money-figure {
    display: none;
  }

  .login-band {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 60px;
    padding: 24px 16px;
  }

  .login-brand {
    justify-self: start;
    padding: 0 0 18px;
  }

  .login-brand h1 {
    display: block;
    margin: 0;
  }

  .login-card {
    width: 100%;
  }

  .ipos-shell {
    grid-template-rows: auto 1fr;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 8px;
  }

  .module-tabs {
    flex-wrap: wrap;
  }

  .user-tools {
    justify-items: start;
  }

  .workbench,
  .dashboard-grid,
  .cashier-screen {
    grid-template-columns: 1fr;
  }

  .legacy-sidebar {
    max-height: 220px;
    border-right: 0;
    border-bottom: 8px solid #075d95;
  }

  .sale-form {
    grid-template-columns: 1fr;
  }
}
