:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --error: #ef4444;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    overflow: hidden;
    position: relative;
}

/* Background Animated Blobs */
.blob {
    position: absolute;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.6;
    animation: drift 10s infinite alternate ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #8b5cf6;
    border-radius: 50%;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: #ec4899;
    border-radius: 50%;
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes drift {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(30px, 30px); }
}

/* Container & Glassmorphism */
.container {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    z-index: 1;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 5px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Alert Box */
.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.3s ease;
}

.alert.error { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.alert.success { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }

/* Forms */
.form { display: none; animation: fadeIn 0.4s ease forwards; }
.form.active { display: block; }

h2 { font-size: 1.8rem; margin-bottom: 8px; }
p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 24px; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Inputs */
.input-group {
    position: relative;
    margin-bottom: 24px;
}

.input-group input {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.input-group label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.3s ease;
    padding: 0 4px;
    font-size: 1rem;
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
    top: 0;
    font-size: 0.8rem;
    color: var(--primary);
    background: var(--card-bg);
}

/* Button */
.submit-btn {
    width: 100%;
    padding: 16px;
    border: none;
    background: linear-gradient(135deg, var(--primary), #ec4899);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.4);
}

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

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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

/* QR Box for MFA */
.qr-box {
    background: white;
    padding: 10px;
    border-radius: 12px;
    margin: 10px auto;
    width: fit-content;
    display: flex;
    justify-content: center;
}
.qr-box img, .qr-box svg {
    max-width: 200px;
    height: auto;
    display: block;
}

.hidden { display: none !important; }

/* Logged in view */
.success-text {
    color: var(--success);
    margin-bottom: 20px;
    text-align: center;
}

.token-box {
    background: rgba(0,0,0,0.3);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    word-break: break-all;
    font-size: 0.85rem;
    color: #a78bfa;
    border: 1px dashed rgba(139, 92, 246, 0.5);
}

.logout-btn {
    background: rgba(255,255,255,0.1);
}
.logout-btn:hover {
    background: rgba(255,255,255,0.2);
    box-shadow: none;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    z-index: 10;
    position: fixed;
    top: 0;
    left: 0;
}

.sidebar {
    width: 260px;
    background: var(--card-bg);
    border-right: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.brand h2 { margin-bottom: 40px; color: white; display: flex; align-items: center; gap: 8px;}
.brand span { color: var(--primary); }

.nav-menu { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s;
}
.nav-item.active, .nav-item:hover {
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: 80px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}
.primary-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }

.secondary-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}
.secondary-btn:hover { background: rgba(255,255,255,0.2); }

.content-area {
    padding: 40px;
    flex: 1;
    overflow-y: auto;
}

/* Table */
.table-container {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.data-table th {
    color: var(--text-muted);
    font-weight: 500;
    background: rgba(0,0,0,0.2);
}
.data-table tr:hover { background: rgba(255,255,255,0.02); }

.prod-img { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; }
.featured-badge { background: rgba(245, 158, 11, 0.2); color: #fbbf24; padding: 4px 8px; border-radius: 12px; font-size: 0.8rem; }
.action-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 6px; border-radius: 6px; transition: 0.2s;}
.action-btn:hover { color: white; background: rgba(255,255,255,0.1); }
.action-btn.del:hover { color: var(--error); background: rgba(239, 68, 68, 0.1); }

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.modal-content {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.close-btn { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.close-btn:hover { color: white; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 32px; }
.checkbox-group { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.file-group { margin-bottom: 24px; }
.file-group label { display: block; margin-bottom: 8px; color: var(--text-muted); }
.file-group input[type="file"] { background: rgba(0,0,0,0.2); padding: 12px; border-radius: 8px; width: 100%; color: white;}
#image-preview { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; margin-top: 12px; border: 1px solid rgba(255,255,255,0.1); }
