:root {
    --primary: #5e60ce;
    --secondary: #4ea8de;
    --background: #0b0c10;
    --surface: #1f2833;
    --text: #c5c6c7;
    --heading: #66fcf1;
    --accent: #45a29e;
    --error: #f28b82;
    --success: #81c995;
    --glass: rgba(31, 40, 51, 0.7);
    --border: rgba(102, 252, 241, 0.2);
}

[data-theme="light"] {
    --primary: #5e60ce;
    --secondary: #4ea8de;
    --background: #ffffff;
    --surface: #ffffff;
    --text: #334155;
    --heading: #0f172a;
    --accent: #3b82f6;
    --error: #ef4444;
    --success: #10b981;
    --glass: rgba(255, 255, 255, 0.6);
    --border: rgba(148, 163, 184, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading);
}

body::before {
    content: '';
    position: fixed;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(94, 96, 206, 0.15) 0%, transparent 70%);
    top: -20vh;
    left: -20vw;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(78, 168, 222, 0.15) 0%, transparent 70%);
    bottom: -20vh;
    right: -20vw;
    z-index: -1;
}

/* Login page centered layout */
body.page-login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

body.page-login .login-container {
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.8s ease;
}

body.page-login .split-right-header {
    text-align: center;
    margin-bottom: 2rem;
}

body.page-login .login-logo {
    max-height: 150px;
    max-width: 150px;
    height: 150px;
    width: 150px;
    margin-bottom: 1.5rem;
    border-radius: 50%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 0 0 4px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    object-fit: cover;
    border: 3px solid var(--heading);
    background: var(--surface);
}

body.page-login .login-logo:hover {
    transform: scale(1.08);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 0 0 6px rgba(255, 255, 255, 0.2);
    border-color: var(--accent);
}

body.page-login .split-right-header h1 {
    color: var(--heading);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(102, 252, 241, 0.4);
}

body.page-login .split-right-header p {
    color: var(--text);
    font-size: 0.95rem;
    opacity: 0.8;
    margin-bottom: 0;
}

.branding {
    text-align: center;
    z-index: 1;
    position: relative;
    animation: fadeInDown 0.8s ease;
}

.branding-logo {
    max-height: 80px;
    max-width: 200px;
    height: auto;
    width: auto;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.branding-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.branding h1 {
    color: var(--heading);
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(102, 252, 241, 0.4);
    line-height: 1.2;
}

.branding p {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 320px;
    margin: 0 auto;
}

.split-left .branding p {
    color: rgba(255,255,255,0.75);
}

.branding-badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
    z-index: 1;
    position: relative;
}

.branding-badge {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(102, 252, 241, 0.25);
    color: rgba(255,255,255,0.8);
    border-radius: 100px;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.split-right-header p {
    color: var(--text);
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 768px) {
    .split-layout { flex-direction: column; }
    .split-left { flex: 0 0 auto; padding: 3rem 2rem; min-height: 250px; }
    .split-right { padding: 2rem 1.5rem; overflow-y: auto; }
}

/* Login page full-screen lock (desktop only) */
body.page-login {
    overflow: hidden;
    height: 100vh;
}

body.page-login .split-layout {
    height: 100vh;
    max-height: 100vh;
}

body.page-login .split-left {
    height: 100vh;
    overflow: hidden;
}

body.page-login .split-right {
    height: 100vh;
    overflow-y: auto;
}

@media (max-width: 768px) {
    body.page-login {
        overflow: auto;
        height: auto;
    }
    body.page-login .split-layout {
        height: auto;
        max-height: none;
    }
    body.page-login .split-left,
    body.page-login .split-right {
        height: auto;
    }
}

.card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    animation: fadeInUp 0.8s ease;
}

@media (max-width: 480px) {
    .branding h1 { font-size: 2.2rem; }
    .card { padding: 1.5rem; }
}

.card h3 {
    color: var(--heading);
    margin-bottom: 1.5rem;
    margin-top: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.card h3:first-child {
    margin-top: 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(102, 252, 241, 0.3);
    background: rgba(0,0,0,0.4);
}

/* Password Toggle Styles */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 2.8rem !important;
}

.password-toggle {
    position: absolute;
    right: 12px;
    cursor: pointer;
    color: var(--text);
    opacity: 0.5;
    transition: all 0.2s ease;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    z-index: 10;
}

.password-toggle:hover {
    opacity: 1;
    color: var(--accent);
}

.btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    margin-top: 1rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(94, 96, 206, 0.4);
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.alert.error {
    background: rgba(242, 139, 130, 0.1);
    color: var(--error);
    border: 1px solid rgba(242, 139, 130, 0.3);
}

.alert.success {
    background: rgba(129, 201, 149, 0.1);
    color: var(--success);
    border: 1px solid rgba(129, 201, 149, 0.3);
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Dashboard specific */
.dashboard-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    color: var(--heading);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    text-shadow: 0 0 10px rgba(102, 252, 241, 0.4);
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 600;
}

.nav-link:hover, .nav-link.active {
    background: rgba(102, 252, 241, 0.1);
    color: var(--heading);
}

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

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

.header h2 {
    color: var(--heading);
    font-size: 2rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.stat-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 150px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.stat-title {
    font-size: 1rem;
    color: var(--text);
}

.stat-value {
    font-size: 2.5rem;
    color: var(--heading);
    font-weight: 800;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--heading);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--accent);
}
/* --- Page Content Responsive Rules --- */
.page-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin-bottom: 1.5rem;
}

.page-content iframe, 
.page-content embed, 
.page-content object, 
.page-content video {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.page-content table th, 
.page-content table td {
    padding: 0.8rem;
    border: 1px solid var(--border);
    min-width: 120px;
}

.page-content a {
    color: var(--accent);
    text-decoration: underline;
    transition: opacity 0.2s;
}

.page-content a:hover {
    opacity: 0.8;
}
/* --- Page Content Layout Helper Classes (For Gemini/AI Code) --- */
.page-content .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -1rem 1.5rem;
}

.page-content .col {
    flex: 1;
    padding: 0 1rem;
    min-width: 300px; /* Responsive stacking */
}

.page-content .grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.page-content .grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.page-content .hero-box {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 2rem;
    padding: 4rem;
    text-align: center;
    margin-bottom: 4rem;
}

.page-content .text-center { text-align: center; }
.page-content .text-right { text-align: right; }
.page-content .mt-4 { margin-top: 2rem; }
.page-content .mb-4 { margin-bottom: 2rem; }

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .page-content .hero-box {
        padding: 2.5rem 1.5rem;
    }
}
