body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: #f8f9fa;
    color: #212529;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.main-container {
    width: 100%;
    max-width: 900px;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    border-bottom: 2px solid #dee2e6;
    padding: 0 20px;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.main-nav li a {
    display: block;
    padding: 16px 20px;
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease-in-out;
}

.main-nav li a:hover {
    color: #0056b3;
}

.main-nav li.active a {
    color: #007bff;
    border-bottom-color: #007bff;
}

.content-container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

.container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 900px;
    box-sizing: border-box;
}

.container.admin-page {
    max-width: 900px;
}

h1, h2 {
    color: #343a40;
    text-align: center;
    margin-bottom: 25px;
}

h1 { font-size: 1.8em; }
h2 { font-size: 1.5em; margin-top: 30px; }

/* Стили для сообщений */
.flash-messages {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}
.flash-messages li {
    padding: 12px 18px;
    border-radius: 5px;
    margin-bottom: 12px;
    border: 1px solid transparent;
}
.flash-messages .info { background-color: #e3f2fd; color: #0c5460; border-color: #bee5eb; }
.flash-messages .error { background-color: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.flash-messages .success { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }

/* Общие стили для форм */
.form-group { margin-bottom: 1rem; }

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

input[type="text"], input[type="number"], input[type="password"], select {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    background-color: #fff; 
}

input[type="text"]:focus, input[type="number"]:focus, input[type="password"]:focus, select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.remember-me {
    display: flex; 
    align-items: center; 
    margin-bottom: 20px;
}
.remember-me input[type="checkbox"] {
    width: auto; 
    margin-right: 8px; 
    margin-bottom: 0;
}
.remember-me label {
    margin-bottom: 0; 
    font-weight: normal;
}


/* Кнопки */
button, .button, input[type="submit"] {
    background-color: #007bff;
    color: white;
    padding: 12px 18px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    width: 100%;
    transition: background-color 0.15s ease-in-out;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    border: 1px solid transparent;
}
button:hover, .button:hover, input[type="submit"]:hover { background-color: #0056b3; }
button:active, .button:active, input[type="submit"]:active { background-color: #004085; }

.button-danger { background-color: #dc3545; color: white; border-color: #dc3545; }
.button-danger:hover { background-color: #c82333; border-color: #bd2130; }


/* Блок результатов на главной странице */
.message-result {
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    border: 1px solid transparent;
    text-align: center;
    box-sizing: border-box; 
}
.message-result.error { background-color: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.message-result.success { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }

.download-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap; 
    box-sizing: border-box; 
}
.download-link, .copy-link-button {
    display: inline-flex; 
    align-items: center;
    padding: 10px 15px; 
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
    color: white;
    transition: background-color 0.15s ease-in-out;
    flex-grow: 1; 
    flex-basis: calc(50% - 5px); 
    justify-content: center; 
    min-width: 120px; 
    box-sizing: border-box; 
}
.download-link { background-color: #28a745; }
.download-link:hover { background-color: #218838; }
.copy-link-button { background-color: #6c757d; border: none; cursor: pointer; font-size: 0.9em; }
.copy-link-button:hover { background-color: #5a6268; }
.file-icon, .copy-icon { margin-right: 8px; }
.file-icon { font-size: 1.3em; }
.copy-icon { font-size: 1.1em; }


/* Верхняя навигация и информация о пользователе */
.user-info {
    text-align: right;
    margin-bottom: 0;
    font-size: 0.9em;
}
.user-info a {
    color: #007bff;
    text-decoration: none;
    margin-left: 5px;
}
.user-info a:hover { text-decoration: underline; }

.top-nav { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
    padding-bottom: 15px; 
    border-bottom: 1px solid #eee; 
}
.top-nav .user-greeting { font-size: 0.95em; }
.top-nav a { color: #007bff; text-decoration: none; margin-left: 15px; }
.top-nav a:hover { text-decoration: underline; }


/* Стили для страницы администратора */
.add-user-form { 
    margin-bottom: 30px; 
    padding: 20px; 
    background-color: #f8f9fA; 
    border: 1px solid #e9ecef; 
    border-radius: 5px; 
}

table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 25px; 
}
th, td { 
    border: 1px solid #dee2e6; 
    padding: 12px; 
    text-align: left; 
    vertical-align: middle; 
}
th { 
    background-color: #e9ecef; 
    font-weight: 600; 
}
td.actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
td.actions form, td.actions .super-admin-text {
    margin: 0;
    width: 100%; 
    box-sizing: border-box;
}
td.actions .password-change-form {
    display: flex; 
    flex-direction: column; 
    gap: 5px; 
}
td.actions .password-change-form input[type="password"] {
    width: 100%;
    padding: 8px;
    font-size: 0.9em;
    margin-bottom: 0; /* Override general input style */
}
td.actions form button {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.95em;
    padding: 9px 16px;
}
.no-users { color: #6c757d; }


/* Адаптивность */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .main-nav ul {
        flex-direction: column;
        width: 100%;
    }
    
    .main-nav li {
        width: 100%;
    }

    .main-nav li a {
        padding: 12px 0;
        text-align: center;
        border-bottom: 1px solid #eee;
    }
    
    .main-nav li.active a {
        border-right: none;
        border-left: none;
        border-top: none;
    }

    .user-info {
        width: 100%;
        text-align: center;
        padding: 15px 0;
        border-top: 1px solid #eee;
        margin-top: 10px;
    }

    th, td { padding: 8px; }
    h1 { font-size: 1.6em; }
    h2 { font-size: 1.3em; }
}

@media (max-width: 480px) {
    body { padding: 10px; }
    .container { padding: 15px; }
    h1 { font-size: 1.5em; margin-bottom: 20px; }
    .download-actions { flex-direction: column; gap: 8px; }
    .download-link, .copy-link-button { width: 100%; flex-basis: auto; padding: 12px 10px; }
    
    .add-user-form { padding: 15px; }
    th, td { font-size: 0.85em; }
    td.actions form button { font-size: 0.85em; }
} 

.flash-success a {
    color: #0f5132;
    font-weight: bold;
    text-decoration: none;
    margin-right: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px; /* Ограничиваем максимальную ширину имени файла */
    display: inline-block;
}

.flash-success .copy-button {
    background-color: #5a6268;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.flash-success .copy-button:hover {
    background-color: #5a6268;
}

.flash-success {
    list-style-type: none;
    padding: 0;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
}

.file-item a {
    color: #007bff;
    text-decoration: none;
    word-break: break-all;
}

.file-item .copy-button {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.file-item .copy-button:hover {
    background-color: #5a6268;
} 

.download-actions .btn,
.email-form-container .btn {
    width: 100%;
    margin-bottom: 10px;
}

.email-form-container .form-group {
    width: 100%;
    margin-bottom: 10px;
} 