:root {
  font-family: Inter, "Microsoft YaHei", sans-serif;
  color: #263650;
  background: #f5f7fb;
  font-size: 15px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  border: 0;
  background: #3b5998;
  color: white;
  border-radius: 7px;
  padding: 12px 18px;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  transition:
    background 0.18s,
    transform 0.18s;
}
button:hover,
.button:hover {
  background: #2c4273;
  transform: translateY(-1px);
}
button.secondary,
.secondary {
  background: #eaf0fa;
  color: #354f84;
}
button.danger {
  background: #f6e9e5;
  color: #944b39;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
a {
  color: #3b5998;
  text-decoration: none;
}
header {
  height: 78px;
  background: #fff;
  border-bottom: 1px solid #dce3ef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
}
header strong {
  font-size: 23px;
  letter-spacing: 2px;
}
header small {
  margin-left: 15px;
  color: #687991;
}
nav {
  display: flex;
  gap: 25px;
  align-items: center;
}
main {
  max-width: 1250px;
  margin: 45px auto;
  padding: 0 28px;
  animation: enter 0.25s ease;
}
h1 {
  font-size: 32px;
  letter-spacing: -1px;
  margin: 9px 0 12px;
}
h2 {
  font-size: 21px;
}
h3 {
  font-size: 17px;
}
p,
.muted {
  color: #65758c;
  line-height: 1.7;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
  color: #617793;
}
.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 18px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #dce3ef;
  border-bottom: 1px solid #dce3ef;
  margin: 30px 0 36px;
  padding: 25px 0;
  gap: 20px;
}
.stat {
  border-right: 1px solid #dce3ef;
  padding-left: 20px;
}
.stat:first-child {
  padding-left: 0;
}
.stat:last-child {
  border: 0;
}
.stat span {
  display: block;
  color: #65758c;
  font-size: 13px;
}
.stat b {
  font-size: 31px;
  font-weight: 550;
  display: block;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
}
.toolbar select {
  width: auto;
  min-width: 150px;
}
.panel {
  background: white;
  padding: 26px;
  border-radius: 10px;
  border: 1px solid #dfe5ef;
  margin: 20px 0;
}
.tablewrap {
  overflow: auto;
  background: white;
  border-radius: 10px;
  border: 1px solid #dfe5ef;
}
table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
  text-align: left;
}
th {
  color: #62738b;
  font-size: 12px;
  background: #f8faff;
  font-weight: 500;
}
th,
td {
  padding: 18px 17px;
  border-bottom: 1px solid #e9eef6;
}
td small {
  display: block;
  color: #718198;
  margin-top: 6px;
}
tr:last-child td {
  border: 0;
}
.badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 5px;
  background: #eaf0fb;
  color: #3b5998;
  font-size: 12px;
}
.badge.pending {
  background: #faf0dc;
  color: #856429;
}
.badge.rejected {
  background: #f5e8e5;
  color: #934d3b;
}
label {
  display: block;
  margin: 19px 0 8px;
  font-size: 14px;
  font-weight: 550;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd6e7;
  border-radius: 6px;
  background: white;
  color: #263650;
  padding: 12px;
  min-height: 46px;
}
input:focus,
select:focus {
  outline: 2px solid #a6b9df;
  outline-offset: 1px;
}
input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
}
input[type="file"] {
  font-size: 13px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.formpage {
  max-width: 720px;
}
.steps {
  display: flex;
  gap: 20px;
  color: #76869e;
  font-size: 13px;
  margin: 30px 0;
}
.steps .active {
  color: #3b5998;
  font-weight: 600;
}
.expense {
  border-top: 1px solid #dfe5ef;
  padding: 15px 0;
  animation: enter 0.2s;
}
.expense img,
.thumb {
  height: 70px;
  width: 70px;
  object-fit: cover;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 10px;
}
.total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0;
  font-size: 18px;
}
.total strong {
  font-size: 27px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.error {
  background: #fff0e9;
  color: #9c463a;
  padding: 14px;
  border-radius: 6px;
  margin: 15px 0;
}
.notice {
  padding: 14px 18px;
  background: #edf2fc;
  border-left: 3px solid #7d97c7;
  font-size: 13px;
  line-height: 1.7;
}
.email-preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 18px;
  border: 1px solid #dce3ef;
  border-radius: 6px;
  background: #f8faff;
  color: #263650;
  font: inherit;
  line-height: 1.7;
}
.badge.mail-sent,
.badge.mail-preview {
  background: #eaf0fb;
  color: #354f84;
}
.badge.mail-failed,
.badge.mail-missing {
  background: #fff0e9;
  color: #9c463a;
}
.tabs {
  display: flex;
  gap: 25px;
  border-bottom: 1px solid #dce3ef;
  padding: 15px 0;
  margin: 20px 0;
}
.tabs a.active {
  font-weight: bold;
  border-bottom: 2px solid #3b5998;
  padding-bottom: 15px;
}
.qr {
  display: flex;
  gap: 30px;
  align-items: center;
}
.qr img {
  width: 170px;
}
.empty {
  padding: 60px;
  text-align: center;
  color: #718198;
}
dialog {
  border: 0;
  border-radius: 12px;
  max-width: 700px;
  width: 95%;
  padding: 28px;
  box-shadow: 0 25px 80px #233d6833;
}
dialog::backdrop {
  background: #172b4966;
}
dialog img.big {
  max-width: 100%;
  max-height: 70vh;
  display: block;
  margin: auto;
}
.success {
  text-align: center;
  padding: 50px 20px;
}
.success-notice {
  padding: 14px 18px;
  margin: 15px 0;
  border-left: 3px solid #3b5998;
  background: #eaf0fb;
  color: #263650;
  font-weight: 600;
}
.success .check {
  font-size: 40px;
  color: #3b5998;
}
.success code {
  font-size: 22px;
  display: block;
  margin: 25px;
}
.foot {
  font-size: 12px;
  color: #718198;
  margin: 30px 0;
  text-align: center;
}
.linkbutton {
  background: none;
  color: #3b5998;
  padding: 6px;
}
.inline {
  display: inline;
  width: auto;
}
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 700px) {
  header {
    height: auto;
    min-height: 70px;
    padding: 17px 20px;
    gap: 15px;
  }
  header small {
    display: none;
  }
  header strong {
    font-size: 19px;
  }
  nav {
    gap: 14px;
    font-size: 13px;
  }
  main {
    margin-top: 26px;
    padding: 0 18px;
  }
  h1 {
    font-size: 27px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 25px;
  }
  .stat {
    padding-left: 0;
    border: 0;
  }
  .stat b {
    font-size: 25px;
  }
  .row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .titlebar {
    align-items: flex-start;
  }
  .panel {
    padding: 19px;
  }
  .qr {
    flex-direction: column;
    align-items: flex-start;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .tabs {
    gap: 19px;
  }
  .actions button {
    flex: 1;
  }
  .tablewrap td,
  .tablewrap th {
    padding: 15px 12px;
  }
}
@media print {
  header,
  .noprint,
  button,
  .toolbar,
  .tabs,
  .actions {
    display: none !important;
  }
  main {
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .tablewrap {
    overflow: visible;
  }
  table {
    white-space: normal;
    font-size: 10px;
  }
  td,
  th {
    padding: 7px;
  }
  .panel {
    border: 0;
    padding: 0;
  }
  .stats {
    gap: 10px;
  }
  .stat b {
    font-size: 21px;
  }
  body {
    background: white;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

.receipt-picker {
  position: relative;
  border: 1px dashed #9aafd5;
  padding: 18px;
  background: #f5f8fe;
  cursor: pointer;
  border-radius: 7px;
  font-weight: 500;
}
.receipt-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-help {
  font-size: 12px;
  line-height: 1.8;
  margin: 12px 0;
}
.receipt-file {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #dce3ef;
}
.receipt-file .thumb {
  margin: 0;
  flex-shrink: 0;
}
.file-info {
  min-width: 0;
  flex: 1;
}
.file-info b {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.file-info small {
  display: block;
  color: #65758c;
  margin-top: 5px;
}
.file-error {
  color: #a04530;
  font-size: 13px;
}
.file-actions {
  display: flex;
  flex-direction: column;
}
.file-actions button {
  min-height: 40px;
  padding: 8px;
}
.file-icon {
  font-size: 30px;
  color: #6c84ac;
}
.receipt-inspector {
  border-top: 1px solid #dce3ef;
  padding-top: 15px;
  margin-top: 25px;
}
.receipt-inspector h3 {
  overflow-wrap: anywhere;
}
.receipt-full {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  margin: 20px auto;
  object-fit: contain;
}
dialog {
  max-height: 92vh;
  overflow: auto;
}

.password-control {
  position: relative;
}
.password-control input {
  padding-right: 100px;
}
.password-toggle {
  position: absolute;
  right: 4px;
  top: 3px;
  bottom: 3px;
  min-width: 88px;
  padding: 0 10px;
  background: transparent;
  color: #3b5998;
  font-size: 13px;
}
.password-toggle:hover {
  background: #eaf0fa;
  transform: none;
}
.password-toggle:focus-visible {
  outline: 2px solid #3b5998;
  outline-offset: 1px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-shrink: 0;
}
.brand-logo {
  width: 49px;
  height: 49px;
  object-fit: contain;
  display: block;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.brand-copy strong {
  letter-spacing: 0.5px;
}
.brand-copy small {
  margin: 0;
  font-size: 11px;
}
.chosen,
input[type="checkbox"] {
  accent-color: #3b5998;
}
@media (max-width: 700px) {
  .brand-logo {
    width: 40px;
    height: 40px;
  }
  .brand {
    gap: 9px;
  }
  header {
    flex-wrap: wrap;
  }
  header nav {
    margin-left: auto;
    flex-wrap: wrap;
  }
  .brand-copy strong {
    font-size: 18px;
  }
  .brand-copy small {
    display: block;
    font-size: 10px;
  }
}
