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

body {
    font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #0a0e17;
    color: #e0e6f0;
    padding: 24px;
    min-height: 100vh;
}

/* ===== СТРАНИЦА ВХОДА ===== */
#login {
    max-width: 480px;
    margin: 100px auto;
    background: #141b2b;
    padding: 50px 40px;
    border-radius: 20px;
    border: 1px solid #1a2a4a;
    box-shadow: 0 8px 60px rgba(0, 0, 0, 0.6);
}

#login h1 {
    text-align: center;
    color: #4af;
    margin-bottom: 8px;
    font-size: 34px;
    font-weight: 700;
}

#login .subtitle {
    text-align: center;
    color: #6a7a8a;
    font-size: 16px;
    margin-bottom: 32px;
}

#login input {
    width: 100%;
    padding: 16px 18px;
    margin: 10px 0;
    background: #0d1421;
    border: 1px solid #1a2a4a;
    border-radius: 12px;
    color: #e0e6f0;
    font-size: 18px;
}

#login input:focus {
    outline: none;
    border-color: #1a6aff;
    box-shadow: 0 0 0 4px rgba(26, 106, 255, 0.15);
}

#login button {
    width: 100%;
    padding: 18px;
    background: #1a6aff;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 16px;
}

#login button:hover {
    background: #2a7aff;
}

#errorMsg {
    color: #ff4444;
    margin-top: 14px;
    text-align: center;
    font-size: 16px;
    display: none;
}

/* ===== ПАНЕЛЬ УПРАВЛЕНИЯ ===== */
#dashboard {
    max-width: 1500px;
    margin: 0 auto;
}

/* ===== ХЕДЕР ===== */
.header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    gap: 16px;
    border-bottom: 2px solid #1a2a4a;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #4af;
}

.header-right {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.header-right button {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s;
}

.header-right .btn-add {
    background: #1a6aff;
}

.header-right .btn-add:hover {
    background: #2a7aff;
    transform: scale(1.02);
}

.header-right .btn-logout {
    background: #ff3b30;
}

.header-right .btn-logout:hover {
    background: #ff554a;
    transform: scale(1.02);
}

/* ===== СТАТИСТИКА ===== */
#stats {
    padding: 18px 22px;
    background: #0d1421;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #8ab;
    border: 1px solid #1a2a4a;
    line-height: 1.8;
    overflow-x: auto;
}

#stats strong {
    color: #e0e6f0;
}

/* ===== ФИЛЬТРЫ ===== */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: #141b2b;
    padding: 20px 22px;
    border-radius: 14px;
    border: 1px solid #1a2a4a;
    margin-bottom: 24px;
}

.filters input,
.filters select {
    padding: 12px 16px;
    background: #0d1421;
    border: 1px solid #1a2a4a;
    border-radius: 10px;
    color: #e0e6f0;
    font-size: 15px;
    flex: 1 1 160px;
    min-width: 140px;
}

.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: #1a6aff;
}

.filters .btn-search {
    padding: 12px 36px;
    background: #1a6aff;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}

.filters .btn-search:hover {
    background: #2a7aff;
}

.filters .btn-clear {
    padding: 12px 24px;
    background: #ff6b35;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}

.filters .btn-clear:hover {
    background: #ff7a45;
}

/* ===== РЕЗУЛЬТАТЫ (ТАБЛИЦА) ===== */
#results {
    margin-top: 4px;
    overflow-x: auto;
    background: #0d1421;
    border-radius: 14px;
    border: 1px solid #1a2a4a;
    padding: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    min-width: 700px;
}

th {
    background: #141b2b;
    padding: 16px 14px;
    text-align: left;
    border-bottom: 2px solid #1a6aff;
    color: #8ab;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
}

td {
    padding: 14px;
    border-bottom: 1px solid #1a2a4a;
    color: #d0d8e0;
    vertical-align: middle;
    cursor: pointer;
}

tr:hover td {
    background: #141b2b;
}

td img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #1a6aff;
}

.empty {
    text-align: center;
    padding: 80px 20px;
    color: #4a5a6a;
    font-size: 18px;
}

/* ===== МОДАЛКИ ===== */
#profileModal,
#addModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#profileModal > div,
#addModal > div {
    background: #141b2b;
    border-radius: 20px;
    padding: 40px;
    max-width: 900px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    border: 1px solid #1a2a4a;
}

/* ===== КАРТОЧКА ===== */
.profile-header {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.profile-avatar {
    flex: 0 0 160px;
    text-align: center;
}

.profile-avatar img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #1a6aff;
}

.profile-avatar .avatar-placeholder {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: #1a2a4a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    color: #4af;
    margin: 0 auto;
}

