@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --accent: #8b5cf6;
    --bg-base: #09090b;
    --bg-card: rgba(24, 24, 27, 0.7);
    --bg-card-hover: rgba(39, 39, 42, 0.8);
    --border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #a1a1aa;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --sidebar-w: 280px;
    --glass-blur: blur(16px);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.12) 0%, transparent 50%);
    background-attachment: fixed;
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.w-100 { width: 100%; }
.font-medium { font-weight: 500; }
.max-w-lg { max-width: 600px; }
.max-w-xl { max-width: 800px; }

/* AUTHENTICATION SCREEN */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    padding: 3rem;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    color: #fff;
    font-size: 1.5rem;
}
.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.error-text {
    color: var(--danger);
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.5rem;
    border-radius: 8px;
}

/* DASHBOARD LAYOUT */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.sidebar-header svg {
    color: var(--primary);
}

.nav-menu {
    list-style: none;
    flex: 1;
    padding: 1rem 1rem;
}

.nav-menu li {
    padding: 0.85rem 1.25rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    border-radius: 12px;
}

.nav-menu li:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}

.nav-menu li.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.sidebar-footer {
    padding: 1.5rem;
}

.main-content {
    flex: 1;
    padding: 2.5rem 3rem;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
}
.content-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.content-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* CARDS & TABLES */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
    transition: transform 0.2s, border-color 0.2s;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

tbody tr {
    transition: background 0.2s;
}
tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

/* BUTTONS */
button {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0.75rem 1.5rem;
}
.btn-primary { 
    background: linear-gradient(135deg, var(--primary), var(--accent)); 
    color: white; 
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover { 
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-danger { 
    background: rgba(239, 68, 68, 0.1); 
    color: var(--danger); 
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover { 
    background: var(--danger); 
    color: white; 
}

.btn-secondary { 
    background: rgba(255, 255, 255, 0.05); 
    color: var(--text-main); 
    border: 1px solid var(--border);
}
.btn-secondary:hover { 
    background: rgba(255, 255, 255, 0.1); 
}

.btn-logout {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.btn-logout:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

/* FORMS */
.form-group {
    margin-bottom: 1.5rem;
}
.form-row {
    display: flex;
    gap: 1.5rem;
}
.form-row .form-group { flex: 1; }

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #e2e8f0;
    font-weight: 500;
}

input, textarea, select {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

select option {
    background: var(--bg-base);
    color: var(--text-main);
}

/* MODALS */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
}

.modal-content {
    background: #18181b;
    margin: 8vh auto;
    width: 90%;
    max-width: 480px;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.7);
    animation: modalScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

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

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h2 { font-size: 1.3rem; }

.modal-body {
    padding: 2rem;
}

.close {
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
}
.close:hover { color: white; }

.qr-container {
    background: rgba(255,255,255,0.05);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px dashed var(--border);
}
.qr-container img {
    margin: 1rem auto;
    border-radius: 8px;
    border: 4px solid white;
    width: 200px;
    height: 200px;
}

/* BADGES */
.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    display: inline-block;
}
.badge-success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-pending { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: #f87171; }
.badge-info { background: rgba(99, 102, 241, 0.1); border: 1px solid rgba(99, 102, 241, 0.2); color: #818cf8; }

/* TOAST */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
    z-index: 2000;
    font-weight: 500;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(0);
}
.toast.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* CODE BLOCK */
.code-block {
    background: #000;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: #a1a1aa;
    position: relative;
    margin-bottom: 1rem;
}
.code-block code {
    white-space: pre;
}
