* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f2f5f9;
    color: #1e293b;
    line-height: 1.5;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-container {
    max-width: 1400px;
    width: 100%;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dce3ec;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.emblem {
    background: transparent;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.emblem:hover {
    transform: scale(1.05);
}

.emblem svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 6px rgba(0, 20, 50, 0.3));
}

.title-section h1 {
    font-weight: 600;
    font-size: 2rem;
    letter-spacing: -0.02em;
    color: #0a1a32;
}

.title-section .badge {
    background: #e1e8f2;
    color: #1e3a6b;
    font-size: 0.8rem;
    padding: 0.2rem 1rem;
    border-radius: 30px;
    border: 1px solid #b7c9e0;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.current-user {
    background: white;
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    border: 1px solid #d2ddea;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    transition: 0.15s;
    position: relative;
}

.current-user:hover {
    background: #f0f5fe;
    border-color: #2b4f8c;
}

.current-user:hover::after {
    content: '▼';
    font-size: 0.7rem;
    margin-left: 0.3rem;
    color: #2b4f8c;
}

.user-rank {
    background: #0b2545;
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-badge {
    font-size: 0.7rem;
    color: #6b81a2;
}

.login-btn {
    background: #0b2545;
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.15s;
}

.login-btn:hover {
    background: #1f3b60;
}

.user-dropdown {
    position: absolute;
    top: 70px;
    right: 0;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border: 1px solid #e2eaf3;
    min-width: 220px;
    z-index: 1000;
    display: none;
}

.user-dropdown.show {
    display: block;
}

.dropdown-content {
    padding: 0.5rem;
}

.dropdown-header {
    padding: 0.8rem 1rem;
    font-weight: 600;
    color: #0b1e38;
    border-bottom: 1px solid #e5ecf5;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-item {
    padding: 0.7rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    transition: 0.1s;
    color: #1e293b;
}

.dropdown-item:hover {
    background: #f0f5fe;
}

.dropdown-item.logout-item {
    color: #b91c1c;
}

.dropdown-item.logout-item:hover {
    background: #fee9e9;
}

.dropdown-divider {
    height: 1px;
    background: #e5ecf5;
    margin: 0.5rem 0;
}

.main-panel {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 1.8rem;
    align-items: start;
}

.list-card {
    background: white;
    border-radius: 28px;
    padding: 1.5rem 1.2rem;
    box-shadow: 0 15px 30px -12px rgba(0,20,40,0.15);
    border: 1px solid #eef2f7;
}

.search-section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #0b2650;
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-search {
    margin-bottom: 1.8rem;
}

.live-search input {
    width: 100%;
    padding: 1rem 1.2rem;
    background: #f9fcff;
    border: 1px solid #cfddee;
    border-radius: 40px;
    font-size: 1rem;
    transition: 0.15s;
}

.live-search input:focus {
    outline: none;
    border-color: #2b4f8c;
    box-shadow: 0 0 0 3px rgba(43,79,140,0.2);
}

.count-indicator {
    font-size: 0.85rem;
    color: #5b6f91;
    margin-top: 0.5rem;
    margin-left: 0.5rem;
}

.people-list {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 5px;
}

.person-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    background: #ffffff;
    border-radius: 18px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: 0.12s;
    border: 1px solid transparent;
}

.person-item:hover {
    background: #f0f5fe;
    border-color: #c5d6f0;
}

.person-item.active {
    background: #e5eefc;
    border-color: #2b4f8c;
    box-shadow: 0 4px 10px rgba(0,60,130,0.1);
}

.person-avatar {
    width: 44px;
    height: 44px;
    background: #cbd5e1;
    border-radius: 40px;
    background-size: cover;
    background-position: center;
    background-color: #b0c2da;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.person-info h4 {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
}

.person-info p {
    font-size: 0.8rem;
    color: #4e6586;
}

.owner-badge {
    font-size: 0.7rem;
    background: #e9ecf3;
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: 0.15s;
}

.owner-badge:hover {
    background: #2b4f8c;
    color: white;
}

.dossier-card {
    background: white;
    border-radius: 32px;
    padding: 2rem;
    box-shadow: 0 20px 35px -10px rgba(0,20,40,0.18);
    border: 1px solid #eef2f7;
    min-height: 650px;
    display: flex;
    flex-direction: column;
}

.dossier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f4fa;
}

.dossier-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0b1e3b;
}

.dossier-badge {
    background: #e9ecf3;
    padding: 0.4rem 1.2rem;
    border-radius: 40px;
    font-size: 0.9rem;
    color: #1a2d4e;
}

.dossier-content {
    display: flex;
    gap: 2.5rem;
    flex: 1;
}

