/* Базовые настройки */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
}

button,
input[type="submit"],
input[type="text"],
input[type="password"] {
    font-family: Arial, sans-serif;
    outline: none;
}

/* Шапка сайта */
header {
    background-color: #dce0e8;
    color: #333;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.2em;
    font-weight: bold;
    color: #2c3e50;
}

.navbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.navbar a {
    text-decoration: none;
    color: #2c3e50;
    background-color: #e9edf5;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.navbar a:hover {
    background-color: #d4d9e7;
}

.user-info-header {
    font-size: 0.9em;
    opacity: 0.8;
    white-space: nowrap;
    margin-left: auto;
}

/* Основной контент */
.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

h2 {
    color: #333;
    margin-top: 40px;
    font-size: 1.5em;
}

/* Форма входа */
.mobile-login {
    background-color: #f0f2f5;
}

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
    margin: auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-container h2 {
    margin-bottom: 20px;
    font-size: 1.2em;
    color: #2c3e50;
}

.login-container label {
    display: block;
    text-align: left;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.95em;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
}

.login-container button {
    width: 100%;
    padding: 10px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
}

.login-container button:hover {
    background-color: #2980b9;
}

.error {
    background-color: #e74c3c;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Таблица пользователей */
.user-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    margin-top: 20px;
}

.user-table thead {
    background-color: #ecf0f1;
}

.user-table th,
.user-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.user-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.user-table tr:hover {
    background-color: #f1f1f1;
}

.status-off {
    color: red;
    font-weight: bold;
}

/* Модальные окна */
.modal {
    width: 90%;
    max-width: 400px;
    padding: 15px;
    border-radius: 6px;
    border: none;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    background-color: #fff;
    font-family: Arial, sans-serif;
}

.modal h3 {
    margin-top: 0;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.edit-form {
    margin-top: 10px;
    padding: 10px;
    background-color: #f7f7f7;
    border-radius: 4px;
}

.edit-form label {
    display: inline-block;
    width: 150px;
    margin-bottom: 4px;
    font-weight: bold;
}

.edit-form input[type="text"],
.edit-form input[type="password"] {
    width: calc(100% - 160px);
    padding: 6px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
}

@media (max-width: 768px) {
    .edit-form label {
        display: block;
        width: 100%;
        margin-bottom: 4px;
    }

    .edit-form input[type="text"],
    .edit-form input[type="password"] {
        width: 100%;
        margin-bottom: 10px;
    }

    .login-container input[type="text"],
    .login-container input[type="password"] {
        font-size: 1em;
        padding: 8px;
        margin-bottom: 12px;
    }

    .login-container button {
        font-size: 1em;
        padding: 10px;
    }

    .container {
        margin: 20px;
        padding: 15px;
    }

    .user-info {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }

    .navbar {
        order: 1;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

    .user-table thead {
        display: none;
    }

    .user-table tbody tr {
        display: block;
        border: 1px solid #ddd;
        margin-bottom: 15px;
        padding: 10px;
        background-color: #fff;
        border-radius: 6px;
    }

    .user-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 6px 8px;
        border: none;
        position: relative;
        word-wrap: break-word;
    }

    .user-table tbody td::before {
        content: attr(data-label);
        font-weight: bold;
        min-width: 100px;
        color: #555;
    }
}
/* Мобильная версия */
@media (max-width: 768px) {
    /* Общие настройки контейнера */
    .container {
        margin: 15px;
        padding: 15px;
    }
    
    /* Заголовки разделов */
    h3 {
        font-size: 1.2em;
        margin-bottom: 15px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    /* Кнопки экспорта */
    .btn.export.small {
        width: 100%;
        margin-left: 0;
        font-size: 0.9em;
        padding: 8px;
        display: inline-flex;
        justify-content: center;
        align-items: center;
    }
    
    /* Таблицы в мобильном виде */
    .report-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    }
    
    .report-table th,
    .report-table td {
        min-width: 120px;
        padding: 10px;
        font-size: 0.9em;
    }
    
    /* Карточный вид для таблиц при очень маленьких экранах */
    @media (max-width: 480px) {
        .report-table {
            display: block;
        }
        
        .report-table thead {
            display: none;
        }
        
        .report-table tbody {
            display: block;
            width: 100%;
        }
        
        .report-table tr {
            display: block;
            margin-bottom: 15px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            background-color: white;
            overflow: hidden;
        }
        
        .report-table td {
            display: flex;
            justify-content: space-between;
            padding: 10px 15px;
            border-bottom: 1px solid #edf2f7;
            text-align: right;
        }
        
        .report-table td:last-child {
            border-bottom: none;
        }
        
        .report-table td::before {
            content: attr(data-label);
            font-weight: 600;
            color: #4a5568;
            text-align: left;
            margin-right: 15px;
            flex: 1;
        }
        
        .report-table tr:last-child {
            margin-bottom: 0;
        }
    }
    
    /* Фильтры в мобильном виде */
    .filters {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .filter-group label {
        align-self: flex-start;
    }
    
    .date-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .date-group input {
        width: 100%;
    }
    
    .btn.apply-filter {
        width: 100%;
        padding: 10px;
    }
}

/* Улучшенная читаемость для мобильных */
@media (max-width: 480px) {
    body {
        font-size: 15px;
    }
    
    .container {
        padding: 12px;
    }
    
    h3 {
        font-size: 1.1em;
    }
    
    .report-table td {
        font-size: 0.85em;
        padding: 8px 12px;
    }
}