:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
}

* { box-sizing: border-box; }

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

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.topbar .brand a { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.topbar nav a { margin-right: 16px; color: var(--muted); text-decoration: none; }
.topbar nav a:hover { color: var(--primary); }
.topbar .who { color: var(--muted); font-size: 0.9rem; }
.topbar .who a { margin-left: 10px; color: var(--primary); text-decoration: none; }

.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }

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

.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.table th { background: #f8fafc; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: none; }

.form { display: flex; flex-direction: column; gap: 6px; max-width: 480px; }
.form label { font-weight: 600; font-size: 0.85rem; margin-top: 8px; }
.form input, .form select, .form textarea {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.95rem; font-family: inherit;
}
.inline-form { display: flex; gap: 8px; align-items: center; max-width: none; flex-direction: row; }

button, .btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
  margin-top: 10px;
  width: fit-content;
}
button:hover, .btn:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); }

.badge { padding: 2px 8px; border-radius: 12px; font-size: 0.78rem; text-transform: capitalize; background: #e2e8f0; }
.status-open { background: #dbeafe; color: #1e40af; }
.status-in_progress { background: #fef3c7; color: #92400e; }
.status-resolved { background: #dcfce7; color: #166534; }
.status-closed { background: #e2e8f0; color: #475569; }
.priority-high { background: #fee2e2; color: #991b1b; }
.priority-medium { background: #fef3c7; color: #92400e; }
.priority-low { background: #e0f2fe; color: #075985; }

.error { color: var(--danger); font-weight: 600; }
.pre { white-space: pre-wrap; }
.comment .meta { color: var(--muted); font-size: 0.8rem; margin-bottom: 4px; }

.login-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 100%; max-width: 360px; text-align: left; }
.login-card h1 { font-size: 1.3rem; margin-bottom: 16px; text-align: center; }
