body {
    font-family: Arial, sans-serif;
    background: #f4f5f7;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

h1 {
    margin-top: 0;
    margin-bottom: 20px;
}

.layout {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.panel {
    flex: 1 1 380px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    background: #fafbfc;
}

.form label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
}

.form input[type="text"],
.form input[type="time"],
.form textarea {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    margin-top: 4px;
}

textarea {
    resize: vertical;
}

.actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

button,
.button {
    padding: 8px 14px;
    border-radius: 4px;
    border: none;
    background: #007bff;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
}

.button.secondary {
    background: #6c757d;
}

button:hover,
.button:hover {
    background: #0056b3;
}

.button.secondary:hover {
    background: #545b62;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table thead {
    background: #e9ecef;
}

table th,
 table td {
    padding: 8px;
    border: 1px solid #dee2e6;
    text-align: left;
}

.link {
    margin-right: 6px;
    color: #007bff;
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

.link.danger {
    color: #dc3545;
}

.back-link {
    display: inline-block;
    margin-bottom: 10px;
    color: #007bff;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.row label {
    flex: 1 1 200px;
}

.timetable-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
}

.timetable-inputs label {
    font-size: 12px;
}

.timetable-inputs input[type="text"] {
    font-size: 12px;
    padding: 6px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .layout {
        flex-direction: column;
    }

    table {
        font-size: 12px;
    }
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.toggle-btn {
    display: block;
    width: 100%;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #dc3545;
    background: #f8d7da;
    cursor: pointer;
    font-size: 12px;
}

.toggle-btn.active {
    background: #28a745;
    color: #ffffff;
    border-color: #28a745;
}

.day-on {
    background: #d4edda;
    color: #155724;
}

.day-off {
    background: #f8d7da;
    color: #721c24;
}

.dept-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.dept-card {
    flex: 1 1 calc(50% - 20px);
    min-width: 360px;
    max-width: calc(50% - 20px);
    min-height: 220px;
    max-height: 420px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    background: #fafbfc;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.dept-desc {
    margin-top: 4px;
    margin-bottom: 8px;
    font-size: 13px;
}

.dept-staff-scroll {
    margin-top: 8px;
    flex: 1 1 auto;
    min-height: 120px;
    max-height: 260px;
    overflow-x: auto;
    overflow-y: auto;
}

.dept-staff-scroll table {
    min-width: 700px;
}

@media (max-width: 768px) {
    .dept-card {
        flex: 1 1 100%;
        max-width: 100%;
        min-width: 0;
    }
}
