*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --primary: #005ea2;
  --primary-hover: #004a7c;
  --primary-light: #e6f0fa;
  --accent: #2e8540;
  --border: #d9d9d9;
  --error: #d54309;
  --error-bg: #fdecea;
  --success: #2e8540;
  --success-bg: #e7f4e4;
  --warning: #cc7a00;
  --warning-bg: #fff5e6;
  --muted: #5c5c5c;
  --radius: 8px;
}

html {
  font-size: 18px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: var(--primary-hover); }

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
}

h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.75rem; }
h2 { font-size: 1.4rem; font-weight: 600; margin-bottom: 0.5rem; }
h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.4rem; }
p, li { margin-bottom: 0.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.6rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: background 0.15s, border-color 0.15s;
}
.btn:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-light); color: var(--primary); }

.btn-large { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  background: var(--bg);
  min-height: 48px;
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

.field { margin-bottom: 1.25rem; }

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.radio-group label {
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.4rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.radio-group label:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.radio-group input[type="radio"] {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.radio-group input[type="radio"]:checked + span { font-weight: 600; }

.checkbox-group label {
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.4rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.checkbox-group input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card:hover { border-color: var(--primary); }

.tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: var(--primary-light);
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tag-success { background: var(--success-bg); color: var(--success); }
.tag-warning { background: var(--warning-bg); color: var(--warning); }

.error-box {
  background: var(--error-bg);
  border: 2px solid var(--error);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.error-box p { color: var(--error); font-weight: 600; margin-bottom: 0.5rem; }

.success-box {
  background: var(--success-bg);
  border: 2px solid var(--success);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.progress-bar {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
}
.progress-step {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
}
.progress-step.active { background: var(--primary); }
.progress-step.done { background: var(--accent); }

.header {
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header a { color: #fff; text-decoration: none; font-weight: 600; }
.header a:hover { text-decoration: underline; }

.footer {
  margin-top: 2rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}
.footer a { color: var(--muted); }

.spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--muted);
}

@media print {
  .header, .footer, .btn, .progress-bar, #categoryFilter, #statusFilters { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  .container { max-width: 100%; padding: 0; }
  .card { border: 1px solid #000; break-inside: avoid; padding: 0.75rem; margin-bottom: 0.5rem; }
  a { color: #000; text-decoration: none; }
  h1 { font-size: 18pt; }
  h2 { font-size: 14pt; }
  h3 { font-size: 12pt; }
  .card:hover { border-color: #000; }
  .tag { border: 1px solid #000; background: #fff; color: #000; }
}

@media (max-width: 600px) {
  .container { padding: 1rem; }
  h1 { font-size: 1.5rem; }
}
