* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft JhengHei", "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #1a1a1a;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a2332;
  color: #fff;
  padding: 14px 24px;
}
.topbar .brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}
.topnav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topnav a {
  color: #cbd5e1;
  text-decoration: none;
}
.topnav a:hover {
  color: #fff;
}
.inline-form {
  display: inline;
}
.link-button {
  background: none;
  border: none;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 1em;
  padding: 0;
}
.link-button:hover {
  color: #fff;
  text-decoration: underline;
}
.container {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 20px 60px;
}
h1 {
  font-size: 1.5rem;
  margin-bottom: 20px;
}
.card {
  background: #fff;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.login-card {
  max-width: 380px;
  margin: 60px auto;
}
.error {
  background: #fde8e8;
  color: #9b1c1c;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}
form label {
  display: block;
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: #374151;
}
form input[type="text"],
form input[type="password"],
form textarea {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}
form textarea {
  resize: vertical;
}
button {
  cursor: pointer;
}
button[type="submit"], .primary-button {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 1rem;
  margin-top: 8px;
}
button[type="submit"]:hover, .primary-button:hover {
  background: #1d4ed8;
}
fieldset {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
  background: #fff;
}
legend {
  font-weight: 700;
  padding: 0 8px;
  color: #111827;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 4px 20px;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
}
.checkbox-row input[type="checkbox"] {
  width: auto;
  margin: 0;
}
.doc-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.doc-type-card {
  display: block;
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: box-shadow 0.15s ease;
}
.doc-type-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.doc-type-card h2 {
  margin: 0 0 8px;
  color: #2563eb;
}
.doc-type-card p {
  margin: 0;
  color: #6b7280;
  font-size: 0.92rem;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.data-table th, .data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  font-size: 0.88rem;
}
.data-table th {
  background: #f9fafb;
}
.data-table tr.fail td {
  color: #9b1c1c;
}
.data-table tr.ok td {
  color: #14532d;
}
.ua-cell {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
