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

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #e0e7ff;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-main: #f8fafc;
    --bg-sidebar: #0f172a;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --sidebar-width: 280px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}


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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Encrypted field styling */
.encrypted {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    color: #92400e;
    background: #fef3c7;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85em;
    border: 1px solid #fde68a;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.badge-encrypted {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 0.6rem;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    font-weight: 800;
    margin-left: 8px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

/* Generic Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.btn-outline {
    background: white;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--bg-main);
    border-color: var(--secondary);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: #dc2626;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-top: 8px;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    padding: 32px 20px;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar h2 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
}

.sidebar h2 svg {
    color: var(--primary-light);
}

.nav-menu {
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.nav-link svg {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    color: #fca5a5;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    background-image: radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
                      radial-gradient(at 50% 0%, hsla(225,39%,30%,0.1) 0, transparent 50%);
}

.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit';
    font-size: 14px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 32px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: var(--primary-light);
    border-radius: 0 0 0 100%;
    opacity: 0.1;
    z-index: 0;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.stat-card.blue .stat-icon { background: #e0e7ff; color: #4f46e5; }
.stat-card.green .stat-icon { background: #dcfce7; color: #10b981; }
.stat-card.purple .stat-icon { background: #f3e8ff; color: #a855f7; }

.stat-info .stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.stat-info .stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    font-family: 'Outfit';
    margin-top: 4px;
}

/* Tables */
.table-wrapper {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

thead th {
    background: #f8fafc;
    padding: 16px 24px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

tbody td {
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: #f8fafc;
}

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.success { background: #dcfce7; color: #15803d; }
.status-badge.warning { background: #fef3c7; color: #b45309; }
.status-badge.danger { background: #fee2e2; color: #b91c1c; }

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b0e14;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 30%, rgba(79, 70, 229, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.1) 0%, transparent 40%),
                radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    animation: rotate 20s linear infinite;
    z-index: 0;
}

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

.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    padding: 56px;
    text-align: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-card h1 {
    color: white;
    margin-bottom: 8px;
    font-size: 2.25rem;
    letter-spacing: -0.02em;
}

.login-card p {
    color: #94a3b8;
    margin-bottom: 40px;
    font-size: 0.95rem;
}

.input-group-premium {
    position: relative;
    margin-bottom: 24px;
    text-align: left;
}

.input-group-premium label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 4px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    transition: color 0.2s;
}

.login-card input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 14px 16px 14px 48px;
    border-radius: 14px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-card input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
    outline: none;
}

.login-card input:focus + svg {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 1024px) {
    --sidebar-width: 80px;
    .sidebar h2 span, .nav-link span { display: none; }
    .sidebar h2 { justify-content: center; padding: 0; }
    .nav-link { justify-content: center; }
}

@media (max-width: 768px) {
    .main-content { padding: 20px; }
    .stats-grid { grid-template-columns: 1fr; }
}
