/* style.css - общие стили для всего сайта */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background: #f4f7fc;
    min-height: 100vh;
    padding: 20px;
}

/* ----- ОБЩИЕ КОМПОНЕНТЫ ----- */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ----- ШАПКА (header) ----- */
.header {
    background: white;
    padding: 15px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 22px;
    color: #1a2a3a;
}

.header .user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header .user-info span {
    font-weight: 600;
}

.header .user-info .role-user {
    color: #2a7de1;
}

.header .user-info .role-admin {
    color: #e67e22;
}

/* ----- КНОПКИ ----- */
.btn {
    display: inline-block;
    padding: 10px 25px;
    background: #2a7de1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.btn:hover {
    background: #1b62b5;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #1e8449;
}

.btn-warning {
    background: #f39c12;
}

.btn-warning:hover {
    background: #d68910;
}

/* ----- КАРТОЧКИ МЕНЮ ----- */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.menu-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.2s;
}

.menu-card:hover {
    transform: translateY(-3px);
}

.menu-card .icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.menu-card h3 {
    color: #1a2a3a;
    margin-bottom: 8px;
}

.menu-card p {
    color: #6b7a8a;
    font-size: 14px;
}

.menu-card .btn {
    margin-top: 15px;
}

/* ----- СТАТИСТИКА (карточки) ----- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
}

.stat-card .number {
    font-size: 36px;
    font-weight: bold;
    color: #2a7de1;
}

.stat-card .label {
    color: #6b7a8a;
    font-size: 14px;
    margin-top: 5px;
}

/* ----- СЕКЦИИ ----- */
.section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.section h2 {
    color: #1a2a3a;
    margin-bottom: 15px;
    font-size: 20px;
}

/* ----- ТАБЛИЦЫ ----- */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e9edf2;
    font-size: 14px;
}

th {
    background: #f8fafc;
    color: #1a2a3a;
    font-weight: 600;
}

td {
    color: #2d3a4a;
}

/* ----- БЭЙДЖИ ----- */
.badge-admin {
    background: #e67e22;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.badge-user {
    background: #2a7de1;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.badge-success {
    color: #27ae60;
    font-weight: 600;
}

/* ----- ФОРМЫ ----- */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #1a2a3a;
    margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d0d8e0;
    border-radius: 6px;
    font-size: 15px;
    background: #fafcfe;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #2a7de1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(42,125,225,0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ----- АВТОРИЗАЦИЯ (login) ----- */
.login-container {
    background: white;
    padding: 40px 35px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.login-container h1 {
    font-size: 24px;
    color: #1a2a3a;
}

.login-container .subtitle {
    color: #6b7a8a;
    font-size: 14px;
    margin-bottom: 25px;
}

.login-container .error {
    color: #d32f2f;
    font-size: 13px;
    margin-top: 12px;
}

.login-container .role-hint {
    font-size: 12px;
    color: #8a9aa8;
    margin-top: 20px;
    text-align: center;
    border-top: 1px solid #e9edf2;
    padding-top: 18px;
}

/* ----- ПУСТЫЕ СОСТОЯНИЯ ----- */
.empty-state {
    text-align: center;
    color: #8a9aa8;
    padding: 30px 0;
}

/* ----- АДАПТИВ ----- */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .header .user-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    table {
        font-size: 12px;
    }
    th, td {
        padding: 8px 10px;
    }
}