:root {
    --primary: #5F27CD; --success: #00B894; --info: #0984e3; --warning: #e17055;
    --light-bg: #f8f9fa; --dark-bg: #1a1a2e; --card-light: #ffffff; --card-dark: #2c3e50;
    --day-monday: #FF6B6B; --day-tuesday: #4ECDC4; --day-wednesday: #45B7D1;
    --day-thursday: #96CEB4; --day-friday: #FECA57;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }

body {
    background: linear-gradient(135deg, #667eea, #764ba2);
    min-height: 100vh; color: #333; transition: all 0.4s ease;
}

body.dark {
    background: #1a1a2e; color: #ecf0f1;
}

.dashboard { max-width: 1300px; margin: 20px auto; padding: 20px; }

.header {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--card-light); padding: 20px; border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15); margin-bottom: 25px;
}

body.dark .header { background: var(--card-dark); }

.school-info { display: flex; align-items: center; gap: 15px; }

.logo-container {
    position: relative; width: 80px; height: 80px; border-radius: 50%;
    overflow: hidden; border: 4px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
}

#school-logo { width: 100%; height: 100%; object-fit: cover; }

.upload-text {
    position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.7);
    color: white; font-size: 0.7rem; text-align: center; padding: 3px 0;
    opacity: 0; transition: 0.3s;
}

.logo-container:hover .upload-text { opacity: 1; }

.school-text { display: flex; flex-direction: column; }

#school-name {
    font-size: 1.8rem; font-weight: 700; border: none; background: none;
    color: var(--primary); outline: none;
}

.header h2 { font-size: 1.6rem; color: #2c3e50; margin-top: 5px; }

body.dark #school-name { color: #74B9FF; }
body.dark .header h2 { color: #ecf0f1; }

#theme-toggle {
    padding: 12px 28px; border: none; border-radius: 50px; background: var(--primary);
    color: white; font-weight: 600; cursor: pointer; transition: 0.3s;
    box-shadow: 0 4px 15px rgba(95, 39, 205, 0.4);
}

#theme-toggle:hover { transform: translateY(-3px); }

.controls {
    background: var(--card-light); padding: 25px; border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1); margin-bottom: 20px;
}

body.dark .controls { background: var(--card-dark); }

.controls select, .controls input, .controls button {
    padding: 14px 20px; border-radius: 12px; font-size: 16px; transition: 0.3s;
}

.controls select, .controls input {
    border: 2px solid #ddd; background: white; color: #333;
}

body.dark .controls select, body.dark .controls input {
    background: #2c3e50; color: #ecf0f1; border-color: #34495e;
}

.controls button {
    background: var(--primary); border: none; color: white; font-weight: bold;
    cursor: pointer; box-shadow: 0 4px 12px rgba(95, 39, 205, 0.3);
    margin: 8px 4px;
}

.controls button:hover { transform: translateY(-3px); }

#ai-generate { background: var(--success); }
#export-docx { background: var(--info); }
#export-pdf { background: var(--warning); }

.students-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px; margin: 20px 0;
}

.student-input label { font-weight: 600; margin-bottom: 5px; display: block; }
.student-input input { width: 100%; }

.duty-customization {
    background: var(--card-light); padding: 20px; border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); margin: 20px 0;
}

body.dark .duty-customization { background: var(--card-dark); }

.duty-names {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.schedule {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px; margin-bottom: 30px;
}

.day {
    background: var(--card-light); padding: 25px; border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1); animation: fadeIn 0.6s ease-out;
}

body.dark .day { background: var(--card-dark); }

.day-header {
    font-size: 1.6rem; font-weight: bold; margin-bottom: 15px;
    text-align: center; color: white; padding: 10px;
    border-radius: 10px; text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.monday .day-header { background: var(--day-monday); }
.tuesday .day-header { background: var(--day-tuesday); }
.wednesday .day-header { background: var(--day-wednesday); }
.thursday .day-header { background: var(--day-thursday); }
.friday .day-header { background: var(--day-friday); }

.duty {
    background: rgba(95, 39, 205, 0.1); margin: 10px 0; padding: 12px 15px;
    border-radius: 10px; font-weight: 500; border-left: 4px solid var(--primary);
}

.information {
    background: var(--card-light); grid-column: 1 / -1; padding: 25px;
    border-radius: 15px; box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

body.dark .information { background: var(--card-dark); }

.information textarea {
    width: 100%; min-height: 120px; padding: 15px; border-radius: 12px;
    border: 2px solid #ddd; background: white; color: #333; font-size: 16px;
}

body.dark .information textarea {
    background: #2c3e50; color: #ecf0f1; border-color: #34495e;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

@media print {
    body { background: white; }
    .controls, .duty-customization, .actions { display: none; }
    .header, .schedule, .information { box-shadow: none; }
}