:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #1a2332;
  --muted: #64748b;
  --border: #d9e0ea;
  --primary: #1e3a5f;
  --primary-hover: #16304d;
  --error: #b3261e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

#login-view {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

#login-form {
  background: var(--surface);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(20, 30, 50, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(24rem, 90vw);
}

#app-view { padding: 1.5rem; max-width: 72rem; margin: 0 auto; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

h1 { font-size: 1.25rem; margin: 0; }
h2 { margin-top: 0; }
.muted { color: var(--muted); font-size: 0.875rem; }
.error { color: var(--error); font-size: 0.875rem; }
.banner { background: #fdecec; padding: 0.5rem 0.75rem; border-radius: 6px; }

label { font-weight: 600; font-size: 0.875rem; }

input[type="password"], textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

button {
  font: inherit;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
}
button:hover { background: var(--primary-hover); }

button.link {
  background: none;
  color: var(--primary);
  text-decoration: underline;
  padding: 0 0.25rem;
}
button.link:hover { background: none; }

.pill {
  background: var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  margin-top: 1rem;
  border-radius: 8px;
  overflow: hidden;
}
th, td { text-align: left; padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--border); }
th { background: #eef2f7; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.03em; }

dialog {
  border: none;
  border-radius: 10px;
  padding: 1.5rem;
  width: min(34rem, 92vw);
  box-shadow: 0 8px 32px rgba(20, 30, 50, 0.18);
}
dialog::backdrop { background: rgba(15, 25, 40, 0.45); }
dialog menu { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0; margin: 1rem 0 0; }
dialog .doc-grid { margin-bottom: 0.75rem; }

@media (max-width: 40rem) {
  th:nth-child(3), td:nth-child(3) { display: none; }
}
