:root {
    --ink-900: #0f172a;
    --ink-700: #334155;
    --ink-600: #475569;
    --ink-500: #64748b;
    --ink-400: #94a3b8;
    --surface-0: #f8fafc;
    --surface-1: #ffffff;
    --surface-2: #f1f5f9;
    --primary-600: #0f766e;
    --primary-500: #14b8a6;
    --primary-400: #2dd4bf;
    --accent-500: #3b82f6;
    --accent-400: #60a5fa;
    --success-500: #22c55e;
    --warning-500: #f59e0b;
    --danger-500: #ef4444;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(15, 23, 42, 0.06);
    --line-200: rgba(148, 163, 184, 0.4);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--surface-0);
    min-height: 100vh;
    color: var(--ink-900);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
.logo-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
}

/* Settings Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

#tfaRenameModal {
    z-index: 1100;
}

.modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
    width: 500px;
    max-width: calc(100vw - 32px);
    position: relative;
    overflow: hidden;
    transform: scale(0.96) translateY(16px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s ease;
}

#settingsModal .modal {
    width: min(760px, 94vw);
    max-width: calc(100vw - 20px);
    height: min(760px, 92vh);
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
}

#settingsModal .modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

#settingsContent {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#settingsContent .settings-tabs {
    flex: 0 0 auto;
}

#settingsContent .settings-tab-panel {
    flex: 1 1 auto;
    min-height: 0;
}

#settingsContent .settings-tab-panel.active {
    display: flex;
    flex-direction: column;
}

#settingsContent .settings-section {
    flex: 1 1 auto;
    min-height: 0;
}

#settingsTabSessionsDevices #sessionsDevicesList {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    max-height: none;
}

/* 2FA flow: dostosowany do okna (viewport) */
.modal.modal-large {
    width: min(760px, 92vw);
    max-width: calc(100vw - 32px);
    height: min(760px, 92vh);
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
}

.modal.modal-large .modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.sessions-list {
    max-height: 520px;
    overflow-y: auto;
    padding-right: 6px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-subtitle {
    margin: 4px 0 0 0;
    font-size: 0.85rem;
    color: var(--ink-500);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--surface-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--surface-0);
}

.modal-body {
    padding: 24px;
}

/* Hasło, 2FA lista, email: dostosowane do okna */
.modal-settings-size {
    width: min(760px, 92vw);
    max-width: calc(100vw - 32px);
    height: min(760px, 92vh);
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
}

.modal-settings-size .modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.modal-intro {
    margin: 0 0 20px 0;
    font-size: 0.9rem;
    color: var(--ink-500);
    line-height: 1.45;
}

.password-policy-box {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.18);
    background: rgba(59, 130, 246, 0.06);
    font-size: 0.85rem;
    color: var(--ink-700);
}

.password-policy-box .settings-label {
    color: var(--ink-600);
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-500);
    margin-bottom: 12px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--surface-2);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.settings-item:hover {
    background: var(--surface-0);
}

.settings-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-1);
}

.settings-item-icon svg {
    width: 20px;
    height: 20px;
    color: var(--ink-700);
}

.settings-item-text strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
}

.settings-item-text span {
    font-size: 0.8rem;
    color: var(--ink-500);
}

.settings-item-arrow {
    color: var(--ink-400);
}

.settings-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-500);
}

.settings-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-500);
}

.settings-item.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.settings-item.is-disabled:hover {
    background: var(--surface-2);
}

.settings-tabs {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: var(--surface-1);
    border-radius: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.settings-tab-btn {
    flex: 1 1 160px;
    border: none;
    background: transparent;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.settings-tab-btn:hover {
    background: var(--surface-0);
    color: var(--ink-700);
}

.settings-tab-btn:hover {
    background: var(--surface-0);
    color: var(--ink-700);
}

.settings-tab-btn.active {
    background: var(--surface-0);
    color: var(--primary-600);
}

.settings-tab-panel {
    display: none;
}

.settings-tab-panel.active {
    display: block;
}

.personal-avatar-row {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.personal-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--ink-500);
}

.personal-actions {
    flex: 1;
    display: flex;
    gap: 10px;
}

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.session-card {
    background: var(--surface-2);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.session-card-left {
    min-width: 0;
}

.session-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink-700);
}

