:root {
    --bg: #0F1420;
    --panel-bg: #171D2C;
    --border: #2A3348;
    --text: #E7E9EE;
    --text-muted: #A7AFC2;
    --primary: #3B5BFD;
    --danger: #E5484D;
    --danger-bg: #3A1A1D;
}

* {
    box-sizing: border-box;
}

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

a {
    color: var(--primary);
}

.brand-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.brand-screen__wordmark {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}

.brand-screen__panel {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="date"],
.field select,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
}

.field textarea {
    resize: vertical;
    min-height: 60px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.field__hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.btn-row {
    display: flex;
    margin-top: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.btn--primary {
    background: var(--primary);
    color: #fff;
    width: 100%;
}

.btn--primary:hover {
    filter: brightness(1.1);
}

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

.btn--secondary:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.btn--sm {
    padding: 5px 10px;
    font-size: 12px;
}

.alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert--danger {
    background: var(--danger-bg);
    color: #FCA5A9;
    border: 1px solid #5C2327;
}

.totp-secret {
    font-family: "SFMono-Regular", Consolas, monospace;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 15px;
    letter-spacing: 0.05em;
    word-break: break-all;
    margin: 12px 0;
}

.qr-box {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.qr-box img {
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.app-shell__sidebar {
    width: 220px;
    background: var(--panel-bg);
    border-right: 1px solid var(--border);
    padding: 20px 16px;
    flex-shrink: 0;
}

.app-shell__brand {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 24px;
}

.app-shell__sidebar nav a {
    display: block;
    padding: 8px 0;
    color: var(--text);
    text-decoration: none;
}

.app-shell__main {
    flex: 1;
    padding: 24px 32px;
    min-width: 0;
}

.app-shell__topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 16px;
}

h1 {
    font-size: 22px;
    margin: 0 0 4px;
}

h2 {
    font-size: 18px;
    margin: 0 0 12px;
}

h3 {
    font-size: 15px;
    margin: 0 0 12px;
}

.list-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.list-toolbar__search {
    flex: 1;
    min-width: 200px;
    max-width: 360px;
    padding: 9px 12px;
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

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

.pagination {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 14px;
}

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge--ok {
    background: rgba(47, 182, 112, 0.16);
    color: #4ADE80;
}

.badge--warn {
    background: rgba(245, 166, 35, 0.16);
    color: #F5A623;
}

.badge--danger {
    background: var(--danger-bg);
    color: #FCA5A9;
}

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

.card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stat-row {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.stat-tile__value {
    font-size: 26px;
    font-weight: 700;
}

.stat-tile__label {
    font-size: 13px;
    color: var(--text-muted);
}

.empty-state {
    color: var(--text-muted);
    font-size: 14px;
    padding: 8px 0;
}
