* {
  box-sizing: border-box;
}

body {
  background: #f5f7fb;
  color: #172033;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.login-shell {
  align-items: center;
  background:
    linear-gradient(120deg, rgba(15, 23, 42, 0.46), rgba(37, 99, 235, 0.18)),
    url("/assets/hzmb-login-bg.svg") 26% -90px / cover no-repeat;
  display: flex;
  min-height: 100vh;
  justify-content: center;
  padding: 32px;
}

.login-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.28);
  padding: 32px;
  transform: translate(95px, 70px);
  width: 420px;
}

@media (max-width: 760px) {
  .login-shell {
    background-position: 34% -40px;
    justify-content: center;
    padding-top: 260px;
  }

  .login-panel {
    transform: none;
  }
}

.login-panel h1 {
  color: #0f172a;
  font-size: 25px;
  line-height: 1.28;
  margin: 0 0 24px;
}

label {
  color: #334155;
  display: block;
  font-weight: 600;
  margin-bottom: 16px;
}

input,
select,
textarea {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  width: 100%;
}

input[readonly] {
  background: #f8fafc;
  color: #64748b;
}

input[type="checkbox"] {
  display: inline-block;
  margin: 0 6px 0 0;
  width: auto;
}

input[type="file"] {
  background: #fff;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  padding: 10px 16px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.primary {
  background: #2563eb;
  color: #fff;
  font-weight: 700;
}

.danger {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
}

.plain {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.message {
  color: #b91c1c;
  min-height: 22px;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px 340px minmax(0, 1fr);
  min-height: 100vh;
  position: relative;
}

.app-shell.archive-mode {
  grid-template-columns: 240px minmax(0, 1fr);
}

.app-shell.archive-mode .detail-pane {
  display: none;
}

.app-shell.detail-only {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.detail-only .sidebar,
.app-shell.detail-only .list-pane {
  display: none;
}

.app-shell.detail-only .detail-pane {
  margin: 0 auto;
  max-width: 1100px;
  width: 100%;
}

.toast {
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  font-weight: 700;
  left: 50%;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  position: fixed;
  top: 18px;
  transform: translateX(-50%);
  z-index: 20;
}

.toast.success {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #047857;
}

.toast.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.sidebar {
  background: #111827;
  color: #fff;
  padding: 24px;
}

.brand {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 20px;
}

.user-line {
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.nav {
  background: transparent;
  color: #cbd5e1;
  display: block;
  margin-bottom: 10px;
  text-align: left;
  width: 100%;
}

.nav.active {
  background: #2563eb;
  color: #fff;
}

#logoutButton {
  margin-top: 24px;
  width: 100%;
}

.list-pane {
  border-right: 1px solid #e5eaf2;
  padding: 22px;
}

.pane-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.pane-head h2 {
  margin: 0;
}

.list-meta {
  color: #64748b;
  font-size: 13px;
  margin: -8px 0 14px;
  min-height: 20px;
}

.filter-panel {
  background: #fff;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 12px;
}

.filter-panel label {
  font-size: 13px;
  margin-bottom: 10px;
}

.filter-panel input,
.filter-panel select {
  margin-top: 6px;
  padding: 8px 10px;
}

.filter-dates {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.filter-actions button {
  flex: 1;
  padding: 9px 10px;
}

.report-card {
  background: #fff;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 12px;
  padding: 14px;
}

.report-card.active {
  border-color: #2563eb;
}

.report-card strong {
  display: block;
  margin-bottom: 8px;
}

.report-meta {
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.archive-table-wrap {
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  overflow: auto;
}

.archive-table {
  background: #fff;
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

.archive-table th,
.archive-table td {
  border-bottom: 1px solid #edf1f7;
  font-size: 14px;
  padding: 13px 14px;
  text-align: left;
  white-space: nowrap;
}

.archive-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
}

.archive-table tbody tr {
  cursor: pointer;
}

.archive-table tbody tr:hover {
  background: #eef4ff;
}

.detail-pane {
  min-width: 0;
  overflow: auto;
  padding: 24px;
}

.empty-state {
  color: #64748b;
  padding: 90px 20px;
  text-align: center;
}

.empty-state.small {
  padding: 24px 12px;
}

.detail-head {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.detail-head h2 {
  margin: 0 0 6px;
}

.detail-head p {
  color: #64748b;
  margin: 0;
}

.status {
  background: #eef4ff;
  border-radius: 8px;
  color: #1d4ed8;
  font-weight: 700;
  padding: 8px 12px;
}

.card {
  background: #fff;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 18px;
}

.card h3 {
  margin: 0 0 14px;
}

.field-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.field {
  border-bottom: 1px solid #edf1f7;
  min-height: 54px;
  padding-bottom: 10px;
}

.field span {
  color: #64748b;
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.field strong {
  font-weight: 650;
  word-break: break-word;
}

.attachment-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.attachment {
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
}

.attachment img {
  background: #f1f5f9;
  border-radius: 6px;
  cursor: zoom-in;
  height: 120px;
  object-fit: contain;
  width: 100%;
}

.attachment a {
  color: #2563eb;
  display: block;
  margin-top: 8px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.report-preview-card {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: flex-start;
}

.attachment-note {
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
}

.link-button {
  background: transparent;
  color: #2563eb;
  padding: 0;
  text-align: left;
}

.report-preview-link {
  font-size: 16px;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preview {
  align-items: center;
  background: rgba(15, 23, 42, 0.86);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 32px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1000;
}

.image-preview img {
  background: #ffffff;
  border-radius: 8px;
  max-height: calc(100vh - 96px);
  max-width: calc(100vw - 96px);
  object-fit: contain;
}

.image-preview-close {
  background: #ffffff;
  border: 0;
  border-radius: 6px;
  color: #0f172a;
  cursor: pointer;
  font-weight: 700;
  padding: 10px 16px;
  position: fixed;
  right: 24px;
  top: 24px;
}

.curve {
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  margin-top: 14px;
  max-width: 100%;
}

.action-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.action-row button {
  min-width: 150px;
}

.user-editor {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.check-grid,
.config-grid {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.check-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.check-item {
  align-items: center;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: flex;
  font-weight: 650;
  gap: 4px;
  margin: 0;
  padding: 10px 12px;
}

.table-list {
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  margin-top: 14px;
  overflow: hidden;
}

.user-filter {
  font-size: 13px;
  margin: 16px 0 0;
}

.user-filter input {
  margin-top: 6px;
}

.table-row {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #edf1f7;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row.active {
  background: #eef4ff;
}

.table-row span {
  color: #64748b;
  display: block;
  font-size: 13px;
  line-height: 1.5;
}

.permission-row {
  align-items: center;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 160px 1fr 1fr;
  padding: 10px 12px;
}

.permission-row label {
  align-items: center;
  display: flex;
  font-weight: 500;
  margin: 0;
}

.hint {
  color: #64748b;
  margin: 0 0 12px;
}

.hint.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  color: #92400e;
  padding: 10px 12px;
}

.signature-preview {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  min-height: 84px;
  padding: 12px;
}

.signature-preview img {
  background: #fff;
  border: 1px solid #e5eaf2;
  border-radius: 6px;
  height: 58px;
  object-fit: contain;
  width: 180px;
}

.signature-preview span {
  color: #475569;
  font-size: 14px;
}