.session-sub {
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--ink-500);
    line-height: 1.35;
    word-break: break-word;
}

.session-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    flex: 0 0 150px;
}

.session-pill {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary-600);
}

.btn-compact {
    padding: 10px 12px;
    border-radius: 10px;
    width: 100%;
    border: 1px solid var(--glass-border);
    background: var(--surface-0);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.btn-compact:hover {
    background: var(--surface-1);
}

.btn-compact.danger {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.btn-compact.danger:hover {
    background: rgba(239, 68, 68, 0.16);
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font-size: 0.95rem;
    background: var(--surface-1);
    transition: border-color 0.2s;
}

.input-with-toggle {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-toggle .form-input {
    padding-right: 46px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--surface-1);
    color: var(--ink-500);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-password:hover {
    background: var(--surface-0);
    color: var(--ink-700);
}

.toggle-password.is-active {
    color: var(--primary-600);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-500);
}

.form-input:disabled,
.form-input[readonly] {
    background: var(--surface-2);
    color: var(--ink-500);
    cursor: default;
}

.btn-session-action {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--glass-border);
    background: var(--surface-2);
    color: var(--ink-600);
}

.btn-session-action:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-600);
    border-color: rgba(239, 68, 68, 0.3);
}



.btn-primary {
    width: 100%;
    padding: 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--primary-500);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-secondary {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: var(--surface-1);
    color: var(--ink-700);
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    /* Default outside modal actions */
}

.verification-code {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
    position: relative;
}

@media (max-width: 480px) {
    .verification-code {
        gap: 4px;
    }
}

.verification-code .code-box {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    line-height: 52px;
    border: 2px solid rgba(15, 23, 42, 0.15);
    background: white;
    color: var(--ink-900);
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: text;
}

@media (max-width: 480px) {
    .verification-code .code-box {
        width: 40px;
        height: 48px;
        font-size: 20px;
        line-height: 44px;
    }
}

.verification-code.focused .code-box {
    border-color: rgba(15, 23, 42, 0.25);
}

.verification-code .code-box.active {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.verification-hidden-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    left: -10000px;
}

/* Skeleton Loading */
.skeleton {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    animation: skeleton-pulse 1.5s infinite ease-in-out;
}

@keyframes skeleton-pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    background: rgba(255, 255, 255, 0.08);
}

.skeleton-text.short {
    width: 40%;
}

.skeleton-text.medium {
    width: 70%;
}

.skeleton-text.long {
    width: 90%;
}

.skeleton-card {
    height: 80px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.skeleton-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Toggle Switch */
.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked+.toggle-slider {
    background: var(--primary-500);
}

input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

.verification-code input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.18);
    outline: none;
}

/* Top Bar Notification */
.top-bar-notification {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translate(-50%, -20px) scale(0.95);
    width: auto;
    min-width: 320px;
    max-width: 90%;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    z-index: 10001;
    pointer-events: none;
}

.top-bar-notification.active {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.top-bar-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    line-height: 1.4;
    padding: 12px 32px;
    transition: opacity 0.3s;
}

.top-bar-skeleton {
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 300px;
    margin: 0 auto;
    transition: opacity 0.3s;
}

.top-bar-skeleton .skel {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    animation: skel-pulse 1.5s infinite ease-in-out;
}

@keyframes skel-pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

@media (max-width: 767px) {
    .top-bar-content {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        padding: 16px 24px;
    }
}

.top-bar-close {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

@media (max-width: 767px) {
    .top-bar-close {
        top: 8px;
        transform: none;
    }
}

.top-bar-close:hover {
    opacity: 1;
}

.top-bar-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 5px 14px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

/* ── Notification Center ── */
.notification-center {
    position: relative;
}

.btn-notification {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-notification:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
    transform: scale(1.08);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 480px;
    background: var(--surface-1);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px);
    z-index: 9998;
    overflow: hidden;
    animation: dropdownIn 0.2s ease;
}

