* { box-sizing: border-box; }
body { font-family: Tahoma, Arial, sans-serif; margin: 0; background: #f4f6fa; color: #1f2937; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { display: flex; align-items: center; gap: 1.5rem; padding: 0.75rem 1.5rem; background: #1f2937; color: #fff; }
.topbar .brand a { color: #fff; font-weight: bold; font-size: 1.1rem; }
.topbar nav { display: flex; gap: 1rem; flex: 1; }
.topbar nav a { color: #cbd5e1; }
.topbar nav a:hover { color: #fff; text-decoration: none; }
.topbar .logout button { background: transparent; border: 1px solid #94a3b8; color: #cbd5e1; padding: 0.25rem 0.75rem; border-radius: 4px; cursor: pointer; }

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

h1 { margin-top: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.card { background: #fff; padding: 1rem 1.25rem; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.card-title { font-size: 0.85rem; color: #64748b; margin-bottom: 0.25rem; }
.card-value { font-size: 2rem; font-weight: bold; }

.grid { width: 100%; border-collapse: collapse; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.grid th, .grid td { padding: 0.6rem 0.75rem; border-bottom: 1px solid #e5e7eb; text-align: right; font-size: 0.9rem; }
.grid th { background: #f1f5f9; font-weight: 600; }
.grid tr:hover { background: #f8fafc; }
.grid .empty { text-align: center; color: #94a3b8; padding: 2rem; }

.flash { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash-info { background: #dbeafe; color: #1e40af; }
.flash-success { background: #d1fae5; color: #065f46; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-warning { background: #fef3c7; color: #92400e; }

form label { display: block; margin-bottom: 0.75rem; }
form input[type="text"], form input[type="password"], form input[type="number"], form input[type="url"], form select, form textarea {
  width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.95rem; font-family: inherit;
}
form textarea { min-height: 200px; font-family: monospace; direction: ltr; text-align: left; }
form button { background: #2563eb; color: #fff; border: 0; padding: 0.6rem 1.25rem; border-radius: 6px; cursor: pointer; font-size: 0.95rem; }
form button:hover { background: #1d4ed8; }
form button.secondary { background: #64748b; }
form button.danger { background: #dc2626; }

.login-card { max-width: 360px; margin: 4rem auto; background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.settings-section { background: #fff; padding: 1.5rem; border-radius: 8px; margin-bottom: 1.5rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.settings-section h2 { margin-top: 0; }

.row-actions { display: flex; gap: 0.5rem; }
.row-actions form { display: inline; }

.preview-ok { background: #ecfdf5; }
.preview-err { background: #fef2f2; }

.filters { display: flex; gap: 0.5rem; margin-bottom: 1rem; align-items: end; flex-wrap: wrap; }
.filters label { margin: 0; }
.filters input, .filters select { padding: 0.4rem 0.6rem; }

.pager { margin-top: 1rem; display: flex; gap: 0.5rem; justify-content: center; }

dl.kv { display: grid; grid-template-columns: 160px 1fr; gap: 0.4rem 1rem; }
dl.kv dt { color: #64748b; }

pre.raw { background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: 6px; overflow: auto; direction: ltr; text-align: left; }
