* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
}

header {
    background-color: #333;
    color: #fff;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo a {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li {
    margin-left: 20px;
}

.nav-menu a {
    color: #fff;
    text-decoration: none;
}

.nav-menu a:hover {
    color: #ffd700;
}

main {
    max-width: 1200px;
    margin: 80px auto 20px;
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    position: fixed;
    bottom: 0;
    width: 100%;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    background-color: #555;
}

.btn-edit {
    background-color: #28a745;
}

.btn-delete {
    background-color: #dc3545;
}

.error {
    color: #dc3545;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8d7da;
    border-radius: 4px;
}

.success {
    color: #28a745;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #d4edda;
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #f4f4f4;
}

table tr:hover {
    background-color: #f5f5f5;
}

.kp-container {
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    margin-bottom: 20px;
}

.kp-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #333;
}

.kp-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.kp-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.kp-table {
    width: 100%;
    margin: 20px 0;
}

.kp-table th {
    background-color: #333;
    color: #fff;
}

.kp-total {
    text-align: right;
    font-size: 18px;
    font-weight: bold;
    margin: 20px 0;
}

.kp-footer {
    margin-top: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kp-signature {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ccc;
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
    }
    
    .nav-menu {
        margin-top: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-menu li {
        margin: 5px 10px;
    }
    
    table {
        font-size: 14px;
    }
    
    .kp-info {
        flex-direction: column;
    }
}
/* Стили для форм организаций */
.organization-form {
    max-width: 1000px;
    margin: 0 auto;
}

.form-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
}

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

.btn-primary {
    background-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #545b62;
}

/* Стили для просмотра */
.view-card {
    max-width: 1000px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 30px;
}

.view-section {
    margin-bottom: 30px;
}

.view-section h3 {
    color: #333;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.view-table {
    width: 100%;
    border-collapse: collapse;
}

.view-table th {
    width: 200px;
    text-align: left;
    padding: 10px;
    background-color: #f4f4f4;
    border: 1px solid #ddd;
}

.view-table td {
    padding: 10px;
    border: 1px solid #ddd;
}

.view-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

/* Стили для карточек КП */
.kp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.kp-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.kp-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.kp-card.classic {
    border-left: 5px solid #333;
}

.kp-card.modern {
    border-left: 5px solid #007bff;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.kp-card.minimal {
    border-left: 5px solid #28a745;
}

.kp-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.kp-card .kp-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.kp-card-info {
    margin-bottom: 20px;
    font-size: 14px;
}

.kp-card-info p {
    margin: 5px 0;
}

.kp-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.kp-card-actions .btn {
    flex: 1;
    text-align: center;
    font-size: 14px;
    padding: 8px;
}

.no-data {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    background: #f9f9f9;
    border-radius: 5px;
    color: #666;
}

/* Адаптивность */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .kp-grid {
        grid-template-columns: 1fr;
    }
    
    .view-table th {
        width: 150px;
    }
    
    .kp-card-actions {
        flex-direction: column;
    }
}

/* Стили для действий в таблице */
.actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.actions .btn {
    padding: 5px 10px;
    font-size: 12px;
}

/* Статусы */
.status-active {
    color: #28a745;
    font-weight: bold;
}

.status-expired {
    color: #dc3545;
    font-weight: bold;
}
/* Улучшенные стили для таблиц */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

table thead {
    background-color: #333;
    color: #fff;
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

table tbody tr:hover {
    background-color: #f5f5f5;
}

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

.pagination a, .pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
}

.pagination a:hover {
    background-color: #f4f4f4;
}

.pagination .active {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

/* Поиск */
.search-box {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-box button {
    padding: 10px 20px;
}

/* Фильтры */
.filters {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filters select, .filters input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 200px;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 15px 20px;
    background: #28a745;
    color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

.notification.error {
    background: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1001;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 5px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-close {
    cursor: pointer;
    font-size: 24px;
    color: #666;
}

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

.modal-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Индикатор загрузки */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Подсказки */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 5px;
    border-radius: 4px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Статистика на дашборде */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    margin: 10px 0;
}

.stat-card .stat-label {
    color: #666;
    font-size: 14px;
}

.stat-card.primary {
    border-left: 5px solid #007bff;
}

.stat-card.success {
    border-left: 5px solid #28a745;
}

.stat-card.warning {
    border-left: 5px solid #ffc107;
}

.stat-card.danger {
    border-left: 5px solid #dc3545;
}