:root {
    --primary: #4A90D9;
    --primary-dark: #2c6fad;
    --accent: #5CB85C;
    --sidebar-bg: #1e2a3b;
    --sidebar-text: #b0c4de;
    --sidebar-hover: #2d3f57;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f0f4f8;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--sidebar-bg);
    min-height: 100vh;
    width: 240px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand h5 {
    color: #fff;
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
}

.sidebar-brand small {
    color: var(--sidebar-text);
    font-size: 0.75rem;
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 0;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-section-title {
    color: rgba(176, 196, 222, 0.5);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 16px 4px;
    font-weight: 600;
}

/* Main content */
.main-content {
    margin-left: 240px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 99;
}

.topbar .page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.content-area {
    padding: 24px;
    flex: 1;
}

/* Cards */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid #e8ecf0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    color: #718096;
    font-size: 0.85rem;
    margin-top: 4px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid #e8ecf0;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f4f8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h6 {
    margin: 0;
    font-weight: 600;
    color: #2d3748;
}

.panel-body {
    padding: 16px 20px;
}

/* Role badges */
.role-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-admin { background: #fce4ec; color: #c62828; }
.role-specialist { background: #e3f2fd; color: #1565c0; }
.role-tutor { background: #e8f5e9; color: #2e7d32; }
.role-parent { background: #fff3e0; color: #e65100; }
.role-volunteer { background: #f3e5f5; color: #6a1b9a; }

/* Status badges */
.status-assigned { background: #e3f2fd; color: #1565c0; }
.status-opened { background: #fff8e1; color: #f57f17; }
.status-done { background: #e8f5e9; color: #2e7d32; }
.status-needs-review { background: #fce4ec; color: #c62828; }
.status-reviewed { background: #e8f5e9; color: #1b5e20; }

/* Child card */
.child-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid #e8ecf0;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.child-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    color: inherit;
}

.child-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: #e8ecf0;
}

.child-avatar-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
}

/* Material card */
.material-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid #e8ecf0;
    transition: all 0.2s;
}

.material-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}

.material-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.material-card .card-body {
    padding: 12px;
}

/* AI Chat */
.ai-response {
    background: #f0f7ff;
    border-left: 4px solid var(--primary);
    border-radius: 0 8px 8px 0;
    padding: 16px;
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Tables */
.table-clean {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.table-clean thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e8ecf0;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Forms */
.form-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: var(--card-shadow);
    border: 1px solid #e8ecf0;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #a0aec0;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .topbar {
        padding: 12px 16px;
    }
    .content-area {
        padding: 16px;
    }
}

/* Level indicator */
.level-bar {
    height: 6px;
    border-radius: 3px;
    background: #e8ecf0;
    overflow: hidden;
}

.level-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--primary);
}

.level-low .level-bar-fill { width: 33%; background: #fc8181; }
.level-medium .level-bar-fill { width: 66%; background: #f6ad55; }
.level-high .level-bar-fill { width: 100%; background: #68d391; }