.profile-avatar h3 {
    font-size: 22px;
    margin-top: 12px;
    color: #e0e6f0;
}

.profile-info {
    flex: 1;
    min-width: 280px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.profile-grid-item {
    background: #0d1421;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #1a2a4a;
}

.profile-grid-item label {
    display: block;
    font-size: 12px;
    color: #6a7a8a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.profile-grid-item value {
    font-size: 16px;
    color: #e0e6f0;
    font-weight: 500;
}

.profile-section {
    margin-top: 20px;
    border-top: 1px solid #1a2a4a;
    padding-top: 20px;
}

.profile-section h4 {
    font-size: 18px;
    color: #8ab;
    margin-bottom: 12px;
}

.profile-section ul {
    list-style: none;
    padding: 0;
}

.profile-section ul li {
    background: #0d1421;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 6px;
    border: 1px solid #1a2a4a;
}

.history-item {
    background: #0d1421;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid #1a2a4a;
}

.history-item .crime-name {
    font-weight: 600;
    color: #e0e6f0;
}

.history-item .crime-details {
    font-size: 13px;
    color: #6a7a8a;
    margin-top: 4px;
}

.history-item .released {
    color: #4caf50;
}

.history-item .not-released {
    color: #ff4444;
}

.profile-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #1a2a4a;
}

.profile-actions button {
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}

.profile-actions .btn-close {
    background: #333;
    color: white;
}

.profile-actions .btn-close:hover {
    background: #444;
}

.profile-actions .btn-edit {
    background: #1a6aff;
    color: white;
}

.profile-actions .btn-edit:hover {
    background: #2a7aff;
}

/* ===== ФОРМА ДОБАВЛЕНИЯ ===== */
#addModal input,
#addModal select {
    width: 100%;
    padding: 14px 16px;
    margin: 6px 0;
    background: #0d1421;
    border: 1px solid #1a2a4a;
    border-radius: 10px;
    color: #e0e6f0;
    font-size: 16px;
}

#addModal .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

#addModal .form-actions button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}

#addModal .form-actions .btn-submit {
    background: #1a6aff;
    color: white;
}

#addModal .form-actions .btn-cancel {
    background: #333;
    color: white;
}

/* ===== АДМИН-ПАНЕЛЬ ===== */
#adminPanel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#adminPanel > div {
    background: #141b2b;
    border-radius: 20px;
    padding: 40px;
    max-width: 1000px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    border: 1px solid #1a2a4a;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-header h2 {
    color: #4af;
    font-size: 28px;
}

.btn-close-admin {
    background: #ff3b30;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
}

#adminPanel table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#adminPanel th {
    background: #1a2a4a;
    padding: 10px;
    text-align: left;
    color: #8ab;
}

#adminPanel td {
    padding: 10px;
    border-bottom: 1px solid #1a2a4a;
}

.admin-user-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.admin-user-form input,
.admin-user-form select {
    flex: 1;
    padding: 10px;
    background: #0d1421;
    border: 1px solid #1a2a4a;
    border-radius: 8px;
    color: #e0e6f0;
    min-width: 150px;
}

.btn-add-user {
    padding: 10px 20px;
    background: #1a6aff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.admin-user-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #0d1421;
    margin: 4px 0;
    border-radius: 6px;
    border: 1px solid #1a2a4a;
}

.admin-user-item button {
    background: #ff3b30;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
}

/* ===== КНОПКА АДМИНА ===== */
.admin-fab {
    background: #ff3b30;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 59, 48, 0.4);
    transition: 0.3s;
}

.admin-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(255, 59, 48, 0.6);
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    #login {
        margin: 40px auto;
        padding: 32px 24px;
    }
    .header h1 {
        font-size: 22px;
    }
    .header-right {
        width: 100%;
        justify-content: center;
    }
    .header-right button {
        flex: 1;
        text-align: center;
    }
    .filters {
        flex-direction: column;
    }
    .filters input,
    .filters select {
        width: 100%;
        min-width: unset;
    }
    .filters .btn-search,
    .filters .btn-clear {
        width: 100%;
    }
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .profile-actions {
        flex-direction: column;
    }
    .profile-actions button {
        width: 100%;
    }
    #profileModal > div,
    #addModal > div {
        padding: 24px 18px;
    }
    #adminPanel > div {
        padding: 20px;
    }
    #stats {
        font-size: 12px;
        padding: 12px 14px;
        line-height: 1.6;
    }
}

/* ===== СКРОЛЛБАР ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0d1421;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: #1a2a4a;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2a3a5a;
}

/* ===== АНИМАЦИИ ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#profileModal > div,
#addModal > div {
    animation: fadeIn 0.3s ease-out;
}

tr {
    animation: fadeIn 0.2s ease-out;
    }
