* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f6f7f9; color: #1a1d22; }
a { color: #4f46e5; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef0f3; padding: 2px 6px; border-radius: 4px; font-size: 13px; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar .muted { color: #6b7280; font-size: 13px; margin-right: 6px; }

.topnav { display: flex; align-items: center; gap: 14px; }
.topnav a { color: #374151; font-size: 14px; padding: 4px 0; }
.topnav a:hover { text-decoration: none; color: #4f46e5; }
.topnav a.active { color: #4f46e5; font-weight: 600; }
.topnav .who { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #6b7280; }
.role-pill { font-size: 10px; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; font-weight: 600; letter-spacing: .04em; }
.role-pill.role-admin { background: #fef3c7; color: #92400e; }
.role-pill.role-user  { background: #dbeafe; color: #1e40af; }

.banner { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.banner.ok  { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.banner.err { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

.users-create { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.users-create input[type=text],
.users-create select {
    padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px;
}
.users-form { background: #fff; padding: 16px 18px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.users-form h2 { margin: 0 0 12px; font-size: 15px; }

.inline-copy { display: flex; gap: 6px; align-items: center; }
.inline-copy input { flex: 1; padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-family: ui-monospace, monospace; font-size: 12px; background: #fafbfc; }

.token { font-size: 12px; color: #6b7280; }
.pw-form { max-width: 320px; }
.pw-form input[type=password] {
    width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; margin-bottom: 4px;
}

.wrap { max-width: 1100px; margin: 24px auto; padding: 0 24px; }
.wrap h2 { margin: 0 0 16px; font-size: 18px; }

.muted { color: #6b7280; }

.btn-ghost {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 6px;
}
.btn-ghost:hover { background: #f3f4f6; }
.btn-danger {
    background: transparent; border: 1px solid #fecaca;
    color: #dc2626; border-radius: 6px; cursor: pointer;
    padding: 4px 10px; font-size: 14px;
}
.btn-danger:hover { background: #fee2e2; }

table.demos {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
table.demos th, table.demos td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f3f6;
    text-align: left;
    font-size: 14px;
}
table.demos th { background: #fafbfc; font-weight: 600; font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: .03em; }
table.demos tr:last-child td { border-bottom: none; }
table.demos .links { white-space: nowrap; }

/* login */
.login-page { background: #1a1d22; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box {
    background: #fff; padding: 32px; border-radius: 14px; min-width: 320px;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-box h1 { margin: 0; font-size: 20px; }
.login-box p { margin: 4px 0 20px; }
.login-box input {
    width: 100%; padding: 10px 12px; border: 1px solid #d1d5db;
    border-radius: 8px; font-size: 15px; margin-bottom: 12px;
}
.login-box button {
    width: 100%; padding: 10px; background: #4f46e5; color: #fff;
    border: 0; border-radius: 8px; font-size: 15px; cursor: pointer;
}
.login-box .err { color: #dc2626; margin-top: 10px; font-size: 13px; text-align: center; }

.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: #1a1d22; color: #fff; padding: 10px 18px; border-radius: 8px;
    font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3); z-index: 1000;
}
