@font-face {
  font-family: 'cwTeXKai';
  font-style: normal;
  font-weight: 500;
  src: url(/assests/fonts/cwTeXKai-zhonly.eot);
  src: url(/assests/fonts/cwTeXKai-zhonly.eot?#iefix) format('embedded-opentype'),
       url(/assests/fonts/cwTeXKai-zhonly.woff2) format('woff2'),
       url(/assests/fonts/cwTeXKai-zhonly.woff) format('woff'),
       url(/assests/fonts/cwTeXKai-zhonly.ttf) format('truetype');
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: inherit;
  vertical-align: middle;
}
html { font-size: 16px; font-family: 'Calibri', sans-serif; }
body { font-size: 1rem; }

/********************************/
.home-frame {
  height: calc(100vh - 100px);
  gap: 8px;
}

#home-logo {
  display: block;
  margin: 0 auto;
  height: 100%;
}

/********************************/
main {
  display: block;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);
  padding: 12px 32px 20px 32px;
  min-width: 1280px;
  overflow-y: auto;
}
h1 { font-size: 2.0rem; margin-bottom: 6px; }
h2 { font-size: 1.5rem; margin-bottom: 6px; }
h3 { font-size: 1.2rem; margin-bottom: 4px; }
h4 { font-size: 1.0rem; margin-bottom: 2px; }

ul { list-style: none; }

#app-version {
  position: fixed;
  bottom: 0;
  left: 0;
  padding: 2px 5px;
  font-size: 8px;
  color: #777;
}

select {
  padding: 2px 5px;
  border: 1px solid silver;
  border-radius: 5px;
  outline: none;
}
label.search-field {
  display: inline-flex;
  align-items: center;
  margin-bottom: 6px;
}
label.search-field span {
  white-space: nowrap;
}

label.search-field input,
label.search-field select {
  margin: 0 5px;
}

label.search-field input[type="checkbox"] {
  margin-right: calc(0.5rem + 16px);
}

label.field {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  line-height: 30px;
}
label.field strong {
  text-align: right;
}

label.field-row {
  display: inline-block;
  margin-left: 5px;
}
label.field-row strong{
  padding-right: 5px;
}


input,
select,
textarea {
  padding: 2px 5px;
  border: 1px solid silver;
  border-radius: 5px;
  line-height: 1.8rem;
  outline: none;
}
input,
select {
  height: 1.8rem;
}
input {
  text-align: inherit;
}
textarea {
  height: 3.6rem;
}

input[type="text"],
input[type="number"],
input[type="password"] {
  margin: 0;
  padding: 1px 8px;
  width: 100%;
}

input[type="checkbox"] {
  margin-right: calc(0.5rem + 8px);
  width: 0;
  height: 1.8rem;
  line-height: 1.8rem;
}
input[type="checkbox"]:after {
  display: inline-block;
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  background-color: white;
  border: 3px solid white;
  box-shadow: 0 0 0 1px silver;
  border-radius: 3px;
  vertical-align: middle;
  cursor: pointer;
  box-sizing: content-box;
  transition: background-color .2s ease;
}
input[type="checkbox"]:checked:after {
  background-color: #4169e1;
}

input[type="checkbox"]:focus:after {
  box-shadow: 0 0 0 1px silver, 0px 5px 5px -4px rgba(0,102,255,.5);
  transition: box-shadow .15s linear;
}

input[type="file"] {
  border: none;
}

.txt-btn-grp {
  display: flex;
  gap: 5px;
}

.centre-all {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-content: center;
}

.right { text-align: right; justify-content: flex-end; }
.fmidcen {
  display: flex;
  flex-flow: column wrap;
  justify-content: center;
  font-family: 'cwTeXKai', sans-serif;
}

table, .table { width: 100%; border-collapse: collapse; }
th { text-align: left; }

.flex { display: flex; }
.flex.g1 { gap: 3px; }
.flex.g2 { gap: 5px; }
.flex.g3 { gap: 8px; }

.split { display: flex; }
.split > * { flex: 1; }
.split > section:not(:last-child) { margin-right: 24px; }
.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.split-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.split-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.split-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.split-8 {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
}

