@font-face {
  font-family: HotelSans;
  src: url("fonts/NotoSansThai-Regular.ttf") format("truetype");
  font-display: swap;
}
:root {
  font-family: HotelSans, Tahoma, Arial, sans-serif;
  color: #263949;
  background: #f4f6f8;
  line-height: 1.65;
  --ink: #122e3d;
  --teal: #167c78;
  --line: #e3e9ec;
  --muted: #71828f;
  --sidebar: 248px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
[hidden] {
  display: none !important;
}
h1,
h2,
p {
  margin-top: 0;
}
h1 {
  font-size: 28px;
  line-height: 1.4;
  letter-spacing: -0.6px;
  margin-bottom: 8px;
}
h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 18px;
}
button,
input,
select,
textarea {
  font: inherit;
}
label > input,
label > select {
  align-self: start;
  width: 100%;
}
.field-wide {
  grid-column: 1 / -1;
}
button {
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--teal);
  color: #fff;
  padding: 10px 17px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
button:hover {
  background: #106560;
  box-shadow: 0 3px 10px #167c781c;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.secondary {
  background: #fff;
  color: #405564;
  border-color: #dce4e8;
}
.secondary:hover {
  background: #f0f5f6;
}
label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #546673;
}
input,
select,
textarea {
  border: 1px solid #dbe3e8;
  background: #fff;
  border-radius: 8px;
  padding: 11px 12px;
  color: #263949;
  min-width: 0;
  max-width: 100%;
  font-weight: 400;
  font-size: 13px;
}
input::placeholder {
  color: #98a5af;
}
textarea {
  min-height: 110px;
  width: 100%;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid #167c7826;
  outline-offset: 2px;
  border-color: var(--teal);
}
/* Eyebrows are Thai: wide letter-spacing and tiny Arial break Thai vowel and tone marks. */
.eyebrow {
  display: block;
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 12px;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font:
    700 16px Arial,
    sans-serif;
  letter-spacing: 2px;
  color: #fff;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #ffffff40;
  border-radius: 12px;
  font-family: Georgia, serif;
  font-size: 27px;
  font-weight: 400;
  color: #dfcba5;
  background: #ffffff08;
}
.brand-subtitle {
  display: block;
  font-size: 9px;
  letter-spacing: 3px;
  margin-top: 5px;
  font-weight: 400;
  color: #acbec7;
}
.login {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(1000px, calc(100% - 64px));
  min-height: 610px;
  margin: 7vh auto;
  background: #fff;
  border: 1px solid #e4eaee;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 75px #1737490f;
}
.login-story {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 40px 42px;
  background: linear-gradient(145deg, #183e4c, #102a36);
  color: #fff;
  overflow: hidden;
}
.story-copy {
  margin-top: 55px;
  z-index: 1;
}
.story-copy .eyebrow {
  color: #a6d1c7;
  font-size: 12px;
}
.story-copy h2 {
  font-size: 32px;
  line-height: 1.55;
  letter-spacing: -0.6px;
  margin: 15px 0;
}
.story-copy p {
  color: #bacbd0;
  font-size: 14px;
  line-height: 1.9;
}
.story-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 220px;
  font-size: 11px;
  letter-spacing: 1px;
  color: #a9bcc4;
}
.login-form-pane {
  padding: 72px 52px 32px;
  align-self: center;
}
.login-form-pane h1 {
  font-size: 28px;
}
.login-description {
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 32px;
}
.login form {
  display: grid;
  gap: 21px;
}
.login form input {
  padding: 13px 14px;
  font-size: 14px;
}
.login form button {
  padding: 13px;
  margin-top: 8px;
  font-size: 14px;
}
.login #forgot {
  padding: 9px 0;
  border: 0;
  color: var(--teal);
  background: transparent;
  box-shadow: none;
  margin-top: 13px;
  font-weight: 400;
}
.login-footer {
  padding-top: 34px;
  margin-top: 32px;
  border-top: 1px solid var(--line);
  font:
    600 11px Arial,
    sans-serif;
  color: #72848f;
}
.login-footer span {
  display: block;
  margin-top: 7px;
  font-family: HotelSans, Tahoma, sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: #8e9da7;
}
.hotel-art {
  position: absolute;
  left: 42px;
  right: 42px;
  bottom: 73px;
  height: 200px;
}
.art-sun {
  position: absolute;
  width: 100px;
  height: 100px;
  right: 25px;
  top: 0;
  border-radius: 50%;
  background: #e0c99b14;
  border: 1px solid #e0c99b30;
}
.art-building {
  position: absolute;
  width: 210px;
  height: 156px;
  left: 45px;
  bottom: 15px;
  border: 1px solid #b3ccc343;
  border-top: 3px solid #c8bea56b;
  background: #153943;
}
.art-building:before {
  content: "";
  position: absolute;
  left: -15px;
  top: -18px;
  width: 238px;
  height: 15px;
  border: 1px solid #b3ccc33d;
}
.art-windows {
  margin: 21px 20px;
  width: 168px;
  height: 88px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 16px,
      #c5d5c345 16px 18px,
      transparent 18px 30px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0 20px,
      #c5d5c345 20px 22px,
      transparent 22px 33px
    );
  border: 1px solid #c5d5c345;
}
.art-door {
  position: absolute;
  width: 30px;
  height: 32px;
  bottom: 0;
  left: 88px;
  border: 1px solid #c5d5c345;
  background: #d3c6a517;
}
.art-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  border-top: 1px solid #b3ccc343;
}
.hotel-art > span {
  position: absolute;
  bottom: -5px;
  left: 120px;
  color: #a5bfb5;
  font:
    8px Arial,
    sans-serif;
  letter-spacing: 3px;
}
#shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}
.sidebar {
  grid-column: 1;
  grid-row: 1/3;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 29px 18px 22px;
  background: var(--ink);
  color: #fff;
}
.sidebar .brand {
  padding: 0 12px;
}
.nav-caption {
  font-size: 10px;
  color: #8299a5;
  margin: 42px 15px 12px;
  letter-spacing: 0.5px;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.nav-group summary {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 15px;
  font-size: 13px;
  color: #b9cbd4;
  cursor: pointer;
  border-radius: 8px;
  list-style: none;
}
.nav-group summary::-webkit-details-marker {
  display: none;
}
.nav-group summary::after {
  content: "›";
  margin-left: auto;
}
.nav-group[open] summary::after {
  transform: rotate(90deg);
}
.nav-group summary:hover {
  background: #ffffff0a;
  color: white;
}
.nav-group summary:focus-visible {
  outline: 2px solid #8dccc0;
}
.nav-children {
  margin: 0 0 6px 22px;
  border-left: 1px solid #ffffff20;
  padding-left: 8px;
}
.nav-children button {
  font-size: 12px;
  padding: 10px 12px;
}
nav button {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  width: 100%;
  background: transparent;
  color: #b9cbd4;
  border-radius: 8px;
  font-size: 13px;
  padding: 12px 15px;
  font-weight: 400;
}
nav button:hover {
  background: #ffffff0a;
  color: #fff;
  box-shadow: none;
}
nav button.active {
  background: #26505a;
  color: #fff;
  box-shadow: inset 3px 0 #8dccc0;
}
.nav-icon {
  width: 18px;
  font:
    18px Arial,
    sans-serif;
  opacity: 0.8;
}
.sidebar-footer {
  margin-top: auto;
  padding: 20px 13px 0;
  border-top: 1px solid #ffffff12;
  color: #8fa9b6;
  font-size: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.status-dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
  background: #92c5b0;
}
header {
  grid-column: 2;
  display: flex;
  gap: 22px;
  align-items: center;
  background: #fff;
  padding: 19px 34px;
  border-bottom: 1px solid var(--line);
}
header label {
  font-size: 10px;
  font-weight: 500;
  gap: 3px;
  min-width: 100px;
}
header select {
  padding: 5px 24px 5px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-weight: 600;
  font-size: 12px;
  max-width: 250px;
}
#user {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  max-width: 200px;
  overflow-wrap: anywhere;
}
#user:before {
  content: "●";
  color: var(--teal);
  font-size: 10px;
  margin-right: 8px;
}
#logout {
  font-size: 11px;
  padding: 8px 12px;
}
main {
  grid-column: 2;
  width: 100%;
  max-width: 1530px;
  margin: 0 auto;
  padding: 34px 34px 50px;
  min-width: 0;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.heading .eyebrow {
  font-size: 11px;
  margin-bottom: 8px;
  color: #81959f;
}
.heading h1 {
  margin-bottom: 6px;
}
.heading p:last-child {
  margin-bottom: 0;
}
.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 23px;
  margin-bottom: 20px;
  overflow: auto;
  box-shadow: 0 2px 3px #17374902;
}
.panel > button {
  margin: 4px 6px 4px 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.grid .panel {
  position: relative;
  min-height: 150px;
  padding: 23px;
  overflow: hidden;
}
.grid .panel:before {
  content: "";
  display: block;
  width: 28px;
  height: 4px;
  border-radius: 5px;
  background: #7faaa4;
  margin-bottom: 19px;
}
.grid .panel:nth-child(2):before {
  background: #c4a975;
}
.grid .panel:nth-child(3):before {
  background: #7193b0;
}
.grid .panel:nth-child(4) {
  background: #153e48;
  color: #fff;
  border-color: #153e48;
}
.grid .panel:nth-child(4):before {
  background: #a7d8c6;
}
.grid h2 {
  font-size: 12px;
  color: #6f828f;
  font-weight: 400;
  margin-bottom: 8px;
}
.grid .panel:nth-child(4) h2 {
  color: #c0d5d9;
}
.stat {
  font-size: 28px;
  line-height: 1.4;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.stat-unit {
  display: block;
  font-size: 10px;
  color: #7f929e;
  font-weight: 400;
  margin-top: 8px;
}
.grid .panel:nth-child(4) .stat-unit {
  color: #b0cbd0;
}
table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 12px;
}
.table-wide {
  min-width: 980px;
}
.sidebar {
  min-width: 0;
}
#content {
  min-width: 0;
}
th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #edf1f3;
  vertical-align: middle;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
