/* NexVault Design System */
:root {
    --nv-bg: #050814;
    --nv-bg-elevated: #0b1020;
    --nv-bg-input: #0a0f1d;
    --nv-primary: #1b3b8c;
    --nv-primary-soft: #25479b;
    --nv-gold: #d9a441;
    --nv-gold-soft: rgba(217, 164, 65, 0.15);
    --nv-text: #f5f7ff;
    --nv-text-muted: #9097b3;
    --nv-border: #20263a;
    --nv-border-focus: rgba(217, 164, 65, 0.55);
    --nv-danger: #ff6b6b;
    --nv-danger-bg: rgba(110, 26, 26, 0.5);
    --nv-success: #1dbf73;
    --nv-success-bg: rgba(29, 191, 115, 0.12);
    --nv-radius: 12px;
    --nv-radius-lg: 16px;
    --nv-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    --nv-transition: 0.15s ease;
    --nv-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --nv-sidebar-width: 300px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
}

body {
    font-family: var(--nv-font);
    color: var(--nv-text);
    background: var(--nv-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--nv-gold);
    transition: color var(--nv-transition);
}

a:hover {
    color: #f0c96a;
}

/* ── Auth (Login) ── */
body.nv-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #10245a 0, #050814 45%, #02030a 100%);
}

.nv-shell {
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.nv-card {
    background: linear-gradient(145deg, rgba(10, 15, 32, 0.96), rgba(5, 7, 18, 0.98));
    border-radius: var(--nv-radius-lg);
    border: 1px solid rgba(73, 96, 167, 0.5);
    box-shadow: var(--nv-shadow);
    padding: 28px 26px 24px;
    position: relative;
    overflow: hidden;
}

.nv-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    background:
        radial-gradient(circle at -10% -20%, rgba(217, 164, 65, 0.18), transparent 50%),
        radial-gradient(circle at 120% 120%, rgba(27, 59, 140, 0.4), transparent 55%);
    pointer-events: none;
}

.nv-card-inner {
    position: relative;
    z-index: 1;
}

.nv-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.nv-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: radial-gradient(circle at 20% 20%, #ffe8a3, #d9a441 45%, #8f6a23 100%);
    box-shadow: 0 0 20px rgba(217, 164, 65, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #050814;
}

.nv-title {
    font-size: 22px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
}

.nv-subtitle {
    font-size: 12px;
    color: var(--nv-text-muted);
}

.nv-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.nv-input,
.nv-select,
textarea.nv-input {
    width: 100%;
    padding: 11px 13px;
    border-radius: 10px;
    border: 1px solid var(--nv-border);
    background: var(--nv-bg-input);
    color: var(--nv-text);
    font-size: 14px;
    outline: none;
    transition: border-color var(--nv-transition), box-shadow var(--nv-transition);
}

.nv-input:focus,
.nv-select:focus,
textarea.nv-input:focus {
    border-color: var(--nv-gold);
    box-shadow: 0 0 0 3px var(--nv-gold-soft);
}

.nv-input::placeholder {
    color: #5d6480;
}

.nv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(120deg, var(--nv-primary), var(--nv-primary-soft));
    color: #fdf7e3;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform var(--nv-transition), filter var(--nv-transition), box-shadow var(--nv-transition);
}

.nv-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.nv-btn:active {
    transform: translateY(0);
}

.nv-btn-block {
    width: 100%;
}

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

.nv-btn-ghost:hover {
    border-color: var(--nv-gold);
    color: var(--nv-gold);
    filter: none;
}

.nv-btn-gold {
    background: var(--nv-gold);
    color: #050814;
}

.nv-btn-sm {
    padding: 7px 12px;
    font-size: 12px;
}

.nv-alert {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 12px;
}

.nv-alert-error {
    border: 1px solid rgba(255, 107, 107, 0.4);
    background: var(--nv-danger-bg);
    color: #ffecec;
}

.nv-alert-success {
    border: 1px solid var(--nv-success);
    background: var(--nv-success-bg);
    color: var(--nv-success);
}

/* ── App layout (Dashboard) ── */
body.nv-app {
    height: 100%;
    overflow: hidden;
    display: flex;
}

.nv-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 998;
    backdrop-filter: blur(2px);
}

.nv-overlay.active {
    display: block;
}