.flex-row { display: flex; }
.flex-row > * { flex: 1; }

.button-group {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.box {
  margin-bottom: 10px;
  border: 1px solid silver;
  border-radius: 2px;
}
.box > .box-head {
  padding: 2px 8px;
  background-color: #999;
  color: white;
  min-height: 1rem;
}
.box > .box-head .button-group {
  float: right;
}
.box > .box-body {
  padding: 12px 8px;
}

.row {
  display: flex;
  align-items: center;
  align-content: center;
  white-space: nowrap;
  margin-bottom: 12px;
}

.box > .box-head.white { background-color: #ffffff; color: black; }
.box > .box-head.grey  { background-color: #686868; }
.box > .box-head.purple{ background-color: #6810c3; }
.box > .box-head.navy  { background-color: #00448d; }
.box > .box-head.blue  { background-color: #1068c3; }
.box > .box-head.green { background-color: #008d44; }
.box > .box-head.yellow{ background-color: #d3c968; }
.box > .box-head.orange{ background-color: #c37868; }
.box > .box-head.red   { background-color: #c31068; }

/********************************************/
.error-msg {
  margin-bottom: 12px;
  color: red;
}

/********************************************/
.action-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/********************************************/
.hidding.search-bar {
  height: 1.8rem;
}
.hidding.search-bar .btn-hide {
  cursor: pointer;
}
.hidding.search-bar .box-body {
  position: relative;
  padding: 0;
  height: 0;
  background-color: white;
  overflow: hidden;
  z-index: 1;
}
.hidding.search-bar.expand .box-body {
  padding: 12px 8px;
  height: auto;
  overflow: visible;
  border: 1px solid silver;
  box-shadow: 1px 1px 6px rgba(0 0 0 / .3);
}

/********************************************/
.modal-box {
  margin: 0 20px;
  min-width: 600px;
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
}
.modal-head {
  background-color: #555;
  color: white;
  padding: 5px 20px;
  min-height: 2rem;
}
.modal-body {
  margin: 10px 20px 20px 20px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 120px);
  overflow: auto;
}

input:not([readonly]):focus,
select:not([readonly]):focus {
  border-bottom-color: #0066ff;
  box-shadow: 0px 5px 5px -4px rgba(0,102,255,.5);
  transition: box-shadow .15s linear;
}

/********************************************/
.thead,
.data-table thead {
  position: sticky;
  top: 0;
  background-color: white;
  font-weight: bold;
  cursor: default;
}
.data-table {
  display: table;
  table-layout: fixed;
  border-collapse: collapse;
  width: auto;
}
.data-table.full-width {
  width: 100%;
}
.data-table tr,
.data-table .table-row {
  display: table-row;
  padding: 0px 8px;
  min-height: 1.8rem;
}
.data-table tr:hover,
.data-table .table-row:hover,
.data-table .table-row[selected] {
  background-color: #ddd;
}
.data-table tr.selected
.data-table .table-row.selected {
  background-color: #f0f0f0;
}
.data-table thead {
  white-space: nowrap;
  z-index: 1;
}
.data-table thead tr,
.data-table thead .table-row {
  border-bottom: 1px solid #ccc;
}

.data-table .table-row > *,
.data-table th, .data-table td {
  display: table-cell;
  padding: 3px 5px;
}

.data-table [data-value="0"] {
  color: #d9d9d9;
}

.data-table tr .btn-edit,
.data-table .table-row .btn-edit {
  display: none;
  margin: 0 5px;
  background: none;
  border: none;
  color: grey;
  cursor: pointer;
}

.data-table tr:hover .btn-edit,
.data-table .table-row:hover .btn-edit {
  display: inline-block;
}
.data-table tr:hover .btn-edit:hover,
.data-table .table-row:hover .btn-edit:hover {
  color: #4169e1;
}

.btn.dark-green { background-color: #004d00; }
.btn.white { background-color: #ffffff; color: black; }
.btn.grey  { background-color: #686868; }
.btn.purple{ background-color: #6810c3; }
.btn.navy  { background-color: #00448d; }
.btn.blue  { background-color: #1068c3; }
.btn.green { background-color: #008d44; }
.btn.yellow{ background-color: #d3c968; }
.btn.orange{ background-color: #c37868; }
.btn.red   { background-color: #c31068; }
.btn {
  display: inline-block;
  padding: 5px 12px;
  border: 0;
  color: white;
  cursor: pointer;
  border-radius: 3px;
}
.btn:hover {
  background-image: linear-gradient(to bottom, rgba(0,0,0,.1) 0%, rgba(0,0,0,.3) 100%);
}
.btn[disabled] {
  background-color: #555;
  cursor: stop;
}

.btn.small { padding: 2px 6px; }
.btn.tiny {
  font-size: 0.8rem;
  padding: 0px 4px;
}

/********************************************/
p.message {
  display: block;
  margin: 12px 0;
  padding: 12px 8px;
}
p.message.blue {
  border: 1px solid #a1e1ff;
  background-color: #cef2ff;
}
p.message.green {
  border: 1px solid #a1ffe1;
  background-color: #cefff2;
}
p.message.yellow {
  border: 1px solid #feffb0;
  background-color: #fffff0;
}
p.message.red {
  border: 1px solid #ffb0d0;
  background-color: #fff0f9;
}

/********************************************/
.price-label {
  text-align: right;
  justify-content: space-between;
}
.price-label:before {
  content: '$';
}

/********************************************/
header {
  display: flex;
  flex-flow: row;
  align-items: stretch;
  padding: 0 36px;
  min-width: 1280px;
  height: 60px;
  background: #555;
  color: white;
  cursor: default;
}
header a {
  color: white;
  text-decoration: none;
  cursor: pointer;
  z-index: 1;
}
header a#btn-login:hover {
  color: yellow;
}

header.SYSTEM {
  background-color: #931038;
}
header.dev::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  border-style: solid;
  border-width: 50px;
  border-color: #1090F0 transparent transparent #1090F0;
  z-index: 0;
}
header.dev::after {
  content: '';
  position: fixed;
  bottom: 0;
  right: 0;
  border-style: solid;
  border-width: 50px;
  border-color: transparent #1090F0 #1090F0 transparent;
}
header.uat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  border-style: solid;
  border-width: 50px;
  border-color: #109338 transparent transparent #109338;
  z-index: 0;
}
header.uat::after {
  content: '';
  position: fixed;
  bottom: 0;
  right: 0;
  border-style: solid;
  border-width: 50px;
  border-color: transparent #109338 #109338 transparent;
}

#btn-home {
  padding: 0 8px;
  user-select: none;
  max-width: 120px;
}
#btn-home > .title {
  font-weight: bold;
  font-size: 22px;
}
#btn-home > .sub-title {
  font-size: 16px;
}

header > nav {
  flex: 1;
  height: 60px;
  white-space: nowrap;
}
header > nav a {
  display: block;
  padding: 8px 16px;
  color: white;
  text-decoration: none;
  cursor: pointer;
}
header > nav > ul {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  height: 100%;
}

header > nav > ul > li {
  position: relative;
  display: flex;
  justify-content: center;
  align-content: center;
  align-items: center;
  padding: 0 24px;
  overflow: hidden;
}
header > nav > ul > li:hover {
  overflow: visible;
}
header > nav > ul > li > ul {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: rgba(100,100,100,.9);
  max-height: 0;
  overflow: hidden;
  z-index: 80;
}
header > nav > ul > li:hover > ul {
  max-height: 50vh;
  transition: max-height .32s ease-in;
}
header > nav > ul > li > ul > li:hover {
  background-color: rgba(150,150,150,.9);
  cursor: pointer;
}

header .salute {
  position: relative;
  max-width: 150px;
  min-width: 80px;
  text-align: right;
  z-index: 100;
}

header .salute ul {
  position: absolute;
  width: 100%;
  top: 100%;
  max-height: 0;
  overflow: hidden;
}
header .salute:hover ul {
  max-height: 50vh;
  transition: max-height .32s ease-in;
}
header .salute ul > li {
  padding: 3px 8px;
  background-color: rgba(100,100,100,.9);
}
header .salute ul > li:hover {
  background-color: rgba(150,150,150,.9);
}
#btn-logout {
  color: white;
  cursor: pointer;
}

/********************************************/
.content-row {
  display: contents;
}
.content-row:hover > tr {
  background-color: #f0f0f0;
}

/********************************************/
.tab-panel {
  display: flex;
  position: relative;
  height: 1.8rem;
  line-height: 1.8rem;
}
.tab-panel .tab-button {
  position: relative;
  padding: 3px 8px;
  height: 1.8rem;
  background-color: white;
  cursor: pointer;
  z-index: 1;
}
.tab-panel .tab-button.selected {
  height: calc(1.8rem + 1px);
  border-top: 1px solid silver;
  border-left: 1px solid silver;
  border-right: 1px solid silver;
  font-weight: bold;
  border-radius: 5px 5px 0 0;
}
.tab-frame {
  margin-bottom: 12px;
  padding: 6px 12px;
  border: 1px solid silver;
}

/********************************************/
.field > .name {
  margin-right: 12px;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  text-align: right;
  font-weight: bold;
}

/********************************************/
.tbl-license {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.tag.license {
  margin: 5px;
  padding: 2px 8px;
  border: 1px solid silver;
  cursor: pointer;
}
.tag.license:hover {
  background-image: linear-gradient(
    0deg,
    rgba(0,0,0,.1) 0%,
    rgba(0,0,0,.1) 100%
  );
}
.tag.license.selected {
  background-color: #CCC;
}

/********************************************/
.search-bar {
  position: relative;
  z-index: 15;
}
/********************************************/
#loading {
  position: relative;
  min-width: 320px;
  min-height: 320px;
  width: 100%;
  height: 100%;
  background-color: #CCC;
  font-size: 0;
}
#loading.small {
  min-width: 96px;
  min-height: 96px;
}
#loading.fullscreen {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}
#loading span {
  display: inline-block;
  position: absolute;
  left: calc(50% - 6px);
  top: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ff9900;
  opacity: 0;
  animation: loading-ball 3s 0s linear infinite forwards;
}
#loading.small span {
  left: calc(50% - 4px);
  top: calc(50% - 4px);
  width: 8px;
  height: 8px;
  animation: loading-ball-small 3s 0s linear infinite forwards;
}
#loading span:nth-child(1) { animation-delay: 0.0s; }
#loading span:nth-child(2) { animation-delay: 0.2s; }
#loading span:nth-child(3) { animation-delay: 0.4s; }
#loading span:nth-child(4) { animation-delay: 0.6s; }
#loading span:nth-child(5) { animation-delay: 0.8s; }
#loading span:nth-child(6) { animation-delay: 1.0s; }
#loading span:nth-child(7) { animation-delay: 1.2s; }
#loading span:nth-child(8) { animation-delay: 1.4s; }

@keyframes loading-ball {
    0% { transform: rotate(0deg)   translateY(100px) translateY(50%); opacity: 1; }
   25% { transform: rotate(135deg) translateY(100px) translateY(50%); opacity: 1; }
   75% { transform: rotate(225deg) translateY(100px) translateY(50%); opacity: 1; }
  100% { transform: rotate(360deg) translateY(100px) translateY(50%); opacity: 1; }
}
@keyframes loading-ball-small {
    0% { transform: rotate(0deg)   translateY(-40px) translateY(50%); opacity: 1; }
   25% { transform: rotate(135deg) translateY(-40px) translateY(50%); opacity: 1; }
   75% { transform: rotate(225deg) translateY(-40px) translateY(50%); opacity: 1; }
  100% { transform: rotate(360deg) translateY(-40px) translateY(50%); opacity: 1; }
}

/********************************************/
.btn-export[disabled] {
  background-color: grey;
  cursor: not-allowed;
}


/********************************************/
@media screen and (max-width: 1279px) {
  .home-frame {
    flex-flow: column;
  }

  #home-logo {
    max-height: 200px;
  }

  #login-frame {
    justify-content: start;
  }
}
