* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #f4f8ff;
  color: #121a26;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

a {
  color: #026cdf;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(118deg, rgba(2, 20, 44, .94) 0%, rgba(0, 60, 160, .82) 44%, rgba(2, 108, 223, .62) 100%),
    radial-gradient(circle at 78% 22%, rgba(255, 255, 255, .24), transparent 26%),
    radial-gradient(circle at 20% 84%, rgba(0, 178, 255, .24), transparent 30%),
    linear-gradient(135deg, #071421 0%, #092b62 52%, #026cdf 100%);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
}

.login-shell {
  width: min(940px, 100%);
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 0;
  align-items: stretch;
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 16px;
  box-shadow: 0 34px 90px rgba(0, 23, 60, .38);
  overflow: hidden;
}

.login-hero {
  color: #fff;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 44px;
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, .22), transparent 28%),
    radial-gradient(circle at 24% 78%, rgba(0, 176, 255, .2), transparent 30%),
    linear-gradient(145deg, #071421 0%, #092b62 56%, #026cdf 100%);
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  width: 100%;
}

.brand-logo {
  width: 181px;
  height: auto;
  display: block;
}

.login-logo {
  width: min(330px, 100%);
  max-width: 70vw;
  background: rgba(255, 255, 255, .97);
  border-radius: 12px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, .26);
  padding: 16px 20px;
}

.login-hero h1 {
  max-width: 640px;
  margin: 34px 0 12px;
  font-size: 50px;
  line-height: 1.04;
  letter-spacing: 0;
}

.login-hero p {
  max-width: 520px;
  margin: 0;
  color: #edf2f7;
  font-size: 16px;
  line-height: 1.5;
}

.login-panel {
  align-self: stretch;
  display: flex;
  align-items: center;
  background: #fff;
  border: 0;
  border-left: 1px solid #d6e2f1;
  box-shadow: none;
  overflow: hidden;
}

.login-panel form {
  width: 100%;
  padding: 44px 38px;
}

.login-panel-brand {
  display: none;
}

.login-panel-brand img {
  width: 180px;
  height: auto;
}

.login-panel h2 {
  margin: 0 0 22px;
  color: #121a26;
  font-size: 25px;
}

.login-panel label {
  display: block;
  margin: 14px 0 7px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-panel input,
.app-shell input[type="text"],
.app-shell select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #c6d4e3;
  border-radius: 6px;
  background: #fff;
  color: #121a26;
  padding: 8px 10px;
  font: inherit;
}

.login-panel button,
.app-shell input[type="submit"],
.app-shell input[type="button"] {
  border: 0;
  background: #026cdf;
  color: #fff;
  min-height: 38px;
  padding: 9px 18px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(2, 108, 223, .24);
}

.login-panel button:hover,
.app-shell input[type="submit"]:hover,
.app-shell input[type="button"]:hover {
  background: #0056bd;
}

.login-panel button {
  width: 100%;
  margin-top: 22px;
}

.alert {
  margin-top: 16px;
  padding: 10px 12px;
  border-left: 4px solid #d71920;
  background: #fff3f5;
  color: #9f1239;
}

.app-shell {
  background: #f4f8ff;
}

.app-header {
  background:
    linear-gradient(90deg, #071421 0%, #092b62 48%, #026cdf 100%);
  color: #fff;
  border-bottom: 4px solid #026cdf;
  box-shadow: 0 8px 28px rgba(0, 32, 72, .18);
}

.app-header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 15px 22px 12px;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, .96);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}

.header-brand:hover {
  text-decoration: none;
}

.header-logo {
  width: 174px;
}

.app-title {
  margin: 0;
  font-size: 23px;
  letter-spacing: 0;
}

.app-subtitle {
  margin: 3px 0 0;
  color: #d5e8ff;
}

.app-user {
  text-align: right;
  color: #dbe4ee;
  line-height: 1.5;
}

.app-user a {
  color: #fff;
  font-weight: 700;
  border-bottom: 2px solid rgba(255, 255, 255, .45);
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 22px 14px;
}

.app-nav a {
  color: #eaf4ff;
  background: rgba(255, 255, 255, .11);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 700;
}

.app-nav a:hover {
  background: #fff;
  color: #026cdf;
  text-decoration: none;
}

.app-footer {
  width: 100%;
  margin: 0;
  padding: 22px 24px 28px;
  background: transparent;
  color: #617188;
}

.app-footer-inner {
  width: 100%;
  border-top: 1px solid #d7e4f2;
  padding-top: 16px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
}

