* { box-sizing: border-box; }
html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #d9ad7a;
  color: #1f2933;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.hidden { display: none !important; }
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 55fr 45fr;
  padding: 0;
  background:
    linear-gradient(90deg, rgba(35, 19, 8, 0.1) 0%, rgba(35, 19, 8, 0.02) 48%, rgba(255, 236, 208, 0.18) 100%),
    url("/assets/login-bg.jpg") center center / cover no-repeat;
  overflow: hidden;
}
.login-visual {
  min-height: 100vh;
  background: transparent;
}
.login::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(35, 19, 8, 0.02) 0%, rgba(255, 234, 202, 0.04) 58%, rgba(255, 236, 208, 0.12) 100%);
}
.login-panel {
  align-self: center;
  justify-self: center;
  position: relative;
  z-index: 1;
  width: min(460px, calc(100% - 64px));
  min-height: auto;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 28px;
  padding: 38px 42px 40px;
  box-shadow: 0 24px 80px rgba(74, 52, 28, 0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.login-brand {
  text-align: center;
  margin-bottom: 26px;
}
.login-camel {
  width: 94px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 12px;
}
.login-brand h1 {
  margin: 0;
  color: #4b2f17;
  font-size: 40px;
  line-height: 1.25;
  letter-spacing: 1px;
  font-weight: 700;
  white-space: nowrap;
}
.login-title-sub {
  margin-top: 10px;
  color: #4b2f17;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: 1px;
}
.login-slogan {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  color: #8a6a3f;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 4px;
}
.login-slogan span {
  width: 46px;
  height: 1px;
  background: rgba(138, 106, 63, 0.62);
}
.login-note {
  margin: 26px 0 0;
  color: #5f6b7a;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 400;
  text-align: center;
}
.login-panel label {
  margin: 16px 0;
  font-size: 18px;
  font-weight: 700;
}
.login-panel input {
  min-height: 52px;
  margin-top: 10px;
  border-radius: 8px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.9);
}
.login-panel .remember-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
  color: #324155;
  font-size: 15px;
  font-weight: 500;
}
.login-panel .remember-login input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: #2f75ff;
}
.login-panel #loginBtn {
  width: 100%;
  min-height: 56px;
  margin-top: 16px;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #2f75ff, #1557e6);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.26);
  transition: box-shadow 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}
