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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #f5f5f7;
    padding: 32px 24px;
    color: #1c1c1e;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 20px;
    border: 1px solid #e4e4e7;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
    transition: transform 0.2s;
}

.logo-img:hover {
    transform: scale(1.02);
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #1c1c1e;
    letter-spacing: -0.3px;
}

.logo-sub {
    font-size: 11px;
    font-weight: 400;
    color: #8e8e93;
    margin-top: 2px;
}

.btn {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: #f2f2f5;
    color: #1c1c1e;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-outline {
    background: transparent;
    border: 1px solid #d4d4d8;
}

.btn-outline:hover {
    background: #fafafc;
    border-color: #a1a1aa;
}

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

.header-buttons {
    display: flex;
    gap: 10px;
}

.avatar-menu {
    position: relative;
    cursor: pointer;
}

.avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f2f2f5;
    padding: 6px 12px 6px 16px;
    border-radius: 40px;
    transition: all 0.2s;
}

.avatar-btn:hover {
    background: #e4e4e7;
}

.avatar-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #1d6eb0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.avatar-name {
    font-size: 13px;
    font-weight: 500;
    color: #1c1c1e;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-arrow {
    font-size: 12px;
    color: #8e8e93;
    transition: transform 0.2s;
}

.avatar-menu.open .avatar-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    border: 1px solid #e4e4e7;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
}

.avatar-menu.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 13px;
    color: #1c1c1e;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f5f5f7;
}

.dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 12px 12px;
}

.dropdown-divider {
    height: 1px;
    background: #e4e4e7;
    margin: 4px 0;
}

.dropdown-item.logout {
    color: #ef4444;
}

.search-group {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.search-group input {
    flex: 1;
}

input, textarea {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #d4d4d8;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #fafafc;
    border-radius: 12px;
    border: 1px solid #e4e4e7;
    cursor: pointer;
}

.user-item:hover {
    background: #ffffff;
    transform: translateX(2px);
}

.user-name {
    font-weight: 500;
    color: #1c1c1e;
}

.user-email {
    font-size: 12px;
    color: #8e8e93;
    margin-top: 2px;
}

.user-id {
    font-size: 12px;
    background: #f2f2f5;
    padding: 4px 10px;
    border-radius: 20px;
}

.sort-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sort-btn {
    padding: 5px 12px;
    border-radius: 8px;
    background: #f2f2f5;
    border: 1px solid #e4e4e7;
    cursor: pointer;
    font-size: 12px;
}

.sort-btn.active {
    background: #3b82f6;
    color: white;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.page-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #fafafc;
    border: 1px solid #e4e4e7;
    cursor: pointer;
}

.page-btn.active {
    background: #3b82f6;
    color: white;
}

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

.section-title {
    font-size: 17px;
    font-weight: 500;
    color: #1c1c1e;
}

.profile-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px 16px;
    align-items: baseline;
}

.profile-label {
    font-size: 13px;
    font-weight: 500;
    color: #8e8e93;
}

.profile-value {
    font-size: 14px;
    font-weight: 500;
    color: #1c1c1e;
}

.empty {
    text-align: center;
    color: #8e8e93;
    padding: 48px;
    font-size: 14px;
}

.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20001;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    width: 100%;
    max-width: 90vw;
}

.toast {
    background: #1c1c1e;
    color: white;
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 13px;
    animation: fadeIn 0.2s ease;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.success {
    background: #34c759;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    justify-content: center;
    align-items: center;
    z-index: 20000;
}

.modal-content {
    background: #ffffff;
    border-radius: 20px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 24px;
    color: #1c1c1e;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

.gap-2 {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.edit-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f2f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.edit-icon:hover {
    background: #e4e4e7;
}

.badge {
    background: #f2f2f5;
    color: #8e8e93;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.right-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.edit-full {
    grid-column: span 2;
}

label {
    font-size: 12px;
    font-weight: 500;
    color: #8e8e93;
    margin-bottom: 4px;
    display: block;
}

hr {
    border: none;
    border-top: 1px solid #e4e4e7;
    margin: 16px 0;
}

@media (max-width: 640px) {
    body { padding: 16px; }
    .card { padding: 20px; }
    .profile-grid { grid-template-columns: 1fr; gap: 8px; }
    .section-header { flex-wrap: wrap; }
    .edit-grid { grid-template-columns: 1fr; }
    .edit-full { grid-column: span 1; }
    .header { flex-direction: column; align-items: stretch; }
    .header-buttons { justify-content: flex-end; }
}