.nv-sidebar {
    width: var(--nv-sidebar-width);
    height: 100vh;
    background: var(--nv-bg-elevated);
    border-right: 1px solid var(--nv-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    z-index: 999;
}

.nv-sidebar-brand {
    padding: 18px 16px 12px;
    border-bottom: 1px solid var(--nv-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nv-sidebar-brand .nv-logo {
    width: 36px;
    height: 36px;
    font-size: 16px;
}

.nv-sidebar-brand-text {
    flex: 1;
    min-width: 0;
}

.nv-sidebar-brand-text strong {
    display: block;
    font-size: 15px;
    color: var(--nv-gold);
    letter-spacing: 0.03em;
}

.nv-sidebar-brand-text span {
    font-size: 11px;
    color: var(--nv-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.nv-app-tabs {
    display: flex;
    gap: 4px;
    padding: 0 16px 12px;
    border-bottom: 1px solid var(--nv-border);
}

.nv-app-tabs a {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--nv-text-muted);
    border: 1px solid transparent;
    transition: background var(--nv-transition), color var(--nv-transition), border-color var(--nv-transition);
}

.nv-app-tabs a:hover {
    color: var(--nv-text);
    background: #111933;
}

.nv-app-tabs a.active {
    color: var(--nv-gold);
    background: rgba(27, 59, 140, 0.35);
    border-color: rgba(217, 164, 65, 0.35);
}

.nv-mail-item {
    display: block;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(10, 16, 32, 0.6);
    color: var(--nv-text);
    text-decoration: none;
    transition: background var(--nv-transition), border-color var(--nv-transition);
}

.nv-mail-item:hover {
    background: #122040;
    border-color: rgba(37, 71, 155, 0.4);
}

.nv-mail-item.active {
    background: rgba(27, 59, 140, 0.35);
    border-color: rgba(217, 164, 65, 0.45);
}

.nv-mail-item-subject {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nv-mail-item-meta {
    font-size: 11px;
    color: var(--nv-text-muted);
}

.nv-mail-unread .nv-mail-item-subject {
    color: var(--nv-gold);
}

/* 2-Spalten E-Mail-Layout (Postfächer in App-Sidebar) */
.nv-main-mail {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.nv-mail-alerts {
    flex-shrink: 0;
    padding: 12px 16px 0;
}

.nv-mail-alerts .nv-alert {
    margin-bottom: 8px;
}

.nv-mail-layout {
    flex: 1;
    min-height: 0;
    display: flex;
    border-top: 1px solid var(--nv-border);
}

.nv-mail-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    border-right: 1px solid var(--nv-border);
    background: var(--nv-bg-elevated);
}

.nv-mail-col:last-child {
    border-right: none;
}

.nv-mail-col-inbox {
    width: 300px;
    flex-shrink: 0;
}

.nv-mail-col-detail {
    flex: 1;
    background: var(--nv-bg);
}

.nv-mail-col-head {
    flex-shrink: 0;
    padding: 12px 14px;
    border-bottom: 1px solid var(--nv-border);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--nv-gold);
}

.nv-mail-col-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 10px 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--nv-primary-soft) var(--nv-bg-input);
}

.nv-mail-col-scroll::-webkit-scrollbar {
    width: 6px;
}

.nv-mail-col-scroll::-webkit-scrollbar-thumb {
    background: var(--nv-primary-soft);
    border-radius: 3px;
}

.nv-mail-account-item {
    display: block;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(10, 16, 32, 0.6);
    text-decoration: none;
    color: var(--nv-text);
    transition: background var(--nv-transition), border-color var(--nv-transition);
}

.nv-mail-account-item:hover {
    background: #122040;
}

.nv-mail-account-item.active {
    background: rgba(27, 59, 140, 0.35);
    border-color: rgba(217, 164, 65, 0.45);
}

.nv-mail-account-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.nv-mail-account-meta {
    font-size: 10px;
    color: var(--nv-text-muted);
}

.nv-mail-detail-scroll {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.nv-mail-detail-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--nv-text-muted);
    text-align: center;
    font-size: 14px;
}

.nv-mail-html-wrap {
    margin-top: 4px;
    border: 1px solid var(--nv-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    min-height: 280px;
}

.nv-mail-html-frame {
    display: block;
    width: 100%;
    min-height: 360px;
    height: 60vh;
    border: none;
    background: #fff;
}

.nv-mail-plain-body {
    white-space: pre-wrap;
    line-height: 1.6;
}

.nv-mail-col-tools {
    padding: 8px 10px 0;
    border-bottom: 1px solid var(--nv-border);
}

@media (max-width: 1100px) {
    .nv-mail-col-inbox {
        width: 260px;
    }
}

@media (max-width: 900px) {
    .nv-mail-layout {
        flex-direction: column;
    }

    .nv-mail-col-inbox {
        width: 100%;
        height: 40vh;
        flex-shrink: 0;
    }

    .nv-mail-col-detail {
        width: 100%;
        flex: 1;
        min-height: 40vh;
        border-top: 1px solid var(--nv-border);
    }
}

.nv-sidebar-by-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.nv-sidebar-by-toggle a {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: var(--nv-text-muted);
    border: 1px solid var(--nv-border);
    background: var(--nv-bg-input);
}

.nv-sidebar-by-toggle a.active {
    color: var(--nv-gold);
    border-color: rgba(217, 164, 65, 0.45);
    background: rgba(27, 59, 140, 0.35);
}

.nv-sidebar-tools {
    padding: 12px 16px;
    border-bottom: 1px solid var(--nv-border);
}

.nv-search-box {
    position: relative;
}

.nv-search-box input {
    width: 100%;
    padding: 10px 36px 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--nv-border);
    background: var(--nv-bg-input);
    color: var(--nv-text);
    font-size: 14px;
    outline: none;
}

.nv-search-box input:focus {
    border-color: var(--nv-gold);
    box-shadow: 0 0 0 3px var(--nv-gold-soft);
}

.nv-search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--nv-text-muted);
    font-size: 14px;
    pointer-events: none;
}