.notification-dropdown.open {
    display: flex;
    flex-direction: column;
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notification-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.notification-dropdown-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.notif-clear-btn {
    background: none;
    border: none;
    color: var(--primary-500);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.notif-clear-btn:hover {
    background: var(--glass-bg);
}

.notification-list {
    overflow-y: auto;
    max-height: 400px;
    padding: 8px;
}

.notification-list::-webkit-scrollbar {
    width: 4px;
}

.notification-list::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 2px;
}

.notification-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    opacity: 0.7;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}

.notif-item:hover {
    background: var(--glass-bg);
}

.notif-item.unread {
    background: rgba(20, 184, 166, 0.06);
    border-left-color: var(--primary-500);
}

.notif-item.type-error {
    border-left-color: #ef4444;
}

.notif-item.type-warning {
    border-left-color: #f59e0b;
}

.notif-item.type-success {
    border-left-color: #22c55e;
}

.notif-item.type-info {
    border-left-color: var(--primary-500);
}

.notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.notif-icon.info {
    background: rgba(20, 184, 166, 0.15);
    color: var(--primary-500);
}

.notif-icon.success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.notif-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.notif-icon.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.notif-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-time {
    font-size: 0.68rem;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-top: 4px;
}

/* Panel badge counters */
.panel-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    padding: 0 5px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    z-index: 10;
}

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--surface-1);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-500);
    animation: toastIn 0.3s ease;
    cursor: pointer;
}

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

.toast.error {
    border-left-color: var(--danger-500);
}

.toast.warning {
    border-left-color: var(--warning-500);
}

.toast.hiding {
    animation: toastOut 0.3s ease forwards;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-500);
}

.toast.error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-500);
}

.toast.warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-500);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.85rem;
    color: var(--ink-500);
}

@keyframes toastIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Password Form Styles */

.password-requirements {
    margin-top: 12px;
    padding: 12px;
    background: var(--surface-2);
    border-radius: 8px;
    font-size: 0.8rem;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    color: var(--ink-500);
}

.password-requirements li.valid {
    color: var(--success-500);
}

.password-requirements li svg {
    width: 14px;
    height: 14px;
}

/* 2FA Setup Styles */
/* 2FA flow: same proportions and padding as Account settings content */
.tfa-flow-shell {
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface-0);
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tfa-flow-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--glass-border);
    background: var(--surface-1);
    flex-shrink: 0;
}

.tfa-flow-header h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink-900);
}

.tfa-flow-header p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ink-500);
}

.tfa-flow-body {
    padding: 24px;
    background: var(--surface-0);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.tfa-flow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.tfa-flow-grid-totp {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 640px) {
    .tfa-flow-grid-totp {
        grid-template-columns: 1fr;
    }
}

.tfa-step-card {
    border: 1px solid var(--line-200);
    border-radius: 16px;
    padding: 20px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tfa-step-card-setup {
    padding: 22px;
}

.tfa-step-card.is-accent {
    border-color: rgba(20, 184, 166, 0.4);
    background: linear-gradient(160deg, rgba(240, 253, 250, 0.95), #ffffff);
    box-shadow: 0 1px 3px rgba(20, 184, 166, 0.08);
}

.tfa-step-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-500);
    margin-bottom: 10px;
}

.tfa-step-card h5 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-900);
    line-height: 1.35;
}

.tfa-qr-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid var(--line-200);
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
    min-height: 220px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tfa-qr {
    width: 100%;
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
    background: #fff;
}

.tfa-qr-fallback {
    text-align: center;
    font-size: 13px;
    color: var(--ink-500);
    line-height: 1.5;
}

.tfa-qr-fallback-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--ink-400);
    font-size: 22px;
    font-weight: 600;
}

.tfa-qr-fallback p {
    margin: 0 0 4px;
}