th {
  background: #f7f9fa;
  color: #7c8d98;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
tbody tr:hover {
  background: #f9fbfb;
}
tbody tr:last-child td {
  border-bottom: 0;
}
td button {
  margin: 3px;
  font-size: 11px;
  padding: 7px 10px;
  background: #eff6f5;
  color: #176a66;
  border: 1px solid #dcece8;
}
td button:hover {
  background: #dcece8;
}
td.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.status-badge {
  display: inline-block;
  border-radius: 5px;
  background: #eff3f5;
  color: #647583;
  font-size: 10px;
  padding: 3px 8px;
  white-space: nowrap;
  font-weight: 600;
}
.status-posted,
.status-approved,
.status-open,
.status-committed {
  background: #e8f5ed;
  color: #297851;
}
.status-draft,
.status-preview,
.status-soft_closed {
  background: #fbf3e4;
  color: #976a20;
}
.status-matched,
.status-verified,
.status-resolved {
  background: #e8f5ed;
  color: #297851;
}
.status-difference,
.status-pending {
  background: #fbf3e4;
  color: #976a20;
}
.warning-panel {
  border-color: #efd9ad;
  background: #fffaf0;
}
.status-void,
.status-closed {
  background: #f3ecee;
  color: #9c5361;
}
.empty-cell {
  text-align: center;
  padding: 52px 20px;
  color: #8595a0;
}
.loading-state {
  padding: 40px;
  text-align: center;
  color: #71858f;
  border: 1px dashed #dce5e8;
  border-radius: 12px;
}
.loading-state:before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto 12px;
  border: 2px solid #dceae7;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  max-width: 900px;
  width: 90vw;
  max-height: 88vh;
  padding: 30px;
  box-shadow: 0 24px 90px #102b4633;
}
dialog::backdrop {
  background: #122e3d80;
  backdrop-filter: blur(3px);
}
#modal-title {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
#modal-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 24px 0 28px;
}
.lines {
  grid-column: 1/-1;
}
.item-row {
  display: grid;
  grid-template-columns:
    minmax(160px, 2.4fr) repeat(3, minmax(80px, 1fr))
    minmax(80px, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.item-head {
  font-size: 12px;
  font-weight: 600;
  color: #546673;
}
.item-net {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.item-cell {
  gap: 4px;
  min-width: 0;
}
.item-cell input {
  width: 100%;
}
.item-caption {
  display: none;
}
.wide-table th,
.wide-table td {
  white-space: nowrap;
}
.cash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.item-summary {
  margin: 10px 0 0;
  font-size: 13px;
  color: #405564;
}
#notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: min(550px, calc(100vw - 32px));
  background: #173f46;
  color: #fff;
  padding: 15px 22px;
  border-radius: 11px;
  box-shadow: 0 8px 32px #17374925;
  z-index: 1000;
  display: none;
  font-size: 13px;
}
#notice.visible {
  display: block;
}
#modal-error {
  margin: -12px 0 18px;
  padding: 11px 14px;
  border-radius: 9px;
  background: #fdecec;
  color: #a12626;
  font-size: 13px;
  font-weight: 600;
}
#notice.error {
  background: #9c3846;
}
.notice-action {
  margin-left: 12px;
  padding: 4px 12px;
  border: 1px solid #ffffff80;
  border-radius: 7px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.field-error {
  display: block;
  margin-top: 4px;
  color: #a12626;
  font-size: 12px;
  font-weight: 600;
}
#modal-fields [aria-invalid="true"] {
  border-color: #c23b3b;
  box-shadow: 0 0 0 2px #c23b3b33;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  background: #f5f8f9;
  padding: 16px;
  border-radius: 9px;
}
a {
  color: var(--teal);
}
small {
  font-weight: 400;
  color: var(--muted);
}
.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px 14px;
  align-items: end;
}
.filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (min-width: 1800px) {
  .login {
    margin-top: 12vh;
  }
}
@media (max-width: 1150px) {
  :root {
    --sidebar: 218px;
  }
  header {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 17px 24px;
  }
  main {
    padding: 28px 24px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  header select {
    max-width: 100%;
    width: 100%;
  }
  #user {
    grid-column: 1 / 3;
    margin-left: 0;
    max-width: none;
  }
  #logout {
    justify-self: end;
  }
  .sidebar .brand {
    font-size: 14px;
  }
  .login-story {
    padding: 32px;
  }
  .login-form-pane {
    padding: 50px 36px 28px;
  }
  .story-copy h2 {
    font-size: 28px;
  }
}
@media (max-width: 800px) {
  .item-row {
    grid-template-columns: 1fr 1fr;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }
  .item-row > :first-child {
    grid-column: 1 / -1;
  }
  .item-head {
    display: none;
  }
  .item-caption {
    display: block;
  }
  #shell {
    display: flex;
    flex-direction: column;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }
  .sidebar .brand {
    padding: 0 5px;
  }
  .nav-caption,
  .sidebar-footer {
    display: none;
  }
  nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    margin-top: 16px;
    gap: 6px;
    padding-bottom: 4px;
  }
  nav button {
    flex-shrink: 0;
    width: 100%;
    white-space: normal;
    padding: 10px 12px;
  }
  nav details[open] {
    grid-column: 1 / -1;
  }
  .nav-icon {
    font-size: 15px;
  }
  nav button.active {
    box-shadow: inset 0 -2px #8dccc0;
  }
  header {
    flex-wrap: wrap;
    padding: 16px 20px;
    gap: 12px;
  }
  header label {
    flex: 1;
    min-width: 100px;
  }
  header select {
    max-width: 100%;
    width: 100%;
  }
  #user {
    margin-left: 0;
    flex: 1;
  }
  main {
    padding: 24px 20px;
  }
  .login {
    width: calc(100% - 32px);
    margin: 30px auto;
    grid-template-columns: 1fr;
    min-height: 0;
    max-width: 500px;
  }
  .login-story {
    padding: 24px 28px;
  }
  .story-copy {
    margin-top: 24px;
  }
  .story-copy h2 {
    font-size: 24px;
    margin: 8px 0;
  }
  .story-copy p {
    font-size: 12px;
    margin: 8px 0;
  }
  .story-footer,
  .hotel-art {
    display: none;
  }
  .login-form-pane {
    padding: 30px 28px;
  }
  .login-footer {
    margin-top: 22px;
    padding-top: 20px;
  }
  .heading h1 {
    font-size: 24px;
  }
}
@media (max-width: 480px) {
  header {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  header label:nth-child(3) {
    grid-column: 1 / -1;
  }
  #user {
    grid-column: 1;
    font-size: 10px;
  }
  #logout {
    grid-column: 2;
  }
  main {
    padding: 22px 14px;
  }
  .heading {
    gap: 12px;
  }
  .heading .eyebrow {
    font-size: 11px;
    letter-spacing: 0;
  }
  .heading .muted {
    font-size: 11px;
  }
  #refresh {
    font-size: 11px;
    padding: 8px 12px;
  }
  .grid {
    gap: 10px;
  }
  .grid .panel {
    padding: 17px;
    min-height: 135px;
  }
  .stat {
    font-size: 23px;
  }
  .panel {
    padding: 16px;
    border-radius: 10px;
  }
  th,
  td {
    padding: 11px 10px;
  }
  .login-form-pane h1 {
    font-size: 24px;
  }
  #modal-fields {
    grid-template-columns: 1fr;
  }
  dialog {
    padding: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
