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

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

body {
    font-family: 'Inter', sans-serif;
    background: #f0f5ff;
    color: #1e293b;
}

.page { display: none !important; }
.page.active { display: block !important; }

/* Login */
#login-page { min-height: 100vh; }
#login-page.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: #64748b;
    font-size: 14px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #6366f1;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    padding: 10px 20px;
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.error-message {
    color: #ef4444;
    font-size: 14px;
    margin-top: 16px;
    display: none;
    text-align: center;
}

.error-message.show { display: block; }

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand h2 {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-user span {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    background: rgba(255,255,255,0.1);
    padding: 8px 14px;
    border-radius: 8px;
}

/* Layout */
.main-container {
    display: flex;
    min-height: calc(100vh - 116px);
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #1e3a5f 0%, #0f172a 100%);
    padding: 24px 0;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    padding: 0 14px;
    margin-bottom: 6px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.2s;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.sidebar-menu .icon {
    width: 20px;
    height: 20px;
}

/* Content */
.content {
    flex: 1;
    padding: 28px;
    background: linear-gradient(180deg, #f0f5ff 0%, #e8f0fe 100%);
}

.content-section { display: none; }
.content-section.active { display: block; }

/* Dashboard Header */
.dashboard-header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    border-radius: 20px;
    padding: 28px 32px;
    margin-bottom: 24px;
    color: white;
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.dashboard-header h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
    position: relative;
}

.dashboard-header p {
    opacity: 0.9;
    font-size: 14px;
    position: relative;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: all 0.3s;
    border: none;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.stat-card.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.stat-card.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.stat-card.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: rgba(255,255,255,0.2);
}

.stat-info { flex: 1; }

.stat-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 6px;
    font-weight: 500;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.chart-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1e293b;
}

.chart-wrapper {
    height: 220px;
    position: relative;
}

/* Table */
.table-container {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

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

.table-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.btn-add {
    padding: 12px 24px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-add:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

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

th {
    padding: 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    background: #f8fafc;
    border-radius: 8px;
}

td {
    padding: 16px 14px;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
}

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

.action-buttons { display: flex; gap: 8px; }

.btn-edit, .btn-delete {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.btn-edit { 
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.btn-delete { 
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    padding: 18px 28px;
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show { display: flex; }

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 28px;
    max-width: 500px;
    width: 90%;
}

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    color: #64748b;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .main-container { flex-direction: column; }
    .sidebar {
        width: 100%;
        padding: 12px 0;
    }
    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 0 12px;
    }
    .sidebar-menu li {
        padding: 0;
        margin-right: 8px;
        margin-bottom: 0;
    }
    .content { padding: 16px; }
}