.nv-select {
    width: 100%;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--nv-border);
    background: var(--nv-bg-input);
    color: var(--nv-text);
    font-size: 13px;
    cursor: pointer;
}

.nv-sidebar-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 12px 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--nv-primary-soft) var(--nv-bg-input);
}

.nv-sidebar-list::-webkit-scrollbar {
    width: 6px;
}

.nv-sidebar-list::-webkit-scrollbar-thumb {
    background: var(--nv-primary-soft);
    border-radius: 3px;
}

.nv-group-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--nv-gold);
    margin: 16px 4px 8px;
}

.nv-pass-item {
    display: block;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(10, 16, 32, 0.6);
    color: var(--nv-text);
    font-size: 14px;
    cursor: pointer;
    transition: background var(--nv-transition), border-color var(--nv-transition);
    text-decoration: none;
}

.nv-pass-item:hover {
    background: #122040;
    border-color: rgba(37, 71, 155, 0.4);
}

.nv-pass-item.active {
    background: rgba(27, 59, 140, 0.35);
    border-color: rgba(217, 164, 65, 0.45);
    color: var(--nv-gold);
}

.nv-pass-item-domain {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.nv-pass-item-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-pass-item-count {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--nv-text-muted);
    background: rgba(10, 16, 32, 0.8);
    border: 1px solid var(--nv-border);
    border-radius: 8px;
    padding: 2px 8px;
    line-height: 1.4;
}

.nv-pass-item.active .nv-pass-item-count {
    color: var(--nv-gold);
    border-color: rgba(217, 164, 65, 0.35);
}

.nv-sidebar-hint {
    padding: 8px 4px;
    font-size: 13px;
    color: var(--nv-text-muted);
}

.nv-main-back {
    margin: 0 0 16px;
    font-size: 14px;
}

.nv-main-back a {
    color: var(--nv-gold);
    text-decoration: none;
}

.nv-main-back a:hover {
    text-decoration: underline;
}

.nv-main-header-meta {
    font-size: 14px;
    color: var(--nv-text-muted);
}

.nv-main-pass-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nv-main-pass-row {
    display: block;
    padding: 14px 16px;
    border-radius: var(--nv-radius);
    border: 1px solid var(--nv-border);
    background: var(--nv-bg-elevated);
    text-decoration: none;
    color: var(--nv-text);
    transition: border-color var(--nv-transition), background var(--nv-transition);
}

.nv-main-pass-row:hover {
    border-color: rgba(37, 71, 155, 0.5);
    background: #122040;
}