.tfa-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    text-align: center;
}

.tfa-divider::before,
.tfa-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line-200);
}

.tfa-divider span {
    padding: 0 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-500);
    text-transform: lowercase;
}

.tfa-secret-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tfa-secret-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line-200);
    background: #fff;
}

.tfa-secret-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--ink-900);
    min-width: 0;
    word-break: break-all;
}

.tfa-secret-actions {
    display: flex;
    gap: 8px;
}

.tfa-secret-copy {
    flex-shrink: 0;
    border: 1px solid var(--line-200);
    background: var(--surface-2);
    color: var(--ink-700);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tfa-cred-edit {
    border: 1px solid var(--glass-border);
    background: var(--surface-2);
    color: var(--ink-700);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 8px;
}

.tfa-cred-edit:hover {
    background: var(--surface-0);
}

.tfa-secret-copy:hover {
    background: var(--surface-0);
}

.tfa-secret-copy:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tfa-secret-meta {
    display: grid;
    gap: 8px;
}

.tfa-kv {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--surface-2);
    font-size: 0.75rem;
    color: var(--ink-600);
}

.tfa-kv strong {
    color: var(--ink-900);
    font-weight: 600;
}

.tfa-secret {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    padding: 8px 10px;
    margin-top: 10px;
    border-radius: 8px;
    border: 1px dashed var(--line-200);
    background: #fff;
    word-break: break-all;
}

.tfa-flow-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.tfa-flow-actions .btn-primary,
.tfa-flow-actions .btn-secondary {
    width: auto;
    flex: 1 1 140px;
    margin-top: 0;
}

.tfa-flow-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-top: 16px;
}

.tfa-flow-hint {
    margin-top: 12px;
    font-size: 13px;
    color: var(--ink-500);
    line-height: 1.5;
}

.tfa-flow-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-600);
    font-size: 14px;
}

.tfa-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--line-200);
    border-top-color: var(--primary-500);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes tfaSuccessPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    60% {
        transform: scale(1.15);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.tfa-flow-note {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.18);
    background: rgba(59, 130, 246, 0.08);
    color: var(--ink-700);
    font-size: 13px;
}

.tfa-tip-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--ink-600);
}

.tfa-tip-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.tfa-tip-list li::before {
    content: '\2022';
    color: var(--primary-500);
    font-size: 1rem;
    line-height: 1;
}

.tfa-credentials {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.tfa-cred-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--line-200);
    background: var(--surface-1);
    transition: all 0.2s ease;
}

.tfa-cred-item:hover {
    border-color: var(--primary-400);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.1);
}

.tfa-cred-item.forced {
    flex-wrap: wrap;
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.02);
}

.tfa-forced-notice {
    width: 100%;
    margin-top: 4px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--accent-500);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.tfa-forced-notice svg {
    flex-shrink: 0;
}

.tfa-cred-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(59, 130, 246, 0.08));
    color: var(--primary-600);
    flex-shrink: 0;
}

.tfa-cred-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.tfa-cred-title {
    font-weight: 600;
    color: var(--ink-900);
    font-size: 0.95rem;
}

.tfa-cred-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.tfa-cred-sub {
    font-size: 0.75rem;
    color: var(--ink-500);
}

.tfa-cred-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tfa-cred-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.15), rgba(59, 130, 246, 0.12));
    color: var(--primary-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tfa-cred-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line-200);
    background: var(--surface-1);
    color: var(--ink-500);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tfa-cred-btn:hover {
    background: var(--surface-2);
    color: var(--ink-700);
}

.tfa-cred-btn.tfa-cred-remove:hover {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger-500);
}

.tfa-cred-btn.tfa-cred-rename:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-500);
}

.tfa-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.tfa-empty-icon {
    color: var(--ink-400);
    margin-bottom: 16px;
    opacity: 0.6;
}

.tfa-empty-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink-700);
    margin-bottom: 6px;
}

.tfa-empty-hint {
    font-size: 0.85rem;
    color: var(--ink-500);
}

