* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    text-align: center;
    border-left: 4px solid #2c3e50;
}

.header h1 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 8px;
}

.header-info {
    color: #666;
    font-size: 13px;
    margin-top: 8px;
}

/* ПК версия */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    table-layout: fixed;
}

.schedule-table th,
.schedule-table td {
    padding: 12px 10px;
    text-align: left;
    border: 1px solid #dee2e6;
    vertical-align: top;
}

.schedule-table th {
    background: #2c3e50;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    font-size: 13px;
}

.schedule-table th:first-child,
.schedule-table td:first-child {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    font-weight: 600;
}

.schedule-table th:not(:first-child),
.schedule-table td:not(:first-child) {
    width: calc((100% - 120px) / 6);
}

/* Добавлено для лучшего отображения времени в заголовке */
.schedule-table th {
    white-space: nowrap;
    line-height: 1.2;
}

.schedule-table th > span {
    display: block;
    font-size: 12px;
    opacity: 0.8;
}

.schedule-table tr {
    border-bottom: 2px solid #dee2e6;
}

.schedule-table tr:hover {
    background: #f8f9fa;
}

.current-day {
    background: #e9f7ef !important;
    border-left: 4px solid #27ae60;
}

.lesson-item {
    margin-bottom: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.lesson-time {
    font-weight: bold;
    color: #3498db;
    font-size: 12px;
    margin-bottom: 3px;
    line-height: 1.4;
}

.lesson-subject {
    font-size: 14px;
    font-weight: 600;
    margin: 3px 0;
    color: #2c3e50;
}

.lesson-teacher,
.lesson-classroom {
    font-size: 12px;
    color: #666;
    margin: 1px 0;
}

.lesson-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    margin-top: 4px;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
}

.lesson-type.лекция {
    background: #3498db;
}
.lesson-type.лабораторная {
    background: #e67e22;
}
.lesson-type.практика {
    background: #9b59b6;
}

/* Мобильная версия */
.mobile-schedule {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.day-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

.day-btn {
    flex: 0 0 40px;
    height: 40px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    transition: background 0.2s;
}

.day-btn:hover {
    background: #1a252f;
}

.day-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.day-name {
    flex: 1;
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    color: #2c3e50;
}

.no-lessons {
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 6px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-today {
    background: #27ae60;
    color: white;
}

.btn-today:hover {
    background: #219653;
}

.btn-full {
    background: #3498db;
    color: white;
}

.btn-full:hover {
    background: #2980b9;
}

/* Админка */
.admin-container {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 1000px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #2c3e50;
}

.admin-header h2 {
    color: #2c3e50;
    font-size: 22px;
}

.back-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background 0.2s;
}

.back-link:hover {
    background: #e9ecef;
    text-decoration: none;
}

.json-display {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    max-height: 60vh;
    line-height: 1.5;
    font-size: 12px;
    margin-top: 15px;
}

.upload-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

.upload-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 16px;
}

.upload-form {
    display: flex;
    gap: 10px;
}

.upload-input {
    flex: 1;
}

.upload-btn {
    padding: 10px 20px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.upload-btn:hover {
    background: #219653;
}

/* Flash messages */
.flash {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.flash.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 25px;
    color: #95a5a6;
    font-size: 12px;
    padding: 15px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 10px;
    }

    .schedule-table {
        font-size: 11px;
        display: block;
        overflow-x: auto;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 8px;
        min-width: 100px;
    }

    .lesson-subject {
        font-size: 12px;
    }

    .lesson-teacher,
    .lesson-classroom {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 20px;
    }

    .day-name {
        font-size: 18px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }
}

/* Объявления */
.announcements {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.announcement {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #ffe066;
}

.announcement:last-child {
    border-bottom: none;
}

.announcement-icon {
    font-size: 18px;
    margin-right: 10px;
    min-width: 24px;
    text-align: center;
}

.announcement-text {
    color: #856404;
    font-size: 14px;
    line-height: 1.5;
}

/* Ссылки */
.links-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 30px 0;
    border-left: 4px solid #3498db;
}

.links-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.link-item {
    display: block;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    border: 1px solid #e9ecef;
}

.link-item:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
    border-color: #3498db;
}

.link-item:active {
    transform: translateY(0);
}

/* Админка - формы редактирования */
.admin-forms {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.admin-forms h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 16px;
}

.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.form-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-row button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-add {
    background: #27ae60;
    color: white;
}

.btn-add:hover {
    background: #219653;
}

.btn-delete {
    background: #e74c3c;
    color: white;
    padding: 6px 12px;
}

.btn-delete:hover {
    background: #c0392b;
}

.items-list {
    margin-top: 15px;
}

.items-list div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #e9ecef;
    font-size: 14px;
}

.items-list div:last-child {
    margin-bottom: 0;
}