
:root {
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --bg-primary: #06060b;
    --bg-secondary: #0d0d14;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-input: rgba(255, 255, 255, 0.05);
    --bg-input-focus: rgba(255, 255, 255, 0.08);
    --bg-overlay: rgba(0, 0, 0, 0.7);
    --bg-toast: rgba(20, 20, 30, 0.95);
    --border: rgba(255, 255, 255, 0.06);
    --border-focus: rgba(99, 102, 241, 0.5);
    --border-input: rgba(255, 255, 255, 0.1);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
    --gradient-hover: linear-gradient(135deg, #818cf8, #a78bfa, #c4b5fd);
    --gradient-text: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px var(--accent-glow);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --spring: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-input: rgba(0, 0, 0, 0.03);
    --bg-input-focus: rgba(0, 0, 0, 0.05);
    --bg-overlay: rgba(0, 0, 0, 0.4);
    --bg-toast: rgba(255, 255, 255, 0.95);
    --border: rgba(0, 0, 0, 0.08);
    --border-input: rgba(0, 0, 0, 0.12);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #f8fafc;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background var(--transition-slow), color var(--transition-slow);
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-primary);
}

.bg-mesh::before,
.bg-mesh::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    will-change: transform;
    transform: translateZ(0);
    contain: strict;
}

.bg-mesh::before {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12), transparent 70%);
    top: -250px;
    right: -150px;
    animation: orbFloat1 25s ease-in-out infinite;
}

.bg-mesh::after {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08), transparent 70%);
    bottom: -200px;
    left: -150px;
    animation: orbFloat2 30s ease-in-out infinite;
}

.bg-mesh-extra {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.06), transparent 70%);
    top: 40%;
    left: 50%;
    filter: blur(100px);
    z-index: -1;
    animation: orbFloat3 20s ease-in-out infinite;
    pointer-events: none;
    will-change: transform;
    transform: translateZ(0);
    contain: strict;
}

[data-theme="light"] .bg-mesh::before { opacity: 0.3; }
[data-theme="light"] .bg-mesh::after { opacity: 0.2; }
[data-theme="light"] .bg-mesh-extra { opacity: 0.2; }

@keyframes orbFloat1 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    25% { transform: translate3d(50px, -60px, 0) scale(1.1); }
    50% { transform: translate3d(-30px, 40px, 0) scale(0.9); }
    75% { transform: translate3d(40px, 30px, 0) scale(1.05); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    33% { transform: translate3d(-40px, -50px, 0) scale(1.15); }
    66% { transform: translate3d(60px, 30px, 0) scale(0.85); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate3d(-50%, 0, 0) scale(1); }
    25% { transform: translate3d(-45%, -40px, 0) scale(1.1); }
    50% { transform: translate3d(-55%, 30px, 0) scale(0.9); }
    75% { transform: translate3d(-48%, -20px, 0) scale(1.05); }
}

.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.3;
    background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

[data-theme="light"] .bg-grid {
    background-image: radial-gradient(rgba(0,0,0,0.04) 1px, transparent 1px);
}


@media (max-width: 768px) {
    .bg-mesh::before { filter: blur(60px); width: 400px; height: 400px; }
    .bg-mesh::after { filter: blur(60px); width: 350px; height: 350px; }
    .bg-mesh-extra { filter: blur(60px); width: 300px; height: 300px; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.5); }
    70% { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes borderGlow {
    0%, 100% { border-color: rgba(99, 102, 241, 0.2); }
    50% { border-color: rgba(99, 102, 241, 0.5); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes fieldShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-4px); }
    30% { transform: translateX(4px); }
    45% { transform: translateX(-3px); }
    60% { transform: translateX(3px); }
    75% { transform: translateX(-1px); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(80px) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

.register-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.register-card {
    width: 100%;
    max-width: 640px;
    background: var(--bg-card);
    backdrop-filter: blur(40px) saturate(1.5);
    -webkit-backdrop-filter: blur(40px) saturate(1.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    position: relative;
    overflow: hidden;
    contain: layout style;
}

.register-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient);
    background-size: 200% auto;
    animation: gradientShift 4s ease-in-out infinite;
}

.register-card .logo {
    text-align: center;
    margin-bottom: 8px;
    animation: slideDown 0.6s ease both;
}

.register-card .logo h1 {
    font-size: 2.2rem;
    font-weight: 900;
    background: var(--gradient-text);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    animation: gradientShift 6s ease-in-out infinite;
}

.register-card .logo p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 4px;
}

.disclaimer {
    background: var(--warning-bg);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 20px 0 12px;
    font-size: 0.8rem;
    color: var(--warning);
    line-height: 1.5;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: fadeIn 0.5s ease both;
}