.tfa-empty {
    font-size: 0.8rem;
    color: var(--ink-500);
    padding: 6px 0;
}

/* Animated Background */
.bg-effects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bg-effects::before,
.bg-effects::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
}

.bg-effects::before {
    background: rgba(13, 148, 136, 0.18);
    top: -200px;
    left: -100px;
    animation: float 20s ease-in-out infinite;
}

.bg-effects::after {
    background: rgba(37, 99, 235, 0.15);
    bottom: -220px;
    right: -120px;
    animation: float 25s ease-in-out infinite reverse;
}

#bootOverlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: var(--surface-0);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 18px;
}

#bootOverlay.hidden {
    display: none;
}

.boot-shell {
    width: min(1100px, 100%);
}

.boot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.20);
    box-shadow: 0 12px 32px rgba(2, 6, 23, 0.06);
}

.boot-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.boot-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.boot-space {
    height: 16px;
}

.boot-title {
    margin-top: 14px;
    padding: 0 6px;
}

.boot-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    margin-top: 18px;
}

@media (min-width: 768px) {
    .boot-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .boot-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.skel {
    position: relative;
    overflow: hidden;
    background: rgba(226, 232, 240, 0.75);
}

.skel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(226, 232, 240, 0) 0%, rgba(248, 250, 252, 0.75) 50%, rgba(226, 232, 240, 0) 100%);
    transform: translateX(-100%);
    animation: bootShimmer 1.25s ease-in-out infinite;
}

@keyframes bootShimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.skel-circle {
    width: 40px;
    height: 40px;
    border-radius: 999px;
}

.skel-pill {
    height: 14px;
    width: 120px;
    border-radius: 999px;
}

.skel-btn {
    height: 38px;
    width: 92px;
    border-radius: 12px;
}

.skel-line {
    height: 14px;
    width: 280px;
    border-radius: 999px;
}

.skel-card {
    height: 150px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(100px, 50px);
    }
}

/* Login Screen */
.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    animation: fadeIn 0.5s ease-out;
}

.login-container {
    text-align: center;
    padding: 60px;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.5);
    animation: slideUpFade 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    width: 88px;
    height: 88px;
    border-radius: 26px;
    background: linear-gradient(135deg, var(--primary-500), #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 32px;
    box-shadow: 0 20px 60px rgba(13, 148, 136, 0.3);
    position: relative;
}

.login-logo::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--primary-500), #2563eb);
    opacity: 0.4;
    filter: blur(12px);
    z-index: -1;
}

.login-logo svg {
    width: 44px;
    height: 44px;
    color: #fff;
}

.login-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: #94a3b8;
    margin-bottom: 48px;
    font-size: 1.05rem;
    line-height: 1.5;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 18px 32px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(13, 148, 136, 0.2);
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(13, 148, 136, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

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

.login-btn svg {
    width: 24px;
    height: 24px;
}

/* Welcome Animation */
.welcome-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    background: var(--dark-950);
    opacity: 0;
}

.welcome-overlay.active {
    display: flex;
    animation: fadeIn 0.5s ease forwards;
}

.welcome-overlay.hiding {
    animation: fadeOut 0.8s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.welcome-content {
    text-align: center;
    transform: scale(0.8);
    opacity: 0;
    animation: welcomeIn 0.8s ease 0.3s forwards;
}

@keyframes welcomeIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.welcome-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 32px;
    font-size: 3rem;
    font-weight: 700;
    box-shadow: 0 0 80px rgba(139, 92, 246, 0.6);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 60px rgba(139, 92, 246, 0.5);
    }

    50% {
        box-shadow: 0 0 100px rgba(139, 92, 246, 0.8);
    }
}

.welcome-text {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.welcome-name {
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
}

/* Main App - Hidden by default */
.app-container {
    display: block;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    opacity: 1;
    pointer-events: auto;
}

.app-container.visible {
    animation: slideUp 0.8s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Surface / Glass Effect */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navigation */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(248, 250, 252, 0.9);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(15, 118, 110, 0.25);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink-900);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.96);
    }
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--surface-1);
    border: 1px solid var(--glass-border);
    cursor: default;
    transition: all 0.2s;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: #fff;
}