.nv-main-pass-row.active {
    border-color: rgba(217, 164, 65, 0.45);
    background: rgba(27, 59, 140, 0.25);
}

.nv-main-pass-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.nv-main-pass-meta,
.nv-main-pass-url {
    display: block;
    font-size: 13px;
    color: var(--nv-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-main-pass-url {
    margin-top: 2px;
    opacity: 0.85;
}

.nv-sidebar-footer {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--nv-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nv-sidebar-footer .nv-btn {
    width: 100%;
    font-size: 13px;
}

.nv-add-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--nv-primary);
    color: var(--nv-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    transition: background var(--nv-transition);
}

.nv-add-btn:hover {
    background: var(--nv-primary-soft);
    color: var(--nv-gold);
}

.nv-main {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 28px 32px;
    background:
        radial-gradient(circle at 80% 0%, rgba(27, 59, 140, 0.12), transparent 40%),
        var(--nv-bg);
}

.nv-main-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.nv-main-header h1 {
    font-size: 24px;
    color: var(--nv-gold);
    font-weight: 600;
}

.nv-empty {
    max-width: 400px;
    padding: 40px 0;
    color: var(--nv-text-muted);
}

.nv-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.nv-detail-card {
    background: var(--nv-bg-elevated);
    border: 1px solid var(--nv-border);
    border-radius: var(--nv-radius-lg);
    padding: 24px;
    max-width: 560px;
    box-shadow: var(--nv-shadow);
}

.nv-detail-title {
    font-size: 22px;
    color: var(--nv-gold);
    margin-bottom: 20px;
    font-weight: 600;
}

.nv-field {
    margin-bottom: 18px;
}

.nv-field-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--nv-text-muted);
    margin-bottom: 6px;
}

.nv-field-value {
    font-size: 15px;
    word-break: break-word;
}

.nv-field-value.mono {
    font-family: ui-monospace, "Cascadia Code", monospace;
    background: var(--nv-bg-input);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--nv-border);
    user-select: all;
}

.nv-field-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex-wrap: wrap;
}

.nv-field-row .nv-field-value {
    flex: 1;
    min-width: 120px;
}

.nv-secret-box[data-masked="1"] .nv-secret-text {
    letter-spacing: 0.12em;
    user-select: none;
}

.nv-input-secret {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.nv-input-secret .nv-input {
    margin-bottom: 0;
    flex: 1;
}

.nv-input-secret .nv-btn {
    flex-shrink: 0;
    align-self: stretch;
}

.nv-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--nv-border);
}

.nv-inline-form {
    display: inline;
    margin: 0;
}

.nv-btn-danger {
    color: #ffb4b4;
    border-color: rgba(220, 80, 80, 0.55);
    background: rgba(120, 30, 30, 0.35);
}

.nv-btn-danger:hover {
    color: #fff;
    border-color: rgba(255, 120, 120, 0.7);
    background: rgba(160, 40, 40, 0.5);
}

.nv-otp-delete-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--nv-border);
}

/* Form pages */
body.nv-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 0%, rgba(27, 59, 140, 0.15), transparent 45%),
        var(--nv-bg);
    padding: 24px 20px 48px;
}

.nv-page-inner {
    max-width: 560px;
    margin: 0 auto;
}

.nv-page-header {
    margin-bottom: 20px;
}

.nv-page-header h1 {
    font-size: 22px;
    color: var(--nv-gold);
    margin-top: 8px;
}

.nv-form-card {
    background: var(--nv-bg-elevated);
    border: 1px solid var(--nv-border);
    border-radius: var(--nv-radius-lg);
    padding: 24px;
}

.nv-form-row {
    margin-bottom: 16px;
}

.nv-form-row-inline {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .nv-form-row-inline {
        grid-template-columns: 1fr;
    }
}

/* OTP-Client */
.nv-otp-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(10, 16, 32, 0.6);
    color: var(--nv-text);
    text-decoration: none;
    transition: background var(--nv-transition), border-color var(--nv-transition);
}

.nv-otp-item:hover {
    background: #122040;
    border-color: rgba(37, 71, 155, 0.4);
}

.nv-otp-item.active {
    background: rgba(27, 59, 140, 0.35);
    border-color: rgba(217, 164, 65, 0.45);
}

.nv-otp-item-label {
    font-size: 14px;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-otp-item-code {
    font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--nv-gold);
    flex-shrink: 0;
}

