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

:root {
    --bg-main: #f4f7fe;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-primary: #4318ff;
    --accent-primary-hover: #3311db;
    --success: #059669;
    --danger: #e11d48;
    --border-color: #e2e8f0;
    --glass-blur: blur(0px);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.dashboard-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.brand-logo {
    width: 40px;
    height: auto;
}

.brand h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--accent-primary), #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.nav-item:hover, .nav-item.active {
    background: rgba(67, 24, 255, 0.08);
    color: var(--accent-primary);
}

.nav-item .material-icons-outlined {
    font-size: 1.25rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f1f5f9;
    border-radius: 0.75rem;
    margin-top: auto;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info p {
    font-size: 0.875rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    color: var(--text-secondary);
    font-size: 0.75rem !important;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 2rem;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    width: 400px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(112, 144, 176, 0.05);
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(67, 24, 255, 0.2);
}

.search-icon {
    color: var(--text-secondary);
    margin-right: 0.75rem;
}

#searchInput {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 10px rgba(112, 144, 176, 0.05);
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.badge {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

.profile-img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--accent-primary);
}

.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(112, 144, 176, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(112, 144, 176, 0.15);
}

.stat-card {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.revenue { background: rgba(5, 150, 105, 0.1); color: var(--success); }
.stat-icon.leads { background: rgba(67, 24, 255, 0.1); color: var(--accent-primary); }
.stat-icon.conversion { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.stat-icon.deals { background: rgba(236, 72, 153, 0.1); color: #db2777; }

.stat-details h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-trend {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
}

.stat-trend.positive { color: var(--success); }
.stat-trend.negative { color: var(--danger); }

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.card-header h2 {
    font-weight: 600;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(67, 24, 255, 0.2);
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    box-shadow: 0 6px 16px rgba(67, 24, 255, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #f1f5f9;
}

.chart-container {
    height: 300px;
    width: 100%;
}

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

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

.data-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active { background: rgba(5, 150, 105, 0.1); color: var(--success); }
.status-pending { background: rgba(245, 158, 11, 0.1); color: #d97706; }

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
}

.action-btn:hover {
    color: var(--accent-primary);
}

/* Forms & Modals */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--accent-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(67, 24, 255, 0.1);
}

.form-group select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 450px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        z-index: 100;
    }
    .search-bar {
        width: 250px;
    }
}

/* --- Login Split Screen --- */
.login-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    z-index: 9999;
    background: var(--bg-main);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.login-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
}
.login-visual {
    flex: 1.2;
    background: linear-gradient(-45deg, #0f172a, #1e3a8a, #4f46e5, #0f172a);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.glass-circles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}
.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
}
.c1 {
    width: 400px;
    height: 400px;
    background: #3b82f6;
    top: -100px;
    left: -100px;
    animation: float 10s ease-in-out infinite;
}
.c2 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    bottom: -50px;
    right: -50px;
    animation: float 12s ease-in-out infinite reverse;
}
.c3 {
    width: 250px;
    height: 250px;
    background: #10b981;
    top: 40%;
    left: 30%;
    animation: float 8s ease-in-out infinite 2s;
}
@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-50px) rotate(10deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}
.visual-content {
    position: relative;
    z-index: 2;
    text-align: left;
    color: white;
    padding: 4rem;
    max-width: 650px;
}
.visual-content h1 {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -1.5px;
    line-height: 1.1;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.visual-content p {
    font-size: 1.25rem;
    opacity: 0.95;
    line-height: 1.7;
    font-weight: 300;
}
.login-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    box-shadow: -20px 0 50px rgba(0,0,0,0.05);
    z-index: 10;
    border-left: 1px solid var(--border-light);
}
.login-form-box {
    width: 100%;
    max-width: 440px;
    padding: 3rem;
    animation: slideUpFade 0.8s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}
@keyframes slideUpFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.login-form-box .form-group input {
    padding: 1.25rem;
    font-size: 1.05rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 0.75rem;
    transition: all 0.3s;
    margin-top: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    caret-color: var(--accent-primary);
}
.login-form-box .form-group input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
    box-shadow: 0 0 0 4px rgba(67, 24, 255, 0.15);
    outline: none;
}
.login-form-box .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
}
@media (max-width: 900px) {
    .login-visual { display: none; }
    .login-form-container { border-left: none; }
}

/* --- Cool Auth Loader --- */
.auth-loader {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(15px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.auth-loader.hidden {
    opacity: 0;
    visibility: hidden;
}
.loader-content {
    text-align: center;
    color: white;
}
.loader-logo {
    width: 90px;
    height: 90px;
    margin-bottom: 2rem;
    animation: pulseGlow 1.2s infinite alternate ease-in-out;
}
@keyframes pulseGlow {
    from { filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.4)); transform: scale(0.95); }
    to { filter: drop-shadow(0 0 35px rgba(59, 130, 246, 1)); transform: scale(1.08); }
}
.loader-content h3 {
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
    color: #f1f5f9;
}
.loader-bar {
    width: 240px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}
.loader-progress {
    width: 30%;
    height: 100%;
    background: var(--accent-primary);
    border-radius: 4px;
    animation: loadingBar 1.2s ease-in-out infinite;
}
@keyframes loadingBar {
    0% { transform: translateX(-150%); }
    50% { width: 50%; }
    100% { transform: translateX(350%); }
}

@media (max-width: 768px) {
    body > * {
        display: none !important;
    }
    body::before {
        content: "Access Restricted. Please access this site from a PC.";
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        width: 100vw;
        background-color: #0f172a;
        color: #fff;
        font-family: 'Outfit', sans-serif;
        font-size: 1.5rem;
        text-align: center;
        padding: 2rem;
        box-sizing: border-box;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 9999999;
    }
}