.photo-section {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.photo-frame {
    width: 100%;
    aspect-ratio: 1/1.2;
    background: #eef3fc;
    border-radius: 24px;
    border: 2px dashed #b9cbe0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #778da0;
    gap: 8px;
}

.photo-placeholder i {
    font-size: 2.5rem;
}

.info-section {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 2rem;
}

.info-field {
    border-bottom: 1px solid #e5ecf5;
    padding-bottom: 0.6rem;
}

.info-field .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b81a2;
    margin-bottom: 0.25rem;
}

.info-field .value {
    font-weight: 500;
    font-size: 1rem;
    color: #0b1e38;
    word-break: break-word;
}

.full-width {
    grid-column: span 2;
}

.status-badge {
    background: #d9e9ff;
    color: #004080;
    padding: 0.3rem 1rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
}

.status-badge.wanted {
    background: #fee2e2;
    color: #b91c1c;
}

.article-block {
    grid-column: span 2;
    background: #f8fafd;
    border-radius: 24px;
    padding: 1.2rem;
    margin-top: 0.5rem;
}

.punishment-details {
    background: #ffffff;
    border-radius: 20px;
    padding: 1rem;
    border: 1px solid #e2eaf3;
    margin-top: 0.5rem;
}

.punishment-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #dce3ec;
}

.punishment-item:last-child {
    border-bottom: none;
}

.punishment-label {
    color: #4e6586;
    font-weight: 500;
}

.punishment-value {
    font-weight: 600;
    color: #0b1e38;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.edit-btn {
    background: #f0f5fe;
    border: 1px solid #c5d6f0;
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.edit-btn:hover {
    background: #e0eafc;
}

.edit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.delete-btn {
    background: #fee9e9;
    color: #b91c1c;
    border: 1px solid #f9c5c5;
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.delete-btn:hover {
    background: #fdd5d5;
}

.delete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.save-btn {
    background: #0b2545;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cancel-btn {
    background: white;
    border: 1px solid #cbd5e1;
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.add-form {
    margin-top: 1.8rem;
    padding-top: 1.2rem;
    border-top: 1px solid #dde3ed;
}

.add-form h3 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.add-form .input-wrapper {
    margin-bottom: 1rem;
}

.add-form input, .add-form select, .add-form textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    background: white;
    border: 1px solid #d2ddea;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: 0.15s;
}

.add-form input.error {
    border-color: #dc2626;
    background-color: #fef2f2;
}

.add-form select.error {
    border-color: #dc2626;
    background-color: #fef2f2;
}

.add-form input:focus.error {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}

.add-form input:disabled, .add-form select:disabled {
    background: #f5f7fa;
    border-color: #e0e7f0;
    color: #94a3b8;
    cursor: not-allowed;
}

.field-hint {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    margin-left: 0.5rem;
    color: #6b7280;
}

.field-hint.error {
    color: #dc2626;
}

.field-hint.valid {
    color: #059669;
}

.radio-group {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
    padding: 0.5rem;
    background: #f8fafd;
    border-radius: 40px;
}

.radio-group.disabled {
    opacity: 0.6;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.radio-group.disabled label {
    cursor: not-allowed;
}

.radio-group input[type="radio"]:disabled {
    cursor: not-allowed;
}

.btn-primary {
    background: #0b2545;
    border: none;
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.15s;
}

.btn-primary:hover:not(:disabled) {
    background: #1f3b60;
}

.btn-primary:disabled {
    background: #b9c9e0;
    cursor: not-allowed;
    opacity: 0.6;
}

.upload-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 40px;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.15s;
}

.upload-btn:hover:not(.disabled) {
    background: #e3eaf2;
}

.upload-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.footer-note {
    margin-top: 2.5rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.75rem;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: #94a3b8;
    background: #f8fafd;
    border-radius: 20px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: #0b2545;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #d2ddea;
    border-radius: 20px;
    font-size: 1rem;
}

.modal-content label {
    display: block;
    margin-bottom: 0.3rem;
    color: #4b5563;
    font-size: 0.9rem;
}

.owner-info {
    font-size: 0.8rem;
    color: #6b81a2;
    margin-top: 0.5rem;
    cursor: pointer;
    transition: 0.15s;
    padding: 0.5rem;
    border-radius: 8px;
}

.owner-info:hover {
    background: #f0f5fe;
}

.auth-message {
    text-align: center;
    padding: 1rem;
    background: #f0f5fe;
    border-radius: 40px;
    margin-bottom: 1rem;
    color: #2b4f8c;
    font-size: 0.9rem;
}

.auth-message i {
    margin-right: 0.5rem;
}

/* Стили для профиля */
.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #eef3fc;
    border: 3px solid #0b2545;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px auto;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar i {
    font-size: 4rem;
    color: #6b81a2;
}

/* Стили для админ-панели */
.admin-request, .admin-verified {
    transition: 0.2s;
}

.admin-request:hover, .admin-verified:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}