/* ===== Базовые стили ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* ===== Страница входа ===== */
.container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.container h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    font-size: 24px;
    color: #2c3e50;
}

.mainLogo {
    height: 40px;
    width: auto;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-form h2 {
    margin-bottom: 10px;
    font-size: 20px;
    color: #34495e;
}

.auth-form input {
    padding: 12px 15px;
    border: 1px solid #dde;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.auth-form input:focus {
    outline: none;
    border-color: #4a90e2;
}

.auth-form button {
    padding: 12px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-form button:hover {
    background: #357abd;
}

.message {
    color: #e74c3c;
    font-size: 14px;
    text-align: center;
}

/* ===== Админ-панель (layout) ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Сайдбар */
.sidebar {
    width: 260px;
    background: #2c3e50;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #34495e;
}

.logo {
    font-weight: bold;
    font-size: 18px;
}

.logo span {
    display: block;
    font-size: 12px;
    color: #bdc3c7;
}

.settings-icon {
    background: none;
    border: none;
    color: #bdc3c7;
    font-size: 20px;
    cursor: pointer;
}

.settings-icon:hover {
    color: white;
}

.nav-tabs {
    flex: 1;
    padding: 20px 0;
}

.menuholder {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    color: #ecf0f1;
    text-align: left;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: #34495e;
}

.nav-btn.active {
    background: #4a90e2;
    color: white;
    font-weight: 500;
}

.sidebar-footer {
    padding: 15px 20px;
    font-size: 12px;
    color: #7f8c8d;
    border-top: 1px solid #34495e;
}

/* Основной контент */
#content {
    flex: 1;
    background: #f5f7fa;
    display: flex;
    flex-direction: column;
}

.content-body {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.card h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 20px;
}

/* Панель действий */
.action-bar {
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 15px 30px;
    display: flex;
    gap: 10px;
    align-items: center;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.02);
}

.action-label {
    color: #7f8c8d;
    margin-right: auto;
    font-size: 14px;
}

.btn {
    padding: 8px 16px;
    border: 1px solid #d0d0d0;
    background: white;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn:hover {
    background: #f0f0f0;
    border-color: #b0b0b0;
}

.btn-new { color: #27ae60; border-color: #27ae60; }
.btn-new:hover { background: #27ae60; color: white; }

.btn-search { color: #2980b9; border-color: #2980b9; }
.btn-search:hover { background: #2980b9; color: white; }

.btn-filter { color: #f39c12; border-color: #f39c12; }
.btn-filter:hover { background: #f39c12; color: white; }

.btn-delete { color: #e74c3c; border-color: #e74c3c; }
.btn-delete:hover { background: #e74c3c; color: white; }

/* ===== Компоненты модулей ===== */
.loader {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-style: italic;
}

.error {
    color: #e74c3c;
    background: #fadbd8;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
}

/* Таблицы */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.data-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

/* Кнопки действий в таблице */
.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    margin: 0 3px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: #e9ecef;
}

.btn-icon.edit:hover { color: #2980b9; }
.btn-icon.delete:hover { color: #e74c3c; }

/* Формы */
.form-panel {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    max-width: 600px;
    margin: 0 auto;
}

.form-panel h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #34495e;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dde;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4a90e2;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.btn-primary {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
}

.btn-primary:hover {
    background: #357abd;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Поиск и фильтры */
.toolbar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    display: flex;
    gap: 5px;
}

.search-box input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dde;
    border-radius: 6px;
}

.search-box button {
    padding: 8px 15px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #dde;
    border-radius: 6px;
    background: white;
}

/* Пагинация */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #dde;
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.pagination button.active {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
}

/* Адаптивность */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .content-body {
        padding: 15px;
    }
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

.clients-toolbar { margin-bottom: 10px; }
.clients-table { width: 100%; border-collapse: collapse; }
.clients-table th, .clients-table td { border: 1px solid #ddd; padding: 8px; text-align: left; }
.clients-table th { background: #f2f2f2; }
.client-form { background: white; padding: 20px; border-radius: 8px; max-width: 600px; margin: 0 auto; }
.client-form input[type="text"], .client-form input[type="date"] { display: block; width: 100%; margin-bottom: 10px; padding: 8px; }
.dynamic-field { display: flex; gap: 5px; margin-bottom: 5px; align-items: center; }
.dynamic-field input { flex: 1; }
.dynamic-field button { background: #ff4444; color: white; border: none; padding: 5px 10px; cursor: pointer; }
#add-dynamic-field { margin: 10px 0; }
.form-actions { margin-top: 15px; }
.form-actions button { margin-right: 10px; padding: 8px 16px; }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.modal-footer button {
    margin-left: 10px;
}

#task-desc{
	width: 100%;
	font-size: 1em;
	min-height: 10em;
}
.form-row{
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center; 
	justify-content: space-evenly;
}

.editor-header{
	display: flex;
	flex-direction: column;
	width: 100%;
	align-items: center;
}

.template-description{
	width: 50%;
	
}