.disclaimer.danger {
    background: var(--danger-bg);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.disclaimer .icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

.form-group {
    margin-bottom: 20px;
    animation: slideUp 0.5s ease both;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color var(--transition);
}

.form-group:focus-within label {
    color: var(--accent);
}

.label-hint {
    color: var(--text-muted);
    font-weight: 400;
    text-transform: none;
    font-size: 0.75rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: all var(--transition);
    outline: none;
}

.form-input:focus,
.form-textarea:focus {
    background: var(--bg-input-focus);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-glow);
    transform: translateY(-1px);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.char-counter {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 4px;
    transition: color var(--transition);
}

.char-counter.ok { color: var(--success); }
.char-counter.warn { color: var(--warning); }

.links-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.link-row {
    display: flex;
    gap: 8px;
    animation: slideUp 0.3s ease both;
}

.link-row .form-input { flex: 1; }

.btn-remove-link {
    width: 40px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--danger-bg);
    color: var(--danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all var(--transition);
}

.btn-remove-link:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.05);
}

.btn-add-link {
    padding: 8px 16px;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.85rem;
    transition: all var(--transition);
}

.btn-add-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
    transform: translateY(-1px);
}

.btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.2), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
}

.btn:active::after { opacity: 1; }

.btn-primary {
    background: var(--gradient);
    background-size: 200% auto;
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    animation: gradientShift 4s ease infinite;
}

.btn-primary:hover {
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-input-focus);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    width: auto;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--bg-input);
    color: var(--text-primary);
    transform: scale(1.1);
}

.btn-group { display: flex; gap: 8px; }

.status-msg {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    display: none;
}

.status-msg.show {
    display: block;
    animation: slideUp 0.3s ease;
}

.status-msg.success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.status-msg.error { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }

.status-screen {
    text-align: center;
    padding: 30px 0;
}

.status-screen .status-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.status-screen h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.status-screen p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

.status-screen .reason-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: left;
    line-height: 1.6;
}

.status-screen .reason-box .reason-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.card-pending {
    animation: borderGlow 2s ease-in-out infinite;
}

.text-danger { color: var(--danger); }

.status-action-btn {
    margin-top: 20px;
    width: auto;
    padding: 12px 32px;
    display: inline-block;
}

.status-action-btn-link {
    margin-top: 20px;
    width: auto;
    padding: 14px 40px;
    display: inline-block;
    text-decoration: none;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-toggle button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition);
    box-shadow: var(--shadow);
}

.theme-toggle button:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: scale(1.1) rotate(15deg);
    box-shadow: var(--shadow-lg);
}

.pwd-strength {
    height: 3px;
    border-radius: 2px;
    background: var(--border);
    margin-top: 6px;
    overflow: hidden;
}

.pwd-strength-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background var(--transition);
    width: 0;
}

.form-input.invalid,
.form-textarea.invalid {
    border-color: var(--danger);
    background: var(--danger-bg);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15), 0 0 20px rgba(239, 68, 68, 0.08);
    animation: fieldShake 0.4s ease;
}

.form-input.invalid:focus,
.form-textarea.invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25), 0 0 30px rgba(239, 68, 68, 0.12);
}

.field-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 4px;
    min-height: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: all 0.25s ease;
    font-weight: 500;
    line-height: 1.4;
}

.field-error.show {
    max-height: 40px;
    opacity: 1;
    margin-top: 6px;
}

.already-registered {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    animation: fadeIn 0.5s ease both;
}

.already-registered a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    transition: all var(--transition);
    text-decoration: none;
}

.already-registered a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}

.copy-link-box {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    animation: slideUp 0.4s ease both;
    animation-delay: 0.2s;
}

.copy-link-url {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    word-break: break-all;
    border: 1px solid var(--border);
    text-align: center;
    user-select: all;
}

.copy-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 32px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.copy-link-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.5);
}

.copy-link-btn.copied {
    background: var(--success);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
    animation: none;
}

.copy-link-hint {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 12px;
    text-align: center;
    line-height: 1.5;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 900;
    background: var(--gradient-text);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease-in-out infinite;
}

.sidebar-header .role {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 16px;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: translateX(3px);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 2px;
    background: var(--accent);
}

.nav-item .icon { font-size: 1.1rem; width: 22px; text-align: center; }

.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

.sidebar-footer {
    padding: 16px 10px;
    border-top: 1px solid var(--border);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    max-width: 100%;
    transition: margin-left var(--transition-slow);
    animation: fadeIn 0.3s ease;
}

.page-header {
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    animation: slideDown 0.4s ease;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    transition: all var(--transition);
    animation: slideUp 0.5s ease both;
    contain: layout style;
}

.card:hover { background: var(--bg-card-hover); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition);
    animation: slideUp 0.5s ease both;
    position: relative;
    overflow: hidden;
    contain: layout style;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.03) 50%, transparent 60%);
    transition: all 0.5s;
    transform: rotate(45deg) translateX(-100%);
}