.login-panel #loginBtn:hover {
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.42), 0 0 18px rgba(47, 117, 255, 0.28);
  filter: brightness(1.04);
  transform: translateY(-1px);
}
label { display: grid; gap: 6px; margin: 10px 0; font-size: 14px; }
input, select, textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid #cfd6df;
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.86);
}
textarea { min-height: 78px; }
button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}
button.secondary { background: #4b5563; }
button.danger { background: #dc2626; }
button.warning { background: #f59e0b; color: #111827; font-weight: 700; }
button:disabled { background: #aab3c2; cursor: not-allowed; }
.error { color: #dc2626; min-height: 20px; }
.hint { color: #667085; font-size: 13px; }
.toast {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 80;
  min-width: 180px;
  max-width: 420px;
  border: 1px solid #86efac;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  font-size: 14px;
}
.toast.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
.form-message {
  border: 1px solid #86efac;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  margin-bottom: 12px;
  padding: 10px 12px;
}
.form-message.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
.edit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  margin-bottom: 12px;
  padding: 10px 12px;
}
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(245, 246, 248, 0.62), rgba(245, 246, 248, 0.82)),
    url("/assets/login-bg-camel-desert.jpg") center / cover fixed no-repeat;
}
aside {
  background: rgba(17, 24, 39, 0.9);
  color: #fff;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
aside h2 { margin: 0 0 14px; font-size: 20px; }
aside button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid #374151;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
aside button.active, aside button:hover { background: #2563eb; }
.menu-badge {
  min-width: 34px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.32);
}
aside button.active .menu-badge {
  background: #fff;
  color: #1d4ed8;
}
.content { padding: 22px; min-width: 0; }
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
header h1 { margin: 0; font-size: 24px; }
header p { margin: 6px 0 0; color: #667085; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.dashboard-cards { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
.card {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(217, 222, 231, 0.86);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card span { display: block; color: #667085; font-size: 13px; }
.card strong { display: block; margin-top: 8px; font-size: 26px; }
.toolbar {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(217, 222, 231, 0.86);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.compact-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.compact-toolbar .actions { margin-top: 0; }
.search-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}
.search-toolbar input {
  max-width: 420px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pending-review {
  margin: 14px 0 18px;
  border: 2px solid #f59e0b;
  border-radius: 10px;
  background: rgba(255, 247, 237, 0.94);
  box-shadow: 0 12px 28px rgba(180, 83, 9, 0.12);
  overflow: hidden;
}
.pending-review.empty {
  padding-bottom: 0;
}
.pending-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #ffedd5;
  color: #9a3412;
}
.pending-review-head strong {
  font-size: 17px;
}
.pending-review-head span {
  font-size: 13px;
  font-weight: 700;
}
.pending-review .table-wrap {
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.9);
}
.subsection-title {
  margin: 18px 0 10px;
  color: #1f2937;
  font-size: 17px;
}
.warning { color: #b45309; font-weight: 700; }
.preview {
  max-width: 220px;
  max-height: 160px;
  border: 1px solid #d9dee7;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
}
.muted { color: #667085; font-size: 13px; }
.receipt-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 12px;
  background: rgba(249, 250, 251, 0.78);
}
.receipt-detail p { margin: 8px 0 0; }
.receipt-detail-row td {
  white-space: normal;
  padding: 0;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.62);
}
.modal {
  width: min(900px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 8px;
  padding: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.manage-modal {
  width: min(760px, 100%);
}
.wide-modal {
  width: min(1180px, 100%);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.detail-grid > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: rgba(249, 250, 251, 0.78);
  border: 1px solid rgba(229, 231, 235, 0.86);
  border-radius: 8px;
}
.detail-grid strong {
  font-size: 15px;
  word-break: break-all;
}
.confirm-modal {
  width: min(460px, 100%);
}
.confirm-message {
  color: #1f2933;
  font-size: 16px;
  line-height: 1.6;
  margin: 10px 0 14px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-image {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
  object-fit: contain;
}
.modal textarea {
  min-height: 150px;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e6eaf0;
}
.import-result {
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: rgba(249, 250, 251, 0.82);
  margin-top: 12px;
  padding: 12px;
}
.import-result p { margin: 0 0 8px; }
.import-result ul {
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 0;
  padding-left: 20px;
}
.import-result li { margin: 6px 0; color: #4b5563; }
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 14px;
  margin-top: 6px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}
.checkbox-item input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: #2563eb;
}
.permission-overview {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}
.permission-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.permission-role-card {
  border: 1px solid rgba(217, 222, 231, 0.86);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  padding: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.permission-role-title {
  color: #1f2937;
  font-size: 16px;
  font-weight: 700;
}
.permission-role-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.permission-role-count {
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}
.permission-role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.permission-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}
.permission-tag.small {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 11px;
}
.permission-cell {
  display: grid;
  gap: 8px;
}
.permission-cell-count {
  color: #1f2937;
  font-size: 12px;
  font-weight: 700;
}
.permission-cell-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.section-title { margin: 18px 0 10px; font-size: 18px; }
.dashboard-section { margin-bottom: 18px; }
.dashboard-clickable { cursor: pointer; }
.dashboard-clickable:hover {
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}
.anomaly-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.anomaly-card {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(217, 222, 231, 0.86);
  border-radius: 8px;
  padding: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.anomaly-card span { display: block; color: #667085; font-size: 13px; }
.anomaly-card strong { display: block; margin-top: 8px; font-size: 26px; }
.anomaly-card.ok { border-color: #86efac; background: #f0fdf4; }
.anomaly-card.ok { background: rgba(240, 253, 244, 0.88); }
.anomaly-card.ok strong { color: #166534; }
.anomaly-card.danger { border-color: #fecaca; background: #fef2f2; }
.anomaly-card.danger { background: rgba(254, 242, 242, 0.9); }
.anomaly-card.danger strong { color: #dc2626; }
.empty-state {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(217, 222, 231, 0.86);
  border-radius: 8px;
  padding: 18px;
  color: #667085;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(217, 222, 231, 0.9);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid #e6eaf0; padding: 10px; text-align: left; vertical-align: top; white-space: nowrap; }
th { background: rgba(249, 250, 251, 0.82); color: #4b5563; font-weight: 600; }
td button { margin-right: 6px; margin-bottom: 4px; }
.row-inactive {
  background: rgba(243, 244, 246, 0.72);
  color: #8b95a1;
}
.row-inactive td {
  color: #8b95a1;
}
.row-inactive button:not(.danger) {
  background: #9ca3af;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
}
.status-inactive {
  background: #e5e7eb;
  color: #6b7280;
}
.status-pending {
  background: #ffedd5;
  color: #9a3412;
}
.ocr-box { white-space: pre-wrap; color: #4b5563; max-width: 280px; }
@media (max-width: 760px) {
  .login {
    grid-template-columns: 1fr;
    place-items: center;
    padding: 28px;
    background:
      linear-gradient(180deg, rgba(255, 234, 202, 0.28), rgba(255, 236, 208, 0.62)),
      url("/assets/login-bg.jpg") left center / cover no-repeat;
  }
  .login-visual,
  .login::after {
    display: none;
  }
  .login-panel {
    width: min(520px, 100%);
    min-height: auto;
    padding: 38px 28px;
    transform: none;
  }
  .app { grid-template-columns: 1fr; }
  aside { position: static; }
  .content {
    width: 100%;
    max-width: 100vw;
    padding: 18px 14px;
    overflow-x: hidden;
  }
  header {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .toolbar {
    width: 100%;
    max-width: 100%;
    padding: 12px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .cards,
  .dashboard-cards,
  .anomaly-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card,
  .anomaly-card {
    min-width: 0;
    padding: 14px;
  }
  .card strong,
  .anomaly-card strong {
    font-size: 24px;
    word-break: break-word;
  }
  .table-wrap {
    width: 100%;
    max-width: 100%;
  }
  table {
    min-width: 520px;
  }
}