.nv-otp-code-block {
    margin: 24px 0;
    text-align: center;
}

.nv-otp-code-lg {
    font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
    font-size: clamp(36px, 8vw, 56px);
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--nv-gold);
    margin-bottom: 16px;
}

.nv-otp-code-md {
    font-size: clamp(28px, 6vw, 42px);
    letter-spacing: 0.16em;
}

.nv-otp-code-block-inline {
    margin: 12px 0 16px;
}

.nv-password-linked-otp {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(217, 164, 65, 0.3);
    background: rgba(27, 59, 140, 0.2);
    margin-bottom: 20px;
}

.nv-password-linked-otp .nv-field-label {
    flex: 1 1 100%;
}

.nv-password-linked-otp .nv-otp-code-block-inline {
    flex: 1 1 100%;
}

.nv-otp-timer-wrap {
    height: 6px;
    background: var(--nv-bg-input);
    border-radius: 3px;
    overflow: hidden;
    max-width: 320px;
    margin: 0 auto 10px;
}

.nv-otp-timer-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--nv-primary-soft), var(--nv-gold));
    border-radius: 3px;
    transition: width 0.3s linear;
}

.nv-otp-timer-text {
    font-size: 13px;
    color: var(--nv-text-muted);
}

/* OTP QR Scanner & Modal */
.nv-otp-setup-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.nv-otp-setup-tabs button {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--nv-border);
    background: var(--nv-bg-input);
    color: var(--nv-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--nv-transition), color var(--nv-transition), border-color var(--nv-transition);
}

.nv-otp-setup-tabs button.active {
    color: var(--nv-gold);
    border-color: rgba(217, 164, 65, 0.45);
    background: rgba(27, 59, 140, 0.35);
}

.nv-otp-scan-hint {
    font-size: 13px;
    color: var(--nv-text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

.nv-qr-reader-wrap {
    position: relative;
    width: 100%;
    max-width: min(100%, 480px);
    margin: 0 auto 8px;
}

.nv-qr-reader {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--nv-border);
    background: #000;
    min-height: 280px;
    touch-action: none;
}

.nv-qr-camera-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--nv-bg-input);
    border: 1px solid var(--nv-border);
}

.nv-qr-camera-controls[hidden] {
    display: none !important;
}

.nv-qr-cam-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--nv-border);
    background: var(--nv-bg-elevated);
    color: var(--nv-text);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background var(--nv-transition), border-color var(--nv-transition);
}

.nv-qr-cam-btn:hover,
.nv-qr-cam-btn.active {
    border-color: rgba(217, 164, 65, 0.5);
    color: var(--nv-gold);
}

.nv-qr-cam-zoom {
    flex: 1;
    min-width: 0;
    accent-color: var(--nv-gold);
}

.nv-qr-camera-hint {
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--nv-text-muted);
    text-align: center;
    line-height: 1.4;
}

.nv-qr-camera-hint[hidden] {
    display: none !important;
}

.nv-qr-reader-wrap.nv-qr-focusing::after {
    content: '';
    position: absolute;
    width: 56px;
    height: 56px;
    margin-left: -28px;
    margin-top: -28px;
    left: var(--nv-focus-x, 50%);
    top: var(--nv-focus-y, 50%);
    border: 2px solid var(--nv-gold);
    border-radius: 50%;
    pointer-events: none;
    animation: nv-focus-pulse 0.6s ease-out;
    z-index: 2;
}

@keyframes nv-focus-pulse {
    0% { transform: scale(1.4); opacity: 0.9; }
    100% { transform: scale(1); opacity: 0; }
}

.nv-otp-qr-mode {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.nv-otp-qr-mode button {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--nv-border);
    background: var(--nv-bg-input);
    color: var(--nv-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.nv-otp-qr-mode button.active {
    color: var(--nv-gold);
    border-color: rgba(217, 164, 65, 0.45);
    background: rgba(27, 59, 140, 0.35);
}

.nv-otp-scan-hint-export {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(217, 164, 65, 0.12);
    border: 1px solid rgba(217, 164, 65, 0.25);
}

.nv-otp-qr-upload {
    margin: 16px 0;
    padding-top: 16px;
    border-top: 1px solid var(--nv-border);
    text-align: center;
}

.nv-otp-qr-upload-btn {
    display: inline-block;
    cursor: pointer;
}

.nv-otp-qr-preview {
    margin-top: 14px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--nv-border);
    background: var(--nv-bg-input);
    overflow: auto;
    max-height: 70vh;
}

.nv-otp-qr-preview img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
}

