:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #1a202c;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #b91c1c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318;
    --surface: #1a1d23;
    --border: #2a2f39;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --danger: #f87171;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

header .container {
  padding-top: 14px;
  padding-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}

.btn-link:hover {
  color: var(--text);
}

form.inline {
  display: inline;
}

.card.login {
  max-width: 360px;
  margin: 24px auto 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 1.05rem;
  color: inherit;
  text-decoration: none;
}

/* The document follows the text color so it survives dark mode; the dot is
   the accent, ringed in the header's surface color for separation. */
.brand-icon {
  width: 24px;
  height: 24px;
  flex: none;
}

/* Element-selector padding would lose to .container's shorthand, so scope
   the vertical spacing to the compound selector. */
main.container {
  padding-top: 24px;
  padding-bottom: 56px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

h1 {
  font-size: 1.15rem;
  margin: 0 0 16px;
}

h2 {
  font-size: 1rem;
  margin: 0 0 12px;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.field {
  margin-bottom: 14px;
}

input[type="date"],
input[type="month"],
input[type="number"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-hover);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th {
  padding: 0 8px 8px 0;
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td {
  padding: 8px 8px 8px 0;
  border-top: 1px solid var(--border);
}

td a {
  color: var(--accent);
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

.error {
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  color: var(--danger);
  font-size: 0.9rem;
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-head h1 {
  margin: 0;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin: 16px 0 0;
}

.meta div {
  min-width: 110px;
}

.meta dt {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meta dd {
  margin: 2px 0 0;
  font-size: 0.95rem;
}

iframe.pdf {
  display: block;
  width: 100%;
  height: 640px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  font-size: 0.85rem;
  color: #15803d;
  background: rgba(21, 128, 61, 0.1);
  border: 1px solid #15803d;
  border-radius: 999px;
  padding: 3px 10px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox label {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
}

.email-field {
  margin-bottom: 14px;
}

.email-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.icon-btn {
  display: inline-flex;
  padding: 6px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--bg);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.email-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
  font-size: 0.88rem;
  white-space: pre-wrap;
  word-break: break-word;
}