.app-shell form {
  padding: 16px 18px 24px;
}

.app-shell table {
  border-collapse: collapse;
}

.app-shell > table,
.app-shell form > table {
  background: #fff;
  margin: 12px 18px;
  border: 1px solid #d8e0e8;
}

.app-shell td {
  padding: 5px;
  vertical-align: middle;
}

.th,
.thb {
  background: #121a26;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
}

.thb {
  font-weight: 700;
}

.td,
.tdb {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  color: #1f2933;
}

.tdb {
  font-weight: 700;
}

.detail-page {
  padding: 18px;
}

.detail-page table {
  background: #fff;
  border-color: #d8e0e8;
}

.report-page {
  padding: 20px 24px 30px;
  background:
    radial-gradient(circle at 18% 0%, rgba(2, 108, 223, .15), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(0, 176, 255, .15), transparent 24%),
    linear-gradient(180deg, #f7fbff, #eef5ff);
}

.report-form {
  padding: 0 !important;
}

.app-shell form[name="frm"] {
  padding: 0;
}

.report-form > table:not(.report-table) {
  width: 100% !important;
  margin: 0 0 14px !important;
  background:
    linear-gradient(135deg, rgba(2, 108, 223, .13), rgba(0, 176, 255, .09) 42%, rgba(255, 255, 255, .97) 43%),
    #fff;
  border: 1px solid #c7d8ef;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(7, 20, 33, .09);
  overflow: hidden;
}

.report-criteria {
  width: calc(100% - 48px) !important;
  margin: 18px 24px 14px !important;
  background:
    linear-gradient(135deg, rgba(2, 108, 223, .14), rgba(0, 176, 255, .09) 42%, rgba(255, 255, 255, .97) 43%),
    #fff !important;
  border: 1px solid #c7d8ef !important;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(7, 20, 33, .09);
  overflow: hidden;
}

.report-criteria td {
  background: transparent !important;
  border-color: transparent !important;
}

.report-form > table:not(.report-table) > tbody > tr > td {
  padding: 10px 12px;
}

.report-form table table {
  border: 0;
  background: transparent;
  margin: 0;
}

.report-form input[type="text"],
.report-form input[type="date"],
.report-form select {
  width: 100%;
  min-height: 34px;
  border: 1px solid #b9c9dd;
  border-radius: 6px;
  background: #fff;
  color: #17202a;
  padding: 7px 9px;
  font: inherit;
}

.report-form .show-search-field {
  min-height: 40px;
  padding-left: 38px;
  padding-right: 40px;
  background:
    linear-gradient(90deg, rgba(2, 108, 223, .12), rgba(2, 108, 223, 0) 56px),
    #fff;
  border-color: #9db7dc;
  font-weight: 700;
}

.show-search-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}

.show-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 24px;
  height: 24px;
  min-height: 24px !important;
  padding: 0 !important;
  border: 0;
  border-radius: 50%;
  background: #dbeafe !important;
  color: #026cdf !important;
  box-shadow: none !important;
  font: 700 15px/24px Arial, Helvetica, sans-serif;
  text-align: center;
  transform: translateY(-50%);
  cursor: pointer;
}

.show-search-clear:hover {
  background: #026cdf !important;
  color: #fff !important;
}

