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

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #10B981;
    --bg-color: #F3F4F6;
    --surface-color: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --sidebar-bg: #1F2937;
    --sidebar-text: #F9FAFB;
    --danger-color: #EF4444;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #111827;
        --surface-color: #1F2937;
        --text-main: #F9FAFB;
        --text-muted: #9CA3AF;
        --border-color: #374151;
        --sidebar-bg: #111827;
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    }
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass {
    background: rgba(var(--surface-color), 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(90deg, #4F46E5, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    flex: 1;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    color: var(--sidebar-text);
    background-color: rgba(255,255,255,0.05);
}

.sidebar-menu li a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--primary-color);
    border-radius: 0 4px 4px 0;
}

.sidebar-menu li a i {
    margin-right: 12px;
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.top-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
}

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

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #8B5CF6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* Cards */
.card {
    background-color: var(--surface-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-info h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.icon-blue { background: rgba(79, 70, 229, 0.1); color: #4F46E5; }
.icon-green { background: rgba(16, 185, 129, 0.1); color: #10B981; }
.icon-purple { background: rgba(139, 92, 246, 0.1); color: #8B5CF6; }
.icon-orange { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

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

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #DC2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

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

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background-color: rgba(0,0,0,0.02);
}

.actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--text-main);
    background-color: var(--border-color);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--surface-color);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-main);
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Login Page (Split Screen) */
.login-body {
    display: flex;
    min-height: 100vh;
    background: var(--bg-color);
}

.login-split {
    display: flex;
    width: 100%;
}

.login-info {
    flex: 1.2;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.9), rgba(16, 185, 129, 0.9)), url('https://images.unsplash.com/photo-1522071820081-009f0129c71c?ixlib=rb-4.0.3&auto=format&fit=crop&w=2850&q=80') center/cover;
    color: white;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-info h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.2;
    z-index: 1;
}

.login-info p {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 480px;
    line-height: 1.6;
    z-index: 1;
}

.login-info .features {
    margin-top: 48px;
    display: flex;
    gap: 32px;
    z-index: 1;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feature-item i {
    font-size: 1.5rem;
    background: rgba(255,255,255,0.2);
    padding: 12px;
    border-radius: 12px;
}

.login-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--surface-color);
}

.login-card {
    width: 100%;
    max-width: 420px;
}

.login-logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 900px) {
    .login-info {
        display: none;
    }
    .login-form-container {
        background: linear-gradient(135deg, #4F46E5, #10B981);
    }
    .login-card {
        background: var(--surface-color);
        padding: 40px;
        border-radius: 20px;
        box-shadow: var(--shadow-lg);
    }
}