.nv-otp-qr-preview-status {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--nv-text-muted);
}

#nv-qr-file-scanner {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.nv-qr-reader video {
    width: 100% !important;
    border-radius: 12px;
}

.nv-otp-scan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}

.nv-otp-scan-actions .nv-btn-gold {
    flex: 1 1 100%;
    max-width: 280px;
}

.nv-otp-qr-upload-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.nv-otp-migration-paste {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--nv-border);
}

.nv-otp-bulk-import {
    margin: 16px 0;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(217, 164, 65, 0.35);
    background: rgba(27, 59, 140, 0.2);
}

.nv-otp-bulk-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--nv-gold);
    margin-bottom: 12px;
}

.nv-otp-bulk-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
}

.nv-otp-bulk-list li {
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--nv-bg-input);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-otp-bulk-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.nv-otp-preview-wrap {
    margin: 16px 0;
    padding: 16px;
    border-radius: 12px;
    border: 1px dashed var(--nv-border);
    text-align: center;
}

.nv-otp-preview-qr,
.nv-otp-export-qr {
    display: inline-block;
    padding: 12px;
    background: #e8ecf4;
    border-radius: 12px;
}

.nv-otp-preview-qr img,
.nv-otp-export-qr img {
    display: block;
}

.nv-otp-scan-inline {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--nv-border);
}

body.nv-modal-open {
    overflow: hidden;
}

.nv-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.nv-modal[hidden] {
    display: none !important;
}

.nv-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 20, 0.75);
}

.nv-modal-card {
    position: relative;
    width: 100%;
    max-width: 360px;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--nv-border);
    background: var(--nv-bg-elevated);
    box-shadow: var(--nv-shadow);
    text-align: center;
}

.nv-modal-title {
    font-size: 18px;
    color: var(--nv-gold);
    margin-bottom: 10px;
}

.nv-modal-text {
    font-size: 13px;
    color: var(--nv-text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Toast */
.nv-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 18px;
    border-radius: 10px;
    background: var(--nv-bg-elevated);
    border: 1px solid var(--nv-border);
    color: var(--nv-text);
    font-size: 14px;
    box-shadow: var(--nv-shadow);
    z-index: 10000;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.nv-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.nv-toast.success {
    border-color: var(--nv-success);
    color: var(--nv-success);
}

/* Mobile */
.nv-mobile-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--nv-border);
    background: var(--nv-bg-elevated);
    color: var(--nv-gold);
    font-size: 22px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .nv-mobile-toggle {
        display: flex;
    }

    .nv-sidebar {
        position: fixed;
        left: calc(-1 * var(--nv-sidebar-width) - 20px);
        top: 0;
        transition: left 0.25s ease;
        box-shadow: var(--nv-shadow);
    }

    .nv-sidebar.open {
        left: 0;
    }

    .nv-main {
        padding: 72px 20px 28px;
    }
}

@media (max-width: 480px) {
    .nv-main {
        padding: 68px 16px 24px;
    }

    .nv-detail-card,
    .nv-form-card {
        padding: 18px;
    }
}

/* ── WebAuthn / YubiKey ── */
.nv-text-muted {
    color: var(--nv-text-muted);
}

.nv-login-separator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 14px;
    color: var(--nv-text-muted);
    font-size: 12px;
}

.nv-login-separator::before,
.nv-login-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--nv-border);
}

.nv-webauthn-status {
    margin-top: 10px;
    text-align: center;
    font-size: 13px;
    min-height: 18px;
}

.nv-webauthn-status-ok {
    color: var(--nv-success);
}

.nv-webauthn-status-err {
    color: var(--nv-danger);
}

.nv-profile-key-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nv-profile-key-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--nv-border);
    border-radius: var(--nv-radius);
    margin-bottom: 8px;
    background: var(--nv-bg-elevated);
}

.nv-profile-status {
    margin-top: 12px;
    font-size: 13px;
    min-height: 18px;
}

.nv-profile-status-ok {
    color: var(--nv-success);
}

.nv-profile-status-err {
    color: var(--nv-danger);
}