.user-info {
    display: none;
}

@media (min-width: 768px) {
    .user-info {
        display: block;
        text-align: left;
    }

    .user-email {
        font-size: 0.75rem;
        color: var(--ink-500);
    }

    .user-session-meta {
        margin-top: 2px;
        font-size: 0.7rem;
        color: var(--ink-400);
    }
}

.btn-settings {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    color: var(--ink-700);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-settings svg {
    width: 20px;
    height: 20px;
}

.btn-settings:hover {
    background: var(--surface-0);
    color: var(--primary-500);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: var(--danger-500);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.btn-logout svg {
    width: 18px;
    height: 18px;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Dashboard Header */
.dashboard-header {
    padding: 48px 0 32px;
}

.header-grid {
    display: grid;
    gap: 24px;
    align-items: center;
}

@media (min-width: 1024px) {
    .header-grid {
        grid-template-columns: 1.4fr 0.9fr;
    }
}

.greeting {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--ink-500);
    margin-bottom: 8px;
}

.dashboard-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--ink-900);
}

.hero-subtitle {
    margin-top: 12px;
    font-size: 1rem;
    color: var(--ink-500);
    max-width: 560px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.session-card {
    padding: 24px;
    border-radius: 20px;
    display: grid;
    gap: 12px;
}

.session-title {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-500);
}

.session-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-size: 0.95rem;
}

.session-row span {
    color: var(--ink-500);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    padding: 24px;
    border-radius: 20px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.purple {
    background: rgba(13, 148, 136, 0.2);
    color: var(--primary-600);
}

.stat-icon.green {
    background: rgba(22, 163, 74, 0.2);
    color: var(--success-500);
}

.stat-icon.blue {
    background: rgba(37, 99, 235, 0.2);
    color: var(--accent-500);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-500);
}

.stat-value {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--ink-900);
}

.section-description {
    color: var(--ink-500);
    font-size: 0.95rem;
}

/* Services Grid */
.services-section {
    margin-bottom: 48px;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding-bottom: 20px;
}

@media (min-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px;
    border-radius: 24px;
    text-decoration: none;
    transition: all 0.3s;
    overflow: hidden;
    min-height: 180px;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
}

.service-card[role="button"] {
    cursor: pointer;
}

.service-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    width: 100%;
    min-height: 56px;
}

.service-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    line-height: 0;
    transition: transform 0.3s;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.service-icon svg {
    width: 28px;
    height: 28px;
    display: block;
    margin: auto;
    flex-shrink: 0;
}

.service-icon.purple {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.15), rgba(13, 148, 136, 0.25));
    color: var(--primary-600);
}

.service-icon.blue {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(37, 99, 235, 0.25));
    color: var(--accent-500);
}

.service-icon.green {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.15), rgba(22, 163, 74, 0.25));
    color: var(--success-500);
}

.service-icon.orange {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.25));
    color: var(--warning-500);
}

.service-icon.cyan {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.25));
    color: #06b6d4; /* cyan-500 */
}

.service-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
}

.service-status.online {
    background: rgba(22, 163, 74, 0.12);
    color: var(--success-500);
}

.service-status.offline {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger-500);
}

.service-status.checking {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning-500);
}

.service-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

.service-status.checking .service-status-dot {
    animation: pulse 1.5s infinite;
}

.service-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink-900);
    margin-bottom: 8px;
    text-align: center;
}

.service-desc {
    font-size: 0.875rem;
    color: var(--ink-500);
    margin-bottom: 16px;
    text-align: center;
}

.service-url {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--ink-500);
}

.service-url svg {
    width: 14px;
    height: 14px;
}

/* Activity Section */
.activity-section {
    margin-bottom: 48px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 16px;
}