.stat-card:hover::after { transform: rotate(45deg) translateX(0%); }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.2);
}

.stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 6px;
    font-weight: 600;
}

.stat-card.pending .stat-value { color: var(--warning); -webkit-text-fill-color: var(--warning); background: none; }
.stat-card.approved .stat-value { color: var(--success); -webkit-text-fill-color: var(--success); background: none; }
.stat-card.rejected .stat-value { color: var(--danger); -webkit-text-fill-color: var(--danger); background: none; }

.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    overflow-x: auto;
}

.filter-tab {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.filter-tab:hover { color: var(--text-primary); }

.filter-tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.app-list { display: flex; flex-direction: column; gap: 12px; }

.app-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    animation: slideUp 0.4s ease both;
    contain: layout style;
}

.app-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.15);
}

.app-item-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
}

.app-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.app-item:hover .app-item-avatar { transform: scale(1.1); }

.app-item-info { flex: 1; min-width: 0; }
.app-item-info .username { font-weight: 600; font-size: 0.95rem; }
.app-item-info .meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.app-item-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-pending { background: var(--warning-bg); color: var(--warning); }
.status-approved { background: var(--success-bg); color: var(--success); }
.status-rejected { background: var(--danger-bg); color: var(--danger); }

.app-item-body {
    padding: 0 20px 16px;
    display: none;
    animation: slideUp 0.3s ease;
}

.app-item-body.open { display: block; }

.app-item-body .about-text {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 14px;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.app-item-body .links-list { list-style: none; margin-bottom: 12px; }
.app-item-body .links-list li { padding: 4px 0; }
.app-item-body .links-list a { font-size: 0.85rem; word-break: break-all; }

.app-item-body .contact-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.app-item-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px 14px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    transition: background var(--transition);
}

.data-table tr:hover td { background: var(--bg-card-hover); }
.data-table tr:last-child td { border-bottom: none; }

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.profile-field {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    transition: all var(--transition);
}

.profile-field:hover {
    background: var(--bg-input-focus);
    transform: translateY(-1px);
}

.profile-field .field-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-field .field-value {
    font-size: 0.9rem;
    margin-top: 4px;
    word-break: break-all;
    font-weight: 500;
}

.profile-field .field-value.active { color: var(--success); }
.profile-field .field-value.inactive { color: var(--danger); }

.profile-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.device-list { display: flex; flex-direction: column; gap: 8px; }

.device-item {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition);
}

.device-item:hover { background: var(--bg-input-focus); }

.device-item .device-info { flex: 1; }
.device-item .device-name { font-size: 0.85rem; font-weight: 500; }
.device-item .device-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9) translateY(20px);
    transition: transform var(--spring);
}

.modal-overlay.open .modal {
    transform: scale(1) translateY(0);
}

.modal h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar .form-input { flex: 1; }

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-toast);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    max-width: 350px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.4s var(--spring);
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    backdrop-filter: blur(40px) saturate(1.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 36px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.7s var(--spring);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient);
    background-size: 200% auto;
    animation: gradientShift 4s ease-in-out infinite;
}

.login-card .logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .logo h1 {
    font-size: 1.8rem;
    font-weight: 900;
    background: var(--gradient-text);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease-in-out infinite;
}

.login-card .logo p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.totp-setup { text-align: center; }

.totp-setup .qr-code {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    display: inline-block;
    margin: 16px 0;
    box-shadow: var(--shadow);
}

.totp-setup .qr-code img { width: 200px; height: 200px; }

.totp-setup .secret-key {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: monospace;
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin: 12px 0;
    word-break: break-all;
    user-select: all;
}

.scroll-content {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 14px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    animation: fadeIn 0.5s ease;
}

.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-input-focus) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    display: none;
    backdrop-filter: blur(4px);
}

@media (max-width: 768px) {
    .register-card { padding: 32px 24px; border-radius: var(--radius-lg); }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0; padding: 20px 16px; }
    .mobile-menu-btn { display: flex; }
    .page-header h1 { font-size: 1.2rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-card .stat-value { font-size: 1.5rem; }
    .profile-grid { grid-template-columns: 1fr; }
    .profile-actions { grid-template-columns: 1fr; }
    .search-bar { flex-direction: column; }
    .app-item-header { padding: 12px 14px; gap: 12px; }
    .app-item-body { padding: 0 14px 14px; }
    .modal { padding: 20px; }
    .data-table { font-size: 0.75rem; }
    .data-table th, .data-table td { padding: 8px 10px; }
    .toast-container { top: auto; bottom: 20px; right: 10px; left: 10px; }
    .toast { max-width: 100%; }
    .login-card { padding: 36px 24px; }
}

@media (max-width: 360px) {
    .stats-grid { grid-template-columns: 1fr; }
    .btn-group { flex-direction: column; }
}

.hidden { display: none !important; }
