* { box-sizing: border-box; }
body { font-family: -apple-system, "Segoe UI", Arial, sans-serif; margin: 0; background: #f5f6f8; color: #1f2933; }
header { background: #1f2933; color: #fff; padding: 0.75rem 0; }
header .container { display: flex; align-items: center; justify-content: space-between; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.brand { color: #fff; text-decoration: none; font-weight: 600; font-size: 1.1rem; }
nav a { color: #fff; margin-left: 1rem; text-decoration: none; }
main { padding: 1.5rem 0; }
.card { background: #fff; padding: 1.25rem 1.5rem; margin: 1rem 0; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.card.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }
h1, h2 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
th, td { padding: 0.5rem 0.6rem; border-bottom: 1px solid #e6e8eb; text-align: left; font-size: 0.92rem; }
th { background: #f0f2f5; font-weight: 600; }
form.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1rem; }
form label { display: flex; flex-direction: column; font-size: 0.85rem; color: #52606d; gap: 0.25rem; }
input, textarea, select { padding: 0.5rem; border: 1px solid #d1d5db; border-radius: 4px; font: inherit; }
textarea { min-height: 60px; }
button { padding: 0.5rem 1rem; background: #2563eb; color: #fff; border: 0; border-radius: 4px; cursor: pointer; font: inherit; }
button:hover { background: #1d4ed8; }
button.del, button.del-f, button.del-c { background: #b91c1c; }
.error { color: #b91c1c; }
.ok { color: #047857; font-weight: 600; }
.fail { color: #b91c1c; font-weight: 600; }
pre { background: #f0f2f5; padding: 0.75rem; border-radius: 4px; overflow-x: auto; font-size: 0.85rem; }
details summary { cursor: pointer; margin: 0.75rem 0; font-weight: 600; }

/* Modal */
dialog { border: 0; border-radius: 8px; padding: 1.5rem; max-width: 500px; width: 90%; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
dialog::backdrop { background: rgba(0,0,0,0.4); }
dialog h2 { margin-bottom: 1rem; }
.button-row { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.button-row button:last-child { background: #6b7280; }
.help-text { color: #6b7280; font-size: 0.9rem; margin-bottom: 0.75rem; }
small { color: #6b7280; font-size: 0.8rem; }
select { padding: 0.5rem; }