.risk-filter {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 48px;
  padding: 8px 10px;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.risk-option {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.risk-option input {
  width: auto !important;
  margin: 0;
}

.risk-option-all {
  gap: 7px;
}

.risk-swatch {
  width: 30px;
  height: 42px;
  border: 1px solid rgba(17, 24, 39, .18);
  display: inline-block;
}

.risk-swatch-blacklist {
  background: #ff0000;
}

.risk-swatch-high-red {
  background: #8b0000;
}

.risk-swatch-high-white {
  background: #fff;
}

.risk-swatch-medium {
  background: #fff200;
}

.risk-swatch-low {
  background: #00c800;
}

.report-form .legacy-show-select,
.report-form .legacy-date-field {
  display: none !important;
}

.report-form .show-search-field::placeholder {
  color: #526b89;
  font-weight: 700;
}

.report-form input[type="date"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23526b89' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 18px 18px;
  min-width: 148px;
  padding-right: 34px;
  position: relative;
  cursor: pointer;
}

.report-form input[type="date"]::-webkit-calendar-picker-indicator {
  background: transparent;
  bottom: 0;
  color: transparent;
  cursor: pointer;
  height: auto;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
  width: auto;
}

.report-form input[type="text"]:focus,
.report-form input[type="date"]:focus,
.report-form select:focus {
  border-color: #026cdf;
  box-shadow: 0 0 0 3px rgba(2, 108, 223, .16);
  outline: 0;
}

.report-form input[type="radio"],
.report-form input[type="checkbox"] {
  accent-color: #026cdf;
}

.report-form .date-format-note {
  color: #5f6f83;
  font-weight: 700;
}

.report-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #c9d8ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(7, 20, 33, .08);
}

.report-table {
  width: 100% !important;
  min-width: 1900px;
  border: 0 !important;
  margin: 0 !important;
}

.report-table td {
  border: 1px solid #d5e2f1 !important;
  padding: 8px 10px !important;
  line-height: 1.32;
}

.report-table tr:first-child td,
.report-table .thb {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #121a26 !important;
  color: #fff !important;
  border-color: #17395f !important;
  font-size: 12px;
  font-weight: 700;
}

.report-table tr:not(:first-child) td:not([bgcolor]) {
  background: #effbff;
}

.report-table tr:nth-child(odd):not(:first-child) td:not([bgcolor]) {
  background: #f8fcff;
}

.report-table tr[bgcolor="#9999CC"] td,
.report-table tr[bgcolor="#9999cc"] td {
  background: #026cdf !important;
  color: #fff;
  font-weight: 700;
  border-color: #0056bd !important;
}

.report-table a {
  color: #026cdf;
  font-weight: 700;
}

.report-table tr[bgcolor="#9999CC"] a,
.report-table tr[bgcolor="#9999cc"] a {
  color: #fff;
}

.sumsaleall-layout {
  width: calc(100% - 48px) !important;
  margin: 18px 24px 14px !important;
  border: 0 !important;
  background: transparent !important;
}

.sumsaleall-layout > tbody > tr:first-child > td {
  background:
    linear-gradient(135deg, rgba(2, 108, 223, .14), rgba(0, 176, 255, .09) 42%, rgba(255, 255, 255, .97) 43%),
    #fff !important;
  border-top: 1px solid #c7d8ef;
  border-bottom: 1px solid #c7d8ef;
  color: #243447;
}

.sumsaleall-layout > tbody > tr:first-child > td:first-child {
  border-left: 1px solid #c7d8ef;
  border-radius: 8px 0 0 8px;
}

.sumsaleall-layout > tbody > tr:first-child > td:last-child {
  border-right: 1px solid #c7d8ef;
  border-radius: 0 8px 8px 0;
}

.sumsaleall-table-wrap {
  margin-top: 16px;
}

.sumsaleall-table {
  min-width: 1040px;
}

.sumsaleall-table td {
  background: #f8fcff !important;
  border-color: #d5e2f1 !important;
  color: #17202a;
}

.sumsaleall-table tr:nth-child(even) td {
  background: #edf7ff !important;
}

.sumsaleall-table tr:first-child td,
.sumsaleall-table tr:nth-child(2) td,
.sumsaleall-table td[bgcolor="#999999"],
.sumsaleall-table td[bgcolor="#999999"] font {
  background: #121a26 !important;
  color: #fff !important;
}

.sumsaleall-table tr:first-child td,
.sumsaleall-table tr:nth-child(2) td {
  border-color: #28415f !important;
  text-align: center;
}

.sumsaleall-data-row td:first-child {
  text-align: left;
  font-weight: 700;
  color: #0d315d;
}

.sumsaleall-spacer-row td {
  height: 12px;
  background: #fff !important;
  border-left-color: transparent !important;
  border-right-color: transparent !important;
}

.sumsaleall-total-row td {
  background: #026cdf !important;
  border-color: #0056bd !important;
  color: #fff !important;
  font-weight: 700;
}

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  input,
  select,
  button {
    font-size: 16px !important;
  }

  a,
  button,
  input[type="submit"],
  input[type="button"],
  input[type="radio"],
  input[type="checkbox"],
  select {
    touch-action: manipulation;
  }

  .login-page {
    align-items: stretch;
    padding: 16px;
  }

  .login-shell,
  .app-header-inner {
    grid-template-columns: 1fr;
  }

  .login-shell {
    min-height: 0;
    border-radius: 10px;
  }

  .login-hero {
    min-height: 150px;
    padding: 24px 20px;
  }

  .login-hero h1 {
    font-size: 34px;
  }

  .login-panel {
    border-left: 0;
    border-top: 1px solid #d6e2f1;
  }

  .login-panel form {
    padding: 28px 22px;
  }

  .app-header-inner {
    gap: 12px;
    padding: 12px 14px 10px;
  }

  .app-title {
    font-size: 20px;
  }

  .app-subtitle {
    font-size: 13px;
  }

  .app-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0 14px 12px;
    -webkit-overflow-scrolling: touch;
  }

  .app-nav a {
    flex: 0 0 auto;
    padding: 10px 12px;
    white-space: nowrap;
  }

  .app-user {
    text-align: left;
  }

  .app-shell {
    overflow-x: hidden;
  }

  .report-page {
    padding: 12px;
  }

  .app-shell form {
    padding: 12px;
  }

  .report-form > table:not(.report-table),
  .report-criteria,
  .sumsaleall-layout,
  .app-shell form > table:not(.report-table) {
    width: 100% !important;
    margin: 0 0 12px !important;
  }

  .report-form > table:not(.report-table),
  .report-form > table:not(.report-table) > tbody,
  .report-form > table:not(.report-table) > tbody > tr,
  .report-form > table:not(.report-table) > tbody > tr > td,
  .report-form > table:not(.report-table) table:not(.report-table),
  .report-form > table:not(.report-table) table:not(.report-table) > tbody,
  .report-form > table:not(.report-table) table:not(.report-table) > tbody > tr,
  .report-form > table:not(.report-table) table:not(.report-table) > tbody > tr > td,
  .app-shell form > table:not(.report-table),
  .app-shell form > table:not(.report-table) > tbody,
  .app-shell form > table:not(.report-table) > tbody > tr,
  .app-shell form > table:not(.report-table) > tbody > tr > td,
  .app-shell form > table:not(.report-table) table:not(.report-table),
  .app-shell form > table:not(.report-table) table:not(.report-table) > tbody,
  .app-shell form > table:not(.report-table) table:not(.report-table) > tbody > tr,
  .app-shell form > table:not(.report-table) table:not(.report-table) > tbody > tr > td,
  .report-criteria,
  .report-criteria > tbody,
  .report-criteria > tbody > tr,
  .report-criteria > tbody > tr > td,
  .sumsaleall-layout,
  .sumsaleall-layout > tbody,
  .sumsaleall-layout > tbody > tr,
  .sumsaleall-layout > tbody > tr > td {
    display: block;
    width: 100% !important;
    height: auto !important;
  }

  .report-form > table:not(.report-table) > tbody > tr > td,
  .report-form > table:not(.report-table) table:not(.report-table) > tbody > tr > td,
  .report-criteria td,
  .sumsaleall-layout td {
    padding: 6px 8px !important;
  }

  .report-form input[type="text"],
  .report-form input[type="date"],
  .report-form select,
  .app-shell input[type="text"],
  .app-shell select {
    width: 100% !important;
    min-height: 44px;
  }

  .report-form input[type="submit"],
  .report-form input[type="button"],
  .app-shell input[type="submit"],
  .app-shell input[type="button"] {
    width: 100%;
    min-height: 44px;
    margin-top: 4px;
  }

  .report-form input[type="radio"],
  .report-form input[type="checkbox"] {
    width: 20px !important;
    height: 20px;
    vertical-align: middle;
  }

  .show-search-wrap {
    display: block;
  }

  .show-search-clear {
    width: 30px;
    height: 30px;
    min-height: 30px !important;
    font-size: 18px;
    line-height: 30px;
  }

  .risk-filter {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    white-space: normal;
  }

  .risk-option {
    min-height: 42px;
    padding: 6px 0;
  }

  .risk-swatch {
    width: 38px;
    height: 28px;
  }

  .report-table-wrap {
    margin-top: 12px;
    border-radius: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .report-table {
    min-width: 1200px;
  }

  .report-payment-page .report-table {
    min-width: 1750px;
  }

  .report-table td {
    padding: 7px 8px !important;
    font-size: 12px;
  }

  .detail-page {
    padding: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .detail-page table {
    width: max-content !important;
    min-width: 720px;
  }

  .detail-page > table:first-of-type {
    width: 100% !important;
    min-width: 0;
  }

  .app-footer {
    padding: 18px 18px 24px;
  }

  .login-panel-brand {
    display: none;
    margin-bottom: 20px;
  }

  .brand-lockup {
    align-items: center;
    flex-direction: column;
  }

  .header-logo {
    width: 188px;
  }
}
