* {
    box-sizing: border-box;
}

:root {
    --bg: #f5f5f5;
    --surface: #fff;
    --text: #1a1a1a;
    --text-muted: #666;
    --border: #ddd;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

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

#app {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem;
}

.header {
    margin-bottom: 1.5rem;
}

.header h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.view {
    display: block;
}

.view.hidden {
    display: none;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card h2 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.login-card {
    max-width: 360px;
}

.login-card .hint,
.hint {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0 0 1rem 0;
}

label {
    display: block;
    margin-bottom: 1rem;
}

.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

input[type="email"],
input[type="password"],
.password-input-wrap input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
}

.password-input-wrap {
    position: relative;
    display: block;
}

.password-input-wrap input {
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--text);
}

.password-toggle:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.password-toggle .password-toggle-hide[hidden] {
    display: none;
}

.password-toggle .password-toggle-show[hidden] {
    display: none;
}

input:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    margin-top: 0.25rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

.status,
.error {
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.status.error,
.error:not(.hidden) {
    color: var(--danger);
}

.loading {
    padding: 1rem 0;
    color: var(--text-muted);
}

.toolbar {
    margin-bottom: 1rem;
}

.table-wrap {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.users-table th,
.users-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.users-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.users-table tbody tr:hover {
    background: var(--bg);
}

.users-table .actions {
    white-space: nowrap;
}

.dialog {
    border: none;
    border-radius: var(--radius);
    padding: 0;
    max-width: 420px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.dialog-inner {
    padding: 1.5rem;
}

.dialog h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
}

.dialog p {
    margin: 0 0 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.dialog-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.hidden {
    display: none !important;
}