.activity-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon svg {
    width: 22px;
    height: 22px;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.activity-time {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}


/* Mobile */
@media (max-width: 640px) {
    .nav-right {
        gap: 8px;
    }

    .dashboard-title {
        font-size: 1.8rem;
    }

    .tfa-flow-body {
        padding: 16px;
    }

    .tfa-flow-grid {
        grid-template-columns: 1fr;
    }

    .tfa-secret-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .tfa-secret-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

.tfa-credential-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ink-200);
    border-radius: 8px;
    margin-bottom: 8px;
}

.tfa-credential-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tfa-credential-label {
    font-weight: 600;
    color: var(--ink-800);
}

.tfa-credential-meta {
    font-size: 11px;
    color: var(--ink-400);
}

.tfa-credential-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-sm {
    padding: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ink-200);
    color: var(--ink-500);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-sm:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ink-800);
}

.btn-icon-sm.danger:hover {
    background: rgba(255, 71, 71, 0.1);
    color: #ff4747;
    border-color: rgba(255, 71, 71, 0.2);
}

.tfa-empty-state {
    padding: 28px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.06), rgba(59, 130, 246, 0.04));
    border: 1px dashed var(--line-200);
    border-radius: 18px;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .nav-content {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        padding: 12px 0;
    }

    .nav-content .logo {
        width: 100%;
        justify-content: center;
    }

    .nav-content .logo-icon {
        width: 36px;
        height: 36px;
    }

    .nav-content .logo-icon svg {
        width: 20px;
        height: 20px;
    }

    .nav-content .nav-right {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    #sessionTimerBlock {
        display: none !important;
    }

    .user-area {
        gap: 8px;
    }

    .user-area .user-info .user-name {
        font-size: 0.8rem;
    }

    .user-area .user-info .user-email {
        font-size: 0.65rem;
    }

    #settingsBtn {
        width: 32px;
        height: 32px;
    }

    #logoutBtn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .greeting {
        font-size: 1rem;
        padding: 12px 16px 0;
        text-align: center;
    }

    .services-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 16px !important;
    }

    .service-card {
        padding: 16px;
    }

    .modal-overlay .modal {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh;
        margin: 5vh auto;
    }

    .settings-tabs {
        flex-wrap: wrap;
        gap: 4px;
    }

    .settings-tab-btn {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    .session-card {
        padding: 10px 12px !important;
    }

    .session-card div[style*="margin-left:32px"] {
        margin-left: 16px !important;
    }
}

@media (max-width: 480px) {
    .nav-content {
        padding: 10px 12px;
    }

    .services-grid {
        grid-template-columns: 1fr !important;
        padding: 12px !important;
    }

    .modal-overlay .modal {
        width: 98vw !important;
        max-height: 95vh;
    }

    .user-area .user-info {
        display: none;
    }
}

/* Classic Session Timer UI (Restored) */
.session-timer-block {
    display: none;
    margin-left: 24px;
    padding: 8px 14px;
    background: var(--surface-2);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    font-size: 0.78rem;
    color: var(--ink-500);
    align-items: center;
}

@media (max-width: 767px) {
    .nav-content .session-timer-block {
        display: none !important;
    }

    .mobile-only-timer {
        display: flex !important;
        background: rgba(15, 23, 42, 0.03) !important;
        padding: 12px 16px !important;
        border-radius: 16px !important;
        border: 1px solid var(--glass-border) !important;
    }
}

.timer-val-container {
    font-weight: 600;
    color: var(--ink-700);
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1px;
}

.timer-part {
    display: inline-block;
    transition: color 0.3s ease;
}

.timer-part.updating {
    animation: timer-tick-fade 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes timer-tick-fade {
    0% {
        opacity: 0.86;
        transform: translateY(-0.4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.timer-skeleton {
    display: inline-block;
    height: 12px;
    width: 48px;
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-1) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: timer-skeleton-pulse 1.5s infinite linear;
    border-radius: 4px;
    vertical-align: middle;
}

@keyframes timer-skeleton-pulse {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}